*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
/* NO overflow-x on html: along with the overlay freeze
   (body.step-open overflow hidden) the scroll position jumps otherwise
   to 0 — horizontal clipping is already body { overflow-x: clip } */
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; } /* beats element-specific display rules (e.g. .cform) */
::selection { background: rgb(var(--accent-rgb) / .22); color: var(--fg); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
a, button { -webkit-tap-highlight-color: transparent; }

html.preboot .mainnav { visibility: hidden; }

html.i18n-pending body { visibility: hidden; }

/* ---------- Base ---------- */
html { scroll-behavior: auto; scrollbar-width: none; } /* Firefox: hide the bar */
/* Hide native scroll bar — top progress line replaces it */
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: clip; /* clip (not hidden) — does not break position:sticky */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { position: relative; z-index: 1; }

/* ---------- Icons · Phosphor (MIT), regular weight ----------
   Inlined as an <svg><symbol> sprite per document, referenced with <use>.
   The site has no build step and uses four icons: a webfont would cost a
   request and a flash of missing glyphs for 700 bytes of path data, and
   Chrome will not resolve <use> across documents, so a shared sprite file
   is not an option either.
   Sized in em, so an icon always matches the type beside it, and painted
   with currentColor, so every colour swap on the page — is-ondark, hover,
   the accent panel — carries the icon along without a second rule.
   .ph overrides the `svg { display: block }` reset above. */
.ph {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -.125em;
}
.ph-sprite { display: none; }

.grain, .vignette, .glow { display: none; }

/* scroll progress — ink line at the top, growing from left to right
   (replaces the native scroll bar) */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 90; pointer-events: none;
  background: var(--line-2);
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: var(--fg);
}

/* "Continue scrolling" hint (after a menu jump landed on a pinned section).
   Minimal editorial: small caps label above a thin accent line running
   downwards. Uses the same keyframes as the hero scroll cue. */
.scrollhint {
  position: fixed; left: 50%; bottom: clamp(24px, 5.5vh, 52px);
  transform: translateX(-50%) translateY(12px); z-index: 95; pointer-events: none;
  display: inline-flex; flex-direction: column; align-items: center; gap: 13px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  opacity: 0; visibility: hidden;
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out), visibility .6s;
}
.scrollhint.is-shown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.scrollhint__label { text-indent: .18em; animation: cue-breathe 2.6s ease-in-out infinite; }
.scrollhint__line {
  width: 1px; height: 44px; transform-origin: top;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: cue-run 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .scrollhint__label, .scrollhint__line { animation: none; }
  .scrollhint { transition: opacity .25s ease, visibility .25s; }
}

/* Brand — just the name, set in the serif */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__text { font-family: var(--font-plain); font-size: 22px; letter-spacing: .01em; line-height: 1; color: var(--fg); }

.mainnav {
  position: fixed; inset: var(--nav-top) 0 auto 0; z-index: 80;
  padding: 0 clamp(20px, 4vw, 48px); pointer-events: none;
  /* The colour the scrim below is painted in. It is the page ground by
     default; whoever knows better — a nav state class, a full-bleed section
     under the bar — re-points it rather than restating the gradient. */
  --nav-scrim-rgb: var(--paper-rgb);
}
/* A scrim downwards instead of a container — keeps the bar readable above
   moving content. It used to run .92 → .5 → transparent across 114px, which
   left the strip the bar itself occupies only 41% opaque at the bottom edge:
   a section eyebrow scrolling under the bar stayed legible through it, and
   poked out above it. Measured collision: nav y 14–72 against
   .works__eyebrow y 4–21.

   So it is solid paper for exactly as far as the bar reaches, then falls off
   over 24px. Still a gradient, still no container edge — the fade just starts
   where the bar ends instead of at its top. check-runtime.mjs reads the
   computed stops and fails if the alpha under an eyebrow drops below .98.

   The colour comes from --nav-scrim-rgb, not from the page ground directly:
   a scrim that is not the colour of what it covers stops being a scrim and
   becomes a band laid over the section. --nav-scrim-opacity takes it away
   entirely where there is nothing to mask yet; it is the half that can be
   transitioned, because a gradient's own stops cannot. */
.mainnav::before {
  content: ''; position: absolute; left: 0; right: 0;
  top: calc(-1 * var(--nav-top)); height: calc(var(--nav-top) + var(--nav-h) + 24px);
  background: linear-gradient(to bottom,
    rgb(var(--nav-scrim-rgb)) 0%,
    rgb(var(--nav-scrim-rgb)) calc(var(--nav-top) + var(--nav-h)),
    rgb(var(--nav-scrim-rgb) / 0) 100%);
  opacity: var(--nav-scrim-opacity, 1);
  pointer-events: none;
}
.mainnav__inner {
  position: relative; height: var(--nav-h);
  /* The side tracks never go below their content: with a bare 1fr the
     centre track grew to the whole label first and squeezed the wordmark's
     column to nothing, so on a phone the case-study label ran over a
     wrapped "Joey Nguyen" instead of ellipsizing. Now the crumb gets only
     what the wordmark and the controls leave. */
  display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr);
  align-items: center;
  column-gap: clamp(12px, 2vw, 28px);
  /* only real elements catch clicks — the empty bar space stays
     transparent to whatever sits underneath */
  pointer-events: none;
}
/* index.html opens with a wrapper, project.html with the bare wordmark —
   addressed by position so one rule covers both */
.mainnav__inner > :first-child { justify-self: start; min-width: 0; }
.mainnav__inner > :last-child { justify-self: end; }
.mainnav__inner a, .mainnav__inner button { pointer-events: auto; }
/* Don't let anchor jumps land under the bar */
.act, #works, #contact { scroll-margin-top: calc(var(--nav-top) + var(--nav-h) + 20px); }

.mainnav__left { display: flex; align-items: center; gap: 6px; }
.mainnav__left .mainnav__avail { margin-inline-start: 8px; }
/* Availability — the one piece of nav copy that is time-sensitive, so it is
   config (JN_PROFILE) rather than markup, and absent unless it is set. */
.mainnav__avail {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-label); font-weight: var(--label-weight); font-size: 11px; letter-spacing: .04em;
  color: var(--label-ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px 4px 9px;
}
.mainnav__avail::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex: none;
}
.mainnav.is-ondark .mainnav__avail { color: #faf9f7; border-color: rgba(250,249,247,.4); }
/* Below 900 the centred crumb owns the space either side of the wordmark */
@media (max-width: 900px) { .mainnav__avail { display: none; } }

/* Section display in the middle — small small caps line.
   Sits in the centre track and is clipped, never overlapped: whatever the
   bar cannot give it, it gives up as an ellipsis. */
.mainnav__crumb {
  grid-column: 2; justify-self: center; max-width: 100%;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  color: var(--label-ink);
  opacity: 0; transition: opacity .35s ease;
}
.mainnav__crumb.has { opacity: 1; }


.mainnav__right { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 30px); }

/* ---- Language, beside the menu ----
   Two cells rather than one label that flips: a single "VI" cannot say
   whether it is the state or the destination. Both are always legible and
   the live one is inked, so the control reads as a switch. Set as a label,
   because the rest of the page's two-letter labels are. */
.mainnav__lang {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-label); font-weight: var(--label-weight); font-size: 11px; letter-spacing: .1em;
  color: var(--muted-2);
  padding: 5px 0;
  transition: color .25s ease;
}
.mainnav__lang-cell { transition: color .25s ease, opacity .25s ease; opacity: .5; }
.mainnav__lang-cell.is-on { color: var(--fg); opacity: 1; }
.mainnav__lang-sep { width: 1px; height: 11px; background: var(--line); flex: none; }
.mainnav__lang:hover .mainnav__lang-cell:not(.is-on) { opacity: .85; }
/* Same light treatment the rest of the bar takes over the dark blocks */
.mainnav.is-ondark .mainnav__lang-cell.is-on { color: #faf9f7; }
.mainnav.is-ondark .mainnav__lang-sep { background: rgba(250, 249, 247, .4); }

/* CTA: the look (ghost label + Klein arrow box) and its per-ground colours
   live in chrome.css. So does the CV picker's list. */
/* inline-flex, not inline: the label has to sit on the bar's centre line like
   every other control. As an inline box it sat on its own text baseline, which
   put it ~12px above the menu label and the CTA beside it. */
.mainnav__cv-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--label-ink);
  transition: color .25s ease;
}
.mainnav__cv-btn:hover, .mainnav__cv.is-open .mainnav__cv-btn { color: var(--fg); }
.mainnav__cv[hidden] { display: none; }
.mainnav.is-ondark .mainnav__cv-btn { color: rgba(250, 249, 247, .7); }
.mainnav.is-ondark .mainnav__cv-btn:hover,
.mainnav.is-ondark .mainnav__cv.is-open .mainnav__cv-btn { color: #faf9f7; }
/* Icon only, left of the wordmark. The 44px box is the touch target; the
   negative margin puts the glyph, not the box, on the page gutter. The
   glyph follows aria-expanded, so the state and the picture cannot drift. */
.mainnav__menu {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; margin-inline-start: -11px;
  color: var(--muted);
  transition: color .25s ease;
}
.mainnav__menu .ph { width: 22px; height: 22px; grid-area: 1 / 1; }
.mainnav__menu .mainnav__menu-close,
.mainnav__menu[aria-expanded="true"] .mainnav__menu-open { display: none; }
.mainnav__menu[aria-expanded="true"] .mainnav__menu-close { display: inline-block; }
.mainnav__menu:hover { color: var(--fg); }

/* ---- full screen menu: the table of contents of the page ---- */
.navmenu {
  position: fixed; inset: 0; z-index: 75;
  display: grid; align-content: center; justify-content: center;
  padding: calc(var(--nav-top) + var(--nav-h) + 24px) 24px 40px;
  background: rgb(var(--paper-rgb) / .94);
  backdrop-filter: blur(22px) saturate(1.05); -webkit-backdrop-filter: blur(22px) saturate(1.05);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .35s var(--ease-out), visibility .35s;
}
.navmenu.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
body.menu-open { overflow: hidden; }
.navmenu__tree { display: grid; gap: 2px; font-family: var(--font-sans); }
/* button as well as a: "About" opens an overlay instead of jumping to a
   section, so it must not be a link — but it has to read as one entry.
   Direct children only: the switches parked in .navmenu__tools on narrow
   screens are buttons too, and they are not entries. */
.navmenu__tree > a,
.navmenu__tree > button {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 12px; border-radius: 10px;
  width: 100%; text-align: left;
  font-family: var(--font-plain);
  font-size: clamp(22px, 2.8vw, 30px); color: var(--fg-dim);
  transition: color .25s ease, background .25s ease;
}
.navmenu__tree > a:hover, .navmenu__tree > a:active,
.navmenu__tree > button:hover, .navmenu__tree > button:active { background: rgba(22,21,19,.04); color: var(--fg); }
.navmenu__child { padding-left: 12px !important; }
.navmenu__tree a.is-active { color: var(--fg); }
.navmenu__item { margin-top: 2px; }
.navmenu__cta { margin-top: 26px; color: var(--accent) !important; }
.navmenu__cta:hover { background: none !important; }
.navmenu__tools { display: flex; align-items: center; gap: 26px; margin-top: 32px; padding: 0 12px; }
.navmenu__tools:empty { display: none; }
.navmenu__tools .mainnav__lang { font-size: 13px; }
/* gentle movement of entries when opening */
.navmenu__tree > * { opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s var(--ease-out); }
.navmenu.is-open .navmenu__tree > * { opacity: 1; transform: translateY(0); }
.navmenu.is-open .navmenu__tree > *:nth-child(2) { transition-delay: .03s; }
.navmenu.is-open .navmenu__tree > *:nth-child(3) { transition-delay: .06s; }
.navmenu.is-open .navmenu__tree > *:nth-child(4) { transition-delay: .09s; }
.navmenu.is-open .navmenu__tree > *:nth-child(5) { transition-delay: .12s; }
.navmenu.is-open .navmenu__tree > *:nth-child(6) { transition-delay: .15s; }
.navmenu.is-open .navmenu__tree > *:nth-child(7) { transition-delay: .18s; }
.navmenu.is-open .navmenu__tree > *:nth-child(8) { transition-delay: .21s; }
.navmenu.is-open .navmenu__tree > *:nth-child(9) { transition-delay: .24s; }

/* Crumb remains visible at all widths (orientation "01 ...");
   smaller on narrow ones, and the grid caps it with an ellipse */
@media (max-width: 900px) {
  .mainnav__crumb { font-size: 11px; letter-spacing: .16em; }
}
@media (max-width: 600px) {
  :root { --nav-h: 52px; --nav-top: 10px; }
  .brand__text { font-size: 16px; }
  .mainnav__crumb { font-size: 10px; }
  /* The bar used to drop the CTA here, which left the first screen on a
     phone with `Joey Nguyen | Menu` and no way to reach Joey that did not
     start with opening a menu. It stays, as a 44px icon pill — the label is
     clipped, not removed, so the accessible name is still the word the
     dictionary writes and no aria-label has to duplicate it. */
  .mainnav__cta {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; padding: 4px;
  }
  .mainnav__cta-label {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip-path: inset(50%); overflow: hidden; white-space: nowrap;
  }
  .mainnav__cta .ph { font-size: 16px; }
  /* CV stays out of the bar at this width — it is still in the footer, and
     four controls in a 390px bar leave the section label nothing. */
  .mainnav__cv { display: none; }
  .mainnav__right { gap: 14px; }
}


.step {
  position: fixed; inset: 0; z-index: 96;
  background: rgb(var(--paper-rgb) / .96);
  backdrop-filter: blur(18px) saturate(1.05); -webkit-backdrop-filter: blur(18px) saturate(1.05);
  overflow-y: auto; overscroll-behavior: contain;
  padding: calc(var(--nav-top) + var(--nav-h) + 5vh) 6vw 12vh;
}
body.step-open { overflow: hidden; }
.step__inner { max-width: 600px; margin: 0 auto; }
.step__pre {
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.step__h {
  margin: 14px 0 30px;
  font-family: var(--font-plain); font-weight: 400;
  font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.12; letter-spacing: -.01em;
  color: var(--fg);
}
/* the "ignition": the headline briefly glows in the accent when opened */
.step:not([hidden]) .step__h { animation: step-glow 1.5s ease-out; }
@keyframes step-glow {
  0% { color: var(--accent); text-shadow: 0 0 24px rgb(var(--accent-rgb) / .35); }
  100% { color: var(--fg); text-shadow: none; }
}
.step p {
  margin: 0 0 18px; max-width: 60ch;
  font-family: var(--font-sans); font-size: 15.5px; line-height: 1.75;
  color: var(--fg-dim);
}
.step:not([hidden]) .step__inner > * { animation: step-in .7s var(--ease-out) backwards; }
.step:not([hidden]) .step__inner > *:nth-child(2) { animation-delay: .06s; }
.step:not([hidden]) .step__inner > *:nth-child(3) { animation-delay: .16s; }
.step:not([hidden]) .step__inner > *:nth-child(4) { animation-delay: .24s; }
.step:not([hidden]) .step__inner > *:nth-child(5) { animation-delay: .32s; }
.step:not([hidden]) .step__inner > *:nth-child(6) { animation-delay: .40s; }
.step:not([hidden]) .step__inner > *:nth-child(7) { animation-delay: .48s; }
.step:not([hidden]) .step__inner > *:nth-child(8) { animation-delay: .56s; }
@keyframes step-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.step__cta { margin-top: 30px; font-size: 15.5px; }
.step__cta button {
  font-family: var(--font-plain); font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  color: var(--accent); border-bottom: 1px solid rgb(var(--accent-rgb) / .4);
  padding-bottom: 2px; transition: border-color .25s ease;
}
.step__cta button:hover { border-color: var(--accent); }
.step__close {
  position: fixed; top: calc(var(--nav-top) + 6px); right: clamp(20px, 4vw, 48px);
  z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  font-size: 26px; line-height: 1; color: var(--fg-dim);
  transition: color .25s ease, background .25s ease;
}
.step__close:hover { color: var(--fg); background: rgba(22,21,19,.05); }

/* Shared scroll hints (including case-study navigation). */
@keyframes cue-breathe {
  0%,100% { opacity: .55; transform: translateY(0); }
  50%     { opacity: 1;   transform: translateY(3px); }
}
@keyframes cue-run {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(10px); opacity: 0; }
}

.act { position: relative; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .prompt__tap::before, .prompt__tap::after { animation: none !important; opacity: .35; transform: scale(.7); }
  .step:not([hidden]) .step__h, .step:not([hidden]) .step__inner > * { animation: none !important; }
}

/* ---------------- HOW I SHIP · one viewport, three crossfading steps -----
   Base (also the reduced-motion / no-JS fallback): a static column —
   paper step, then the two dark blocks, each carrying its own ink.
   .is-live (added by buildStack) collapses the column into one pinned
   viewport with the three steps overlaid; opacity is then GSAP's. */
.stack { position: relative; }
.stack__step {
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 12vh 6vw;
}
.stack__step--1 { background: var(--bg); color: var(--fg); }
.stack__step--2 {
  background: var(--ink-panel); color: var(--ink-panel-fg);
  border-radius: 30px 30px 0 0; box-shadow: 0 -24px 60px -26px rgba(22,21,19,.55);
}
.stack__step--3 {
  background: var(--accent-panel); color: var(--accent-panel-fg);
  border-radius: 30px 30px 0 0; box-shadow: 0 -24px 60px -26px rgba(22,21,19,.45);
}
.stack.is-live { height: 100svh; overflow: hidden; }
.stack.is-live .stack__step { position: absolute; inset: 0; min-height: 0; border-radius: 0; box-shadow: none; }
.stack.is-live .stack__step--2,
.stack.is-live .stack__step--3 { visibility: hidden; }
.brand__text, .mainnav__crumb, .mainnav__menu, .mainnav__cta { transition: color .35s ease, background .35s ease, border-color .35s ease; }
.mainnav.is-ondark .brand__text,
.mainnav.is-ondark .mainnav__crumb,
.mainnav.is-ondark .mainnav__menu { color: #faf9f7; }
.stack__inner { max-width: 900px; text-align: center; will-change: transform, opacity; }
.stack__num { display: block; margin-bottom: 16px; font-family: var(--font-label); font-weight: var(--label-weight); font-size: 15px; letter-spacing: .12em; color: var(--accent); }
.stack__step--2 .stack__num { color: #c9ccff; }
/* light instead of dark: on --accent-panel black reaches only 1.96:1, white 10.69 */
.stack__step--3 .stack__num { color: var(--accent-panel-fg); }
.stack__h {
  font-family: var(--font-plain); font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 6rem); line-height: 1.03; letter-spacing: -.02em;
}
.stack__p {
  margin: 26px auto 0; max-width: 30ch;
  font-family: var(--font-sans); font-size: clamp(1rem, 2.3vw, 1.35rem); line-height: 1.5; opacity: .82;
}
.stack__step--3 .stack__p { opacity: .9; }
@media (prefers-reduced-motion: reduce) {
  .stack__step { min-height: 0; padding: 14vh 6vw; }
}

.finale {
  position: relative;
  min-height: 78svh;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(56px, 9vh, 104px) 6vw clamp(72px, 11vh, 132px);
}
/* ---- Footer: copyright + links, resting at the foot of the contact ---- */
.sitefooter {
  position: absolute; left: 0; right: 0; bottom: 18px;
  display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
}
.sitefooter__links { display: flex; gap: 20px; }
.sitefooter a { color: var(--muted); transition: color .25s ease; }
.sitefooter a:hover { color: var(--fg); }

.finale__inner { width: 100%; max-width: 760px; text-align: center; }
.finale__pre {
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  margin-bottom: clamp(24px, 5vh, 44px);
}

/* Stage 1 · Prompt */
.prompt__line {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: .3em;
  font-family: var(--font-plain); font-weight: 400;
  font-size: clamp(1.9rem, 5.4vw, 3.6rem); line-height: 1.16; letter-spacing: -.01em;
  color: var(--fg);
}
.prompt__prefix { white-space: nowrap; }
.prompt__field { position: relative; display: flex; flex: 1 1 8ch; min-width: 8ch; max-width: 100%; }
.prompt__input {
  width: 100%;
  font: inherit; padding: 0; margin: 0; border: 0; outline: 0; resize: none; overflow: hidden;
  background: transparent; color: var(--accent);
  caret-color: var(--accent);
  text-align: left;
}
.prompt__input::placeholder { color: var(--muted-2); }
/* Affordance: as long as nothing has been typed, the placeholder breathes lightly
   and touch waves pulsate behind the gap - both disappear,
   as soon as the field is focused or filled */
#promptInput:placeholder-shown:not(:focus)::placeholder { animation: prompt-breathe 2.6s ease-in-out infinite; }
@keyframes prompt-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
/* Touch waves: two concentric rings radiating from the click point */
.prompt__tap {
  position: absolute; left: 4.5ch; top: 50%;
  width: 58px; height: 58px; margin: -29px 0 0 -29px;
  pointer-events: none;
}
.prompt__tap::before, .prompt__tap::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgb(var(--accent-rgb) / .5);
  opacity: 0; transform: scale(.25);
  animation: tapwave 2.8s ease-out infinite;
}
.prompt__tap::after { animation-delay: 1.4s; }
@keyframes tapwave {
  0% { transform: scale(.25); opacity: 0; }
  16% { opacity: .5; }
  70%, 100% { transform: scale(1); opacity: 0; }
}
.prompt:focus-within .prompt__tap,
.prompt:has(#promptInput:not(:placeholder-shown)) .prompt__tap { display: none; }
.prompt__caret { display: none; }
/* Small note under the prompt — gone as soon as you focus or type */
.prompt__cue {
  display: block; margin-top: 18px;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  opacity: .65; transition: opacity .35s ease;
}
.prompt:focus-within .prompt__cue,
.prompt:has(#promptInput:not(:placeholder-shown)) .prompt__cue { opacity: 0; }
.prompt__send {
  margin-top: clamp(28px, 5vh, 40px);
  font-weight: 600; color: var(--ink-panel-fg); padding: 13px 28px; border-radius: 12px;
  background: var(--ink-panel);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), background .2s ease;
}
.prompt__send.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.prompt__send:hover { background: #000; }

/* Stage 2 · Form */
.cform { max-width: 540px; margin: 0 auto; text-align: left; display: flex; flex-direction: column; gap: 16px; }
.cform__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cfield { display: flex; flex-direction: column; gap: 8px; }
.cfield > span { font-family: var(--font-label); font-weight: var(--label-weight); font-size: 13px; letter-spacing: .04em; color: var(--label-ink); }
.cfield input, .cfield textarea {
  font-family: var(--font-sans); font-size: 15px; color: var(--fg);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; outline: 0; resize: vertical; width: 100%;
  transition: border-color .25s ease, background .25s ease;
}
.cfield input::placeholder, .cfield textarea::placeholder { color: var(--muted-2); }
.cfield input:focus, .cfield textarea:focus { border-color: rgba(22,21,19,.45); }
.cfield textarea { min-height: 128px; line-height: 1.55; }
.cform__actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 4px; }
.cbtn { font-weight: 600; padding: 12px 24px; border-radius: 12px; transition: transform .2s var(--ease-out), background .2s ease, color .2s ease; }
.cbtn--ghost { color: var(--muted); }
.cbtn--ghost:hover { color: var(--fg); }
.cbtn--send { color: var(--ink-panel-fg); background: var(--ink-panel); }
.cbtn--send:hover { transform: translateY(-2px); background: #000; }
.cform__note { font-family: var(--font-label); font-weight: var(--label-weight); font-size: 12.5px; color: var(--label-ink); text-align: center; margin-top: 2px; }

/* Stage 3 · Confirmation */
.cdone { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cdone__check {
  width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ink-panel); color: var(--ink-panel-fg); font-size: 27px; font-weight: 700;
}
.cdone__title { font-family: var(--font-plain); font-size: clamp(1.7rem, 4vw, 2.6rem); color: var(--fg); }
.cdone__sub { color: var(--muted); max-width: 34ch; }

@media (max-width: 600px) {
  .cform__grid { grid-template-columns: 1fr; }
  /* Prompt among themselves: prefix at top, input full width (no squeezing);
     centered, otherwise the input text will stick to the left edge of the viewport
     under the centered prefix */
  .prompt__line { flex-direction: column; align-items: stretch; gap: .1em; }
  .prompt__field { width: 100%; min-width: 0; flex: 1 1 auto; }
  .prompt__input { text-align: center; }
  /* zentrierter Text → Wellen mittig hinter den Platzhalter */
  .prompt__tap { left: 50%; }
}

/* Selected Works moved to showcase.css with the Refraction rollout. */
/* ---- Hover preview ----------------------------------------------------
   The index has no room for a thumbnail and does not need one to be read.
   So the image is not in the layout at all: one frame, built by buildWorkPeek
   only if a row actually carries a data-peek, following the cursor.
   position: fixed with z-index under the nav (80) — the preview may cover a
   row, never the navigation. */
.wpeek {
  position: fixed; left: 0; top: 0; z-index: 60;
  width: clamp(180px, 17vw, 260px); aspect-ratio: 4 / 3;
  border-radius: 14px; overflow: hidden;
  background: var(--panel-2);
  box-shadow: 0 18px 44px -18px rgba(22,21,19,.42);
  opacity: 0; pointer-events: none;
  will-change: transform;
}
/* Every row's image is rendered once and cross-faded, rather than one <img>
   whose src is swapped: a swap decodes on hover and flashes the frame. */
.wpeek img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; transition: opacity .28s var(--ease-out);
}
.wpeek img.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .wpeek img { transition: none; }
}

/* ---- END WORKS ---- */

.track { background: var(--bg); color: var(--fg); }
.track__inner {
  max-width: var(--nav-w);
  margin: 0 auto;
  padding: clamp(40px, 6vh, 72px) clamp(20px, 5vw, 48px);
}
.track__eyebrow {
  font-family: var(--font-label); font-weight: var(--label-weight); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--label-ink);
}
.track__h {
  margin: clamp(14px, 2.4vh, 24px) 0 clamp(20px, 3.4vh, 36px);
  max-width: 20ch;
  font-family: var(--font-plain); font-weight: 400;
  font-size: clamp(26px, 3.4vw, 42px); line-height: 1.08; letter-spacing: -.015em;
  color: var(--fg);
}
.track__list { list-style: none; }

/* Four columns, one line: when · who · what I was · what came out.
   The last column takes the most room — it is the only cell that
   carries a sentence. */
.trow {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
  grid-template-areas: "span company role shipped";
  align-items: baseline;
  gap: 6px clamp(14px, 2.4vw, 32px);
  padding: clamp(13px, 1.7vh, 19px) 0;
  border-top: 1px solid var(--line-2);
}
.track__list .trow:last-child { border-bottom: 1px solid var(--line-2); }

.trow__span {
  grid-area: span;
  font-family: var(--font-label); font-weight: var(--label-weight); font-size: 12px; letter-spacing: .06em;
  white-space: nowrap; color: var(--label-ink);
}
/* The company is the row's claim, so it is the one cell set above the
   labels and at full ink. */
.trow__company {
  grid-area: company;
  font-family: var(--font-sans); font-size: 15px; font-weight: 500;
  color: var(--fg);
}
.trow__role {
  grid-area: role;
  font-family: var(--font-label); font-weight: var(--label-weight); font-size: 12px; letter-spacing: .06em;
  color: var(--label-ink);
}
.trow__shipped {
  grid-area: shipped;
  font-family: var(--font-sans); font-size: 14px; line-height: 1.5;
  color: var(--muted);
}

/* Two lines, not four: a 390px column cannot hold four cells side by
   side, and stacking each on its own line turns a table into a list. */
@media (max-width: 768px) {
  .trow {
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas:
      "span    company"
      "role    shipped";
  }
}

@media (prefers-reduced-motion: reduce) {
  .trow { opacity: 1 !important; transform: none !important; }
}
/* ---- END TRACK RECORD ---- */
