/* Home. The top of the page is one SceneView world: a fixed canvas behind the copy,
 * scrolling flies its camera through five sets. Copy always sits on a card, never on the
 * place itself. After the journey, `.classic` is a plain, opaque reading part.
 * Stacking (root context): plates + shades (0) · canvas, then the veil (2) · content (3)
 * · chrome (20+). */
.home{overflow-x:clip;--scrim:11,11,12}
:root[data-theme=light] .home{--scrim:236,232,224}
.home .masthead{border-bottom-color:transparent;position:absolute;inset:0 0 auto 0;background:rgba(var(--scrim),.84);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}

.plates{position:fixed;inset:0;z-index:0;background:var(--bg);pointer-events:none;overflow:hidden}
.plate{position:absolute;inset:0;background-repeat:repeat-x;background-size:var(--plate-size,cover);background-position:var(--plate-pos,center);opacity:0;transition:opacity 1.1s var(--ease)}
.plate.is-front{opacity:1}
.plates:before{content:'';position:absolute;inset:0;z-index:1;background:rgba(var(--scrim),.18)}
.shade{position:absolute;inset:0;z-index:2;opacity:0;transition:opacity .9s var(--ease)}
.shade-l{background:linear-gradient(90deg,rgba(var(--scrim),.7) 0,rgba(var(--scrim),.45) 34%,rgba(var(--scrim),0) 58%)}
.shade-r{background:linear-gradient(270deg,rgba(var(--scrim),.7) 0,rgba(var(--scrim),.45) 34%,rgba(var(--scrim),0) 58%)}
.shade-b{background:linear-gradient(0deg,rgba(var(--scrim),.8) 0,rgba(var(--scrim),0) 50%)}
.world[data-side=left] .shade-l,.world[data-side=right] .shade-r,.world[data-side=bottom] .shade-b{opacity:1}
#world-canvas{position:fixed;inset:0;z-index:2;width:100%;height:100%;display:block;pointer-events:none;opacity:0;transition:opacity .8s var(--ease)}
.world.is-live #world-canvas{opacity:1}
.veil{position:fixed;inset:0;z-index:2;background:var(--bg);opacity:var(--veil,0);pointer-events:none}
/* The poster is the first set as the live camera frames it: on screen at once, it fades
 * when the canvas has drawn, and stays (whole, never cropped on a phone) without WebGL2. */
.world-poster{position:absolute;inset:0;z-index:1;display:block;transition:opacity .8s var(--ease)}
.world-poster img{width:100%;height:100%;object-fit:cover;display:block}
.world.is-live .world-poster{opacity:0}
.no-webgl .hud,.no-webgl .relight{display:none}
.no-webgl #world-canvas{display:none}
.noscript-note{position:relative;z-index:3;max-width:var(--max);margin:0 auto;padding:96px var(--gutter) 0;font-size:.875rem;color:var(--muted)}

main{position:relative}
.chapter{max-width:var(--max);margin:auto;padding:clamp(96px,14vh,168px) var(--gutter);position:relative;z-index:3}
.chapter h2{font-size:clamp(2.2rem,3.4vw,3.9rem)}
.chapter .eyebrow{color:var(--fg)}
.chapter .eyebrow b{font-weight:400;margin-right:14px;color:var(--fg)}
.chapter .eyebrow span{color:var(--muted);margin-left:10px}
.chapter .eyebrow span:before{content:'/';margin-right:10px;color:var(--faint)}
.chapter code{font-size:.9em}
.chapter-copy>p:not(.eyebrow):not(.note):not(.credit){font-size:clamp(1rem,1.1vw,1.125rem);line-height:1.6;color:var(--fg)}
.credit{font-family:var(--mono);font-size:.625rem;line-height:1.7;letter-spacing:.06em;color:var(--muted);max-width:none;margin:24px 0 0;text-wrap:pretty}
.credit a{color:inherit;border-bottom:1px solid var(--line)}
.credit a:hover{color:var(--fg)}

/* Cards: every word of the journey is read on one, never on the place behind it */
.hero-card,.stop .chapter-copy,.beat>*:first-child{background:rgba(var(--scrim),.84);-webkit-backdrop-filter:blur(18px) saturate(1.1);backdrop-filter:blur(18px) saturate(1.1);border:1px solid var(--line);padding:clamp(22px,2.6vw,40px)}
.beat .beat-line{padding-bottom:0}

/* A stop: one set on screen, the card on one side, the set on the other */
.stop{min-height:150vh;display:flex;align-items:center}
.stop .chapter-copy{width:min(100%,520px,40vw)}
.stop[data-side=right]{justify-content:flex-end}

/* HUD: live telemetry under the hero card */
.hud{display:flex;gap:18px;align-items:center;font-family:var(--mono);font-size:.625rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-variant-numeric:tabular-nums;opacity:0;transition:opacity .6s var(--ease)}
.hud b{color:var(--fg);font-weight:400}
.world-ready .hud{opacity:1}
.hud-live{color:var(--fg);display:inline-flex;align-items:center;gap:8px}
.hud-live:before{content:'';width:6px;height:6px;border-radius:50%;background:#ff4d2e;box-shadow:0 0 0 3px rgba(255,77,46,.18)}
.hud-place{color:var(--fg)}

/* ---------- hero: a card on the left, the living room on the right ---------- */
.hero{--u-accent:var(--fg);--u-on-accent:var(--bg);--u-hover:var(--field);--u-on-hover:#fff;--u-em:var(--fg)}
.hero[data-universe=armv]{--u-accent:#f59e0b;--u-on-accent:#140e02;--u-hover:#fbbf24;--u-on-hover:#140e02;--u-em:#fbbf24}
.hero[data-universe=wif]{--u-accent:#fb923c;--u-on-accent:#1c0a02;--u-hover:#fdba74;--u-on-hover:#1c0a02;--u-em:#fdba74}
.hero[data-universe=shop]{--u-accent:#34d399;--u-on-accent:#04261a;--u-hover:#6ee7b7;--u-on-hover:#04261a;--u-em:#6ee7b7}
:root[data-theme=light] .hero[data-universe=armv]{--u-accent:#9e5300;--u-on-accent:#fff;--u-hover:#7c4100;--u-on-hover:#fff;--u-em:#9e5300}
:root[data-theme=light] .hero[data-universe=wif]{--u-accent:#c2410c;--u-on-accent:#fff;--u-hover:#9a3412;--u-on-hover:#fff;--u-em:#c2410c}
:root[data-theme=light] .hero[data-universe=shop]{--u-accent:#047857;--u-on-accent:#fff;--u-hover:#065f46;--u-on-hover:#fff;--u-em:#047857}
.hero{min-height:100svh;display:flex;flex-direction:column;justify-content:center;padding-top:clamp(104px,14vh,140px);padding-bottom:28px}
.hero-card{width:min(100%,600px,44vw);animation:rise 1s var(--ease) both}
.hero-panel[hidden]{display:none}
.hero .eyebrow{color:var(--fg);margin-bottom:18px}
.hero .eyebrow span{color:var(--muted);margin-left:10px}
.hero .eyebrow span:before{content:'/';margin-right:10px;color:var(--faint)}
.hero-title{font-size:clamp(2.6rem,4.9vw,5.4rem);line-height:.94;letter-spacing:-.045em;font-stretch:122%;font-weight:800;margin:0 0 .36em;max-width:none}
.hero-title em{display:block;font-size:.62em;line-height:1.02;letter-spacing:-.015em;margin-top:.12em;color:var(--u-em)}
.hero .lead{margin:0;max-width:44ch;color:var(--fg);font-size:clamp(1rem,1.1vw,1.125rem)}
.hero-actions{margin:26px 0 18px}
.hero .button.primary{background:var(--u-accent);color:var(--u-on-accent);border-color:var(--u-accent)}
.hero .button.primary:hover{background:var(--u-hover);color:var(--u-on-hover);border-color:var(--u-hover)}
.hero-meta{display:flex;flex-wrap:wrap;gap:8px 22px;margin:0;font-family:var(--mono);font-size:.6875rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.hero-meta b{font-weight:400;color:var(--fg);margin-left:6px}
.hero-credit{max-width:none;display:flex;flex-direction:column;gap:8px;margin:22px 0 0;padding-top:14px;border-top:1px solid var(--line);font-family:var(--mono);font-size:.625rem;letter-spacing:.06em;color:var(--muted)}
.hero-credit .credit{margin:0}
@keyframes rise{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}

/* Universe switcher: four tabs, one row, inside the card */
.universes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin:0 0 clamp(20px,2.4vw,32px);border:1px solid var(--line-strong)}
.universes [role=tab]{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 10px;font-family:var(--mono);font-size:.625rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);white-space:nowrap;transition:background-color .15s,color .15s}
.universes [role=tab]+[role=tab]{border-left:1px solid var(--line-strong)}
.universes [role=tab]:hover{color:var(--fg)}
.universes [role=tab][aria-selected=true]{background:var(--u-accent);color:var(--u-on-accent)}
.universes .dot{width:7px;height:7px;border-radius:50%;flex:none}
.universes [data-universe=sceneview] .dot{background:#8f97ff}
.universes [data-universe=armv] .dot{background:#f59e0b}
.universes [data-universe=wif] .dot{background:#ea580c}
.universes [data-universe=shop] .dot{background:#10b981}
.universes [role=tab]:focus-visible{outline-offset:-3px}

/* 02 Filament: move the car */
.relight{margin:28px 0 30px}
.relight-pills{display:inline-flex;flex-wrap:wrap;border:1px solid var(--line-strong)}
.relight-pills button{font-family:var(--mono);font-size:.75rem;letter-spacing:.1em;text-transform:uppercase;color:var(--fg);padding:14px 16px;min-height:48px;transition:background-color .2s,color .2s}
.relight-pills button+button{border-left:1px solid var(--line-strong)}
.relight-pills button:hover{background:var(--line)}
.relight-pills button[aria-pressed=true]{background:var(--fg);color:var(--bg)}
.relight-pills button:disabled{opacity:.5;cursor:default}
.relight-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.spec-list{margin:0 0 8px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 32px;max-width:460px;font-family:var(--mono);font-size:.6875rem;letter-spacing:.08em;text-transform:uppercase}
.spec-list dt{color:var(--muted);margin-bottom:6px}
.spec-list dd{margin:0;color:var(--fg)}
.web-chapter .spec-list{margin:24px 0 28px}

/* Beats: one line of type on its card while the camera moves */
.beat{min-height:130vh;flex-direction:column;align-items:flex-start;justify-content:center}
.beat[data-side=right]{align-items:flex-end}
.beat>*{width:min(100%,520px,40vw)}
.beat-line{font-family:var(--display);font-weight:780;font-stretch:122%;font-size:clamp(2.4rem,4vw,4.6rem);letter-spacing:-.045em;line-height:.94;margin:0;color:var(--fg)}
.beat-line em{display:block}
.beat>*+*{margin:0;background:rgba(var(--scrim),.84);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);border:1px solid var(--line);border-top:0;padding:0 clamp(22px,2.6vw,40px) clamp(22px,2.6vw,32px)}
.beat-note{color:var(--muted);padding-top:16px!important}
.beat .credit{padding-top:16px!important}

/* 04 ARCore: the place steps back, real captures step in */
.reality-chapter{min-height:100vh}
.reality-head{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:12px clamp(32px,6vw,120px);align-items:end}
.reality-head h2,.reality-head p{margin:0}
.reality-media{margin-top:clamp(56px,8vw,120px);display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:24px;align-items:start}
.media{margin:0;position:relative}
.media video{display:block;width:100%;height:auto;background:var(--surface);aspect-ratio:4/5;object-fit:cover}
.media-tall{grid-column:2/7}
.media-wide{grid-column:8/12;margin-top:30%}
.media figcaption{display:flex;gap:14px;margin-top:14px;font-size:.8125rem;line-height:1.5;color:var(--muted);max-width:44ch}
.media figcaption b{font-family:var(--mono);font-weight:400;font-size:.625rem;letter-spacing:.12em;text-transform:uppercase;color:var(--fg);padding-top:3px}
.theme-light-only{display:none!important}
:root[data-theme=light] .theme-light-only{display:block!important}
:root[data-theme=light] .theme-dark-only{display:none!important}

/* ---------- after the journey: a plain reading part, no 3D behind the words ---------- */
.classic{position:relative;z-index:3;background:var(--bg);border-top:1px solid var(--line)}
.classic:before{content:'';position:absolute;left:0;right:0;bottom:100%;height:clamp(80px,14vh,160px);background:linear-gradient(rgba(var(--scrim),0),var(--bg));pointer-events:none}
.band{max-width:var(--max);margin:auto;padding:clamp(64px,8vw,128px) var(--gutter);border-top:1px solid var(--line)}
.classic>.band:first-child{border-top:0}
.band-grid{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(32px,5vw,104px);align-items:start}
.band-grid>*{min-width:0}
.band h2{font-size:clamp(2.1rem,3.9vw,4.1rem);max-width:13ch}
.band h3{font-size:clamp(1.5rem,2.1vw,2.1rem);font-stretch:118%;font-weight:740;letter-spacing:-.03em;line-height:1;margin-bottom:.5em}
.band-copy>p:not(.eyebrow):not(.note){color:var(--fg);font-size:clamp(1rem,1.1vw,1.125rem);line-height:1.6}
.band .eyebrow{color:var(--muted)}
.visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.code-tablist{display:flex;border:1px solid var(--line);border-bottom:0;width:max-content;max-width:100%;overflow-x:auto}
.code-tablist [role=tab]{flex:none;font-family:var(--mono);font-size:.6875rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);padding:12px 16px;min-height:44px;white-space:nowrap}
.code-tablist [role=tab]+[role=tab]{border-left:1px solid var(--line)}
.code-tablist [role=tab][aria-selected=true]{background:var(--code);color:var(--fg)}
.code-tabs .code-block[hidden]{display:none}
.code-tabs pre,.terminal pre{white-space:pre;overflow-x:auto;-webkit-overflow-scrolling:touch;font-variant-ligatures:none}
.platform-rows{list-style:none;margin:28px 0 24px;padding:0;border-top:1px solid var(--line-strong)}
.platform-rows a{display:grid;grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr) auto;gap:8px 24px;align-items:baseline;padding:18px 0 16px;border-bottom:1px solid var(--line-strong);transition:padding .3s var(--ease),background-color .2s}
.platform-rows a:hover{padding-left:14px;background:var(--raise)}
.row-name{font-family:var(--display);font-stretch:118%;font-weight:720;font-size:clamp(1.25rem,1.6vw,1.6rem);letter-spacing:-.02em;line-height:1}
.row-stack{color:var(--muted);font-size:.875rem}
.row-status{font-family:var(--mono);font-size:.6875rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);display:inline-flex;align-items:center;gap:10px;white-space:nowrap}
.row-status:before{content:'';width:8px;height:8px;border:1px solid currentColor}
.row-status.is-stable{color:var(--fg)}
.row-status.is-stable:before{background:currentColor}
.row-status.is-ended{color:var(--faint)}
.row-status.is-ended:before{border-style:dashed}
.platform-rows li:last-child .row-name{color:var(--muted)}
.platforms-band .note{color:var(--muted)}
.platforms-band .note a{color:var(--fg);border-bottom:1px solid var(--line-strong)}
.terminal{background:var(--code);border:1px solid var(--line);margin:28px 0 24px}
.terminal-bar{display:flex;justify-content:space-between;align-items:center;padding:12px 18px;border-bottom:1px solid var(--line);font-family:var(--mono);font-size:.6875rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.terminal-bar button{font-family:var(--mono);font-size:.6875rem;letter-spacing:.08em;text-transform:uppercase;color:var(--fg);border-bottom:1px solid var(--line-strong);padding:4px 0}
.proof-names{list-style:none;margin:8px 0 28px;padding:24px 0;border-top:1px solid var(--line-strong);border-bottom:1px solid var(--line-strong);display:flex;flex-wrap:wrap;gap:12px clamp(24px,3vw,52px)}
.proof-names li{font-family:var(--display);font-stretch:118%;font-weight:720;font-size:clamp(1.3rem,2.2vw,2.3rem);letter-spacing:-.03em;line-height:1.05;color:var(--fg)}
.proof-foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:16px 40px;align-items:baseline}
.proof-foot p{margin:0;max-width:56ch}
.work-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(16px,2vw,32px)}
.work-card{border:1px solid var(--line-strong);padding:clamp(24px,3vw,48px);display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.work-card h3{max-width:16ch}
.work-card p:not(.eyebrow){color:var(--fg);flex:1}
.work-card .actions{margin:12px 0 0}
.work-card>.button{margin-top:12px}
.home footer{border-top:1px solid var(--line);position:relative;z-index:3;background:var(--bg)}

@media(max-width:1000px){
  .reality-head{grid-template-columns:minmax(0,1fr)}
  .band-grid,.work-cards{grid-template-columns:minmax(0,1fr)}
}

/* ---------- phones, portrait: the set on top, the copy on a card under it ---------- */
@media(max-width:760px){
  .world[data-side] .shade{opacity:0}
  .world-poster{inset:0}
  .hud{gap:12px}
  .hud>span:not(.hud-live):not(.hud-place),.hud>span:has([data-hud=fps]){display:none}
  .chapter.hero{min-height:0;display:block;padding:104px 0 0}
  .hero-card{width:auto}
  .hero-card{display:contents}
  .hero-panel>*{max-width:none}
  .hero-credit{border:0}
  .universes,.hero-panel>.eyebrow,.hero-panel>.hero-title{background:rgba(var(--scrim),.88);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}
  .universes{margin:0;border-left:0;border-right:0}
  .universes [role=tab]{padding:8px 4px;font-size:.5625rem;letter-spacing:.06em}
  .universes .dot,.universes .long{display:none}
  .hero-panel>.eyebrow{margin:0;padding:14px var(--gutter) 6px;font-size:.625rem}
  .hero-panel>.hero-title{margin:0;padding:0 var(--gutter) 18px;font-size:clamp(2.1rem,10.4vw,2.8rem)}
  /* the window onto the set */
  .hero-panel>.lead{margin-top:clamp(170px,27svh,250px)}
  .hero-panel>.lead,.hero-panel>.hero-actions,.hero-panel>.hero-meta{background:rgba(var(--scrim),.9);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);padding-left:var(--gutter);padding-right:var(--gutter)}
  .hero-panel>.lead{padding-top:20px;font-size:1rem;line-height:1.5}
  .hero-panel>.hero-actions{margin:0;padding-top:18px;padding-bottom:14px;display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
  .hero-panel>.hero-actions .button{width:100%}
  .hero-panel>.hero-meta{padding-bottom:18px;gap:6px 16px;font-size:.625rem}
  .hero-credit{margin:0;padding:12px var(--gutter) 20px;background:rgba(var(--scrim),.9)}
  .chapter{padding-top:96px;padding-bottom:96px}
  .chapter h2{font-size:clamp(2.1rem,10vw,3.2rem)}
  .stop,.beat{min-height:0;display:block;padding-top:62vh}
  .stop .chapter-copy,.beat>*{width:auto;margin:0 calc(-1 * var(--gutter));border-left:0;border-right:0}
  .stop .chapter-copy,.beat>*:first-child{padding:24px var(--gutter) 28px}
  .beat>*+*{padding:0 var(--gutter) 24px}
  .beat-line{font-size:clamp(2.4rem,12vw,3.6rem)}
  .relight-pills{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
  .relight-pills button+button{border-left:0}
  .relight-pills button:nth-child(even){border-left:1px solid var(--line-strong)}
  .relight-pills button:nth-child(n+3){border-top:1px solid var(--line-strong)}
  .spec-list{gap:16px 28px}
  .reality-media{grid-template-columns:repeat(6,minmax(0,1fr));gap:14px}
  .media-tall{grid-column:1/5}
  .media-wide{grid-column:3/7;margin-top:-30%}
  .media figcaption{font-size:.75rem;flex-direction:column;gap:4px}
  .platform-rows a{grid-template-columns:minmax(0,1fr) auto}
  .row-stack{grid-column:1/-1;order:3;font-size:.8125rem}
  .row-status{font-size:.625rem}
  .code-tabs pre,.terminal pre{font-size:.78rem;padding:20px 18px}
  .proof-names li{font-size:1.35rem}
  .proof-foot{flex-direction:column;align-items:flex-start}
}

/* ---------- phones, landscape: a short screen, the card and the set side by side ---------- */
@media(orientation:landscape) and (max-height:520px){
  .home .masthead .nav-shell{min-height:56px}
  .hero{padding-top:72px;padding-bottom:16px;justify-content:flex-start}
  .hero-card{width:min(100%,46vw)}
  .hero-card{padding:16px 20px}
  .universes{margin-bottom:12px}
  .universes [role=tab]{min-height:36px;font-size:.5625rem;padding:6px 6px}
  .universes .dot,.universes .long{display:none}
  .hero .eyebrow{display:none}
  .hero-title{font-size:clamp(1.6rem,4.4vw,2.2rem)}
  .hero .lead{font-size:.8125rem;line-height:1.45}
  .hero-actions .button+.button{display:none}
  .hero-actions{margin:12px 0 8px;gap:8px}
  .hero-actions .button{min-height:42px;padding:8px 14px;font-size:.8125rem;gap:16px}
  .hero-meta{display:none}
  .hero-actions{flex-wrap:nowrap}
  .hero-credit{display:none}
  .stop .chapter-copy,.beat>*{width:min(100%,46vw)}
  .stop .chapter-copy,.beat>*:first-child{padding:20px 22px}
  .chapter h2,.beat-line{font-size:clamp(1.8rem,4.6vw,2.6rem)}
  .chapter-copy>p:not(.eyebrow):not(.note):not(.credit){font-size:.875rem;line-height:1.5}
  .spec-list,.credit{display:none}
  .relight{margin:16px 0 0}
  .relight-pills button{min-height:40px;padding:8px 12px;font-size:.625rem}
}
@media(prefers-reduced-motion:reduce){
  .plate,.shade,.world-poster,#world-canvas{transition:none}
  .hero-card{animation:none}
}
