/* ===========================
   BASE + THEME
   =========================== */

:root {
  --bg: #fff5e6;
  --bg-panel: #fffdf7;
  --bg-elevated: #ffffff;
  --text: #1a1a1a;
  --text-muted: #555555;
  --accent: #f4a259;
  --accent-soft: #f9c89b;
  --border: #1a1a1a;
  --shadow-soft: 3px 4px 0 rgba(0,0,0,0.15);
  --shadow-strong: 5px 6px 0 rgba(0,0,0,0.32);
  --hero-highlight: #d95d39;
  --link: #7bafd4;
}

body.dark-mode {
  --bg: #0f172a;
  --bg-panel: #111827;
  --bg-elevated: #020617;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #f4a259;
  --accent-soft: #eab308;
  --border: #0b1220;
  --shadow-soft: 3px 4px 0 rgba(0,0,0,0.6);
  --shadow-strong: 5px 6px 0 rgba(0,0,0,0.85);
  --hero-highlight: #f97316;
  --link: #93c5fd;
}

/* Reset-ish */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top, rgba(244,162,89,0.18), transparent 55%), var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===========================
   HEADER
   =========================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 2px solid var(--border);
  background: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(255,245,230,0.96));
  backdrop-filter: blur(8px);
}

body.dark-mode .site-header {
  background: linear-gradient(to bottom, rgba(15,23,42,0.96), rgba(15,23,42,0.96));
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  max-width: 1060px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: "Permanent Marker", "Comic Neue", system-ui, sans-serif;
  letter-spacing: 0.08em;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--accent-soft);
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
}

.brand-text {
  font-size: 1.25rem;
}

.nav-links {
  display: none;
  gap: 1.5rem;
  font-family: "Comic Neue", system-ui, sans-serif;
}

.nav-links a {
  position: relative;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease-out;
}

.nav-links a:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme toggle */

.theme-toggle {
  border: 2px solid var(--border);
  background: var(--bg-panel);
  border-radius: 999px;
  padding: 0.2rem 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.theme-toggle .theme-icon {
  font-size: 0.9rem;
  line-height: 1;
}

body:not(.dark-mode) .theme-icon-moon {
  opacity: 0.35;
}

body.dark-mode .theme-icon-sun {
  opacity: 0.35;
}

/* Burger button */

.burger-button {
  border: 2px solid var(--border);
  background: var(--bg-panel);
  border-radius: 999px;
  padding: 0.35rem 0.5rem;
  display: inline-flex;
  flex-direction: column;
  gap: 0.18rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.burger-button span {
  width: 18px;
  height: 2px;
  background: var(--border);
  display: block;
}

/* Overlay */

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 40;
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile menu */

.mobile-menu {
  position: fixed;
  inset-block: 0;
  right: 0;
  width: min(75%, 320px);
  background: var(--bg-panel);
  border-left: 2px solid var(--border);
  box-shadow: var(--shadow-strong);
  transform: translateX(100%);
  transition: transform 0.22s ease-out;
  z-index: 60;
  display: flex;
  flex-direction: column;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.9rem 0.65rem;
  border-bottom: 2px dashed var(--border);
  font-family: "Comic Neue", system-ui, sans-serif;
}

.mobile-menu-title {
  font-weight: 700;
}

.mobile-menu-close {
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.9rem 1.2rem;
  gap: 0.35rem;
}

.mobile-link {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 2px solid transparent;
  text-decoration: none;
  color: var(--text);
  font-family: "Comic Neue", system-ui, sans-serif;
  font-size: 0.98rem;
}

.mobile-link:hover {
  border-color: var(--border);
  background: var(--bg-elevated);
}

/* ===========================
   HERO
   =========================== */

.section {
  padding: 4rem 0;
}

.hero {
  padding-top: 3.25rem;
  padding-bottom: 4.5rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-content {
  position: relative;
}

.hero-pill {
  display: inline-flex;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--bg-panel);
  box-shadow: var(--shadow-soft);
  font-family: "Comic Neue", system-ui, sans-serif;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: "Permanent Marker", "Comic Neue", system-ui, sans-serif;
  font-size: 2rem;
  line-height: 1.25;
  margin: 0 0 0.9rem;
}

.hero-highlight {
  color: var(--hero-highlight);
}

.hero-subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  border: 2px solid var(--border);
  text-decoration: none;
  cursor: pointer;
  font-family: "Comic Neue", system-ui, sans-serif;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  background: var(--accent);
  color: #1a1a1a;
}

.btn-ghost {
  background: var(--bg-panel);
  color: var(--text);
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-strong);
}

/* Hero art */

.hero-art {
  display: flex;
  justify-content: center;
}

.hero-doodle {
  border-radius: 18px;
  border: 2px solid var(--border);
  background: var(--bg-panel);
  padding: 1.25rem 1.1rem;
  box-shadow: var(--shadow-strong);
  max-width: 320px;
  position: relative;
}

.hero-doodle::before {
  content: "";
  position: absolute;
  inset: 0.3rem 0.5rem auto auto;
  border-top: 2px dashed var(--border);
  opacity: 0.5;
}

.hero-avatar {
  margin: 0 auto 0.75rem;
  width: 120px;
  height: 150px;
  position: relative;
}

.avatar-hair {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 80px;
  height: 35px;
  transform: translateX(-50%);
  background: var(--accent-soft);
  border-radius: 40px 40px 10px 10px;
  border: 2px solid var(--border);
}

.avatar-face {
  position: absolute;
  top: 40px;
  left: 50%;
  width: 80px;
  height: 70px;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border-radius: 50px;
  border: 2px solid var(--border);
}

.avatar-eye {
  position: absolute;
  top: 24px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #ffffff;
}

.avatar-eye.left {
  left: 20px;
}

.avatar-eye.right {
  right: 20px;
}

.avatar-mouth {
  position: absolute;
  bottom: 18px;
  left: 50%;
  width: 28px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 0 0 16px 16px;
  border: 2px solid var(--border);
  border-top: none;
}

.avatar-book {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--link);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Permanent Marker", "Comic Neue", system-ui, sans-serif;
  font-size: 1.4rem;
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}

.hero-caption {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: "Comic Neue", system-ui, sans-serif;
}

/* ===========================
   SECTION PANELS
   =========================== */

.section-panel {
  position: relative;
}

.section-title {
  font-family: "Permanent Marker", "Comic Neue", system-ui, sans-serif;
  font-size: 1.6rem;
  margin: 0 0 1.25rem;
}

.section-tagline {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.section-tagline .highlight {
  color: var(--hero-highlight);
  font-weight: 600;
}

/* Panel card */

.panel {
  border-radius: 18px;
  border: 2px solid var(--border);
  background: var(--bg-panel);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

.panel p {
  margin: 0 0 0.85rem;
  font-size: 0.97rem;
}

.lore-quote {
  margin-top: 1.1rem;
  font-style: italic;
  font-family: "Comic Neue", system-ui, sans-serif;
}

/* ===========================
   TIMELINE
   =========================== */

.timeline {
  margin-top: 1.5rem;
  border-left: 2px dashed var(--border);
  padding-left: 1.25rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-badge {
  position: absolute;
  left: -1.65rem;
  top: 0.4rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Comic Neue", system-ui, sans-serif;
  font-size: 0.8rem;
  box-shadow: var(--shadow-soft);
}

.timeline-card {
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  padding: 0.85rem 0.9rem;
  box-shadow: var(--shadow-soft);
}

.timeline-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.timeline-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ===========================
   MEME GRID
   =========================== */

.meme-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.meme-card {
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.07s ease-out, box-shadow 0.07s ease-out;
  overflow: hidden;
}

.meme-card:hover {
  transform: translate(-1px, -1px) rotate(-0.8deg);
  box-shadow: var(--shadow-strong);
}

.meme-media {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 comic frame */
  overflow: hidden;
}

.meme-visible-img,
.meme-visible-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meme-video-play {
  position: absolute;
  inset: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #ffffff;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
}

.meme-hint {
  margin-top: 1.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Meme lightbox */

.meme-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 70;
}

.meme-lightbox.visible {
  opacity: 1;
  pointer-events: auto;
}

.meme-lightbox-inner {
  background: var(--bg-panel);
  border-radius: 18px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-strong);
  padding: 0.75rem;
  max-width: min(480px, 94vw);
}

.meme-lightbox-close {
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  margin-bottom: 0.4rem;
}

.meme-lightbox img {
  border-radius: 12px;
  border: 2px dashed var(--border);
  max-width: 100%;
}

/* ===========================
   LINKS
   =========================== */

.links-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.link-card {
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  padding: 1rem 1rem 0.9rem;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}

.link-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-strong);
}

.link-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.link-emoji {
  font-size: 1.1rem;
}

.link-title {
  font-family: "Comic Neue", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.link-text {
  margin: 0.15rem 0 0.55rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.link-cta {
  font-family: "Comic Neue", system-ui, sans-serif;
  font-size: 0.88rem;
}

.link-disclaimer {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===========================
   FOOTER
   =========================== */

.site-footer {
  border-top: 2px solid var(--border);
  background: var(--bg-panel);
  margin-top: 3rem;
}

.footer-inner {
  padding: 1.4rem 1.25rem 1.6rem;
}

.footer-text {
  margin: 0 0 0.4rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: "Comic Neue", system-ui, sans-serif;
}

/* ===========================
   BACK TO TOP BUTTON
   =========================== */

.back-to-top {
  position: fixed;
  bottom: 1.35rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--accent);
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  z-index: 45;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===========================
   MEDIA QUERIES
   =========================== */

@media (min-width: 720px) {
  .nav-links {
    display: flex;
  }

  .burger-button {
    display: none;
  }

  .section {
    padding: 4.5rem 0;
  }

  .hero {
    padding-top: 4rem;
  }

  .hero-title {
    font-size: 2.4rem;
  }

  .links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meme-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timeline {
    padding-left: 1.6rem;
  }

  .timeline-badge {
    left: -1.9rem;
  }
}

@media (max-width: 720px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    order: -1;
  }

  .hero {
    padding-top: 3.1rem;
  }

  .hero-title {
    font-size: 1.7rem;
  }
}

@media (min-width: 980px) {
  .hero-title {
    font-size: 2.6rem;
  }

  .meme-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
/* ===========================
   COMIC CTA BUTTON
   =========================== */

.comic-cta {
  margin-top: 1.5rem;
  text-align: center;
  animation: cta-pop-in 0.6s ease-out forwards;
  opacity: 0;
  transform: scale(0.85);
}

.comic-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.2rem;
  border: 3px solid var(--border);
  border-radius: 14px;
  background: var(--bg-panel);
  font-family: "Comic Neue", system-ui, sans-serif;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.18);
  position: relative;

  /* Slight rough wiggle */
  animation: cta-wiggle 3.2s infinite ease-in-out;
  animation-delay: 1s;
}

.comic-cta a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.25);
  animation: none; /* stops wiggle on hover */
}

.cta-emoji {
  font-size: 1.25rem;
}

.cta-arrow {
  font-size: 1.2rem;
  font-weight: 900;
  display: inline-block;

  /* little shaky scribble arrow */
  animation: arrow-shake 0.6s infinite alternate ease-in-out;
}

/* ===========================
   ANIMATIONS
   =========================== */

/* CTA popping onto the screen */
@keyframes cta-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  60% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Subtle wiggly motion (comic effect) */
@keyframes cta-wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  30% {
    transform: rotate(-1.4deg);
  }
  60% {
    transform: rotate(1.2deg);
  }
}

/* Arrow shakes right-left */
@keyframes arrow-shake {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(3px);
  }
}