:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #111;
  --muted: #626262;
  --line: #dedede;
  --nav-height: 76px;
  --gutter: clamp(24px, 4vw, 80px);
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; scroll-padding-top: var(--nav-height); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.65 "Courier New", Courier, monospace; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 3px solid #356ac3; outline-offset: 5px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 30; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
.nav {
  position: fixed; inset: 0 0 auto; height: var(--nav-height); z-index: 10;
  padding: 12px var(--gutter); display: flex; align-items: center;
  justify-content: space-between; gap: 16px; background: #fffffff5;
}
.brand { font-size: clamp(18px, 1.6vw, 26px); letter-spacing: -.055em; white-space: nowrap; }
.nav nav { display: flex; align-items: center; gap: 32px; }
.nav nav a, .nav button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.nav nav a { gap: 18px; font-size: 12px; }
.nav button { border: 1px solid var(--ink); border-radius: 24px; background: var(--ink); color: white; padding: 8px 20px; font-size: 11px; }
.story-progress { position: absolute; inset: auto 0 0; height: 1px; background: var(--line); }
.story-progress span { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.story { position: relative; }
.character-stage { position: sticky; top: 0; height: 100vh; height: 100svh; pointer-events: none; z-index: 2; }
.character { position: absolute; inset: var(--nav-height) 0 0; }
.character img, .character canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; }
.character canvas { opacity: 0; }
.character.ready canvas { opacity: 1; }
.character.ready img { opacity: 0; }
.chapters { position: relative; margin-top: -100vh; margin-top: -100svh; }
.chapter { height: 100vh; height: 100svh; position: relative; }
.chapter:not(.intro) { z-index: 3; }
.loop-text { position: absolute; left: 0; top: 25%; width: 100%; overflow: hidden; }
.loop-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.loop-track > span { flex-shrink: 0; font: 400 clamp(72px, 11vw, 190px)/1.15 Arial, Helvetica, sans-serif; letter-spacing: -.045em; white-space: nowrap; }
.loop-track em { font-style: normal; color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
@keyframes marquee { to { transform: translateX(-50%); } }
.chapter-heading, .chapter-copy { position: absolute; z-index: 3; width: 25%; max-width: 420px; }
.left { left: var(--gutter); }
.right { right: var(--gutter); text-align: right; }
.chapter-heading { top: 27%; }
.chapter-copy { top: 53%; }
.intro .chapter-copy { top: auto; bottom: 13%; }
.chapter-copy p + p { margin-top: 20px; }
.chapter-copy [lang="zh"] { line-height: 1.85; color: var(--muted); }
.eyebrow { color: var(--muted); font-size: 11px; margin-bottom: 18px; }
h2 { font: 800 clamp(32px, 3.5vw, 65px)/.98 Arial, Helvetica, sans-serif; letter-spacing: -.055em; }
.fun h2 { font-size: clamp(40px, 5vw, 84px); }
.statement { font: 800 clamp(28px, 2.8vw, 48px)/1.04 Arial, Helvetica, sans-serif; letter-spacing: -.045em; }
.playground .chapter-heading { top: 26%; }
.playground .chapter-copy { top: 49%; }
.muted, .scroll-link { color: var(--muted); }
.scroll-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 18px; gap: 18px; }
.footer { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding: 34px var(--gutter); border-top: 1px solid var(--line); background: white; }
.socials { display: flex; flex-wrap: wrap; gap: 24px; }
.footer a { display: inline-flex; align-items: center; min-height: 44px; }
.nav a:hover, .footer a:hover, .scroll-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.motion-paused .loop-track { animation-play-state: paused; }
@media (min-width: 1600px) { .character { inset: var(--nav-height) 4% 0; } }
@media (max-width: 1100px) and (min-width: 701px) {
  :root { --gutter: 24px; --nav-height: 68px; }
  .chapter-heading, .chapter-copy { width: 27%; }
  .chapter-copy { font-size: 12px; line-height: 1.6; }
  h2 { font-size: clamp(26px, 3.8vw, 42px); }
  .fun h2 { font-size: clamp(36px, 5vw, 54px); }
  .statement { font-size: clamp(25px, 3.3vw, 36px); }
  .character { inset: 14% 12% 10%; }
  .character img, .character canvas { object-fit: cover; }
  .loop-track > span { font-size: 90px; }
}
@media (max-width: 700px) {
  :root { --nav-height: 64px; --gutter: 22px; }
  .nav { padding-block: 10px; }
  .nav nav { gap: 10px; }
  .nav nav > a { display: none; }
  .nav button { font-size: 10px; padding: 7px 14px; }
  .brand { font-size: 19px; }
  .character { inset: calc(var(--nav-height) + 144px) 0 218px; }
  .character img, .character canvas { object-fit: cover; }
  .loop-text { top: 34%; }
  .loop-track > span { font-size: clamp(48px, 11vw, 72px); }
  .chapter-heading, .chapter-copy { width: calc(100% - 2 * var(--gutter)); max-width: none; }
  .chapter-heading, .playground .chapter-heading { top: calc(var(--nav-height) + 24px); }
  h2, .fun h2 { font-size: clamp(28px, 6vw, 40px); line-height: .98; }
  .eyebrow { font-size: 10px; margin-bottom: 12px; }
  .chapter-copy, .playground .chapter-copy { top: auto; bottom: 26px; font-size: 11px; line-height: 1.55; }
  .intro .chapter-copy.left { top: calc(var(--nav-height) + 24px); bottom: auto; max-width: 440px; }
  .intro .chapter-copy.right { top: auto; bottom: 28px; }
  .chapter-copy p + p { margin-top: 12px; }
  .chapter-copy [lang="zh"] { line-height: 1.65; }
  .statement { font-size: clamp(26px, 6.2vw, 36px); }
  .scroll-link { margin-top: 8px; }
  .footer { padding-block: 24px; gap: 12px 24px; font-size: 12px; }
  .footer .brand { width: 100%; }
  .socials { gap: 18px; }
}
@media (min-width: 701px) and (max-width: 1000px) and (orientation: portrait) {
  .character { inset: 230px 0 260px; }
  .chapter-heading, .playground .chapter-heading { top: calc(var(--nav-height) + 40px); width: 46%; }
  .chapter-copy, .playground .chapter-copy { top: auto; bottom: 36px; width: 46%; }
  .intro .chapter-copy.left { top: calc(var(--nav-height) + 40px); bottom: auto; }
  .intro .chapter-copy.right { top: auto; bottom: 36px; }
  h2, .fun h2 { font-size: 38px; }
  .statement { font-size: 34px; }
}
@media (max-width: 700px) and (max-height: 650px) {
  :root { --gutter: 18px; --nav-height: 58px; }
  .character { inset: 184px 0 198px; }
  .chapter-heading, .playground .chapter-heading { top: calc(var(--nav-height) + 16px); }
  h2, .fun h2 { font-size: 27px; }
  .eyebrow { margin-bottom: 8px; }
  .chapter-copy, .playground .chapter-copy { bottom: 16px; font-size: 10px; line-height: 1.45; }
  .chapter-copy p + p { margin-top: 8px; }
  .intro .chapter-copy.left { top: calc(var(--nav-height) + 16px); }
  .intro .chapter-copy.right { bottom: 16px; }
}
@media (min-width: 560px) and (max-height: 600px) {
  :root { --nav-height: 58px; --gutter: 24px; }
  .character { inset: auto 32% 0; height: min(calc(100svh - var(--nav-height)), 45vw); }
  .character img, .character canvas { object-fit: cover; }
  .chapter-heading, .playground .chapter-heading { top: 28%; }
  .chapter-copy, .playground .chapter-copy { top: auto; bottom: 8%; font-size: 10px; line-height: 1.45; }
  .chapter-copy p + p { margin-top: 10px; }
  .chapter-heading, .chapter-copy { width: 28%; }
  h2, .fun h2 { font-size: clamp(20px, 3.4vw, 34px); }
  .statement { font-size: clamp(18px, 2.7vw, 26px); }
  .eyebrow { font-size: 9px; margin-bottom: 10px; }
  .loop-track > span { font-size: 75px; }
}
@media (min-width: 560px) and (max-width: 700px) and (max-height: 600px) {
  .chapter-copy, .playground .chapter-copy { font-size: 9px; line-height: 1.4; }
  .intro .chapter-copy.left { top: auto; bottom: 10%; }
}
@media (prefers-reduced-motion: reduce) { .loop-track { animation: none; } }

/* Phones use a single pinned reading surface with measured text bands.
   Text changes in place instead of scrolling across the portrait. */
.mobile-story { --nav-height: 64px; --gutter: clamp(18px, 5vw, 36px); }
.mobile-story .nav { padding-block: 10px; }
.mobile-story .nav nav > a { display: none; }
.mobile-story .nav nav { gap: 8px; }
.mobile-story .nav button { font-size: 11px; padding: 8px 14px; }
.mobile-story .brand { font-size: clamp(18px, 4.8vw, 24px); }
.mobile-story .story { height: 700svh; }
.mobile-story .character-stage { z-index: 2; }
.mobile-story .character { inset: var(--portrait-top, 230px) 0 var(--portrait-bottom, 230px); height: auto; z-index: 2; }
.mobile-story .character img, .mobile-story .character canvas { object-fit: cover; }
.mobile-story .chapters { position: sticky; top: 0; height: 100svh; z-index: 3; }
.mobile-story .chapter { position: absolute; inset: 0; height: 100%; visibility: hidden; pointer-events: none; }
.mobile-story .chapter.is-active { visibility: visible; pointer-events: auto; }
.mobile-story .chapter-heading, .mobile-story .chapter-copy { width: calc(100% - 2 * var(--gutter)); max-width: 640px; }
.mobile-story .chapter-heading, .mobile-story .playground .chapter-heading,
.mobile-story .intro .chapter-copy.left { top: calc(var(--nav-height) + 20px); bottom: auto; }
.mobile-story .chapter-copy, .mobile-story .playground .chapter-copy,
.mobile-story .intro .chapter-copy.right { top: auto; bottom: 20px; font-size: clamp(12px, 3.25vw, 15px); line-height: 1.5; }
.mobile-story .chapter-copy p + p { margin-top: 10px; }
.mobile-story .chapter-copy [lang="zh"] { line-height: 1.6; }
.mobile-story h2, .mobile-story .fun h2 { font-size: clamp(26px, 7vw, 42px); line-height: .98; }
.mobile-story .statement { font-size: clamp(24px, 6.1vw, 34px); line-height: 1.04; }
.mobile-story .eyebrow { font-size: 10px; margin-bottom: 10px; }
.mobile-story .loop-text { top: var(--marquee-top, 244px); z-index: 1; }
.mobile-story .loop-track > span { font-size: clamp(40px, 9vw, 64px); }
.mobile-story .scroll-link { margin-top: 6px; }
.mobile-story .footer { gap: 12px 20px; padding-block: 20px; font-size: 12px; }
.mobile-story .footer .brand { width: 100%; }
@media (max-height: 650px) {
  .mobile-story { --nav-height: 58px; }
  .mobile-story .chapter-heading, .mobile-story .playground .chapter-heading,
  .mobile-story .intro .chapter-copy.left { top: calc(var(--nav-height) + 12px); }
  .mobile-story h2, .mobile-story .fun h2 { font-size: 24px; }
  .mobile-story .eyebrow { margin-bottom: 8px; }
  .mobile-story .chapter-copy, .mobile-story .playground .chapter-copy,
  .mobile-story .intro .chapter-copy.right { bottom: 12px; font-size: 12px; line-height: 1.4; }
  .mobile-story .chapter-copy p + p { margin-top: 8px; }
  .mobile-story .loop-text { display: none; }
}
@media (min-width: 480px) and (max-height: 600px) and (orientation: landscape) {
  .mobile-story { --gutter: 20px; }
  .mobile-story .character { left: 31%; right: 31%; }
  .mobile-story .chapter-heading, .mobile-story .chapter-copy { width: calc(31% - var(--gutter) - 10px); }
  .mobile-story .chapter-heading, .mobile-story .playground .chapter-heading { top: calc(var(--nav-height) + 22px); }
  .mobile-story .intro .chapter-copy.left { top: auto; bottom: 20px; }
  .mobile-story .chapter-copy, .mobile-story .playground .chapter-copy,
  .mobile-story .intro .chapter-copy.right { bottom: 20px; font-size: clamp(11px, 1.7vw, 12px); line-height: 1.4; }
  .mobile-story .chapter-copy { max-height: calc(100svh - var(--nav-height) - 40px); overflow-y: auto; scrollbar-width: thin; }
  .mobile-story h2, .mobile-story .fun h2 { font-size: clamp(16px, 3.2vw, 30px); }
  .mobile-story .statement { font-size: clamp(18px, 2.6vw, 25px); }
  .mobile-story .eyebrow { font-size: 9px; margin-bottom: 8px; }
}
