/* KORDAR lab — INSTRUMENT
 *
 * One accent, three text weights, sharp corners, hairlines. Everything that
 * animates is behind html.js and stops at html.still, so the page without
 * JavaScript and the page with prefers-reduced-motion are both complete
 * documents rather than blank ones.
 *
 * Fonts are served from this host. The old sheet pulled three families from
 * fonts.googleapis.com, which is why the CSP had to name two Google domains
 * for one page.
 */

/* ── Faces ────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/lab/fonts/grotesk-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/lab/fonts/grotesk-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/lab/fonts/inter-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/lab/fonts/inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/lab/fonts/jbmono-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/lab/fonts/jbmono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/lab/fonts/jbmono-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/lab/fonts/jbmono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Tokens ───────────────────────────────────────────────────────────── */

:root {
  --ink:      #07080B;
  --ink-2:    #0A0C11;
  --ink-3:    #0F1218;

  --line:     rgba(255, 255, 255, .07);
  --line-2:   rgba(255, 255, 255, .14);

  /* Three steps, and the quietest one still clears 4.5:1 against the page.
     It used to be #5E646D, which measured 3.35:1 — every mono label, every
     status line and the legal line in the colophon were below the readable
     floor, on a site whose whole voice is small mono labels. */
  --text:     #EDEDEA;
  --text-2:   #A8AEB6;
  --text-3:   #7C838D;

  /* One accent. It marks state — focus, hover, live — and nothing else.
     Two bright brand colours is what made the previous sheet read templated. */
  --signal:   #F5A524;
  --signal-2: rgba(245, 165, 36, .16);

  --live:     #34D399;
  --desktop:  #A78BFA;
  --ext:      #38BDF8;
  --cli:      #F472B6;

  --display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --sans:    'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --ease:    cubic-bezier(.16, 1, .3, 1);
  --ease-ui: cubic-bezier(.4, 0, .2, 1);
  --t:       180ms;
  --t-slow:  760ms;

  --gutter: clamp(20px, 5vw, 76px);
  --maxw:   1340px;
  --bar:    58px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--ink);
  scrollbar-color: var(--text-3) var(--ink);
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
}

html.js:not(.still) { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--signal); color: #0A0A0A; }

/* ── Language ─────────────────────────────────────────────────────────── */
/* Both languages are in the document; exactly one is displayed. `revert`
   restores each element's own default, so a <p> stays a block and a <span>
   stays inline without a rule per tag. */

[data-lang] { display: none; }
html:not(.en) [data-lang="ru"],
html.en      [data-lang="en"] { display: revert; }

/* ── Shared ───────────────────────────────────────────────────────────── */

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.mono, .kicker, .tags, .chip, .section-title, .row-num, .scene-num,
.stack-name, .nav-dir, .masthead-nav, .lang-btn, .palette-open, .copy,
.scroll-cue, .colophon, .crumb, .block-title, .project-date, .scene-more,
.scene-live, .btn, .section-note, .arch {
  font-family: var(--mono);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--signal);
  color: #0A0A0A;
  padding: 12px 18px;
  font-family: var(--mono);
  font-size: 13px;
}
.skip:focus { left: 0; }

/* Film grain. One 120×120 tile of SVG noise, tiled — a static texture that
   keeps a large flat dark surface from banding on cheap panels. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* The bar is sticky, so an anchor that scrolls to the top of a section would
   put its heading underneath it. */
[id] { scroll-margin-top: calc(var(--bar) + 26px); }

.wrap, .hero-inner, .manifest, .work, .index-block, .stack, .contact,
.project {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Masthead ─────────────────────────────────────────────────────────── */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 28px;
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .16em;
  font-size: 13px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-2);
  font-size: 11px;
  color: var(--signal);
  transition: border-color var(--t) var(--ease-ui);
}
.brand:hover .brand-mark { border-color: var(--signal); }

.masthead-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.masthead-nav a { position: relative; padding-block: 4px; transition: color var(--t) var(--ease-ui); }
.masthead-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t) var(--ease-ui);
}
.masthead-nav a:hover { color: var(--text); }
.masthead-nav a:hover::after { transform: scaleX(1); }

.masthead-tools { display: flex; align-items: center; gap: 10px; }

.palette-open, .lang-btn, .copy, .btn {
  background: none;
  border: 1px solid var(--line-2);
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: .1em;
  padding: 5px 9px;
  cursor: pointer;
  transition: color var(--t) var(--ease-ui), border-color var(--t) var(--ease-ui);
}
.palette-open:hover, .lang-btn:hover, .copy:hover, .btn:hover {
  color: var(--text);
  border-color: var(--text-3);
}
.palette-open kbd { font: inherit; }

@media (max-width: 720px) {
  .masthead-nav { display: none; }
  .palette-open { display: none; }
  .masthead-tools { margin-left: auto; }
}

/* ── Call to action ───────────────────────────────────────────────────── */
/* The one filled element on the page. Everything else is a hairline and a
   label, which is exactly what makes a single solid block read as the thing
   to press. It sits in the sticky bar and in the hero, so it is reachable
   from the first screen without scrolling. */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--signal);
  color: #0A0A0A;
  border: 1px solid var(--signal);
  transition: background var(--t) var(--ease-ui), color var(--t) var(--ease-ui),
              box-shadow var(--t) var(--ease-ui);
}
.cta:hover, .cta:focus-visible {
  background: transparent;
  color: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-2);
}
.cta-ic { width: 15px; height: 15px; flex: none; }

.cta-bar { font-size: 11px; padding: 6px 12px; }
.cta-big { font-size: 12.5px; padding: 14px 22px; }
.cta-big .cta-ic { width: 17px; height: 17px; }

.hero-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}
.cta-note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text-3);
}

/* The bar is tight on a phone: the label goes, the mark and the colour stay,
   because the button is the whole point of the bar being sticky.
   Hidden from sight, not from the accessibility tree — display:none here left
   the link with nothing but an aria-hidden icon, which is a link with no name
   at all. Lighthouse caught it at 390px; the desktop check never would. */
@media (max-width: 460px) {
  .cta-bar span[data-lang] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .cta-bar { padding: 7px 9px; }
  .cta-bar .cta-ic { width: 16px; height: 16px; }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: calc(100svh - var(--bar));
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Fades into the page rather than ending at a hard edge. */
  -webkit-mask-image: radial-gradient(120% 90% at 50% 45%, #000 30%, transparent 78%);
          mask-image: radial-gradient(120% 90% at 50% 45%, #000 30%, transparent 78%);
}

.hero-inner {
  position: relative;
  width: 100%;
  padding-block: clamp(36px, 6vh, 72px);
}

.kicker {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .04em;
}
.kicker .prompt { color: var(--signal); }
.kicker .typed::after {
  content: "";
  display: inline-block;
  width: .5em;
  height: 1em;
  margin-left: .25em;
  background: var(--signal);
  vertical-align: -.15em;
}
html.js:not(.still) .kicker .typed::after { animation: blink 1.05s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-kicker {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-2);
}

.hero-title {
  margin-top: 8px;
  font-family: var(--display);
  font-weight: 700;
  /* Capped well below the viewport width: three lines of this have to share a
     screen with the lede, three gauges and the scroll cue, and a hero that
     needs scrolling to reach its own numbers is a hero that failed. */
  font-size: clamp(2.6rem, 9vw, 7.6rem);
  line-height: .9;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line:nth-child(2) .line-inner { color: var(--signal); }
.hero-title .line-inner { display: block; will-change: transform; }
.hero-title .ch { display: inline-block; white-space: pre; }

html.js:not(.still) .hero-title .ch {
  transform: translateY(105%);
  opacity: 0;
}
html.js:not(.still) .hero-title.in .ch {
  transform: none;
  opacity: 1;
  transition: transform var(--t-slow) var(--ease), opacity 420ms var(--ease-ui);
  transition-delay: calc(var(--i) * 26ms);
}

.hero-lede {
  margin-top: 24px;
  max-width: 54ch;
  color: var(--text-2);
  font-size: clamp(15px, 1.15vw, 17px);
}

.gauges {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 720px;
  border-top: 1px solid var(--line);
}
/* space-between, so a label that wraps to two lines (Russian does) still
   leaves its number on the same line as the other two. */
.gauge {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 22px 2px 0;
}
.gauge + .gauge { padding-left: 22px; border-left: 1px solid var(--line); }
.gauge dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.gauge dd {
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: color var(--t) var(--ease-ui);
}
.scroll-cue:hover { color: var(--signal); }
html.js:not(.still) .scroll-cue .arrow { animation: nudge 2.1s var(--ease-ui) infinite; }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(5px); } }

/* ── Manifest ─────────────────────────────────────────────────────────── */

.manifest { padding-block: clamp(70px, 12vh, 130px); }
.manifest-line {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.6vw, 3rem);
  line-height: 1.14;
  letter-spacing: -.025em;
  max-width: 20ch;
}

/* ── Sections ─────────────────────────────────────────────────────────── */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(38px, 6vw, 74px);
}
.section-title {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text);
}
.section-mark { color: var(--signal); margin-right: 10px; }
.section-note {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text-3);
}
@media (max-width: 640px) { .section-note { display: none; } }

/* ── Chips, tags ──────────────────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--text-2);
}
.chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}
.chip[data-status="live"]    i { background: var(--live);    box-shadow: 0 0 0 3px rgba(52, 211, 153, .16); }
.chip[data-status="desktop"] i { background: var(--desktop); }
.chip[data-status="ext"]     i { background: var(--ext); }
.chip[data-status="cli"]     i { background: var(--cli); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}
.tags li {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--text-3);
  border: 1px solid var(--line);
  padding: 3px 8px;
  transition: border-color var(--t) var(--ease-ui), color var(--t) var(--ease-ui);
}
.tags li:hover { border-color: var(--line-2); color: var(--text-2); }

/* ── Reveal ───────────────────────────────────────────────────────────── */

html.js:not(.still) .reveal {
  opacity: 0;
  transform: translateY(22px);
}
html.js:not(.still) .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 620ms var(--ease-ui), transform var(--t-slow) var(--ease);
}

/* ── Work scenes ──────────────────────────────────────────────────────── */

.work { padding-bottom: clamp(50px, 8vw, 100px); }

.scene {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: center;
  padding-block: clamp(40px, 7vw, 90px);
  border-top: 1px solid var(--line);
}
.scene:first-of-type { border-top: 0; padding-top: 0; }
.scene:nth-of-type(even) .scene-visual { order: 2; }

.scene-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background:
    radial-gradient(90% 70% at 30% 20%, rgba(245, 165, 36, .05), transparent 60%),
    var(--ink-2);
  overflow: hidden;
}
/* Corner ticks — the detail that reads "instrument" rather than "card". */
.scene-visual::before, .scene-visual::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border: 1px solid var(--line-2);
  pointer-events: none;
}
.scene-visual::before { top: 9px; left: 9px; border-right: 0; border-bottom: 0; }
.scene-visual::after { bottom: 9px; right: 9px; border-left: 0; border-top: 0; }
.scene-visual canvas { display: block; width: 100%; height: 100%; }

.scene-num {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--text-3);
}
.scene-title {
  margin-top: 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}
.scene-title a { transition: color var(--t) var(--ease-ui); }
.scene-title a:hover { color: var(--signal); }
.scene-meta {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--text-3);
}
.scene-lede {
  margin-top: 20px;
  max-width: 46ch;
  color: var(--text-2);
  font-size: 16px;
}
.scene .tags { margin-top: 22px; }

.scene-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.scene-more, .scene-live, .btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  padding: 10px 16px;
  transition: background var(--t) var(--ease-ui), border-color var(--t) var(--ease-ui),
              color var(--t) var(--ease-ui);
}
.scene-more { border-color: var(--signal); color: var(--signal); }
.scene-more:hover { background: var(--signal-2); }
.scene-live:hover, .btn:hover { border-color: var(--text-2); color: var(--text); }
.arrow { transition: transform var(--t) var(--ease-ui); }
.scene-more:hover .arrow, .scene-live:hover .arrow, .btn:hover .arrow {
  transform: translateX(3px);
}

@media (max-width: 900px) {
  .scene { grid-template-columns: minmax(0, 1fr); }
  .scene:nth-of-type(even) .scene-visual { order: 0; }
}

/* ── Index rows ───────────────────────────────────────────────────────── */

.index-block { padding-bottom: clamp(60px, 9vw, 120px); }
.rows { list-style: none; border-top: 1px solid var(--line); }

.row { position: relative; border-bottom: 1px solid var(--line); }
.row-link {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 64px minmax(0, 190px) minmax(0, 1fr) 120px 26px;
  align-items: center;
  gap: 18px;
  padding: 22px 12px;
  transition: padding-inline var(--t) var(--ease-ui), background var(--t) var(--ease-ui);
}
.row-link:hover { background: linear-gradient(90deg, rgba(255,255,255,.03), transparent 60%); padding-left: 22px; }

.row-num { font-size: 11px; color: var(--text-3); letter-spacing: .14em; }
.row-name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  letter-spacing: -.02em;
  transition: color var(--t) var(--ease-ui);
}
.row-link:hover .row-name { color: var(--signal); }
.row-meta { color: var(--text-3); font-size: 14px; }
.row-arrow { justify-self: end; color: var(--text-3); transition: transform var(--t) var(--ease-ui), color var(--t) var(--ease-ui); }
.row-link:hover .row-arrow { transform: translateX(4px); color: var(--signal); }

/* The sketch, drawn only while the row is pointed at. */
.row-thumb {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  width: min(340px, 38%);
  height: 100%;
  opacity: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%);
          mask-image: linear-gradient(90deg, transparent, #000 55%);
  transition: opacity 380ms var(--ease-ui);
}
.row:hover .row-thumb, .row:focus-within .row-thumb { opacity: .55; }

@media (max-width: 860px) {
  .row-link { grid-template-columns: 46px minmax(0, 1fr) 26px; gap: 14px; }
  .row-meta, .row .chip { display: none; }
  .row-thumb { display: none; }
}

/* ── Stack ────────────────────────────────────────────────────────────── */

.stack { padding-bottom: clamp(60px, 9vw, 120px); }
/* Three columns, not auto-fit: there are six groups, and auto-fit at this
   width lays them out five and one, which leaves four empty cells and reads
   like a broken table. */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
@media (max-width: 860px) { .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stack-grid { grid-template-columns: minmax(0, 1fr); } }
.stack-group {
  padding: 24px 26px 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stack-name {
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--signal);
}
.stack-items { margin-top: 16px; list-style: none; }
.stack-items li {
  padding: 5px 0;
  font-size: 14.5px;
  color: var(--text-2);
  border-bottom: 1px dashed transparent;
  transition: color var(--t) var(--ease-ui);
}
.stack-items li:hover { color: var(--text); }

/* ── Contact ──────────────────────────────────────────────────────────── */

.contact { padding-bottom: clamp(80px, 12vw, 150px); }
.contact-lede { color: var(--text-2); max-width: 46ch; }
.contact-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}
.contact-handle {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--text-3);
}
.contact-mail {
  margin-top: 30px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 18px;
}
.contact-mail a {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.7rem, 6vw, 4.4rem);
  letter-spacing: -.04em;
  line-height: 1;
  background-image: linear-gradient(var(--signal), var(--signal));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: background-size 420ms var(--ease), color var(--t) var(--ease-ui);
}
.contact-mail a:hover { color: var(--signal); background-size: 100% 2px; }
.copy[data-done] { color: var(--signal); border-color: var(--signal); }

.contact-business {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-3);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.contact-business a { color: var(--text-2); text-decoration: underline; text-underline-offset: 4px; }
.contact-business a:hover { color: var(--signal); }

/* ── Project page ─────────────────────────────────────────────────────── */

.crumb { padding-block: 26px 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.crumb a { display: inline-flex; gap: 9px; align-items: center; transition: color var(--t) var(--ease-ui); }
.crumb a:hover { color: var(--signal); }

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding-block: clamp(34px, 6vw, 70px) clamp(40px, 7vw, 84px);
  border-bottom: 1px solid var(--line);
}
.project-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: var(--ink-2);
  overflow: hidden;
  order: 2;
}
.project-visual canvas { display: block; width: 100%; height: 100%; }
.project-date { margin-left: auto; color: var(--text-3); }
.project-title {
  margin-top: 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  line-height: .98;
  letter-spacing: -.04em;
}
.project-meta { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--text-3); letter-spacing: .04em; }
.project-lede { margin-top: 22px; max-width: 46ch; color: var(--text-2); }
.project-actions { margin-top: 30px; }

@media (max-width: 900px) {
  .project-hero { grid-template-columns: minmax(0, 1fr); }
  .project-visual { order: 0; }
}

.project-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(30px, 4vw, 56px);
  padding-block: clamp(46px, 7vw, 88px);
}
.block-title {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--signal);
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.block p { color: var(--text-2); max-width: 60ch; }

.features { list-style: none; }
.features li {
  position: relative;
  padding: 9px 0 9px 22px;
  color: var(--text-2);
  font-size: 15px;
  border-bottom: 1px solid var(--line);
}
.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 7px;
  height: 1px;
  background: var(--signal);
}

.arch {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 20px 22px;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

.project-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
  margin-bottom: clamp(60px, 9vw, 110px);
}
.project-nav a {
  background: var(--ink);
  padding: 28px 26px;
  transition: background var(--t) var(--ease-ui);
}
.project-nav a:hover { background: var(--ink-3); }
.project-next { text-align: right; }
.nav-dir {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.project-next .nav-dir { justify-content: flex-end; }
.nav-title {
  display: block;
  margin-top: 10px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: -.02em;
}
.project-nav a:hover .nav-title { color: var(--signal); }

/* ── Colophon ─────────────────────────────────────────────────────────── */

/* Full-bleed rule like the hero's, with the rows held to the same text column
   as every section above — so the hairline runs the width of the screen and
   the words still line up with the headings. */
.colophon {
  border-top: 1px solid var(--line);
  padding: 30px var(--gutter) 44px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text-3);
}
.colophon-row {
  max-width: calc(var(--maxw) - var(--gutter) * 2);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 26px;
}
.colophon-brand {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--text-2);
}
.colophon-mail { margin-left: auto; color: var(--text-2); }
.colophon-mail:hover { color: var(--signal); }
.colophon-fine { margin-top: 14px; color: var(--text-3); }
.colophon-fine a { margin-left: auto; text-decoration: underline; text-underline-offset: 4px; }
.colophon-fine a:hover { color: var(--signal); }

/* ── Command palette ──────────────────────────────────────────────────── */

.palette {
  width: min(560px, calc(100vw - 32px));
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--line-2);
  background: var(--ink-3);
  color: var(--text);
}
.palette::backdrop { background: rgba(4, 5, 7, .72); backdrop-filter: blur(4px); }
.palette-input {
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
}
.palette-list { list-style: none; max-height: 48vh; overflow-y: auto; }
.palette-list a, .palette-list button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 20px;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.palette-list li[hidden] { display: none; }
.palette-list a:hover, .palette-list button:hover,
.palette-list .on a, .palette-list .on button {
  background: var(--signal-2);
  color: var(--text);
}
.pal-num { font-family: var(--mono); font-size: 11px; color: var(--text-3); min-width: 26px; }
.pal-hint {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
  opacity: 0;
}
.palette-list a:hover .pal-hint, .palette-list .on .pal-hint { opacity: 1; }
.palette-empty { padding: 18px 20px; font-family: var(--mono); font-size: 13px; color: var(--text-3); }

/* ── Pointer ring ─────────────────────────────────────────────────────── */
/* Only ever created by JS, and the native cursor is hidden only once the ring
   exists — otherwise a script error would leave the page with no pointer. */

.ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 70;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 1px solid var(--text-3);
  border-radius: 50%;
  pointer-events: none;
  transition: width 220ms var(--ease-ui), height 220ms var(--ease-ui),
              margin 220ms var(--ease-ui), border-color 220ms var(--ease-ui),
              opacity 220ms var(--ease-ui), background 220ms var(--ease-ui);
}
.ring.hot {
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-color: var(--signal);
  background: var(--signal-2);
}
.ring.gone { opacity: 0; }

@media (hover: hover) and (pointer: fine) {
  html.ring-on, html.ring-on * { cursor: none; }
  html.ring-on :focus-visible { cursor: none; }
}
@media (hover: none), (pointer: coarse) { .ring { display: none; } }

/* ── Between pages ────────────────────────────────────────────────────── */
/* Native cross-document transition where the browser has it. Nothing depends
   on it: without support the navigation is an ordinary one. */

@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out 180ms var(--ease-ui) both; }
  ::view-transition-new(root) { animation: vt-in 320ms var(--ease) both; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ── Reduced motion ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .ring { display: none; }
}
