/* Richie de la Rosa — portfolio
   A night studio: the room of his photograph, lit by the lamp that is in it. Tokens come from DDR.md §4. */

@font-face {
  font-family: "Gantari";
  src: url(../fonts/gantari.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* colour */
  --color-paper: #061026;            /* the room */
  --color-deep: #0b1c44;             /* bands and surfaces */
  --color-ink: #f2f6ff;
  --color-ink-2: #a9b9da;
  --color-accent: #2a6fe8;           /* controls */
  --color-sky: #7ab8ff;              /* his first name, links, what is lit */
  --color-lamp: #ffe7c2;             /* the lamp's light */
  --color-live: #35d48a;             /* the dot beside "Available" */
  --color-rule: rgba(150, 180, 255, .2);
  /* type */
  --font-display: "Gantari";
  --font-text: "Gantari";
  --size-body: 18px;
  --size-h1: 88px;
  --leading-body: 1.55;
  --tracking-display: -0.02em;
  /* space */
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 32px;
  --space-5: 48px; --space-6: 64px; --space-7: 96px; --space-8: 128px;
  --container: 1248px;
  --pad: clamp(20px, 6.6vw, 96px);
  /* shape and light */
  --radius-control: 999px;
  --radius-media: 24px;
  --radius-window: 32px;
  --radius-node: 8px;                /* a box in the sketches the torch finds */
  --shadow-glow: 0 24px 64px -24px rgba(47,124,246,.3);
  --hair: 0 0 0 1px var(--color-rule);
  /* motion */
  --ease: cubic-bezier(.16,1,.3,1);
  --dur-micro: .25s;
  --dur-element: .8s;
  --dur-section: 1.1s;
  /* the lamp: 1 when on, 0 when off */
  --lit: 1;
  color-scheme: dark;
}
html[data-lights="off"] { --lit: 0; }

* { box-sizing: border-box; margin: 0; }
html { background: var(--color-paper); color: var(--color-ink); -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
/* ground and ink are repeated on body: a host that wraps the page (a preview frame, an embed) brings its own body colours */
body { background: var(--color-paper); color: var(--color-ink); font: 400 var(--size-body)/var(--leading-body) var(--font-text), system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: clip; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--color-sky); outline-offset: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -64px; z-index: 50; padding: 12px 16px; border-radius: var(--radius-control); background: var(--color-ink); color: var(--color-paper); font-weight: 560; transition: top var(--dur-micro) var(--ease); }
.skip:focus { top: 16px; }

h1, h2, h3 { font-family: var(--font-display), system-ui, sans-serif; letter-spacing: var(--tracking-display); text-wrap: balance; }
h2 { font-size: clamp(32px, 3.5vw, 48px); line-height: 1.08; font-weight: 720; }
h3 { font-size: clamp(24px, 2.2vw, 30px); line-height: 1.15; font-weight: 560; }
.lead { margin-top: var(--space-3); font-size: clamp(19px, 1.6vw, 22px); line-height: 1.4; color: var(--color-ink-2); max-width: 34em; }
.note { margin-top: var(--space-4); font-size: 15px; line-height: 24px; color: var(--color-ink-2); max-width: 36em; }
.wrap { max-width: var(--container); width: calc(100% - 2 * var(--pad)); margin-inline: auto; }
.two { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-6) clamp(32px, 6vw, 96px); align-items: center; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 56px; padding: 0 var(--space-4); border-radius: var(--radius-control); background: var(--color-accent); color: #fff; font-weight: 560; font-size: var(--size-body); box-shadow: var(--shadow-glow); transition: transform var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease); }
.btn svg { transition: transform var(--dur-micro) var(--ease); }
.btn:hover { background: #2563d8; box-shadow: var(--shadow-glow), 0 0 0 4px rgba(64,134,255,.28); }
.btn:hover svg { transform: translateY(2px); }
.btn:active { transform: scale(.97); }
.btn.quiet { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(150,180,255,.45); color: var(--color-ink); }
.btn.quiet:hover { background: rgba(122,184,255,.1); box-shadow: inset 0 0 0 1.5px var(--color-sky); }
.act { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: var(--space-4); }
.more { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: var(--space-3); }
.mail { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0; font-size: var(--size-body); font-weight: 400; color: var(--color-ink); border-bottom: 1.5px solid var(--color-rule); transition: border-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease); }
.mail:hover { border-color: var(--color-sky); }
.mail:active { color: var(--color-ink-2); }
.mail:focus-visible { outline: 2px solid var(--color-sky); outline-offset: 4px; }
.mail svg { color: var(--color-ink-2); transition: transform var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease); }
.mail[data-done] svg { color: var(--color-sky); transform: scale(1.2) rotate(-8deg); }
.link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--color-sky); font-weight: 560; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; padding: 4px 0; transition: background-size var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease); }
.link { background-position: 0 calc(100% - 8px); }
.link:hover { background-size: 100% 1.5px; }
.link:active { color: var(--color-ink); }
.cue { all: unset; box-sizing: border-box; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 0; font-size: 15px; line-height: 24px; color: var(--color-ink-2); transition: color var(--dur-micro) var(--ease); }
.cue span { text-decoration: underline dotted rgba(169,185,218,.6) 1px; text-underline-offset: 5px; transition: text-decoration-color var(--dur-micro) var(--ease); }
.cue:hover { color: var(--color-ink); }
.cue:hover span { text-decoration-color: var(--color-lamp); }
.cue:active { color: var(--color-sky); }
.cue:focus-visible { outline: 2px solid var(--color-sky); outline-offset: 4px; }
/* the dot in the hint is the lamp in small: lit when it is lit, dark with a rim when it is off */
.pip { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--color-lamp); box-shadow: 0 0 10px 2px rgba(255,231,194,.45); transition: background-color var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease), scale var(--dur-micro) var(--ease); }
.cue:hover .pip { scale: 1.3; }
html[data-lights="off"] .pip { background: #2a3350; box-shadow: 0 0 0 1px rgba(150,180,255,.5); }

/* ---------------------------------------------------------------- header */
.top { position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; gap: var(--space-4); height: 72px; padding: 0 var(--pad); transition: transform var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease); }
.top.solid { background: rgba(6,16,38,.94); box-shadow: 0 1px 0 var(--color-rule); }
.top.away { transform: translateY(-100%); }
.brand { margin-right: auto; min-height: 44px; display: inline-flex; align-items: center; font-weight: 560; font-size: var(--size-body); transition: color var(--dur-micro) var(--ease); }
.brand:hover { color: var(--color-sky); }
.brand:active { color: var(--color-ink-2); }
.top nav { --g: var(--space-3); display: flex; align-items: center; gap: var(--g); }
.top nav a:not(.btn), .lang { all: unset; cursor: pointer; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; padding: 0; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 8px) / 0 1.5px no-repeat; transition: background-size var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease); }
.top nav a:not(.btn):hover, .lang:hover { background-size: 100% 1.5px; }
.top nav a:not(.btn):active, .lang:active { color: var(--color-sky); }
.top nav a:not(.btn):focus-visible, .lang:focus-visible { outline: 2px solid var(--color-sky); outline-offset: 4px; }
.lang { color: var(--color-ink-2); }
html:not(.js) .lang, html:not(.js) .cue { display: none; }   /* without the script these would promise something that does not answer */
html:not(.js) .lamp { pointer-events: none; }
.top .btn { height: 40px; font-size: 15px; box-shadow: none; white-space: nowrap; overflow: hidden; max-width: 0; padding: 0; margin-left: calc(var(--g) * -1); opacity: 0; visibility: hidden;
  transition: max-width var(--dur-micro) var(--ease), padding var(--dur-micro) var(--ease), margin var(--dur-micro) var(--ease), opacity var(--dur-micro) var(--ease), visibility 0s linear var(--dur-micro), transform var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease); }
.top.past .btn { max-width: 200px; padding: 0 var(--space-2); margin-left: 0; opacity: 1; visibility: visible;
  transition: max-width var(--dur-micro) var(--ease), padding var(--dur-micro) var(--ease), margin var(--dur-micro) var(--ease), opacity var(--dur-micro) var(--ease), visibility 0s, transform var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease); }

/* ---------------------------------------------------------------- 1 · the first screen */
.hero, .close { --tr: clamp(110px, 10vw, 170px); }   /* how far the torch reaches when the lights are off */
.hero { position: relative; min-height: max(100svh, 660px); display: flex; align-items: center; overflow: clip; background: linear-gradient(180deg, rgba(6,16,38,0) 62%, var(--color-paper) 100%), linear-gradient(118deg, #0c2460 0%, #08173c 40%, #050c1e 100%); }
/* lights off. A layer of darkness lies over each scene. While the pointer is in a studio section it is a torch:
   a soft glow travels with it, and near it, in the empty areas around the text and the photograph, faint sketches
   of three systems he has worked on show (site.js adds and places them; aria-hidden: the same facts are in the page). */
.hero::after, .close::after, .disc::after { content: ""; position: absolute; inset: 0; background: #02050e; transition: opacity var(--dur-element) var(--ease); pointer-events: none; }
.ghosts { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: calc(1 - var(--lit)); transition: opacity var(--dur-element) var(--ease); font-size: clamp(10.5px, min(.95vw, 1.75svh), 13.5px); line-height: 1.1; }
.ghosts:lang(es) { font-size: clamp(10px, min(.82vw, 1.6svh), 12px); }   /* the Spanish labels run longer */
.ghost { position: absolute; left: 0; top: 0; display: grid; gap: .45em; justify-items: start; }
.ghost b, .ghost span, .ghost i { opacity: 0; }
.ghost b { font-weight: 500; color: rgba(255,214,170,.72); }
.ghost p { display: flex; align-items: center; white-space: nowrap; }
.ghost span { padding: .5em .65em; border-radius: var(--radius-node); border: 1px solid rgba(134,182,255,.3); background: rgba(6,14,34,.45); color: rgba(211,226,255,.7); }
.ghost i { width: 1.1em; height: 1px; background: repeating-linear-gradient(90deg, rgba(134,182,255,.45) 0 4px, transparent 4px 9px); }
.hero::after { opacity: calc((1 - var(--lit)) * .55); }
/* the glow that travels with the pointer while the lights are off (added by site.js) */
.torch { position: absolute; left: 0; top: 0; z-index: 2; width: calc(var(--tr) * 2.6); aspect-ratio: 1; margin: calc(var(--tr) * -1.3) 0 0 calc(var(--tr) * -1.3); border-radius: 50%; opacity: 0; pointer-events: none; will-change: transform, opacity; }
.torch::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle closest-side, rgba(255,236,206,.16) 0, rgba(150,195,255,.09) 32%, rgba(90,150,255,.035) 62%, rgba(90,150,255,0) 100%); }
.hero .copy { position: relative; z-index: 3; padding: var(--space-5) 0 0 var(--pad); max-width: min(560px, 44vw); }
h1 { font-size: clamp(52px, 6.1vw, 104px); line-height: 1; font-weight: 720; }
h1 span { display: block; }
h1 .nm { color: var(--color-sky); }
.role em { font-style: normal; color: var(--color-sky); }   /* "backend", in the blue of his name */
.role { margin-top: var(--space-2); font-size: clamp(22px, 2.1vw, 30px); line-height: 1.2; font-weight: 560; letter-spacing: -.008em; text-wrap: balance; }
.avail { margin-top: var(--space-1); color: var(--color-ink-2); }
/* "Available", with a green dot that pings */
.open { display: flex; align-items: center; gap: 10px; margin-top: var(--space-1); font-weight: 560; }
.live { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--color-live); }
.live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--color-live); opacity: 0; }
.s { display: inline-block; }                 /* a sentence that stays whole when the line breaks */

/* his portrait in a ring. On the ring: the lamp that lights the photograph, and three doors into the story */
.stage { position: absolute; z-index: 1; right: calc(var(--pad) + 2.5vw); top: 50%; width: min(41vw, 66svh); aspect-ratio: 1; translate: 0 -47%; }
.disc { position: absolute; inset: 8%; border-radius: 50%; overflow: hidden; background: #0d1830; box-shadow: 0 0 0 3px #3f8cff, var(--shadow-glow); translate: calc(var(--px, 0) * -8px) calc(var(--py, 0) * -5px); }
/* the photograph is 1296 × 1182; the circle shows a square of 896 px from its top right: head, shoulders, chest */
.disc img { position: absolute; left: -44.64%; top: 0; width: 144.64%; max-width: none; height: auto; transition: filter var(--dur-element) var(--ease); }
.disc::after { opacity: calc((1 - var(--lit)) * .84); }
.orbit { position: absolute; inset: 0; border-radius: 50%; translate: calc(var(--px, 0) * -18px) calc(var(--py, 0) * -10px); }
/* the outline: brightest where the lamp hangs */
.orbit::before { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 314deg, rgba(160,205,255,1) 0, rgba(122,184,255,.5) 9%, rgba(122,184,255,.2) 30%, rgba(122,184,255,.12) 52%, rgba(122,184,255,.24) 74%, rgba(122,184,255,.55) 92%, rgba(160,205,255,1) 100%);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); mask: radial-gradient(closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  opacity: calc(.4 + .6 * var(--lit)); transition: opacity var(--dur-element) var(--ease); }
/* the lamp's light */
.orbit::after { content: ""; position: absolute; left: calc(50% + 50% * cos(-136deg)); top: calc(50% + 50% * sin(-136deg)); width: 230%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle closest-side, rgba(255,236,206,.62) 0, rgba(255,222,176,.22) 5%, rgba(110,160,255,.26) 13%, rgba(60,130,250,.14) 34%, rgba(47,124,246,.05) 60%, rgba(47,124,246,0) 82%);
  opacity: var(--lit); transition: opacity var(--dur-element) var(--ease), scale var(--dur-element) var(--ease); }
.orbit:has(.lamp:hover)::after { scale: 1.06; }
.lamp, .obj { position: absolute; z-index: 2; left: calc(50% + 50% * cos(var(--a))); top: calc(50% + 50% * sin(var(--a))); translate: -50% -50%; }
.lamp { all: unset; position: absolute; z-index: 2; left: calc(50% + 50% * cos(var(--a))); top: calc(50% + 50% * sin(var(--a))); translate: -50% -50%; width: 11.5%; aspect-ratio: 1; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle closest-side, #fff 0 74%, #fff3dc 88%, rgba(255,231,194,0) 100%);
  box-shadow: 0 0 30px 8px rgba(255,231,194,.3);
  transition: box-shadow var(--dur-micro) var(--ease), scale var(--dur-micro) var(--ease); }
.lamp:hover { scale: 1.08; box-shadow: 0 0 40px 12px rgba(255,231,194,.3); }
.lamp:active { scale: .95; }
.lamp:focus-visible { outline: 2px solid var(--color-lamp); outline-offset: 6px; }
.lamp::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,231,194,.6); opacity: 0; pointer-events: none; }
html[data-lights="off"] .lamp { background: radial-gradient(circle closest-side, #1b2238 0 74%, #2a3350 86%, rgba(42,51,80,0) 100%); box-shadow: 0 0 0 1px rgba(150,180,255,.35); }
html[data-lights="off"] .lamp:hover { box-shadow: 0 0 0 1px rgba(255,231,194,.6), 0 0 24px 4px rgba(255,231,194,.18); }
/* the doors: three tiles with depth, each the mark of the chapter it opens */
.obj { width: 15.5%; aspect-ratio: 1; }
.tile, .mark { display: grid; place-items: center; border-radius: 28%; color: #fff;
  background: linear-gradient(150deg, #62a8ff 0%, #2a6fe8 46%, #1543a8 100%);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.55), inset 0 -8px 16px rgba(6,16,38,.22), var(--shadow-glow); }
.tile { width: 100%; height: 100%; transform: perspective(520px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease); }
.tile svg, .mark svg { width: 54%; height: 54%; }
.app .tile, .mark.app { background: linear-gradient(150deg, #ffffff 0%, #eef4ff 60%, #d5e4ff 100%); box-shadow: inset 0 1.5px 0 #fff, inset 0 -8px 16px rgba(21,67,168,.14), var(--shadow-glow); }
.app .tile img, .mark.app img { width: 78%; height: 78%; mix-blend-mode: multiply; }
.obj:hover .tile, .obj:focus-visible .tile { transform: perspective(520px) rotateX(0deg) rotateY(0deg) translateY(-5px) scale(1.07); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.6), inset 0 -8px 16px rgba(6,16,38,.2), var(--shadow-glow), 0 0 0 4px rgba(122,184,255,.28); }
.obj:active .tile { transform: perspective(520px) scale(.95); }
.obj:focus-visible { outline: none; }
.tip { position: absolute; z-index: 3; left: 50%; top: calc(100% + 10px); translate: -50% 4px; padding: 4px 12px; border-radius: var(--radius-control); background: var(--color-deep); box-shadow: var(--hair); font-size: 15px; line-height: 24px; white-space: nowrap; color: var(--color-ink); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--dur-micro) var(--ease), translate var(--dur-micro) var(--ease), visibility 0s linear var(--dur-micro); }
.obj:hover .tip, .obj:focus-visible .tip { opacity: 1; visibility: visible; translate: -50% 0; transition: opacity var(--dur-micro) var(--ease), translate var(--dur-micro) var(--ease), visibility 0s; }
.mark { width: 56px; height: 56px; margin-bottom: var(--space-3); }

/* ---------------------------------------------------------------- the phone */
.phone { position: relative; aspect-ratio: 560 / 1212; border: 6px solid #04060d; border-radius: var(--radius-window); overflow: hidden; background: #fff; box-shadow: var(--hair); transition: box-shadow var(--dur-element) var(--ease); }
.phone video, .phone img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shade { position: absolute; inset: 0; background: #050c1e; opacity: var(--shade, 0); pointer-events: none; transition: opacity var(--dur-element) var(--ease); }

/* ---------------------------------------------------------------- 2 · one request, start to finish
   Six moments, each a phone. The visitor turns through them sideways; the page's own scroll is never taken.
   Without script the six stand in a row that scrolls sideways, each with its sentence under it. */
.story { padding: var(--space-7) 0 var(--space-8); overflow-x: clip; }
.story .head, .story .tail { display: grid; justify-items: center; text-align: center; }
.story .head .lead { max-width: 30em; }
.deck { position: relative; margin-top: var(--space-6); --ph: clamp(380px, 58svh, 620px); --pw: calc(var(--ph) * 560 / 1212); }
.slides { list-style: none; margin: 0; padding: 0 var(--pad) var(--space-2); display: flex; gap: var(--space-4); overflow-x: auto; scroll-snap-type: x mandatory; }
.slide { flex: 0 0 min(78vw, 300px); scroll-snap-align: center; }
.slide .step { margin-top: var(--space-3); }
.step .n { font-size: 15px; line-height: 24px; color: var(--color-sky); font-weight: 560; }
.step h3 { margin-top: var(--space-1); max-width: 28em; }
.step h3 + p { margin-top: 12px; max-width: 32em; color: var(--color-ink-2); }
.nav, .ticks { display: none; }

/* with script: a fan in depth. The phone in the middle is lit and plays; the others wait in the dark */
html.js .slides { display: block; position: relative; height: var(--ph); padding: 0; overflow: visible; perspective: 1500px; touch-action: pan-y; -webkit-user-select: none; user-select: none; cursor: grab; }
html.js .deck.dragging .slides { cursor: grabbing; }
html.js .slides::before { content: ""; position: absolute; left: 50%; top: 50%; width: calc(var(--pw) * 3.6); height: calc(var(--ph) * 1.3); translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(64,134,255,.22), rgba(47,124,246,0)); opacity: calc(.35 + .65 * var(--lit)); transition: opacity var(--dur-element) var(--ease); }
html.js .slide { position: absolute; left: 50%; top: 0; width: var(--pw); margin-left: calc(var(--pw) / -2); will-change: transform; transition: transform var(--dur-element) var(--ease), opacity var(--dur-micro) var(--ease), visibility 0s; }
html.js .slide:not(.on) { cursor: pointer; }
html.js .slide.far { opacity: 0; visibility: hidden; transition: transform var(--dur-element) var(--ease), opacity var(--dur-micro) var(--ease), visibility 0s linear var(--dur-micro); }
html.js .slide.on .phone { box-shadow: var(--hair), var(--shadow-glow); }
@media (hover: hover) { html.js .slide:not(.on):hover .shade { opacity: calc(var(--shade, 0) * .6); transition-duration: var(--dur-micro); } }
html.js .slide video, html.js .slide img { pointer-events: none; }
html.js .deck.dragging .slide, html.js .deck.dragging .shade { transition: none; }

html.js .nav { all: unset; box-sizing: border-box; position: absolute; z-index: 40; top: calc(var(--ph) / 2); translate: 0 -50%; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--color-deep); box-shadow: var(--hair); color: var(--color-ink); cursor: pointer; transition: background-color var(--dur-micro) var(--ease), scale var(--dur-micro) var(--ease), opacity var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease); }
html.js .nav.prev { left: max(12px, 50% - var(--pw) * 1.62 - 100px); }
html.js .nav.next { right: max(12px, 50% - var(--pw) * 1.62 - 100px); }
@media (hover: hover) { html.js .nav:hover { background: var(--color-accent); box-shadow: 0 0 0 4px rgba(64,134,255,.28); } }
html.js .nav:active { scale: .93; background: var(--color-accent); }
html.js .nav:focus-visible { outline: 2px solid var(--color-sky); outline-offset: 4px; }
html.js .nav[aria-disabled="true"] { opacity: .28; cursor: default; background: var(--color-deep); box-shadow: var(--hair); scale: 1; }

.steps { display: grid; justify-items: center; text-align: center; margin-top: var(--space-4); padding: 0 var(--pad); }
.steps .step { grid-area: 1 / 1; display: grid; justify-items: center; align-content: start; opacity: 0; visibility: hidden; translate: 0 8px; transition: opacity var(--dur-micro) var(--ease), translate var(--dur-micro) var(--ease), visibility 0s linear var(--dur-micro); }
.steps .step.on { opacity: 1; visibility: visible; translate: 0 0; transition: opacity var(--dur-element) var(--ease) .15s, translate var(--dur-element) var(--ease) .15s, visibility 0s; }
html.js .ticks { display: flex; justify-content: center; margin-top: var(--space-2); }
.tick { all: unset; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; }
.tick::before { content: ""; width: 16px; height: 4px; border-radius: var(--radius-control); background: rgba(150,180,255,.32); transition: width var(--dur-element) var(--ease), background-color var(--dur-micro) var(--ease); }
.tick:hover::before { background: rgba(170,200,255,.7); }
.tick:active::before { background: var(--color-ink); }
.tick[aria-current="step"]::before { width: 32px; background: var(--color-sky); }
.tick:focus-visible { outline: 2px solid var(--color-sky); outline-offset: -8px; }
.story .tail { margin-top: var(--space-5); }
.story .tail .lead { margin-top: 0; max-width: 33em; color: var(--color-ink); }
.story .tail .note { margin-top: var(--space-2); }

/* ---------------------------------------------------------------- 3 · tested, then live */
.ships { padding: var(--space-7) 0 var(--space-8); }                 /* the stage above already gave it distance */
.ships .txt p + p { margin-top: var(--space-4); }
.frame { border-radius: var(--radius-media); overflow: hidden; box-shadow: var(--hair), var(--shadow-glow); background: var(--color-deep); }
.frame video { width: 100%; aspect-ratio: 960 / 600; object-fit: cover; }
.frame figcaption { padding: 12px var(--space-3); font-size: 15px; line-height: 24px; color: var(--color-ink-2); }

/* ---------------------------------------------------------------- 4 · on a team: the row being read is the lit one */
.team { padding: var(--space-8) 0; background: linear-gradient(180deg, var(--color-paper), var(--color-deep) 30%, var(--color-deep) 70%, var(--color-paper)); }
.rows { list-style: none; padding: 0; margin-top: var(--space-6); border-bottom: 1px solid var(--color-rule); }
.row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-2) clamp(32px, 6vw, 96px); align-items: baseline; padding: var(--space-5) 0; border-top: 1px solid var(--color-rule); transition: opacity var(--dur-element) var(--ease), border-color var(--dur-element) var(--ease); }
.row h3 { transition: color var(--dur-element) var(--ease); }
.row p { color: var(--color-ink-2); line-height: 1.5; transition: color var(--dur-element) var(--ease); }
html.js .row.on p { color: var(--color-ink); }
html.js .row.on { border-top-color: rgba(122,184,255,.75); }
.nb { white-space: nowrap; }

/* ---------------------------------------------------------------- 5 · before and after */
.apex { padding: var(--space-8) 0 var(--space-7); }
.ba { position: relative; margin-top: var(--space-6); width: min(100%, 74svh * 2.09); aspect-ratio: 1800 / 861; border-radius: var(--radius-media); overflow: hidden; box-shadow: var(--hair), var(--shadow-glow); background: var(--color-deep); touch-action: pan-y; cursor: ew-resize; user-select: none; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba .a { clip-path: inset(0 0 0 var(--x)); }
.ba::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; translate: -1px 0; background: var(--color-ink); pointer-events: none; }
.knob { all: unset; position: absolute; top: 50%; left: var(--x); translate: -50% -50%; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--color-ink); color: var(--color-paper); cursor: ew-resize; transition: scale var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease); }
.knob:hover { scale: 1.08; background: #fff; }
.knob:active { scale: .96; }
.knob:focus-visible { outline: 2px solid var(--color-sky); outline-offset: 4px; }
.ba-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-2); width: min(100%, 74svh * 2.09); font-size: 15px; color: var(--color-ink-2); }
.tabs { display: flex; gap: 4px; }
.tabs button { all: unset; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: var(--radius-control); font-size: 15px; color: var(--color-ink-2); transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease); }
.tabs button:hover { color: var(--color-ink); background: rgba(122,184,255,.1); }
.tabs button:active { color: var(--color-sky); }
.tabs button[aria-pressed="true"] { color: var(--color-ink); background: #16306a; }
.tabs button:focus-visible { outline: 2px solid var(--color-sky); outline-offset: 2px; }

/* ---------------------------------------------------------------- 6 · still studying */
.learn { padding: var(--space-6) 0 var(--space-8); }                          /* a quiet list, then air before the ask */
.learn .two { align-items: start; }
.skills { display: grid; }
.skills div { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: var(--space-2); padding: var(--space-2) 0; border-top: 1px solid var(--color-rule); }
.skills div:last-child { border-bottom: 1px solid var(--color-rule); }
.skills dt { color: var(--color-ink-2); }
.skills dd { margin: 0; }

/* ---------------------------------------------------------------- 7 · the ask, back in the studio */
.close { position: relative; min-height: min(100svh, 820px); display: flex; align-items: center; overflow: clip; background: #050c1e; }
.close::after { opacity: calc((1 - var(--lit)) * .8); }
.room { position: absolute; inset: 72px 0 0 auto; width: 62%; --lx: 21.97%; --ly: 2.78%; }
.room img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 34%), linear-gradient(180deg, transparent 0, #000 16%); -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0, #000 34%), linear-gradient(180deg, transparent 0, #000 16%); mask-composite: intersect; transition: filter var(--dur-element) var(--ease); }
.room .lamp { left: var(--lx); top: var(--ly); width: 9.6%; }
.room::before { content: ""; position: absolute; z-index: 2; left: var(--lx); top: var(--ly); width: 150%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle closest-side, rgba(255,231,194,.5) 0, rgba(255,220,170,.16) 6%, rgba(96,150,255,.18) 15%, rgba(47,124,246,.08) 38%, rgba(47,124,246,0) 70%);
  opacity: var(--lit); transition: opacity var(--dur-element) var(--ease); }
.room::after { content: ""; position: absolute; z-index: 1; left: var(--lx); top: var(--ly); width: 34%; aspect-ratio: 1; translate: -50% -50%; background: radial-gradient(circle closest-side, #0a0f1c 0 26%, rgba(10,15,28,.86) 36%, rgba(10,15,28,0) 78%); opacity: calc(1 - var(--lit)); transition: opacity var(--dur-element) var(--ease); pointer-events: none; }
.close .copy { position: relative; z-index: 3; padding-left: var(--pad); max-width: min(560px, 46vw); }
.close .lead { color: var(--color-ink-2); }
.links { display: flex; gap: var(--space-3); margin-top: var(--space-3); }
.foot { display: flex; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) var(--pad); font-size: 15px; color: var(--color-ink-2); background: #050c1e; border-top: 1px solid var(--color-rule); }

/* ---------------------------------------------------------------- load and idle: the lamp, then the three doors; the ring sways as one */
@media (prefers-reduced-motion: no-preference) {
  html.js .obj { opacity: 0; scale: .6; transition: opacity var(--dur-element) var(--ease), scale var(--dur-element) var(--ease); }
  html.js.ready .obj { opacity: 1; scale: 1; transition-delay: calc(.3s + var(--i) * .1s); }
  .orbit { animation: sway 12s ease-in-out infinite alternate; }
  @keyframes sway { from { rotate: -3.5deg; } to { rotate: 3.5deg; } }
  /* a ring leaves the lamp now and then until it has been tried, and whenever it is off (so it can be found again) */
  html:not([data-lamp-used]) .lamp::after, html[data-lights="off"] .lamp::after { animation: beacon 3.4s var(--ease) infinite; }
  @keyframes beacon { 0% { scale: 1; opacity: 0; } 10% { opacity: .55; } 62%, 100% { scale: 1.9; opacity: 0; } }
  .torching .torch::before { animation: breathe 1.3s ease-in-out infinite alternate; }
  @keyframes breathe { from { scale: .93; opacity: .78; } to { scale: 1.07; opacity: 1; } }
  .live::after { animation: ping 1.8s var(--ease) infinite; }
  @keyframes ping { from { scale: 1; opacity: .75; } to { scale: 3; opacity: 0; } }
}

/* ---------------------------------------------------------------- small screens: composed, not shrunk */
@media (max-width: 899px) {
  .top { height: 60px; gap: var(--space-2); }
  .top nav { --g: var(--space-2); }
  .top nav a:not(.btn) { display: none; }
  .hero { display: flex; flex-direction: column; align-items: stretch; min-height: 100svh; padding: calc(60px + var(--space-2)) 0 var(--space-4); }
  .hero { --sw: min(100vw - 2 * var(--pad) - 40px, 440px); }
  .stage { order: -1; position: relative; right: auto; top: auto; translate: none; width: var(--sw); margin: 8px auto 0; }
  .obj { width: 17%; }
  .lamp { width: max(13%, 44px); }
  .room .lamp { width: max(9.6%, 44px); }
  .top .btn { height: 44px; }
  html.js .nav { width: 44px; height: 44px; }
  .tip { display: none; }
  .hero .copy { max-width: none; padding: var(--space-5) var(--pad) 0; }
  h1 { font-size: clamp(48px, 14vw, 64px); }
  .act { margin-top: var(--space-3); }
  .btn { width: 100%; }
  .top .btn { width: auto; }
  .two { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .ships, .team, .apex, .learn { padding: var(--space-7) 0; }
  .row { grid-template-columns: minmax(0, 1fr); padding: var(--space-4) 0; }
  .skills div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ba-foot { flex-wrap: wrap; }
  .tabs { order: 3; flex-basis: 100%; justify-content: center; }
  .close { display: block; min-height: 0; }
  .room { position: relative; inset: auto; width: 100%; aspect-ratio: 4 / 3; margin-top: 56px; }
  .room img { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 62%, transparent 100%); -webkit-mask-composite: source-over; mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 62%, transparent 100%); mask-composite: add; }
  .close .copy { max-width: none; padding: var(--space-3) var(--pad) var(--space-6); }
  .foot { flex-direction: column; }
}

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