@font-face { font-family: "Archivo"; src: url("../assets/fonts/archivo-vf.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/instrumentserif-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Young Serif"; src: url("../assets/fonts/youngserif.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url("../assets/fonts/martianmono-vf.woff2") format("woff2"); font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap; }

:root {
  --blue: #1f5ae8;
  --blue-deep: #1748c4;
  --ink: #0b0b0c;
  --ink-2: #5b5b5e;
  --paper: #ffffff;
  --mist: #f3f3f1;
  --line: #e2e2de;
  --sans: "Archivo", system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mark: "Young Serif", Georgia, serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --inset: clamp(6px, 0.9vw, 12px);
  --pad: clamp(20px, 6vw, 96px);
  --r: clamp(18px, 2.2vw, 30px);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: #444 var(--ink); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; background: var(--ink); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.5; font-variation-settings: "wght" 430; -webkit-font-smoothing: antialiased; overflow-x: clip; }
::selection { background: var(--blue); color: #fff; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #3a3a3d; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
[data-tone="blue"] :focus-visible, .screen--blue :focus-visible, .screen--black :focus-visible { outline-color: #fff; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 660; letter-spacing: -0.035em; line-height: 1; text-wrap: balance; }
p { text-wrap: pretty; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; font-size: 1.06em; }
code, .mono { font-family: var(--mono); font-size: 0.82em; font-weight: 450; }

/* one shared canvas for every 3D view; drawn at half resolution, scaled up crisp */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 5; pointer-events: none; image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; z-index: 30; background: var(--ink); color: #9b9b9f; display: grid; place-content: center; gap: 14px; width: 100%; transition: opacity 0.6s var(--out), visibility 0.6s; }
.boot p { width: min(320px, 70vw); display: flex; justify-content: space-between; font: 450 0.75rem/1 var(--mono); }
.boot i { display: block; height: 2px; width: min(320px, 70vw); background: #2a2a2d; position: relative; overflow: hidden; }
.boot i::after { content: ""; position: absolute; inset: 0; background: #fff; transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 0.4s var(--out); }
.boot.is-done { opacity: 0; visibility: hidden; }

/* ---------- HUD ---------- */

/* ---------- scenes: sticky frames that stack like cuts ---------- */
.scene { position: relative; height: var(--len, 100vh); }
.frame { position: sticky; top: 0; height: 100vh; height: 100svh; padding: var(--inset); }
.screen { position: relative; height: 100%; border-radius: var(--r); overflow: hidden; transform-origin: 50% 0; will-change: transform; }
.screen::after { content: ""; position: absolute; inset: 0; background: #000; opacity: var(--cover, 0); pointer-events: none; z-index: 20; }
.screen--white { background: var(--paper); }
.screen--blue { background: var(--blue); color: #fff; }
.screen--black { background: #0e0e10; color: #fff; box-shadow: inset 0 0 0 1px #232327; }
.screen--grid { background-color: var(--mist); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; background-position: -1px -1px; }
.scene--end { height: 100vh; }
.view { position: absolute; }

/* ---------- shared ---------- */
.display { font-size: clamp(2.6rem, 6.6vw, 6.6rem); font-weight: 680; letter-spacing: -0.045em; line-height: 0.96; }
.display em { font-size: 1.08em; letter-spacing: -0.02em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 34px; }
.actions--center { justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 22px; border-radius: 999px; border: 0; font: inherit; font-weight: 620; font-size: 1rem; text-decoration: none; cursor: pointer; transition: transform 0.45s var(--out), background-color 0.25s, color 0.25s, box-shadow 0.25s; }
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(0.97); }
.btn--blue { background: var(--blue); color: #fff; }
.btn--blue:hover { background: var(--blue-deep); transform: translateY(-2px); }
.btn--line { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--line:hover { background: var(--ink); color: #fff; }

/* ---------- 01 hello ---------- */
.hello__copy { position: absolute; left: var(--pad); top: 50%; transform: translateY(-50%); width: min(760px, 56vw); z-index: 6; }
.display .line { display: block; }
.swap { display: inline-grid; vertical-align: bottom; overflow: hidden; padding: 0 0.08em 0.12em 0.02em; margin-bottom: -0.12em; }
.swap span { grid-area: 1 / 1; transform: translateY(var(--y, 110%)); transition: transform 0.9s var(--out); }
.lede { margin-top: 26px; max-width: 46ch; color: var(--ink-2); font-size: clamp(1rem, 1.15vw, 1.15rem); }
.lede code { color: var(--ink); background: var(--mist); padding: 2px 6px; border-radius: 5px; }
.view--hello { right: -2vw; bottom: 0; width: 46vw; height: 94%; }

/* ---------- 02 range ---------- */
.range__title { position: absolute; left: var(--pad); top: 15vh; font-size: clamp(1.9rem, 3.4vw, 3.2rem); max-width: 12ch; z-index: 6; }
.view--range { left: -3vw; bottom: 0; width: 42vw; height: 74%; }
.cards { position: absolute; right: 5vw; top: 50%; transform: translateY(-46%); display: flex; align-items: flex-start; gap: clamp(10px, 1.2vw, 18px); }
.card { width: clamp(160px, 17.5vw, 280px); background: var(--paper); color: var(--ink); border-radius: 18px; padding: 14px 14px 18px; box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.45); transform: translate3d(0, var(--ty, 0), 0) rotate(var(--rot, 0deg)); opacity: var(--o, 1); transition: box-shadow 0.4s; will-change: transform; }
.card:nth-child(2) { margin-top: 28px; }
.card:nth-child(3) { margin-top: -26px; }
.card header { display: flex; justify-content: space-between; font: 450 0.6875rem/1 var(--mono); color: var(--ink-2); }
.card .view { position: relative; width: 100%; aspect-ratio: 1 / 0.92; margin: 10px 0 14px; }
.card h3 { font-size: clamp(1.5rem, 2.1vw, 2.1rem); }
.card p { margin-top: 6px; font: 450 0.6875rem/1.3 var(--mono); color: var(--ink-2); }

/* ---------- 03 build ---------- */
.build__copy { position: absolute; left: var(--pad); top: 17vh; width: min(520px, 42vw); z-index: 6; }
.serif-mark { font-family: var(--mark); font-weight: 400; letter-spacing: -0.02em; font-size: clamp(2.2rem, 3.8vw, 3.6rem); line-height: 1.02; }
.build__line { margin-top: 6px; font-size: clamp(2.2rem, 3.8vw, 3.6rem); font-weight: 660; letter-spacing: -0.04em; line-height: 1; }
.build__note { margin-top: 22px; color: var(--ink-2); max-width: 40ch; font-size: 1rem; }
.view--peek { left: 33%; bottom: 0; width: 28vw; height: 50%; }
.phone { position: absolute; right: 8vw; top: 50%; width: 300px; height: 612px; transform: translateY(-50%) scale(var(--ps, 1)); transform-origin: 100% 50%; background: var(--paper); border: 9px solid var(--ink); border-radius: 46px; overflow: hidden; z-index: 6; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45); }
.phone__notch { position: absolute; top: 9px; left: 50%; width: 88px; height: 25px; margin-left: -44px; background: var(--ink); border-radius: 20px; z-index: 3; }
.phone__bar { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 13px 22px 0 26px; color: #fff; font-size: 0.85rem; font-weight: 620; }
.phone__bar svg { width: 24px; }
.phone__top { background: var(--blue); color: #fff; margin-top: -38px; padding: 52px 14px 16px; }
.prompt { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-size: 0.8rem; font-weight: 520; white-space: nowrap; overflow: hidden; }
.prompt i { width: 6px; height: 6px; border-radius: 50%; background: #fff; flex: none; }
.caret { width: 1.5px; height: 15px; background: #fff; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.store { display: grid; justify-items: center; gap: 4px; padding: 14px 0 2px; opacity: var(--so, 0); transform: translateY(calc((1 - var(--so, 0)) * 12px)); }
.store p { font-weight: 680; font-size: 1.15rem; letter-spacing: -0.02em; }
.view--avatar { position: relative; width: 84px; height: 84px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5); overflow: hidden; }
.phone__list { padding: 16px 16px 0; }
.phone__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.phone__head b { font-weight: 680; font-size: 1.05rem; letter-spacing: -0.02em; }
.phone__head span { font: 450 0.6875rem/1 var(--mono); color: var(--ink-2); }
.phone ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 12px; opacity: var(--io, 0); transform: translateX(calc((1 - var(--io, 0)) * 26px)); }
.view--thumb { position: relative; width: 60px; height: 60px; border-radius: 12px; border: 1px solid var(--line); background: #fff; overflow: hidden; }
.item b { display: block; font-size: 0.875rem; font-weight: 640; letter-spacing: -0.01em; }
.item span { font: 450 0.6875rem/1.4 var(--mono); color: var(--ink-2); }
.item button { all: unset; background: var(--ink); color: #fff; font-size: 0.72rem; font-weight: 620; padding: 7px 13px; border-radius: 999px; }

/* ---------- 04 handled ---------- */
.bento { position: absolute; inset: 9vh 4vw 13vh; display: grid; grid-template-columns: 1.15fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: clamp(10px, 1.2vw, 16px); }
.slot { border: 1.5px dashed #c9c9c4; border-radius: 18px; position: relative; }
.tile { position: absolute; inset: -1px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; transform: translate3d(var(--fx, 0), var(--fy, 0), 0) rotate(var(--fr, 0deg)) scale(var(--fs, 1)); opacity: var(--fo, 1); will-change: transform; overflow: hidden; }
.tile__k { font: 450 0.6875rem/1 var(--mono); color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; white-space: nowrap; }
.tile__tag { margin-left: auto; padding: 3px 6px; border-radius: 4px; background: var(--mist); }
.tile__note { margin-top: auto; font-size: 0.85rem; color: var(--ink-2); }
.tile--intro h2 { margin-top: auto; font-size: clamp(1.7rem, 2.7vw, 2.7rem); }
.tile--intro > p:last-child { margin-top: 12px; color: var(--ink-2); font-size: 0.95rem; max-width: 30ch; }
.tile--air { padding: 0; }
.tile--air .tile__k { position: absolute; top: 18px; left: 20px; z-index: 2; }
.view--air { inset: 44px 0 0; } /* the 3D layer paints over text, so keep the label out of its rect */
.rec { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.state-btn { margin: auto 0 14px; align-self: flex-start; position: relative; display: inline-grid; height: 50px; min-width: 190px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font: inherit; font-weight: 620; cursor: pointer; transition: background-color 0.3s, transform 0.3s var(--out); }
.state-btn > span { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: 9px; opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.4s var(--out); }
.state-btn svg { width: 16px; }
.state-btn i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.state-btn[data-s="idle"] .s-idle, .state-btn[data-s="load"] .s-load, .state-btn[data-s="done"] .s-done { opacity: 1; transform: none; }
.state-btn[data-s="done"] { background: var(--blue); }
.state-btn:active { transform: scale(0.97); }
.mini-form { margin-top: auto; display: grid; gap: 8px; }
.mini-form label { font-size: 0.8rem; font-weight: 620; }
.mini-form input { min-width: 0; width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit; font-size: 0.95rem; color: var(--ink); background: #fff; transition: border-color 0.25s, box-shadow 0.25s; caret-color: var(--blue); }
.mini-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 90, 232, 0.16); }
.mini-form[data-v="bad"] input { border-color: #c2331f; }
.mini-form[data-v="ok"] input { border-color: #1b7f4b; }
.mini-form__msg { font-size: 0.8rem; color: var(--ink-2); min-height: 1.3em; }
.mini-form[data-v="bad"] .mini-form__msg { color: #b02a17; }
.mini-form[data-v="ok"] .mini-form__msg { color: #17703f; }
.spring { position: relative; height: 56px; margin: auto 0 16px; touch-action: none; }
.spring__track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line); }
.spring__knob { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; border-radius: 50%; background: var(--blue); cursor: grab; transform: translateX(var(--kx, 0px)) scale(var(--ks, 1)); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.35); touch-action: none; }
.spring__knob:active { cursor: grabbing; }
.big { margin-top: auto; font-size: clamp(2.6rem, 4.2vw, 4.2rem); font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.big small { font-size: 0.32em; font-weight: 520; letter-spacing: -0.01em; color: var(--ink-2); }
.steps { list-style: none; margin: 18px 0 2px; padding: 0; display: flex; justify-content: space-between; position: relative; font: 500 0.6875rem/1 var(--mono); letter-spacing: 0; color: var(--ink-2); }
.steps::before { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 2px; background: linear-gradient(90deg, var(--blue) 0 62.5%, var(--line) 62.5%); }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 0; white-space: nowrap; } /* flex, so dot and label centre on the point even past a 0 width */
.steps li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); position: relative; }
.steps li.on::before { background: var(--blue); box-shadow: none; }
.steps li:first-child { align-items: flex-start; translate: -7px 0; } /* end labels hang inward, not past the card */
.steps li:last-child { align-items: flex-end; translate: 7px 0; }
.steps li:nth-child(even) { visibility: hidden; }
.steps li:nth-child(even)::before { visibility: visible; }

/* ---------- 05 flow ---------- */
.flow__copy { position: absolute; left: var(--pad); top: 50%; transform: translateY(-56%); z-index: 6; }
.flow__a { font-size: clamp(3rem, 8.6vw, 8.8rem); }
.flow__b { margin-top: 0.12em; font-size: clamp(2.4rem, 6.4vw, 6.6rem); color: #a2a2a8; }
.drop { display: inline-grid; vertical-align: bottom; overflow: hidden; color: #fff; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.drop span { grid-area: 1 / 1; transform: translateY(var(--y, -110%)) rotate(var(--r, -4deg)); transform-origin: 0 100%; transition: transform 0.8s var(--out); }
.view--flow { right: -1vw; bottom: 0; width: 34vw; height: 78%; }

/* ---------- 06 end ---------- */
.end { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 0 var(--pad) 8vh; }
.view--end { position: relative; width: clamp(200px, 22vw, 320px); height: clamp(170px, 19vw, 280px); margin-bottom: -2.2vw; }
.wordmark { font-family: var(--mark); font-weight: 400; font-size: clamp(5rem, 15vw, 13rem); letter-spacing: -0.035em; line-height: 0.9; position: relative; z-index: 6; }
.end__tag { margin-top: 18px; font-size: clamp(1.2rem, 2vw, 1.8rem); color: var(--ink-2); letter-spacing: -0.02em; }
.end__tag em { color: var(--ink); }
.end .actions { margin-top: 30px; }
.end .mono { color: var(--ink-2); }

/* ---------- player ---------- */
.player { all: unset; position: fixed; z-index: 9; left: 50%; translate: -50% 0; bottom: calc(var(--inset) + 20px); width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: rgba(14, 14, 16, 0.86); color: #fff; cursor: pointer; box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.6); transition: transform 0.2s var(--out), background-color 0.2s; }
.player:hover { background: rgba(30, 30, 34, 0.92); }
.player:active { transform: scale(0.94); }
.player:focus-visible { outline: 2px solid var(--blue, #1f5ae8); outline-offset: 3px; }
.player > svg:not(.player__ring) { width: 18px; height: 18px; }
.player .i-play { margin-left: 2px; }
.player .i-pause, .player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: block; }
.player__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 2.5; }
.player__ring circle { stroke: rgba(255, 255, 255, 0.22); }
.player__ring .player__fill { stroke: #fff; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p, 0)); }

/* ---------- phones and tablets ---------- */
@media (max-width: 820px) {
  .hello__copy { top: 15vh; transform: none; width: auto; right: var(--pad); }
  .display { font-size: clamp(2.3rem, 10.5vw, 3.6rem); }
  .lede { font-size: 0.95rem; margin-top: 16px; }
  .actions { margin-top: 22px; }
  .view--hello { width: 84vw; height: 38%; right: -10vw; }
  .range__title { top: 11vh; }
  .view--range { width: 64vw; height: 34%; left: auto; right: -6vw; top: 22vh; bottom: auto; }
  .cards { left: 4vw; right: 4vw; top: auto; bottom: 12vh; transform: none; justify-content: center; gap: 8px; }
  .card { width: 30vw; padding: 9px 9px 12px; border-radius: 14px; }
  .card:nth-child(2) { margin-top: 18px; }
  .card:nth-child(3) { margin-top: -12px; }
  .card h3 { font-size: 1.05rem; }
  .card p { display: none; }
  .build__copy { top: 10vh; width: auto; right: var(--pad); }
  .serif-mark, .build__line { font-size: 2rem; }
  .build__note { font-size: 0.875rem; margin-top: 12px; }
  .view--peek { display: none; }
  .phone { --ps: 0.66; right: 50%; top: auto; bottom: 10vh; transform: translateX(50%) scale(var(--ps)); transform-origin: 50% 100%; }
  .bento { inset: 7vh 3vw 11vh; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); gap: 8px; }
  .tile { padding: 12px 13px; border-radius: 14px; }
  .tile--intro h2 { font-size: 1.3rem; }
  .tile--intro > p:last-child, .tile__note, .mini-form__msg { display: none; }
  .state-btn { min-width: 0; width: 100%; height: 42px; padding: 0 10px; font-size: 0.85rem; margin-bottom: 0; }
  .mini-form input { height: 40px; }
  .steps { display: none; }
  .big { font-size: 2.4rem; }
  .flow__copy { top: 14vh; transform: none; right: var(--pad); }
  .flow__a { font-size: clamp(2.8rem, 13vw, 4.4rem); }
  .flow__b { font-size: clamp(2.1rem, 9.6vw, 3.4rem); }
  .view--flow { width: 82vw; height: 46%; right: -10vw; }
  .view--end { margin-bottom: 0; }
  .tile__tag { margin-left: 0; }
}

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