html {
  box-sizing: border-box;
  color-scheme: light dark;
}
*, *::before, *::after {
  box-sizing: inherit;
}

nav.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1em 2em;
}

nav.navbar ul.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2em;
  justify-content: center;
}

nav.navbar a {
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 500;
  padding: 0.25em 0.5em;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

nav.navbar a:hover {
  border: 1px solid currentColor;
}

html, body {
  min-height: 100%;
}

body { 
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: min(55em, calc(100% - 2em));
  margin: 0 auto;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  padding: 5em 1em 0;
  text-transform: lowercase;
  background-color: #f6dec6;
  color: #370000;
}

.main-wrapper {
  display: flex;
  gap: 2em;
  align-items: flex-start;
  flex: 1;
}

.content {
  flex: 1;
}

/* jasny tryb */
nav.navbar {
  background-color: rgba(246, 222, 198, 0.95);
}

.profile-tooltip {
  background: rgba(246, 222, 198, 0.5);
  border-color: #370000;
  color: #370000;
}

/* ciemny tryb */
body.dark-mode {
  background-color: #1e0000;
  color: #dacaa3;
}

body.dark-mode nav.navbar {
  background-color: rgba(30, 0, 0, 0.95);
}

body.dark-mode .profile-tooltip {
  background: rgba(30, 0, 0, 0.5);
  border-color: #dacaa3;
  color: #dacaa3;
}

.profile-container {
  flex-shrink: 0;
  width: 200px;
}

.profile-wrapper {
  position: relative;
}

.profile-image {
  width: 100%;
  display: block;
  border: 1px solid transparent;
  transition: border 0.2s ease;
  cursor: default;
}

.profile-image:hover {
  border: 1px solid currentColor;
}

.profile-tooltip {
  position: fixed;
  padding: 0.5em 0.75em;
  backdrop-filter: blur(2px);
  border: 1px solid;
  border-radius: 0;
  font-size: 0.85em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 999;
}

h1 {
  margin-top: 0;
  font-size: 1.8em;
}

p {
  margin-bottom: 1em;
  text-align: justify;
}

em { 
  font-style: italic;
}

a {
  color: inherit;
}

footer {
  position: relative;
  margin-top: auto;
  text-align: center;
  padding: 2em 0;
  font-style: italic;
  opacity: 0.5;
}

@media (max-width: 800px) {
  body {
    width: 90%;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  p {
    text-align: center;
  }

  .main-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 1.25em;
    width: 100%;
  }

  .profile-container {
    width: 150px;
    align-self: center;
  }

  .content {
    width: 100%;
  }
}

@media (max-width: 540px) {
  nav.navbar {
    padding: 0.75em 1em;
  }

  nav.navbar ul.nav-list {
    gap: 1em;
    flex-wrap: wrap;
    justify-content: center;
  }

  nav.navbar a {
    font-size: 1em;
  }

  body {
    padding-top: 5em;
  }

  .socials-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1em;
  }

  .stuff-item h2 {
    font-size: 1.4em;
  }
}

@media (max-width: 380px) {
  nav.navbar ul.nav-list {
    gap: 0.7em;
  }

  nav.navbar a {
    font-size: 0.95em;
  }

  .socials-grid {
    grid-template-columns: 1fr;
  }
}



.stuff-container {
  display: block;
}

.content {
  padding: 0 0.75em;
}

.stuff-item {
  margin-bottom: 2em;
  overflow: hidden;
  padding: 0;
}

.stuff-item-image {
  float: left;
  width: 300px;
  height: 240px;
  overflow: hidden;
  margin: 0 0.75em 0.75em 0;
}

.stuff-item.reverse .stuff-item-image {
  float: right;
  margin: 0 0 0.75em 0.75em;
}

.stuff-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 1px solid transparent;
  transition: border 0.2s ease;
  cursor: pointer;
}

.stuff-item-image img:hover {
  border: 1px solid currentColor;
}

.stuff-item h2 {
  margin: 0 0 0.75em 0;
  font-size: 1.8em;
}

.stuff-item p {
  line-height: 1.6;
  margin: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.stuff-item::after {
  content: '';
  display: table;
  clear: both;
}

@media (max-width: 768px) {
  .stuff-item-image,
  .stuff-item.reverse .stuff-item-image {
    float: none;
    width: 100%;
    height: 200px;
    margin: 0 0 1em 0;
  }
}

.socials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5em;
  margin-top: 2em;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 1em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.05);
}

.social-item:hover {
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.social-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.social-info {
  display: flex;
  flex-direction: column;
}

.social-name {
  font-weight: bold;
  font-size: 1.1em;
}

.social-handle {
  font-size: 0.85em;
  opacity: 0.7;
}

body.dark-mode .social-item {
  background: rgba(0, 0, 0, 0.2);
}

/* lightbox */
#lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
}

#lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.6);
  transform: scale(0.94);
  transition: transform 0.25s ease;
  cursor: default;
}

#lightbox-overlay.active #lightbox-img {
  transform: scale(1);
}

#lightbox-close {
  position: fixed;
  top: 1em;
  right: 1.25em;
  font-size: 1.5em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border 0.2s ease;
  padding: 0.15em 0.35em;
  font-family: inherit;
}

#lightbox-close:hover {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.8);
}
