@font-face {
  font-family: 'CryptOfNextWeek';
  src: url('../fonts/crypt-of-next-week.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #121417;
  font-family: 'CryptOfNextWeek', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #d1d5db;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
}

.page-wrapper {
  flex: 1 0 auto;
  padding-bottom: 120px; /* space for walker gif */
}

a {
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #93c5fd;
}

/* Header */
header {
  background-color: #1f2937;
  padding: 25px 20px 30px;
  text-align: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  border-bottom: 1px solid #374151;
}

.logo {
  max-width: 250px;
  height: auto;
  margin-bottom: -20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.author {
  font-style: italic;
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 12px;
  color: #9ca3af;
  user-select: none;
}

nav {
  margin-top: 10px;
}

nav a {
  margin: 0 18px;
  font-weight: 600;
  font-size: 1rem;
}

/* Main content */
main {
  max-width: 900px;
  margin: 30px auto 60px;
  padding: 0 15px;
  flex-grow: 1;
}

section {
  margin-bottom: 50px;
  background: #1e293b;
  padding: 25px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

h2 {
  font-weight: 700;
  color: #60a5fa;
  margin-top: 0;
  margin-bottom: 15px;
  text-shadow: 0 0 6px #3b82f6;
}

/* Paragraph style */
p {
  font-size: 0.9rem;
  color: #a1a8b3;
  line-height: 1.5;
  margin-bottom: 1em;
}

/* Buttons */
.button {
  display: inline-block;
  margin-top: 15px;
  padding: 12px 24px;
  background-color: #2563eb;
  color: white;
  font-weight: 600;
  border-radius: 30px;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.9);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  background-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 1);
}

/* Footer */
footer {
  flex-shrink: 0;
  background-color: #1f2937;
  color: #9ca3af;
  text-align: center;
  padding: 18px 20px;
  font-size: 0.9rem;
  border-top: 1px solid #374151;
  user-select: none;
}

/* GIF container */
.walker-container {
  position: fixed;
  bottom: -14px;
  left: 0;
  width: 100vw;
  height: 120px;
  pointer-events: none;
  overflow: visible;
  z-index: 1000;
}

.walker {
  position: absolute;
  bottom: 0;
  width: 100px;
  height: auto;
  animation-name: walkCycle;
  animation-duration: 20s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

@keyframes walkCycle {
  0% {
    transform: translateX(-120px) scaleX(1);
  }
  49.999% {
    transform: translateX(calc(100vw + 120px)) scaleX(1);
  }
  50% {
    transform: translateX(calc(100vw + 120px)) scaleX(-1);
  }
  99.999% {
    transform: translateX(-120px) scaleX(-1);
  }
  100% {
    transform: translateX(-120px) scaleX(1);
  }
}

/* Media Thumbnails Section */
.media-thumbnails {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.media-thumbnails img {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border: 3px solid white;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease-in-out;
  user-select: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

.media-thumbnails img:hover {
  border-color: yellow;
}

/* Popup overlay for full image */
#popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 2000;
  padding: 20px;
  box-sizing: border-box;
}

#popup-overlay.active {
  display: flex;
}

#popup-overlay img {
  max-width: 90vw;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 0 20px 6px #ffd800cc;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
  cursor: default;
  user-select: none;
  margin-bottom: 10px;
}

#popup-caption {
  color: #ffd800cc;
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  max-width: 90vw;
  user-select: none;
}

#popup-overlay .close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: #ffd800cc;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  text-shadow: 0 0 6px #ffd800cc;
  background: transparent;
  border: none;
  outline: none;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  nav a {
    margin: 0 10px;
    font-size: 0.9rem;
  }
  main {
    margin: 20px 15px 50px;
  }
  section {
    padding: 20px;
  }
  .button {
    padding: 10px 18px;
    font-size: 0.95rem;
  }
  .walker {
    width: 70px;
  }
  .walker-container {
    height: 90px;
  }
  .media-thumbnails img {
    width: 70px;
    height: 50px;
  }
  #popup-overlay .close-btn {
    top: 10px;
    right: 15px;
    font-size: 2rem;
  }
}
