@font-face {
  font-family: 'Fredoka';
  src: url('fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('fonts/nunito-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Ground & Structural Ink */
  --paper-alabaster: #f6f2e9;
  --paper-warm: #ede7d9;
  --paper-celadon: #e5f2ea;
  --ink-obsidian: #121a24;
  --ink-slate: #334559;
  --rule-ink: rgba(18, 26, 36, 0.13);

  /* Biome 1: Quackdown Bathhouse Cobalt */
  --cobalt-deep: #083b68;
  --cobalt-surface: #0b4c84;
  --cobalt-ink: #f5faff;
  --cobalt-muted: #c6e2fa;
  --marigold-cta: #ffd23f;
  --marigold-cta-hover: #ffde6a;

  /* Biome 2: Letter Run Rainforest Canopy */
  --canopy-deep: #09422b;
  --canopy-surface: #0e583a;
  --canopy-ink: #f3fbf6;
  --canopy-muted: #c2ecd3;
  --celadon-ink: #0d2b1d;
  --celadon-muted: #244b39;
  --celadon-rule: rgba(13, 43, 29, 0.14);
  --amber-cta: #ffca3a;
  --amber-cta-hover: #ffd666;
  --forest-cta: #0d4a30;
  --forest-cta-hover: #093823;

  /* Colophon */
  --footer-ink: #f6f2e9;
  --footer-muted: #b8c7da;
  --footer-rule: rgba(246, 242, 233, 0.14);

  /* Typography */
  --font-display: 'Fredoka', system-ui, -apple-system, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;

  /* Radii & Motion */
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Elevation (offset + soft blur, never combined with 1px border) */
  --shadow-theater: 0 24px 52px -16px rgba(12, 24, 38, 0.28);
  --shadow-device: 0 20px 42px -14px rgba(10, 22, 36, 0.24);
  --shadow-cutout: drop-shadow(0 16px 24px rgba(6, 18, 32, 0.34));
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--paper-alabaster);
  color: var(--ink-obsidian);
  scrollbar-color: #6b7d91 var(--paper-warm);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--paper-warm);
}

::-webkit-scrollbar-thumb {
  background: #6b7d91;
  border-radius: 5px;
  border: 2px solid var(--paper-warm);
}

::selection {
  background: var(--marigold-cta);
  color: var(--ink-obsidian);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  background-color: var(--paper-alabaster);
  color: var(--ink-obsidian);
  caret-color: var(--cobalt-deep);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
}

:focus-visible {
  outline: 2.5px solid var(--cobalt-deep);
  outline-offset: 3px;
}

.theater-stage :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--marigold-cta);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--ink-obsidian);
  color: var(--paper-alabaster);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  z-index: 1000;
}

.skip-link:focus {
  left: 16px;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================
   Header Masthead
   ========================================= */
.site-header {
  border-bottom: 1px solid var(--rule-ink);
  background: var(--paper-alabaster);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 20px;
}

.studio-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink-obsidian);
}

.brand-emblem {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--ink-obsidian);
  color: var(--marigold-cta);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.header-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-slate);
  transition: color 0.18s var(--ease-out-expo);
}

.header-nav a:hover {
  color: var(--ink-obsidian);
}

.header-nav .nav-support {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule-ink);
  color: var(--ink-obsidian);
  background: var(--paper-warm);
}

.header-nav .nav-support:hover {
  background: #e3dbca;
}

/* =========================================
   First Viewport: Masthead Statement + Biome Stage
   ========================================= */
.opening-folio {
  padding: 40px 0 64px;
}

.masthead-lead {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 32px;
  align-items: end;
  margin-bottom: 32px;
}

.masthead-lead h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.3vw, 3.65rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink-obsidian);
  text-wrap: balance;
}

.masthead-lead p {
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--ink-slate);
  max-width: 44ch;
  padding-bottom: 4px;
}

/* Asymmetric 72 / 28 Interactive Theater */
.biome-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: stretch;
}

.theater-stage {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-theater);
  background: radial-gradient(circle at 78% 24%, var(--cobalt-surface) 0%, var(--cobalt-deep) 72%);
  color: var(--cobalt-ink);
  min-height: 460px;
  transition: background-color 0.45s var(--ease-out-expo);
}

.theater-stage[data-active-world="letterrun"] {
  background: radial-gradient(circle at 78% 24%, var(--canopy-surface) 0%, var(--canopy-deep) 72%);
  color: var(--canopy-ink);
}

.world-panel {
  display: none;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 28px;
  padding: 36px;
  min-height: 460px;
  align-items: center;
  animation: worldReveal 0.42s var(--ease-out-expo);
}

.world-panel.is-active {
  display: grid;
}

@keyframes worldReveal {
  from {
    opacity: 0.75;
    clip-path: inset(0 0 4% 0 round 16px);
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0 round 16px);
    transform: translateY(0);
  }
}

.world-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 2;
}

.world-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.world-app-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 22px -6px rgba(4, 12, 24, 0.45);
  flex-shrink: 0;
}

.world-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.55rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 8px;
}

.platform-line {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--cobalt-muted);
  margin-bottom: 14px;
}

.theater-stage[data-active-world="letterrun"] .platform-line {
  color: var(--canopy-muted);
}

.world-summary {
  font-size: 1.04rem;
  line-height: 1.58;
  color: var(--cobalt-muted);
  max-width: 46ch;
  margin-bottom: 26px;
}

.theater-stage[data-active-world="letterrun"] .world-summary {
  color: var(--canopy-muted);
}

/* Buttons */
.action-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s var(--ease-out-expo), background-color 0.2s var(--ease-out-expo);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn:hover {
  transform: translateY(-1.5px);
}

.btn:active {
  transform: translateY(0);
}

.btn-marigold {
  background: var(--marigold-cta);
  color: var(--ink-obsidian);
}

.btn-marigold:hover {
  background: var(--marigold-cta-hover);
}

.btn-amber {
  background: var(--amber-cta);
  color: var(--celadon-ink);
}

.btn-amber:hover {
  background: var(--amber-cta-hover);
}

.btn-stage-secondary {
  background: rgba(245, 250, 255, 0.14);
  color: #ffffff;
}

.btn-stage-secondary:hover {
  background: rgba(245, 250, 255, 0.22);
}

.btn-obsidian {
  background: var(--ink-obsidian);
  color: var(--paper-alabaster);
}

.btn-obsidian:hover {
  background: #1f2c3d;
}

.btn-forest {
  background: var(--forest-cta);
  color: var(--canopy-ink);
}

.btn-forest:hover {
  background: var(--forest-cta-hover);
}

.btn-paper-outline {
  background: transparent;
  border: 1px solid var(--rule-ink);
  color: var(--ink-obsidian);
}

.btn-paper-outline:hover {
  background: var(--paper-warm);
}

.btn-celadon-outline {
  background: transparent;
  border: 1px solid var(--celadon-rule);
  color: var(--celadon-ink);
}

.btn-celadon-outline:hover {
  background: rgba(13, 43, 29, 0.07);
}

/* Stage Visual Diorama & Inline Playable */
.world-diorama {
  position: relative;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.diorama-plate {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 18px 36px -12px rgba(3, 12, 24, 0.48);
  background: #062847;
}

.diorama-scene-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1024 / 500;
  object-fit: cover;
}

.diorama-hero-cutout {
  position: absolute;
  right: -8px;
  bottom: -14px;
  width: clamp(148px, 19vw, 212px);
  height: auto;
  filter: var(--shadow-cutout);
  pointer-events: none;
  z-index: 3;
}

.diorama-runner-cutout {
  position: absolute;
  left: -6px;
  bottom: -12px;
  width: clamp(140px, 17vw, 196px);
  height: auto;
  filter: var(--shadow-cutout);
  pointer-events: none;
  z-index: 3;
}

/* Live Inline 60s Playable Drawer inside Quackdown Stage */
.inline-playable-wrap {
  display: none;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  flex-direction: column;
  gap: 10px;
}

.inline-playable-wrap.is-playing {
  display: flex;
}

.world-diorama.is-playing .diorama-showcase {
  display: none;
}

.playable-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--cobalt-muted);
}

.playable-close {
  background: rgba(245, 250, 255, 0.16);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.playable-close:hover {
  background: rgba(245, 250, 255, 0.26);
}

.playable-viewport {
  width: 100%;
  height: 440px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #07192b;
  box-shadow: 0 18px 40px -12px rgba(2, 10, 20, 0.55);
}

.playable-viewport iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Interactive Phonics Tile Strip on Letter Run Stage */
.phonics-toybar {
  margin-top: 16px;
  width: 100%;
  background: rgba(6, 36, 23, 0.62);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 4;
}

.phonics-prompt {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--canopy-muted);
}

.phonics-tiles {
  display: flex;
  gap: 8px;
}

.letter-tile {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: #fff8e7;
  color: var(--celadon-ink);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #d4b475;
  transition: transform 0.14s var(--ease-out-expo), background-color 0.14s var(--ease-out-expo);
}

.letter-tile:hover {
  transform: translateY(-2px);
}

.letter-tile.is-lit {
  background: var(--amber-cta);
  color: var(--celadon-ink);
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b88714;
}

/* Right-Hand Biome Switcher Index Rail */
.biome-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rail-tab {
  flex: 1;
  text-align: left;
  background: var(--paper-warm);
  border: 1px solid var(--rule-ink);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink-obsidian);
  font-family: var(--font-body);
  transition: background-color 0.22s var(--ease-out-expo), transform 0.22s var(--ease-out-expo);
}

.rail-tab:hover {
  background: #e5dcc9;
}

.rail-tab[aria-selected="true"] {
  background: var(--ink-obsidian);
  color: var(--paper-alabaster);
  border-color: transparent;
  box-shadow: 0 14px 30px -12px rgba(18, 26, 36, 0.32);
}

.rail-tab-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rail-tab-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.rail-tab-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.15;
}

.rail-tab-meta {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-slate);
  margin-top: 2px;
}

.rail-tab[aria-selected="true"] .rail-tab-meta {
  color: #c3d0e0;
}

.rail-tab-desc {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-slate);
}

.rail-tab[aria-selected="true"] .rail-tab-desc {
  color: #dce5f0;
}

.rail-tab-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--cobalt-deep);
}

.rail-tab[aria-selected="true"] .rail-tab-cta {
  color: var(--marigold-cta);
}

/* =========================================
   Editorial Production Spreads
   ========================================= */
.editorial-spread {
  padding: 88px 0;
  border-top: 1px solid var(--rule-ink);
}

.editorial-spread--celadon {
  background: var(--paper-celadon);
  color: var(--celadon-ink);
  border-top-color: var(--celadon-rule);
}

.spread-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 56px;
  align-items: center;
}

.spread-grid--reversed {
  grid-template-columns: 1.05fr 0.95fr;
}

.spread-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.spread-icon {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 10px 24px -8px rgba(18, 26, 36, 0.22);
  flex-shrink: 0;
}

.spread-story h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.3vw, 2.85rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.spread-platforms {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--cobalt-deep);
  margin-bottom: 16px;
}

.editorial-spread--celadon .spread-platforms {
  color: var(--forest-cta);
}

.spread-lead {
  font-size: 1.08rem;
  line-height: 1.62;
  color: var(--ink-slate);
  max-width: 56ch;
  margin-bottom: 28px;
}

.editorial-spread--celadon .spread-lead {
  color: var(--celadon-muted);
}

.pillar-list {
  list-style: none;
  border-top: 1px solid var(--rule-ink);
  margin-bottom: 30px;
}

.editorial-spread--celadon .pillar-list {
  border-top-color: var(--celadon-rule);
}

.pillar-item {
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--rule-ink);
}

.editorial-spread--celadon .pillar-item {
  border-bottom-color: var(--celadon-rule);
}

.pillar-item h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 4px;
}

.pillar-item p {
  font-size: 0.96rem;
  line-height: 1.52;
  color: var(--ink-slate);
  max-width: 56ch;
}

.editorial-spread--celadon .pillar-item p {
  color: var(--celadon-muted);
}

/* Staggered Uncropped 9:16 Gameplay Diptych */
.shot-diptych {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.shot-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-device);
  background: var(--ink-obsidian);
}

.shot-frame--offset {
  margin-top: 36px;
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: contain;
}

.boss-sticker {
  position: absolute;
  right: -18px;
  bottom: -20px;
  width: clamp(112px, 13vw, 156px);
  height: auto;
  filter: var(--shadow-cutout);
  pointer-events: none;
}

/* =========================================
   Studio Colophon & Compliance Footer
   ========================================= */
.site-footer {
  background: var(--ink-obsidian);
  color: var(--footer-ink);
  padding: 64px 0 56px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--footer-rule);
}

.footer-studio h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-studio p {
  font-size: 0.96rem;
  color: var(--footer-muted);
  max-width: 46ch;
  margin-bottom: 16px;
}

.footer-mail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--marigold-cta);
  text-decoration: none;
}

.footer-mail:hover {
  text-decoration: underline;
}

.footer-col h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--footer-ink);
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-col a {
  color: var(--footer-muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
}

.footer-col a:hover {
  color: var(--footer-ink);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--footer-muted);
}

.legacy-note {
  max-width: 64ch;
}

/* =========================================
   Responsive Breakpoints (Tablet & 390x844 Mobile)
   ========================================= */
@media (max-width: 1024px) {
  .masthead-lead {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .biome-deck {
    grid-template-columns: 1fr;
  }

  .biome-rail {
    flex-direction: row;
  }

  .world-panel {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .spread-grid,
  .spread-grid--reversed {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .spread-grid--reversed .shot-diptych {
    order: 2;
  }

  .spread-grid--reversed .spread-story {
    order: 1;
  }
}

@media (max-width: 680px) {
  .shell {
    padding: 0 18px;
  }

  .header-inner {
    padding: 12px 0;
    min-height: 64px;
  }

  .header-nav {
    gap: 14px;
  }

  .header-nav .nav-hide-sm {
    display: none;
  }

  .opening-folio {
    padding: 28px 0 48px;
  }

  .biome-rail {
    flex-direction: column;
    gap: 10px;
  }

  .rail-tab {
    padding: 16px;
    gap: 8px;
  }

  .rail-tab-desc {
    display: none;
  }

  .world-panel {
    padding: 22px 18px 26px;
    gap: 22px;
    min-height: 0;
  }

  .theater-stage {
    min-height: 0;
  }

  .world-diorama {
    min-height: 0;
  }

  .diorama-hero-cutout {
    width: 124px;
    right: -4px;
    bottom: -8px;
  }

  .diorama-runner-cutout {
    width: 116px;
    left: -4px;
    bottom: -8px;
  }

  .phonics-toybar {
    flex-direction: column;
    align-items: flex-start;
  }

  .action-cluster {
    width: 100%;
  }

  .action-cluster .btn {
    flex: 1 1 auto;
  }

  .editorial-spread {
    padding: 60px 0;
  }

  .shot-diptych {
    gap: 12px;
  }

  .shot-frame--offset {
    margin-top: 20px;
  }

  .boss-sticker {
    width: 96px;
    right: -6px;
    bottom: -12px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
