/* Bored Ants - Sunlit Nest Design System */
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("/fonts/NunitoSans-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
:root {
  --canvas: #FFF9ED;
  --surface: #F0EBDD;
  --surface-raised: #FFFCF5;
  --ink: #292D25;
  --ink-muted: #626653;
  --border: #D9D7C6;
  --accent: #FFD647;
  --accent-hover: #F3C62F;
  --accent-ink: #292D25;
  --moss: #405B3B;
  --moss-soft: #E5EDDD;
  --clay: #B96B50;
  --danger: #A53C36;
  --danger-soft: #FBEAE5;

  --font-display: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-control: 14px;
  --radius-card: 24px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 8px rgba(41, 45, 37, 0.06);
  --shadow-md: 0 8px 24px rgba(41, 45, 37, 0.08);
  --shadow-primary: 0 4px 12px rgba(243, 198, 47, 0.35);

  --max-width: 1160px;
  --header-height: 64px;
}

:root[data-theme="dark"] {
  --canvas: #20251F;
  --surface: #2B3228;
  --surface-raised: #343D30;
  --ink: #FFF9ED;
  --ink-muted: #C6CEBD;
  --border: #66725D;
  --accent: #FFD647;
  --accent-hover: #F3C62F;
  --accent-ink: #292D25;
  --moss: #B8D79D;
  --moss-soft: #303F2C;
  --clay: #B96B50;
  --danger: #FFADA3;
  --danger-soft: #4B2927;
}

/* Reset and base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, .wordmark {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.55;
}

a {
  color: var(--moss);
  text-decoration: none;
  transition: color 180ms ease;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}

/* Layout container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header & Navbar (Never wraps at ~640px, collapses below 900px)
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 249, 237, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.nav-logo:hover {
  text-decoration: none;
}

.ant-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
}

.nav-logo .wordmark {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
}

/* Desktop navigation links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 180ms ease;
}

.nav-link:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.nest-link {
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  transition: all 180ms ease;
}

.nest-link:hover {
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}

/* Primary Action Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  background-color: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-control);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  text-decoration: none;
  transition: background-color 180ms ease, transform 160ms ease, box-shadow 180ms ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(243, 198, 47, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-hero {
  min-height: 52px;
  padding: 0 32px;
  font-size: 1.05rem;
}

/* Mobile Hamburger Menu Toggle Button */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle svg {
  display: block;
}

/* Mobile Drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--surface-raised);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 20px 24px;
  z-index: 99;
  flex-direction: column;
  gap: 16px;
}

.mobile-drawer.open {
  display: flex;
}

.mobile-nav-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-link:hover {
  text-decoration: none;
  color: var(--moss);
}

/* ==========================================================================
   Hero Section (Desktop Split, Mobile Compact, Artwork Early)
   ========================================================================== */
.hero {
  padding: 48px 0 64px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--moss);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clay);
}

.hero h1 {
  margin: 0;
}

.hero-sub {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 480px;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 8px;
}

.btn-invite-trigger {
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 180ms ease, background 180ms ease;
}

.btn-invite-trigger:hover {
  color: var(--moss);
  background: var(--surface);
}

.hero-meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: -6px;
}

/* Hero Artwork Card */
.hero-artwork-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-art-caption {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(255, 252, 245, 0.92);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-control);
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
}

.hero-art-caption .tag {
  font-weight: 700;
  color: var(--moss);
}

/* ==========================================================================
   Section 1: Real Gameplay Moments (3 panels max)
   ========================================================================== */
.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}

.section-kicker {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clay);
  margin-bottom: 8px;
}

.gameplay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.gameplay-card {
  background: var(--surface-raised);
  border-radius: var(--radius-card);
  padding: 24px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gameplay-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.gameplay-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--moss-soft);
  color: var(--moss);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.gameplay-card h3 {
  margin: 0;
}

.gameplay-card p {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ==========================================================================
   Section 2: How To Play (3 Steps & Scripted Command Preview)
   ========================================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.step-card {
  background: var(--surface-raised);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  border: 1px solid var(--border);
  position: relative;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.step-card h3 {
  margin-bottom: 8px;
}

/* Scripted Command Preview (No fake audio engine claim) */
.cmd-preview-container {
  background: var(--surface-raised);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: 32px;
  max-width: 760px;
  margin: 0 auto;
}

.cmd-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.cmd-preview-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.cmd-preview-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

.cmd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.cmd-chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 160ms ease;
}

.cmd-chip:hover {
  border-color: var(--ink-muted);
  background: var(--surface-raised);
}

.cmd-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-primary);
}

.cmd-result-box {
  background: var(--canvas);
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  padding: 16px 20px;
  min-height: 68px;
  display: flex;
  align-items: center;
}

.cmd-result-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   Section 3: Meet the Ants (Real catalog appearances + hover 3D spin)
   ========================================================================== */
.crew-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.ant-card {
  background: var(--surface-raised);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.ant-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.ant-media-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  overflow: hidden;
}

.ant-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 200ms ease;
}

.ant-spin {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

/* Reveal 3D turntable spin on hover */
.ant-card:hover .ant-portrait {
  opacity: 0;
}

.ant-card:hover .ant-spin {
  opacity: 1;
}

.ant-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ant-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ant-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.ant-flavor {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* ==========================================================================
   Section 4: Origin Story & Sketchbook-to-World
   ========================================================================== */
.origin-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 48px;
}

.origin-narrative {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.origin-narrative p {
  font-size: 1.05rem;
  line-height: 1.65;
}

.origin-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sketch-card {
  background: var(--surface-raised);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sketch-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.sketch-caption {
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* "In the Sketchbook" future worlds notice */
.future-worlds-box {
  background: var(--surface-raised);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.future-worlds-text h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.future-worlds-text p {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.future-worlds-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.future-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ==========================================================================
   Section 5: FAQ Accordion
   ========================================================================== */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface-raised);
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 160ms ease;
}

.faq-item.open {
  border-color: var(--ink-muted);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 20px 24px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-icon {
  font-size: 1.25rem;
  color: var(--ink-muted);
  transition: transform 180ms ease;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 24px 20px;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ==========================================================================
   Section 6: Final Call to Action
   ========================================================================== */
.cta-banner {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--border);
  padding: 56px 32px;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.cta-banner h2 {
  margin: 0;
}

.cta-banner p {
  max-width: 520px;
  font-size: 1.1rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  font-size: 0.9rem;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--ink-muted);
}

.footer-links a:hover {
  color: var(--ink);
}

/* ==========================================================================
   Join Sheet Modal (Got an invite?)
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(41, 45, 37, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-sheet {
  background: var(--surface-raised);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 460px;
  padding: 32px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-sheet h3 {
  font-size: 1.35rem;
}

.modal-sheet p {
  font-size: 0.95rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
}

.modal-input:focus {
  border-color: var(--ink-muted);
}

.modal-error {
  display: none;
  color: var(--danger);
  background: var(--danger-soft);
  padding: 8px 12px;
  border-radius: var(--radius-control);
  font-size: 0.85rem;
  font-weight: 600;
}

.modal-error.visible {
  display: block;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .nav-links, .nest-link {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .gameplay-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .crew-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .origin-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .future-worlds-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 60px;
  }

  .container {
    padding: 0 16px;
  }

  .nav-container {
    gap: 10px;
  }

  .nav-logo .wordmark {
    font-size: 1.15rem;
  }

  .btn-primary {
    min-height: 48px;
    padding: 0 16px;
    font-size: 0.9rem;
  }

  .crew-grid {
    grid-template-columns: 1fr;
  }

  .origin-gallery {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-hero {
    width: 100%;
    text-align: center;
  }

  .btn-invite-trigger {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
