:root {
  color-scheme: light;
  --sand: #FFE4B9;
  --mint: #C0ECB8;
  --lagoon: #4ABBBD;
  --tidal: #1E80A0;
  --blue: #0684E5;
  --deep: #0D2E92;
  --violet: #43329c;
  --coral: #ff6b8b;

  --paper: #f3fbf9;
  --surface: #ffffff;
  --ink: #0f254e;
  --muted: #3e5578;
  --accent: var(--deep);
  --accent-ink: #ffffff;
  --outline: #1e427833;

  --ocean-top: #165980;
  --ocean-mid: #1d3ca3;
  --ocean-bottom: #3a2682;
  --ocean-ink: #f6fffb;
  --card: #173a8c;
  --card-border: #8de6e255;
  --nav: #0d2363e8;
  --hero-tint: linear-gradient(180deg, #fff5e438 0%, transparent 45%, #12487418 72%, #165980 100%);
  --heading: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --scroll-y: 0px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --red: #B02A29;
  --wine: #9B1135;
  --flame: #DB4D25;
  --orange: #FA891F;
  --sun: #FFF531;

  --paper: #190b1d;
  --surface: #2c1028;
  --ink: #fff2e4;
  --muted: #e5bdb6;
  --accent: var(--orange);
  --accent-ink: #1f0914;
  --outline: #fa891f44;

  --ocean-top: #5e1134;
  --ocean-mid: #3d103b;
  --ocean-bottom: #210b2e;
  --ocean-ink: #fff2e4;
  --card: #461235;
  --card-border: #fa891f70;
  --nav: #270b22ee;
  --hero-tint: linear-gradient(180deg, #7b143b45, transparent 43%, #9b113525 73%, #5e1134 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.2rem; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.65 Inter, system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
  position: fixed; z-index: 20; top: .5rem; left: 1rem;
  transform: translateY(-200%);
  background: var(--surface); color: var(--ink);
  padding: .65rem 1rem; border-radius: .5rem; font-weight: 700;
}
.skip:focus { transform: translateY(0); }

.wrap { width: min(1180px, calc(100% - 2.5rem)); margin-inline: auto; }

/* Navigation */
.masthead {
  position: sticky; inset-block-start: 0; z-index: 10;
  background: var(--nav); color: #fff7ea;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #ffffff1a;
}
.mast-inner, .nav-links, .nav-tools { display: flex; align-items: center; gap: 1.15rem; }
.mast-inner { min-height: 66px; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark {
  width: 2rem; height: 2rem; display: grid; place-items: center;
  border-radius: 50%; color: #0d2e92; background: #c0ecb8; font-size: 1.25rem;
}
[data-theme="dark"] .brand-mark { background: var(--sun); color: var(--wine); }
.nav-links { font-size: .88rem; font-weight: 600; }
.nav-links a { padding: .35rem .5rem; border-radius: .4rem; transition: background .2s ease; }
.nav-links a:hover { background: #ffffff1a; }
.theme-toggle {
  min-width: 42px; min-height: 42px;
  border: 1px solid #fff7ea55; color: inherit;
  background: #ffffff10; border-radius: .6rem; font-size: 1.15rem;
}

/* Layered Light Rays & Scroll Parallax */
.ocean-rays {
  position: absolute; inset: -10% 0; pointer-events: none; z-index: 0;
  transform: translate3d(0, calc(var(--scroll-y) * -0.06), 0);
  background:
    radial-gradient(circle at 18% 20%, #86f2ee29 0%, transparent 42%),
    radial-gradient(circle at 82% 28%, #b794f430 0%, transparent 46%),
    repeating-linear-gradient(-24deg, transparent 0 72px, #ffffff09 72px 108px, transparent 108px 195px);
}

/* Hero Section */
.hero {
  isolation: isolate;
  min-height: clamp(620px, calc(100svh - 66px), 960px);
  position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(var(--sand), var(--lagoon), var(--ocean-top));
  display: flex; flex-direction: column; justify-content: center;
}
.hero-image, .hero-tone { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-image img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center 54%;
  transform: scale(1.06) translate3d(0, calc(var(--scroll-y) * 0.14), 0);
}
.hero-tone { background: var(--hero-tint); }
[data-theme="dark"] .hero { background: linear-gradient(var(--orange), var(--wine), var(--ocean-top)); }
[data-theme="dark"] .hero-image { filter: sepia(.85) saturate(1.75) hue-rotate(324deg) brightness(.82); }

.hero-copy {
  position: relative; z-index: 1;
  padding-block: clamp(3.5rem, 8vh, 6.5rem);
  transform: translate3d(0, calc(var(--scroll-y) * 0.08), 0);
}
.eyebrow {
  font-size: .78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .16em; margin: 0 0 .65rem;
}
.hero .eyebrow { color: #0e2654; text-shadow: 0 1px 14px #fff; }
[data-theme="dark"] .hero .eyebrow { color: var(--sun); text-shadow: 0 2px 10px #2b0a1d; }

h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--heading); line-height: 1.05; }
h1 {
  font-size: clamp(2.45rem, 6.8vw, 6.2rem);
  margin: .4rem auto 1.15rem;
  color: #0b2559; letter-spacing: -.05em; text-transform: uppercase;
}
h1 span, h1 em { display: block; }
h1 em { font-size: .58em; font-style: normal; letter-spacing: .22em; margin-top: .25em; }
[data-theme="dark"] .hero h1 { color: #fff3e6; text-shadow: 0 4px 24px #2f091d; }

.hero-caption {
  font-size: clamp(1.05rem, 1.8vw, 1.32rem);
  font-weight: 700; max-width: 44ch; margin: 0 auto .65rem;
  color: #0d2654; text-shadow: 0 1px 16px #ffffffd9;
}
.hero-sub {
  max-width: 56ch; margin: 0 auto 1.6rem;
  font-size: .96rem; font-weight: 500;
  color: #143266; text-shadow: 0 1px 12px #ffffffcc;
}
[data-theme="dark"] .hero-caption,
[data-theme="dark"] .hero-sub { color: #fff3e6; text-shadow: 0 2px 10px #270a1b; }

.hero-actions, .voice-bar, .page-arrows { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.hero-actions { justify-content: center; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 45px; border: 1px solid transparent; border-radius: 999px;
  padding: .6rem 1.25rem; font-weight: 750; font-size: .9rem;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}
.button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.main-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--coral), #e6496f);
  box-shadow: 0 8px 22px #e6496f4d;
}
.quiet { background: var(--surface); color: var(--ink); border-color: var(--outline); }
.bare { background: transparent; border-color: var(--outline); color: var(--ink); }

.scroll-link {
  color: #fff; position: absolute; z-index: 2; display: grid; place-items: center;
  width: 44px; height: 44px; bottom: 1.25rem; left: 50%; translate: -50%;
  border: 1px solid #ffffff88; border-radius: 50%; background: #0c224777;
  animation: float-bob 2.6s ease-in-out infinite;
}
@keyframes float-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Ocean & Legend Section */
.ocean {
  position: relative; overflow: hidden;
  color: var(--ocean-ink);
  background: linear-gradient(180deg, var(--ocean-top) 0%, var(--ocean-mid) 52%, var(--ocean-bottom) 100%);
  padding-bottom: clamp(4rem, 9vw, 7rem);
}
.ocean > .wrap { position: relative; z-index: 1; }
.legend { text-align: center; padding-block: clamp(3.8rem, 8vw, 6.2rem) clamp(2.4rem, 5vw, 4rem); }
.legend .eyebrow { color: var(--mint); }
[data-theme="dark"] .legend .eyebrow { color: var(--sun); }
h2 { font-size: clamp(1.85rem, 3.8vw, 3.2rem); letter-spacing: -.04em; margin-bottom: .8rem; }
.legend-prose { max-width: 62ch; margin: 0 auto; font-size: 1.05rem; opacity: .96; }
.legend-prose p { margin-bottom: .9rem; }

.legend-timeline {
  list-style: none; padding: 0; margin-bottom: 2.5rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1rem;
}
.legend-timeline li {
  background: #ffffff12; backdrop-filter: blur(8px);
  border: 1px solid #ffffff24; border-top: 3px solid var(--mint);
  border-radius: .85rem; padding: 1rem 1.1rem; font-weight: 800;
  transition: transform .25s ease, background .25s ease;
}
.legend-timeline li:hover { transform: translateY(-4px); background: #ffffff1c; }
[data-theme="dark"] .legend-timeline li { border-top-color: var(--sun); }
.legend-timeline span { display: block; font-weight: 400; font-size: .92rem; margin-top: .3rem; opacity: .92; }

/* Project Statistics Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
  gap: .85rem;
}
.stat-pill {
  background: #0b194775; border: 1px solid #ffffff29;
  border-radius: 1rem; padding: 1rem; text-align: center;
  backdrop-filter: blur(10px);
  transition: transform .25s ease, border-color .25s ease;
}
.stat-pill:hover { transform: translateY(-3px); border-color: var(--coral); }
.stat-pill strong { display: block; font-size: 1.35rem; color: #fff; margin-bottom: .15rem; }
.stat-pill span { font-size: .86rem; opacity: .9; }

/* General Sections */
.section { padding-block: clamp(3.8rem, 8vw, 6.5rem); }
.section-head { text-align: center; max-width: 64ch; margin: 0 auto clamp(2rem, 4vw, 3rem); }
.section-sub { color: var(--muted); font-size: 1.04rem; margin-bottom: 0; }

/* User Journey */
.journey {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1rem;
}
.journey li a {
  display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: 1rem; padding: 1.25rem;
  box-shadow: 0 10px 26px #0d2e920d;
  transition: transform .22s ease, border-color .22s ease;
}
.journey li a:hover { transform: translateY(-4px); border-color: var(--coral); }
.step-badge {
  display: inline-block; align-self: flex-start;
  font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
  padding: .22rem .6rem; border-radius: 999px;
  background: var(--deep); color: #fff; margin-bottom: .75rem;
}
[data-theme="dark"] .step-badge { background: var(--orange); color: #1f0914; }
.journey h3 { font-size: 1.12rem; margin-bottom: .45rem; }
.journey p { font-size: .9rem; color: var(--muted); margin: 0; }
.journey.in-view li { animation: step-in .38s both; animation-delay: calc(var(--step, 0) * 80ms); }
@keyframes step-in { from { opacity: 0; transform: translateY(12px); } }

/* Digital Storybook */
.story-grid, .scan-grid {
  display: grid; grid-template-columns: 1.02fr 1fr;
  align-items: center; gap: clamp(1.2rem, 3.5vw, 3rem);
}
.story-panel, .character-card {
  background: var(--surface); border: 1px solid var(--outline); border-radius: 1.15rem;
  box-shadow: 0 14px 34px #0d2e9210;
}
.story-panel { padding: clamp(1.2rem, 3vw, 2.1rem); }
.scene-stage, .ar-preview {
  background: radial-gradient(ellipse at 50% 15%, var(--mint), var(--lagoon));
  position: relative; overflow: hidden; border-radius: 1.15rem;
}
[data-theme="dark"] :is(.scene-stage, .ar-preview) {
  background: radial-gradient(ellipse at 49% 10%, #db4d25, #4d0e2b 75%);
}
.book-page {
  margin: 0; aspect-ratio: 0.88; display: grid; place-items: center;
  perspective: 1000px; touch-action: pan-y;
}
.book-page img {
  width: 100%; height: 100%; position: absolute;
  object-fit: contain; object-position: center;
  transform-origin: left center;
}
.book-page[data-direction="back"] img { transform-origin: right center; }
.book-page.turn img { animation: page-turn .34s ease-out; }
@keyframes page-turn { from { transform: rotateY(-34deg); opacity: .55; } }

.stage-label, .ar-overlay {
  position: absolute; z-index: 3; color: var(--ink);
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: .6rem; padding: .42rem .8rem; font-size: .83rem; font-weight: 600;
  pointer-events: none;
}
.stage-label { inset: .85rem auto auto .85rem; }
.ar-overlay { inset: auto .85rem .85rem; text-align: center; }

.story-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .7rem; margin-bottom: .8rem;
}
.lang-control { display: flex; align-items: center; gap: .5rem; }
.lang-control label { font-size: .86rem; font-weight: 600; color: var(--muted); }
.story-meta select, #personName {
  color: var(--ink); background: var(--paper); border: 1px solid var(--outline);
  min-height: 42px; border-radius: .5rem; padding: .4rem .65rem;
}
#pageCount { font-size: .9rem; color: var(--muted); font-weight: 800; }
h3 { margin-bottom: .6rem; font-size: 1.42rem; line-height: 1.25; }
#pageText { white-space: pre-line; }
.status { color: var(--muted); min-height: 1.3em; margin: .45rem 0; font-size: .86rem; }

.page-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .38rem; margin-block: .6rem .95rem; }
.page-grid button {
  min-height: 40px; border: 1px solid var(--outline);
  background: transparent; border-radius: .45rem; color: var(--ink); font-weight: 600;
}
.page-grid button[aria-current] {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 800;
}
.page-arrows { justify-content: space-between; margin-bottom: 1rem; }

.marker-callout { padding-top: .95rem; border-top: 1px solid var(--outline); }
.marker-copy { font-size: .92rem; margin-bottom: .65rem; }
.book-ending {
  margin-top: 1rem; padding: .95rem; border-radius: .8rem;
  background: var(--paper); border: 1px solid var(--coral);
}

/* Character Section */
.cast { background: linear-gradient(180deg, var(--sand) 0%, #f5edd8 100%); }
[data-theme="dark"] .cast { background: linear-gradient(180deg, #2a1024 0%, #1d0c1c 100%); }
.character-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.1rem, 3vw, 2.2rem); }
.character-card { overflow: hidden; display: flex; flex-direction: column; }
.portrait {
  display: grid; justify-items: center;
  background: radial-gradient(ellipse, var(--mint), var(--lagoon));
  overflow: hidden; height: clamp(230px, 32vw, 390px);
}
[data-theme="dark"] .portrait { background: radial-gradient(ellipse, #db4d25, #4d0e2b); }
.portrait img { width: 100%; height: 100%; object-fit: contain; }
.char-tag {
  display: inline-block; font-size: .76rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--tidal); margin-bottom: .35rem;
}
[data-theme="dark"] .char-tag { color: var(--sun); }
.character-info { padding: 1.35rem; }
.portrait img.gesture-wave { animation: wave .8s ease-in-out; }
.portrait img.gesture-story { animation: story-gesture .8s ease-in-out; }
.portrait img.gesture-greet { animation: greet .8s ease-in-out; }
.portrait img.gesture-point { animation: point .8s ease-in-out; }
@keyframes wave { 25%, 65% { transform: rotate(-5deg) scale(1.035); } 45% { transform: rotate(5deg) scale(1.035); } }
@keyframes story-gesture { 30% { transform: translateX(-3%) scale(1.045); } 65% { transform: translateX(3%) scale(1.045); } }
@keyframes greet { 45% { transform: translateY(5%) rotate(4deg) scale(.98); } }
@keyframes point { 45% { transform: translateX(5%) rotate(-4deg) scale(1.045); } }

/* AR Section, Viewfinder HUD & 3-Card Carousel */
.scan {
  position: relative;
  color: var(--ocean-ink);
  background: linear-gradient(180deg, var(--ocean-top) 0%, var(--ocean-mid) 50%, var(--ocean-bottom) 100%);
  overflow: hidden;
}
.scan > .wrap { position: relative; z-index: 1; }
.scan .section-sub, .scan .status, .scan .inline-link, .privacy-note { color: #e2ecff; }
[data-theme="dark"] .scan .section-sub,
[data-theme="dark"] .scan .status,
[data-theme="dark"] .scan .inline-link,
[data-theme="dark"] .privacy-note { color: #f6dfd8; }
.scan .eyebrow { color: var(--mint); }
[data-theme="dark"] .scan .eyebrow { color: var(--sun); }
.scan .bare { color: #fff; border-color: #ffffff55; }

.scan-meta-links { margin-top: .75rem; font-size: .9rem; }
.inline-link { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.privacy-note { font-size: .82rem; opacity: .82; margin-top: .5rem; }

.ar-preview {
  height: 29rem; isolation: isolate;
  border: 2px solid #ffffff33;
  box-shadow: 0 24px 52px #07103075;
}
.vf-hud-top {
  position: absolute; top: .85rem; left: .85rem; right: 3.8rem; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  pointer-events: none;
}
.vf-pill, .vf-tag {
  background: #09153ed9; color: #f6fffb;
  border: 1px solid #ffffff30; border-radius: 999px;
  padding: .28rem .72rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em;
  backdrop-filter: blur(8px);
}
.vf-pill { display: inline-flex; align-items: center; gap: .42rem; }
.vf-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #94a3b8;
  display: inline-block;
}
.ar-preview.is-live .vf-dot { background: #34d399; box-shadow: 0 0 8px #34d399; }

.vf-reticle {
  position: absolute; inset: 18% 20%; z-index: 2; pointer-events: none;
}
.vf-corner {
  position: absolute; width: 22px; height: 22px;
  border-color: #ffffffaa; border-style: solid;
}
.vf-corner.tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.vf-corner.tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.vf-corner.bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.vf-corner.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

#ar-container { width: 100%; height: 100%; overflow: hidden; position: relative; }
#ar-container video { z-index: 0 !important; pointer-events: none; }
#ar-container canvas { position: absolute; z-index: 1; touch-action: none; }
.expand {
  position: absolute; z-index: 4; right: .75rem; top: max(.75rem, env(safe-area-inset-top));
  border: 1px solid #ffffff44; color: #fff; background: #09153ed9;
  min-width: 42px; min-height: 42px; border-radius: .6rem; backdrop-filter: blur(8px);
}
.ar-preview.expanded { position: fixed; z-index: 25; inset: 0; width: 100%; height: 100dvh; border-radius: 0; background: #0a0a0a; border: 0; }
body:has(.ar-preview.expanded) { overflow: hidden; }

.ar-session-bar,.ar-tool-dock {
  position: absolute;
  z-index: 4;
  color: #fff4e6;
  font-size: .74rem;
}
.ar-session-bar {
  top: max(.75rem,env(safe-area-inset-top));
  left: .65rem;
  right: 3.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
  justify-content: space-between;
}
.ar-session-bar[hidden],.ar-tool-dock[hidden] { display: none; }
.ar-session-bar button,.ar-session-bar select,.ar-session-bar span,
.ar-tool-dock summary,.ar-tool-panel button {
  min-height: 42px;
  padding: .38rem .55rem;
  border: 1px solid #ffe0ac54;
  border-radius: .48rem;
  background: #241533ef;
  color: #fff4e6;
  font: inherit;
  font-weight: 730;
}
.ar-session-bar span { display: inline-grid; place-items: center; }
.ar-session-bar select { max-width: 7.5rem; }
.ar-tool-dock { right: .65rem; bottom: max(4.6rem,calc(env(safe-area-inset-bottom) + 4rem)); }
.ar-tool-dock summary { align-content: center; cursor: pointer; width: max-content; margin-left: auto; }
.ar-tool-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + .35rem);
  display: grid;
  width: min(12rem,calc(100vw - 2rem));
  gap: .25rem;
  border: 1px solid #ffe0ac68;
  border-radius: .55rem;
  background: #201124f4;
  padding: .32rem;
}
.ar-tool-panel button { text-align: left; }
.ar-tool-panel button[aria-pressed="true"] { border-inline-start: 3px solid #ffc37d; }
.ar-preview.is-live .vf-hud-top { display: none; }
.ar-preview.has-target .vf-reticle { opacity: 0; }
.ar-preview.expanded .ar-overlay { bottom: max(.85rem,env(safe-area-inset-bottom)); }

.scene-hub { margin-top: 4.2rem; scroll-margin-top: 5rem; }
.scene-carousel-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.8rem);
  align-items: stretch;
  transition: opacity .2s ease;
}
.scene-card {
  position: relative;
  display: flex; flex-direction: column;
  border-radius: 1.35rem; padding: 1.2rem;
  color: #f6fffb;
  background: linear-gradient(180deg, #1b48a3 0%, #142466 100%);
  border: 1px solid #96ebe659;
  box-shadow: 0 20px 42px #09123659;
  animation: deck-enter .36s cubic-bezier(.22, 1, .36, 1) both;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
@keyframes deck-enter {
  from { opacity: .25; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
[data-theme="dark"] .scene-card {
  background: linear-gradient(180deg, #56153d 0%, #260a24 100%);
  border-color: #fa891f66;
}
.scene-card.featured {
  transform: translateY(-10px);
  border-color: var(--coral);
  box-shadow: 0 26px 52px #08103078;
}
.scene-card:hover { transform: translateY(-12px); border-color: var(--coral); }
.scene-badge {
  position: absolute; top: 1.6rem; left: 1.6rem; z-index: 2;
  background: #09153ed9; color: #fff; font-weight: 800; font-size: .8rem;
  padding: .26rem .68rem; border-radius: 999px; border: 1px solid #ffffff40;
  backdrop-filter: blur(6px);
}
.scene-card img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: center 75%;
  border-radius: .85rem; margin-bottom: .95rem;
}
.scene-card h4 { font-size: 1.15rem; margin: 0 0 .4rem; color: #ffffff; }
.scene-card p { font-size: .9rem; line-height: 1.5; color: #dbeafe; margin-bottom: 1rem; flex: 1; }
.scene-card .voice-bar { margin-top: auto; }
.scene-card .button { font-size: .82rem; padding: .5rem .85rem; }
.scene-card .bare { color: #fff; border-color: #ffffff55; }

.carousel-controls {
  display: flex; align-items: center; justify-content: center; gap: 1.2rem;
  margin-top: 1.85rem;
}
.carousel-dots { display: flex; align-items: center; gap: .5rem; }
.carousel-dots button {
  width: 28px; height: 6px; border-radius: 999px; border: 0;
  background: #ffffff44; padding: 0; transition: width .25s ease, background .25s ease;
}
.carousel-dots button[aria-selected="true"] {
  width: 44px; background: var(--coral);
}

/* Quiz, Learning Outcomes & Certificate */
.quiz, .help { background: var(--surface); }
.quiz-panel {
  max-width: 52rem; margin-inline: auto;
  background: var(--paper); border: 1px solid var(--outline);
  border-radius: 1.2rem; padding: clamp(1.25rem, 4vw, 2.35rem);
}
.learning-outcome {
  margin-block: 1.2rem; padding: 1.1rem 1.25rem;
  background: var(--surface); border-left: 4px solid var(--coral);
  border-radius: .75rem;
}
.learning-outcome h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.learning-outcome p { font-size: .92rem; margin-bottom: .45rem; color: var(--muted); }
.learning-outcome ul { margin: 0; padding-left: 1.2rem; font-size: .92rem; }
.learning-outcome li { margin-bottom: .25rem; }

.untimed-label { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; cursor: pointer; }
.quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-block: 1rem; }
.quiz-options button { text-align: left; justify-content: flex-start; border-radius: .75rem; padding: .75rem 1rem; }
.quiz-options button[data-answer="correct"] { background: #c0ecb8; color: #123b24; border-color: #36734a; }
.quiz-options button[data-answer="incorrect"] { background: #ffe2dc; color: #69252e; border-color: #a2454c; }
.quiz-options button:disabled[data-answer] { opacity: 1; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-block: 1rem; }
#quizProgress { width: 100%; height: 8px; accent-color: var(--coral); margin-bottom: 1rem; }
.result-message { white-space: pre-line; font-size: 1.03rem; }

#certificateForm { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-block: 1.2rem; }
.certificate-paper {
  text-align: center; color: #102a54; background: #fff9ec;
  border: 6px double #1e80a0; border-radius: .85rem;
  padding: clamp(1.25rem, 5vw, 2.5rem); overflow-wrap: anywhere;
}
.cert-kicker { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #1e80a0; }
.cert-sub, .cert-foot { font-size: .92rem; max-width: 48ch; margin-inline: auto; }
#certificateName { font-size: 1.65rem; font-weight: 800; margin-block: .65rem; color: #0d2e92; }
#certificateDetails { font-weight: 700; margin-bottom: .65rem; }

/* Team Section */
.team-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.team-card {
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: 1rem; padding: 1.25rem;
}
.team-card h3 { font-size: 1.12rem; margin-bottom: .35rem; }
.team-card p { font-size: .9rem; color: var(--muted); margin: 0; }
.team-note { text-align: center; max-width: 68ch; margin: 0 auto; color: var(--muted); font-size: .94rem; }

/* FAQ & Troubleshooting */
.faq-list { max-width: 54rem; margin: 0 auto 2.5rem; }
.faq-list details {
  background: var(--paper); border: 1px solid var(--outline);
  border-radius: .85rem; padding: .65rem 1.1rem; margin-bottom: .65rem;
}
.faq-list summary { cursor: pointer; min-height: 42px; align-content: center; font-weight: 750; }
.faq-list p { margin: .45rem 0 .35rem; color: var(--muted); }
.trouble-title { text-align: center; margin-bottom: 1.25rem; }
.quick-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1rem;
}
.quick-grid div {
  background: var(--paper); border: 1px solid var(--outline);
  border-radius: .9rem; padding: 1.1rem;
}
.quick-grid dt { font-weight: 800; margin-bottom: .35rem; }
.quick-grid dd { margin: 0; font-size: .92rem; color: var(--muted); }

/* Final CTA & Footer */
.final-cta {
  position: relative; overflow: hidden;
  color: var(--ocean-ink);
  background: linear-gradient(180deg, var(--ocean-mid), var(--ocean-bottom));
  text-align: center; padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}
.final-cta > .wrap { position: relative; z-index: 1; }
.final-cta .eyebrow { color: var(--mint); }
[data-theme="dark"] .final-cta .eyebrow { color: var(--sun); }
.final-sub { max-width: 54ch; margin: 0 auto 1.6rem; font-size: 1.05rem; opacity: .94; }

footer { background: var(--nav); color: #fff2e4; padding-block: 1.6rem; font-size: .88rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; }

/* Marker Dialog */
#markerDialog {
  border: 1px solid var(--outline); border-radius: 1rem;
  background: var(--surface); color: var(--ink);
  width: min(95vw, 760px); max-height: 94dvh; padding: 1.2rem;
}
#markerDialog header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
#markerDialog h2 { margin: 0; font-size: 1.25rem; }
#markerDialog::backdrop { background: #071329cc; backdrop-filter: blur(4px); }
#fullMarker { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(86dvh - 6rem); margin-inline: auto; background: #fff; border-radius: .5rem; }

/* Responsive Breakpoints */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .story-grid, .scan-grid { grid-template-columns: 1fr; }
  .scene-carousel-deck { grid-template-columns: 1fr; }
  .scene-card.featured { transform: none; }
}
@media (max-width: 560px) {
  .wrap { width: min(100% - 1.75rem, 600px); }
  .character-grid, .quiz-options { grid-template-columns: 1fr; }
  .ar-preview { height: min(65vh, 26rem); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* 3D chapter preview */
.model-preview {
  box-sizing: border-box;
  width: min(94vw, 58rem);
  max-width: none;
  max-height: 94dvh;
  padding: 0;
  border: 1px solid #c99162;
  border-radius: 1rem;
  background: #26162e;
  color: #fff7e7;
  box-shadow: 0 20px 75px #0c061bd9;
}
.model-preview::backdrop { background: #11091be0; }
.preview-frame { display: grid; grid-template-rows: auto minmax(10rem, 1fr) auto; min-height: min(37rem, 89dvh); }
.preview-header, .preview-controls {
  display: flex;
  gap: .6rem;
  align-items: center;
  justify-content: space-between;
  padding: .75rem clamp(.65rem, 3vw, 1.35rem);
}
.preview-header h2 { font: 700 clamp(1rem, 4vw, 1.65rem) system-ui; letter-spacing: normal; margin: .1rem 0 0; }
.preview-chapter { margin: 0; color: #ffce8c; font-size: .76rem; font-weight: 720; }
.preview-stage {
  position: relative;
  display: grid;
  min-height: min(20rem, 55dvh);
  overflow: hidden;
  border-block: 1px solid #ffd99b37;
  background: radial-gradient(at 50% 28%, #503552 1%, #170f24 78%);
}
.preview-surface { min-height: 0; position: absolute; inset: 0; }
.preview-surface model-viewer { width: 100%; height: 100%; display: block; --poster-color: transparent; }
.preview-poster { width: 100%; height: 100%; object-fit: contain; opacity: .48; }
.preview-status { margin: auto; z-index: 1; padding: .55rem .8rem; background: #21152cec; border-radius: .45rem; pointer-events: none; }
.preview-controls { justify-content: flex-start; flex-wrap: wrap; }
.preview-button {
  display: inline-flex;
  align-items: center;
  padding: .38rem .65rem;
  min-height: 44px;
  border: 1px solid #f6c48079;
  border-radius: .45rem;
  background: #35233e;
  color: #fff4e2;
  font: 650 .85rem system-ui;
  text-decoration: none;
  cursor: pointer;
}
.preview-button:disabled { opacity: .5; cursor: default; }
.preview-button[aria-pressed="true"] { border-color: #ffcc85; }
.preview-launch { margin-left: auto; background: #ffd28f; color: #201124; border-color: #ffd28f; }
.preview-button:focus-visible, .preview-surface model-viewer:focus-visible { outline: 3px solid #ffce8c; outline-offset: 2px; }
.model-preview.preview-expanded, .model-preview:fullscreen {
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border-radius: 0;
}
.model-preview.preview-expanded .preview-frame, .model-preview:fullscreen .preview-frame { height: 100%; }
@media (max-width: 520px) {
  .preview-controls { gap: .35rem; }
  .preview-launch { margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .model-preview[open] { animation: show-preview .17s ease-out both; }
  @keyframes show-preview { from { opacity: 0; transform: translateY(.5rem); } }
}


.carousel-controls.is-gallery-hidden { display: none; }
.scene-carousel-deck.is-full { row-gap: 1rem; }
