/* STUDIO plain pages: 404.html, privacy.html and hi/index.html at the site root.
   Loaded after tokens.css, on its own (no studio.css, no showcase.css, no JS), so these
   pages stay light and render from any path. The shared pieces below copy the studio.css
   and showcase.css rules of the same name (.label, .display, .link, .pillbtn, .arrow,
   .wordmark) so they look identical; then one block per page. House rule: one font, one
   style and one color per sentence, heading, label or line; the one exception is a company
   name in Bodoni italic (.co).
   404.html links this file root-absolute (/next/css/pages.css): GitHub Pages serves it
   for any missing path. Font urls here are relative to this file, so they work too. */
@font-face { font-family: Archivo; src: url(../../studies/shared/fonts/archivo-var.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Martian Mono'; src: url(../../studies/shared/fonts/martian-mono-var.woff2) format('woff2'); font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap; }
@font-face { font-family: 'Bodoni Moda'; src: url(../assets/fonts/bodoni-moda-italic-latin.woff2) format('woff2'); font-weight: 400 900; font-style: italic; font-display: swap; }

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; background: var(--paper); color: var(--ink);
  font-family: var(--display); font-stretch: 100%; font-size: var(--text-l); line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent; overflow-x: clip;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; border-radius: var(--radius-focus); }

/* ---------------------------------------------- shared (studio.css) */
.wrap { width: 100%; max-width: var(--wrap-max); margin: 0 auto; padding: 0 var(--gutter); }
.label { font-family: var(--mono); font-size: var(--text-mono-m); line-height: 1.5; font-weight: 400; font-stretch: var(--mono-stretch); letter-spacing: var(--mono-tracking); text-transform: uppercase; color: var(--muted); }
.display { font-family: var(--display); font-stretch: var(--display-stretch); font-weight: var(--display-weight); text-transform: uppercase; font-size: clamp(42px, 7vw, 120px); line-height: .9; letter-spacing: -.025em; }
.link { display: inline-block; position: relative; font-family: var(--mono); font-size: var(--text-mono-l); text-transform: uppercase; letter-spacing: var(--mono-tracking); font-stretch: var(--mono-stretch); padding: 4px 0; }
.link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform-origin: right; transition: transform var(--dur-600) var(--ease); }
.link--quiet { color: var(--muted); }
.arrow { position: relative; width: 20px; height: 1.5px; background: currentColor; flex: none; }
.arrow::after { content: ""; position: absolute; right: 0; top: -4px; width: 9px; height: 9px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: translate(1px, 0) rotate(45deg); transform-origin: center; }
.wordmark { font-family: var(--display); font-weight: 600; font-size: var(--text-s); letter-spacing: -.01em; display: inline-flex; gap: 6px; align-items: baseline; }
.wordmark__c { display: inline-block; transition: transform var(--dur-800) var(--ease); }
.pillbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 26px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--tile); color: var(--ink); font-size: var(--text-m); font-weight: 520; letter-spacing: -.005em; white-space: nowrap; transition: background var(--dur-400) var(--ease), color var(--dur-400) var(--ease), border-color var(--dur-400) var(--ease), transform var(--dur-600) var(--ease); }
.pillbtn--solid { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pillbtn .arrow { width: 14px; }
.pillbtn .arrow::after { width: 7px; height: 7px; top: -3px; }
@media (hover: hover) {
  .link:hover::after { transform: scaleX(0); }
  .wordmark:hover .wordmark__c { transform: rotate(360deg); }
  .pillbtn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  .pillbtn--solid:hover { background: var(--signal); border-color: var(--signal); color: var(--ink); }
}
.pillbtn:focus-visible { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pillbtn--solid:focus-visible { background: var(--signal); border-color: var(--signal); color: var(--ink); }

/* plain page chrome: a static top row and a one-line foot */
.ptop { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.pfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: var(--space-70-140); padding-top: 18px; padding-bottom: 28px; border-top: var(--hairline); }

/* rise in once on load; content is visible at rest (motion.md rule 3) */
@keyframes rise { from { opacity: .35; transform: translateY(14px); } }
.rise { animation: rise var(--dur-1100) var(--ease) backwards; }
.rise--2 { animation-delay: .08s; }
.rise--3 { animation-delay: .16s; }

/* ------------------------------------------------------------- 404 */
.nf { padding-top: clamp(24px, 6vw, 96px); }
.nf__hero { display: grid; grid-template-columns: minmax(0, 1fr) clamp(200px, 26vw, 420px); column-gap: clamp(24px, 3vw, 56px); align-items: center; }
.nf__copy { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(18px, 2vw, 28px); }
.nf__title { font-size: clamp(40px, 6.6vw, 124px); line-height: .88; letter-spacing: -.04em; max-width: 9.5em; }
.nf__line { max-width: 44ch; font-size: clamp(17px, 1.5vw, 22px); line-height: 1.38; letter-spacing: -.01em; color: var(--ink-soft); }
.nf__line a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color var(--dur-400) var(--ease); }
.nf__path { display: none; overflow-wrap: anywhere; }
.nf__path b { font-weight: inherit; color: inherit; }
.nf__path.is-set { display: block; }

/* CHARGER, lost: the hero's rocket (next/js/lost-rocket.js) wandering in its own column beside the
   text (above it on phones). Its whole wander is framed inside the stage, so it never covers the text.
   The poster is the same render, so nothing jumps when the live canvas fades in. */
.nf__stage { position: relative; width: 100%; aspect-ratio: 4 / 5; pointer-events: none; }
.nf__poster, .nf__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.nf__poster { transition: opacity var(--dur-600) linear; }
.nf__canvas { opacity: 0; transition: opacity var(--dur-800) linear; }
.nf__stage.is-live .nf__canvas { opacity: 1; }
.nf__stage.is-live .nf__poster { opacity: 0; transition-delay: var(--dur-500); }

.nf__go { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bento-gap); margin-top: var(--space-40-90); }
.nf__group { padding: clamp(20px, 2vw, 30px); border-radius: var(--radius-tile); background: var(--tile); box-shadow: var(--shadow-tile); }
.nf__group > .label { display: block; padding-bottom: 12px; }
.nf__list a { display: flex; align-items: center; gap: 16px; min-height: 58px; padding: 10px 0; border-top: var(--hairline); font-size: clamp(18px, 1.6vw, 24px); font-weight: 620; letter-spacing: -.02em; line-height: 1.15; }
.nf__list .nf__name { flex: 1; min-width: 0; }
.nf__list .arrow { width: 16px; transition: transform var(--dur-600) var(--ease); }
.nf__list .arrow::after { width: 8px; height: 8px; top: -3.5px; }
.nf__list a { transition: color var(--dur-400) var(--ease); }
@media (hover: hover) {
  .nf__line a:hover { text-decoration-color: var(--signal-ink); }
  .nf__list a:hover { color: var(--signal-ink); }
  .nf__list a:hover .arrow { transform: translateX(6px); }
}
.nf__list a:focus-visible { color: var(--signal-ink); outline-offset: 2px; }
.nf__list a:focus-visible .arrow { transform: translateX(6px); }

@media (max-width: 760px) {
  body { font-size: var(--text-m); }
  .nf__hero { display: flex; flex-direction: column; }
  .nf__stage { order: -1; width: 168px; margin: -18px -6px 10px auto; }
  .nf__go { grid-template-columns: minmax(0, 1fr); }
  .nf__copy .pillbtn { width: 100%; }
}

/* --------------------------------------------------------- privacy */
.legal { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--bento-gap) clamp(32px, 5vw, 96px); align-items: start; padding-top: clamp(24px, 5vw, 80px); padding-bottom: var(--space-40-90); }
.legal__head { position: sticky; top: 40px; display: flex; flex-direction: column; gap: 18px; }
.legal__title { font-size: clamp(46px, 6.2vw, 112px); line-height: .88; letter-spacing: -.035em; }
.legal__card { padding: clamp(26px, 3.4vw, 56px); border-radius: var(--radius-tile); background: var(--tile); box-shadow: var(--shadow-tile); }
.legal__body { max-width: 68ch; color: var(--ink-soft); line-height: 1.68; }
.legal__body p + p { margin-top: 1.2em; padding-top: 1.2em; border-top: var(--hairline); }
.legal__body p:first-child { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.45; letter-spacing: -.01em; color: var(--ink); }
/* each paragraph's lead ("What is collected.") sits on its own line: a whole element, not a bold run-in */
.legal__body strong { display: block; margin-bottom: .35em; font-weight: 680; color: var(--ink); letter-spacing: -.005em; }
.legal__body a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; transition: text-decoration-color var(--dur-400) var(--ease); }
@media (hover: hover) { .legal__body a:hover { text-decoration-color: var(--signal-ink); } }
.legal__back { grid-column: 2; margin-top: clamp(8px, 1.4vw, 20px); }
@media (max-width: 1100px) {
  .legal { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .legal__head { position: static; }
  .legal__back { grid-column: 1; }
}
@media (max-width: 760px) {
  body { font-size: var(--text-m); }
  .legal__card { border-radius: 26px; padding: 26px 20px; }
  .legal__body { font-size: var(--text-s); }
  .legal__back .pillbtn { width: 100%; }
}

/* ------------------------------------------- /hi/ (business card QR) */
/* phone first: the QR code on the card opens this page */
.hi { display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
.card { width: 100%; max-width: 520px; display: flex; flex-direction: column; padding: 22px 22px 20px; border-radius: 26px; background: var(--tile); box-shadow: var(--shadow-stage); }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card__face { width: 64px; height: 64px; object-fit: cover; object-position: 50% 22%; border-radius: 50%; background: var(--paper-3); }
.card__name { margin-top: 30px; font-size: clamp(54px, 17.5vw, 104px); line-height: .84; letter-spacing: -.04em; }
.card__name span { display: block; }
.card__role { margin-top: 18px; font-size: clamp(19px, 5.4vw, 24px); line-height: 1.2; letter-spacing: -.015em; font-weight: 560; }
/* company names may stay Bodoni italic (owner); the only accent allowed in a line */
.co { font-family: var(--serif); font-style: italic; font-weight: 500; font-stretch: normal; letter-spacing: -.01em; font-size: 1.12em; white-space: nowrap; }
.card__save { width: 100%; height: 64px; margin-top: 30px; justify-content: space-between; padding: 0 26px; font-size: var(--text-l); }
.card__save svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card__hint { margin-top: 10px; padding: 0 4px; font-size: var(--text-2xs); line-height: 1.45; color: var(--muted); }
.card__links { margin-top: 24px; border-bottom: var(--hairline); }
.card__links a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 2px; border-top: var(--hairline); font-size: var(--text-m); font-weight: 520; letter-spacing: -.01em; overflow-wrap: anywhere; transition: color var(--dur-400) var(--ease); }
.card__links .arrow { width: 14px; transform: rotate(-45deg); transition: transform var(--dur-600) var(--ease); }
.card__links .arrow::after { width: 7px; height: 7px; top: -3px; }
.card__work { width: 100%; height: 58px; margin-top: 18px; justify-content: space-between; }
.card__foot { margin-top: 18px; text-align: center; }
@media (hover: hover) {
  .card__links a:hover { color: var(--signal-ink); }
  .card__links a:hover .arrow { transform: rotate(-45deg) translateX(4px); }
}
.card__links a:focus-visible { color: var(--signal-ink); outline-offset: 0; }
@media (min-width: 761px) {
  .hi { padding: 40px var(--gutter); }
  .card { padding: 34px 36px 26px; border-radius: var(--radius-tile); }
  .card__face { width: 76px; height: 76px; }
}

/* /hi/ drift words: the Studio hero's .slot words (studio.css, same names and values), floating
   behind the card. Far slots are larger, softer and blurred; near slots sharp. Phone: they live in
   the band above the card. Only transform, opacity and filter move (composited). */
.hi .card { position: relative; z-index: 1; }
.drift { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.slot { position: absolute; left: var(--x); top: var(--y); white-space: nowrap; will-change: transform; animation: float var(--t, 11s) var(--ease-io) infinite alternate; }
.slot:nth-child(2) { --t: 13s; animation-delay: -4s; }
.slot:nth-child(3) { --t: 9s; animation-delay: -2s; }
.slot:nth-child(4) { --t: 12s; animation-delay: -6s; }
.slot:nth-child(5) { --t: 14s; animation-delay: -3s; }
.slot:nth-child(6) { --t: 10s; animation-delay: -7s; }
.slot:nth-child(7) { --t: 12.5s; animation-delay: -5s; }
@keyframes float { from { translate: 0 0; } to { translate: var(--fx, 14px) var(--fy, -18px); } }
/* the swap is the hero's rise and fade without its blur filter: a phone page gets transform and opacity only */
/* out first, then in (never two words of a slot on screen at once); --stagger is set per slot by the page */
.slot i { position: absolute; left: 0; top: 0; font-style: normal; opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity var(--dur-400) var(--ease), transform var(--dur-400) var(--ease); transition-delay: var(--stagger, 0ms); }
.slot i.on { opacity: 1; transform: none; transition-duration: var(--dur-900), var(--dur-1100); transition-delay: calc(var(--stagger, 0ms) + var(--dur-400)); }
.slot i:first-child { position: relative; }
.s-xl { font-size: clamp(30px, 3.9vw, 66px); font-weight: var(--display-weight); font-stretch: var(--display-stretch); letter-spacing: -.03em; line-height: 1; text-transform: uppercase; }
.s-l { font-size: clamp(22px, 2.5vw, 40px); font-weight: 500; font-stretch: 100%; letter-spacing: -.02em; line-height: 1; }
.s-m { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2vw, 32px); font-weight: 500; color: var(--ink-soft); }
.s-s { font-family: var(--mono); font-size: var(--text-mono-m); font-stretch: var(--mono-stretch); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
/* far words: the blur is a text-shadow (painted once), not a filter (recomputed every frame while they float) */
.slot.far { opacity: .38; scale: 1.4; transform-origin: 0 0; }
.slot.far i { color: transparent; text-shadow: 0 0 4px var(--ink); }
.slot.far.s-m i { text-shadow: 0 0 4px var(--ink-soft); }
@media (max-width: 760px) {
  /* the card stays at the top and fills the screen: words peek out below it and, blurred, at its edges */
  .slot:nth-child(4), .slot:nth-child(6), .slot:nth-child(7) { display: none; }
  .slot:nth-child(1), .slot:nth-child(3) { --fx: 10px; --fy: 4px; } /* the strip under the card is ~30px: float sideways, not up */
  .slot:nth-child(1) { --x: 6% !important; --y: calc(100svh - 30px) !important; }
  .slot:nth-child(3) { --x: 64% !important; --y: calc(100svh - 30px) !important; }
  .slot:nth-child(2) { --x: -22% !important; --y: 30svh !important; }
  .slot:nth-child(5) { --x: 90% !important; --y: 58svh !important; }
  .s-xl { font-size: 24px; }
  .s-l { font-size: 21px; }
  .s-m { font-size: 19px; }
  .slot.far { scale: 2.2; opacity: .3; }
}

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