/* Neumorphism Revisited — soft extruded surfaces, with the contrast fixes neumorphism usually skips.
   Rules this file enforces:
   1. Text is never tone-on-tone: ink is 13:1+, secondary ink 7:1+ on the ground.
   2. Every control carries a 3:1 edge line, so it is findable without the shadow.
   3. Current / pressed / selected always pair the inset shadow with a second cue (weight, dot, check).
   4. Primary actions are filled, not extruded.
   5. A "Crisp" depth mode (and prefers-contrast: more) trades blur for hard edges. */

:root {
  --ground: #e2e7ee;
  --ground-deep: #d7dde6;
  --well: #d5dce5;
  --hi: #ffffff;
  --lo: #a3b0c2;
  --ink: #141c27;
  --ink-2: #3a4758;
  --edge: #6f7d90;
  --edge-soft: #c6cfdb;
  --accent: #364f6a;
  --accent-ink: #ffffff;
  --accent-soft: #c9d6e4;
  --signal: #9a4a0e;
  --ok: #1d6b50;
  --code-bg: #121922;
  --code-ink: #dfe6ee;
  --code-dim: #9fb0c4;
  --focus: #0b57d0;
  --focus-halo: #ffffff;

  --blur: 16px;
  --dist: 7px;
  --edge-w: 1px;
  --card-edge: var(--edge-soft);

  --raised: var(--dist) var(--dist) var(--blur) var(--lo), calc(var(--dist) * -1) calc(var(--dist) * -1) var(--blur) var(--hi);
  --raised-sm: 3px 3px 7px var(--lo), -3px -3px 7px var(--hi);
  --inset: inset 5px 5px 10px var(--lo), inset -5px -5px 10px var(--hi);
  --inset-sm: inset 2px 2px 5px var(--lo), inset -2px -2px 5px var(--hi);

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --pill: 999px;

  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1220px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #232b36;
    --ground-deep: #1d242e;
    --well: #1c232c;
    --hi: #303b49;
    --lo: #12171e;
    --ink: #eef2f7;
    --ink-2: #b3bfce;
    --edge: #6f8094;
    --edge-soft: #3a4656;
    --accent: #9dbde0;
    --accent-ink: #111a24;
    --accent-soft: #34485f;
    --signal: #e6a15a;
    --ok: #6fcf9f;
    --code-bg: #10161e;
    --focus: #ffd166;
    --focus-halo: #10161e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #232b36;
  --ground-deep: #1d242e;
  --well: #1c232c;
  --hi: #303b49;
  --lo: #12171e;
  --ink: #eef2f7;
  --ink-2: #b3bfce;
  --edge: #6f8094;
  --edge-soft: #3a4656;
  --accent: #9dbde0;
  --accent-ink: #111a24;
  --accent-soft: #34485f;
  --signal: #e6a15a;
  --ok: #6fcf9f;
  --code-bg: #10161e;
  --focus: #ffd166;
  --focus-halo: #10161e;
  color-scheme: dark;
}

/* Crisp depth: short, hard shadows and full-strength edges on every surface */
:root[data-depth="crisp"] {
  --blur: 2px;
  --dist: 4px;
  --edge-w: 2px;
  --card-edge: var(--edge);
  --raised-sm: 2px 2px 0 var(--lo), -2px -2px 0 var(--hi);
  --inset: inset 3px 3px 0 var(--lo), inset -2px -2px 0 var(--hi);
  --inset-sm: inset 2px 2px 0 var(--lo), inset -1px -1px 0 var(--hi);
}
@media (prefers-contrast: more) {
  :root:not([data-depth="soft"]) {
    --blur: 2px;
    --dist: 4px;
    --edge-w: 2px;
    --card-edge: var(--edge);
    --raised-sm: 2px 2px 0 var(--lo), -2px -2px 0 var(--hi);
    --inset: inset 3px 3px 0 var(--lo), inset -2px -2px 0 var(--hi);
    --inset-sm: inset 2px 2px 0 var(--lo), inset -1px -1px 0 var(--hi);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color .2s ease, color .2s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4.2rem); font-weight: 600; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
code, pre, kbd { font-family: var(--font-mono); }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--focus-halo);
  border-radius: 10px;
}

.skip {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .75rem 1rem; border-radius: var(--r-sm); font-weight: 700;
}
.skip:focus { top: 1rem; }

.wrap { width: min(var(--maxw), 100% - 2rem); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- primitives: surfaces ---------- */
.raised { background: var(--ground); box-shadow: var(--raised); border: var(--edge-w) solid var(--card-edge); border-radius: var(--r-lg); }
.well { background: var(--well); box-shadow: var(--inset); border-radius: var(--r-lg); border: var(--edge-w) solid var(--card-edge); }
.tray { background: var(--ground-deep); box-shadow: var(--inset); border-radius: var(--r-lg); padding: clamp(1rem, 2.4vw, 1.75rem); }

/* ---------- labels, eyebrows ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono); font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: .9rem;
}
.led { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--ground), var(--raised-sm); flex: none; }
.led.warm { background: var(--signal); }
.led.ok { background: var(--ok); }
.muted { color: var(--ink-2); }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.35rem); color: var(--ink-2); max-width: 60ch; line-height: 1.55; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--ground);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.35rem;
  font: 700 1rem/1.2 var(--font-body); text-decoration: none; color: var(--ink);
  background: var(--btn-bg);
  border: var(--edge-w) solid var(--edge);
  border-radius: var(--pill);
  box-shadow: var(--raised-sm);
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease, background-color .15s ease;
}
.btn:hover { box-shadow: 5px 5px 12px var(--lo), -5px -5px 12px var(--hi); }
.btn:active, .btn[aria-pressed="true"] { box-shadow: var(--inset-sm); transform: translateY(1px); }
.btn.primary { --btn-bg: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn.small { min-height: 44px; padding: .5rem 1rem; font-size: .9375rem; }
.btn svg { width: 18px; height: 18px; flex: none; }
.textlink { font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--edge); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.textlink:hover { text-decoration-color: var(--accent); color: var(--accent); }
.arrowlink { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; text-decoration: none; min-height: 44px; }
.arrowlink::after { content: "→"; transition: transform .15s ease; }
.arrowlink:hover { text-decoration: underline; text-underline-offset: 4px; }
.arrowlink:hover::after { transform: translateX(3px); }

/* round knob button (theme, depth, menu) */
.knob {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ground); color: var(--ink); border: var(--edge-w) solid var(--edge);
  box-shadow: var(--raised-sm); cursor: pointer; padding: 0; transition: box-shadow .15s ease;
}
.knob:hover { box-shadow: 5px 5px 11px var(--lo), -5px -5px 11px var(--hi); }
.knob:active, .knob[aria-pressed="true"] { box-shadow: var(--inset-sm); }
.knob svg { width: 20px; height: 20px; }

/* ---------- header / dock ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding: .85rem 0; background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.dock {
  display: flex; align-items: center; gap: 1rem;
  padding: .55rem .6rem .55rem .7rem;
  border-radius: var(--pill);
  background: var(--ground); box-shadow: var(--raised); border: var(--edge-w) solid var(--card-edge);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; min-height: 48px; border-radius: var(--pill); padding-right: .5rem; }
.brand-mark { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--ground); box-shadow: var(--inset-sm); border: var(--edge-w) solid var(--edge-soft); }
.brand-mark svg { width: 28px; height: 28px; }
.brand-word { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word small { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .12em; color: var(--ink-2); text-transform: uppercase; }
.brand-word strong { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: .02em; }

.nav-list { display: flex; gap: .35rem; list-style: none; margin: 0; padding: .3rem; border-radius: var(--pill); background: var(--ground-deep); box-shadow: var(--inset-sm); }
.nav-list a {
  display: flex; align-items: center; gap: .45rem; min-height: 44px; padding: .45rem 1rem; border-radius: var(--pill);
  text-decoration: none; font-weight: 700; font-size: 1rem; color: var(--ink-2); border: var(--edge-w) solid transparent;
  transition: box-shadow .15s ease, color .15s ease, background-color .15s ease;
}
.nav-list a:hover { color: var(--ink); background: var(--ground); box-shadow: var(--raised-sm); border-color: var(--edge-soft); }
.nav-list a[aria-current="page"] { color: var(--ink); background: var(--ground); box-shadow: var(--raised-sm); border-color: var(--edge); }
.nav-list a[aria-current="page"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.nav-list a.ai-link { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.nav-list a.ai-link[aria-current="page"]::before { background: var(--accent-ink); }
.dock-tools { display: flex; gap: .5rem; align-items: center; }
.search-mini { display: flex; align-items: center; }
.search-mini input {
  width: 150px; min-height: 44px; padding: .5rem 1rem; border-radius: var(--pill);
  border: var(--edge-w) solid var(--edge); background: var(--well); box-shadow: var(--inset-sm);
  font: 1rem var(--font-body); color: var(--ink);
}
.search-mini input::placeholder { color: var(--ink-2); opacity: 1; }
.menu-btn { display: none; }
.mobile-panel { display: none; }
.depth-knob .depth-label { position: absolute; }

@media (max-width: 1120px) {
  .search-mini { display: none; }
}
@media (max-width: 900px) {
  .nav-list.desktop { display: none; }
  .menu-btn { display: grid; }
  .brand-word small { display: none; }
  .mobile-panel[data-open="true"] { display: block; margin-top: .8rem; padding: 1rem; border-radius: var(--r-lg); background: var(--ground); box-shadow: var(--raised); border: var(--edge-w) solid var(--card-edge); }
  .mobile-panel .nav-list { flex-direction: column; border-radius: var(--r-md); }
  .mobile-panel .nav-list a { min-height: 50px; font-size: 1.1rem; }
  .mobile-panel .search-mini { display: flex; margin-top: .8rem; }
  .mobile-panel .search-mini input { width: 100%; }
}
@media (max-width: 420px) {
  .dock { gap: .4rem; }
  .knob { width: 44px; height: 44px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand-word strong { font-size: 1.05rem; }
}

/* ---------- sections ---------- */
main { display: block; }
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section.tight { padding-top: 1rem; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.sec-head h2 { margin: 0; }
.sec-head p { margin: .4rem 0 0; color: var(--ink-2); font-size: 1.1rem; }

/* page hero (non-home) */
.page-hero { padding: clamp(2rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.page-hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero-art { aspect-ratio: 4 / 3; padding: 14px; }
.hero-art .art-inner { width: 100%; height: 100%; border-radius: calc(var(--r-lg) - 10px); overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), var(--ground-deep)); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .page-hero-grid { grid-template-columns: 1fr; } }

/* ---------- home hero ---------- */
.home-hero { padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 5vw, 4rem); }
.hero-slab { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding: clamp(1.25rem, 3.5vw, 3rem); }
.portrait-well { position: relative; aspect-ratio: 1; border-radius: 50%; padding: clamp(12px, 2vw, 22px); background: var(--ground); box-shadow: var(--inset); border: var(--edge-w) solid var(--card-edge); max-width: 460px; width: 100%; justify-self: center; }
.portrait-well .photo { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; box-shadow: var(--raised-sm); background: radial-gradient(circle at 35% 35%, var(--accent-soft), var(--ground-deep)); }
.portrait-well img { width: 100%; height: 100%; object-fit: cover; object-position: 22% 30%; }
.portrait-tag { position: absolute; right: 6%; bottom: 8%; padding: .5rem .9rem; border-radius: var(--pill); background: var(--ground); box-shadow: var(--raised-sm); border: var(--edge-w) solid var(--edge); font-weight: 700; font-size: .9375rem; display: flex; gap: .45rem; align-items: center; }
.hero-copy h1 { margin-bottom: .35em; }
.hero-copy .lede { margin-bottom: 1.6rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: center; }
@media (max-width: 860px) {
  .hero-slab { grid-template-columns: 1fr; }
  .portrait-well { max-width: 300px; }
}

/* ---------- dials (stat knobs) ---------- */
.dials { display: flex; flex-wrap: wrap; gap: clamp(1rem, 2.5vw, 2rem); margin: 1.8rem 0 2rem; }
.dial { display: flex; align-items: center; gap: .9rem; }
.dial-face {
  width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--ground); box-shadow: var(--raised-sm); border: var(--edge-w) solid var(--edge-soft); position: relative;
}
.dial-face::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; box-shadow: var(--inset-sm); }
.dial-face b { position: relative; font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dial-label { font-weight: 700; line-height: 1.25; max-width: 9ch; }
.dial-label small { display: block; font-weight: 400; color: var(--ink-2); font-size: .9375rem; }
@media (max-width: 480px) { .dial-face { width: 72px; height: 72px; } .dial-face b { font-size: 1.2rem; } }

/* ---------- cards ---------- */
.grid { display: grid; gap: clamp(1.25rem, 2.4vw, 2rem); }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid.c2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.card {
  position: relative; display: flex; flex-direction: column; gap: .7rem;
  padding: 14px 14px 1.4rem; border-radius: var(--r-lg);
  background: var(--ground); box-shadow: var(--raised); border: var(--edge-w) solid var(--card-edge);
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { transform: translateY(-2px); }
.card:has(a.stretch:active) { box-shadow: var(--inset); transform: none; }
.card .thumb { aspect-ratio: 16 / 9; border-radius: calc(var(--r-lg) - 8px); overflow: hidden; box-shadow: var(--inset-sm); padding: 6px; background: var(--well); }
.card .thumb .t-in { width: 100%; height: 100%; border-radius: calc(var(--r-lg) - 13px); overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), var(--ground-deep)); display: grid; place-items: center; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: .2rem .7rem 0; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card h3 { margin: 0; font-size: 1.25rem; line-height: 1.25; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.card p { margin: 0; color: var(--ink-2); }
.card .meta { font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-2); letter-spacing: .04em; text-transform: uppercase; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.card .foot { margin-top: auto; padding-top: .6rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card .read { font-weight: 700; display: inline-flex; gap: .35rem; align-items: center; }
.card .read::after { content: "→"; }
a.stretch::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); z-index: 1; }
a.stretch:focus-visible { outline: none; box-shadow: none; }
.card:has(a.stretch:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; }
.card .above { position: relative; z-index: 2; }
.card.plain { padding: 1.5rem 1.6rem; }

.glyph-thumb { color: var(--accent); }
.glyph-thumb svg { width: 38%; height: auto; }

/* chips / tags */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: .2rem .75rem; border-radius: var(--pill);
  font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-2); background: var(--ground-deep); box-shadow: var(--inset-sm); text-decoration: none;
}
a.chip { min-height: 44px; border: var(--edge-w) solid var(--edge); background: var(--ground); box-shadow: var(--raised-sm); color: var(--ink); }
a.chip:hover { box-shadow: 4px 4px 9px var(--lo), -4px -4px 9px var(--hi); }
a.chip:active { box-shadow: var(--inset-sm); }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: var(--pill); font-family: var(--font-mono); font-size: .8125rem; font-weight: 500; border: 1.5px solid currentColor; }
.badge.new { color: var(--ok); }
.badge.updated { color: var(--signal); }
.badge.new::before { content: "✦"; }
.badge.updated::before { content: "↻"; }

/* list rows in a tray */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.row {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center;
  padding: 1.1rem 1.3rem; border-radius: var(--r-md); background: var(--ground); box-shadow: var(--raised-sm); border: var(--edge-w) solid var(--card-edge);
}
.row .date { font-family: var(--font-mono); font-size: .875rem; color: var(--ink-2); white-space: nowrap; min-width: 6.5rem; }
.row h3 { font-size: 1.15rem; margin: 0 0 .2rem; }
.row h3 a { text-decoration: none; }
.row h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.row p { margin: 0; color: var(--ink-2); }
.row .go { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--inset-sm); font-weight: 700; }
.row:has(a.stretch:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
a.stretch.r::after { border-radius: var(--r-md); }
@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; gap: .4rem; }
  .row .go { display: none; }
}

/* segmented control */
.segmented { display: inline-flex; flex-wrap: wrap; gap: .35rem; padding: .35rem; border-radius: var(--r-md); background: var(--ground-deep); box-shadow: var(--inset-sm); border: var(--edge-w) solid var(--edge-soft); }
.segmented button, .segmented a {
  min-height: 44px; padding: .45rem 1rem; border-radius: calc(var(--r-md) - 5px); border: var(--edge-w) solid transparent; background: transparent;
  font: 700 1rem var(--font-body); color: var(--ink-2); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .45rem;
}
.segmented button:hover, .segmented a:hover { color: var(--ink); }
.segmented [aria-pressed="true"], .segmented [aria-selected="true"] { background: var(--ground); color: var(--ink); box-shadow: var(--raised-sm); border-color: var(--edge); }
.segmented [aria-pressed="true"]::before, .segmented [aria-selected="true"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.segmented .count { font-family: var(--font-mono); font-size: .8125rem; font-weight: 500; }

/* inputs */
.field { width: 100%; min-height: 52px; padding: .75rem 1.2rem; border-radius: var(--pill); border: var(--edge-w) solid var(--edge); background: var(--well); box-shadow: var(--inset-sm); font: 1.0625rem var(--font-body); color: var(--ink); }
.field::placeholder { color: var(--ink-2); opacity: 1; }
select.field { appearance: none; padding-right: 2.6rem; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
label.lbl { display: block; font-weight: 700; margin-bottom: .45rem; }

/* newsletter */
.newsletter { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; padding: clamp(1.5rem, 4vw, 3rem); }
.newsletter form { display: flex; gap: .8rem; flex-wrap: wrap; }
.newsletter .field { flex: 1 1 220px; }
.newsletter .status { flex-basis: 100%; margin: 0; font-weight: 700; min-height: 1.6em; }
.newsletter .consent { flex-basis: 100%; display: flex; gap: .6rem; align-items: flex-start; color: var(--ink-2); }
.newsletter .consent input { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--accent); flex: none; }
@media (max-width: 800px) { .newsletter { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { margin-top: clamp(3rem, 6vw, 5rem); padding: clamp(2.5rem, 5vw, 4rem) 0 2rem; background: var(--ground-deep); box-shadow: inset 0 8px 16px -8px var(--lo); }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.4fr; gap: 2rem; }
.site-footer h2 { font-size: 1rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); font-weight: 500; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.site-footer ul a { display: inline-flex; min-height: 40px; align-items: center; text-decoration: none; font-weight: 700; }
.site-footer ul a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-news form { display: flex; flex-direction: column; gap: .7rem; }
.foot-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--edge-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--ink-2); }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- project bits ---------- */
.jump { position: sticky; top: 92px; z-index: 30; padding: .6rem 0; }
.jump .segmented { background: color-mix(in srgb, var(--ground-deep) 94%, transparent); backdrop-filter: blur(8px); }
.feature-panel { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 3vw, 3rem); padding: clamp(1.25rem, 3vw, 2.5rem); align-items: center; }
@media (max-width: 860px) { .feature-panel { grid-template-columns: 1fr; } }
.landscape { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; padding: 14px; }
.landscape:nth-child(even) .thumb { order: 2; }
.landscape .thumb { aspect-ratio: 16/10; }
.landscape .body { padding: 1rem 1.2rem; }
@media (max-width: 760px) { .landscape { grid-template-columns: 1fr; } .landscape:nth-child(even) .thumb { order: 0; } }
.stars { display: inline-flex; gap: .3rem; align-items: center; font-family: var(--font-mono); font-size: .875rem; font-weight: 500; }
.mini-stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
.mini-stats span { font-family: var(--font-mono); font-size: .875rem; padding: .3rem .7rem; border-radius: var(--r-sm); box-shadow: var(--inset-sm); }

/* terminal placeholder inside thumbs (for gifs that open on blank frames) */
.term-thumb { width: 100%; height: 100%; background: var(--code-bg); color: var(--code-dim); font: .875rem/1.5 var(--font-mono); padding: 1rem; display: flex; flex-direction: column; justify-content: flex-end; }

/* ---------- about ---------- */
.career-bar { display: flex; gap: 6px; padding: 8px; border-radius: var(--r-md); background: var(--ground-deep); box-shadow: var(--inset-sm); overflow-x: auto; }
.career-bar span { flex: 1 0 auto; padding: .6rem .8rem; border-radius: 10px; background: var(--ground); box-shadow: var(--raised-sm); font-weight: 700; font-size: .9375rem; white-space: nowrap; text-align: center; }
.career-bar span small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: .8125rem; color: var(--ink-2); }
.career-bar span.now { border: 2px solid var(--accent); }
.timeline { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.5rem; }
.timeline > li { display: grid; grid-template-columns: 180px 1fr; gap: 1.5rem; }
.timeline .when { font-family: var(--font-mono); font-size: .9375rem; color: var(--ink-2); padding-top: .35rem; }
.timeline .when b { display: block; font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.timeline ul { padding-left: 1.2rem; margin: .6rem 0 0; }
@media (max-width: 700px) { .timeline > li { grid-template-columns: 1fr; gap: .3rem; } }
.quote-keys { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); counter-reset: q; }
.quote-keys li { counter-increment: q; padding: 1.3rem 1.4rem 1.3rem 4.4rem; position: relative; border-radius: var(--r-md); background: var(--ground); box-shadow: var(--raised-sm); border: var(--edge-w) solid var(--card-edge); font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; line-height: 1.35; }
.quote-keys li::before { content: counter(q); position: absolute; left: 1.1rem; top: 1.1rem; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--inset-sm); font-family: var(--font-mono); font-size: 1rem; color: var(--ink-2); }
.skill-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: .8rem 0 0; }
.skill-list li { padding: .35rem .8rem; border-radius: var(--pill); background: var(--ground-deep); box-shadow: var(--inset-sm); font-size: .9375rem; }

/* ---------- article ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 8px; z-index: 60; background: var(--ground-deep); box-shadow: var(--inset-sm); }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 0 var(--pill) var(--pill) 0; }
.progress-pct { position: fixed; top: 14px; right: 14px; z-index: 60; font-family: var(--font-mono); font-size: .8125rem; padding: .25rem .6rem; border-radius: var(--pill); background: var(--ground); box-shadow: var(--raised-sm); border: 1px solid var(--edge); display: none; }
@media (min-width: 1300px) { .progress-pct { display: block; top: auto; bottom: 20px; } }
.article-head { padding: clamp(1.5rem, 4vw, 3rem) 0 2rem; }
.crumbs { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.crumbs a { font-weight: 700; }
.article-hero { padding: 14px; margin-top: 2rem; }
.article-hero .art-inner { aspect-ratio: 21/9; border-radius: calc(var(--r-lg) - 10px); overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), var(--ground-deep)); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.meta-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; font-family: var(--font-mono); font-size: .9375rem; color: var(--ink-2); }
.meta-row .sep { width: 5px; height: 5px; border-radius: 50%; background: var(--edge); }
.article-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.toc { position: sticky; top: 110px; padding: 1.2rem; }
.toc h2 { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; margin-bottom: .8rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.toc a { display: flex; gap: .5rem; align-items: center; min-height: 44px; padding: .4rem .8rem; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: .9375rem; line-height: 1.3; border: var(--edge-w) solid transparent; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); background: var(--ground-deep); box-shadow: var(--inset-sm); border-color: var(--edge-soft); }
.toc a[aria-current="true"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.toc-mobile { display: none; margin-bottom: 2rem; }
.toc-mobile summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: .6rem 1.2rem; cursor: pointer; font-weight: 700; list-style: none; border-radius: var(--r-md); }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "+"; font-size: 1.4rem; }
.toc-mobile[open] summary::after { content: "–"; }
.toc-mobile ol { padding: 0 1.2rem 1rem 2.4rem; margin: 0; }
.toc-mobile li a { display: inline-flex; min-height: 40px; align-items: center; font-weight: 700; }
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .toc-mobile { display: block; }
}
.prose { font-size: 1.125rem; line-height: 1.7; max-width: 70ch; }
.prose h2 { margin: 2.6rem 0 1rem; font-size: clamp(1.6rem, 2.6vw, 2.1rem); scroll-margin-top: 110px; }
.prose p, .prose li { color: var(--ink); }
.prose a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 700; }
.prose a:hover { color: var(--accent); }
.prose ol, .prose ul { padding-left: 1.4rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: .35em; }
.prose :not(pre) > code { font-size: .92em; padding: .12em .42em; border-radius: 7px; background: var(--ground-deep); box-shadow: var(--inset-sm); }
.codeblock { margin: 1.8rem 0; padding: 10px; border-radius: var(--r-md); background: var(--ground); box-shadow: var(--inset); border: var(--edge-w) solid var(--card-edge); max-width: calc(100vw - 2rem); }
.codeblock .code-bar { display: flex; justify-content: space-between; align-items: center; padding: .2rem .4rem .6rem .6rem; }
.codeblock .lang { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .08em; color: var(--ink-2); display: flex; gap: .5rem; align-items: center; }
.codeblock pre { margin: 0; padding: 1.2rem 1.3rem; border-radius: calc(var(--r-md) - 6px); background: var(--code-bg); color: var(--code-ink); overflow-x: auto; font-size: .9375rem; line-height: 1.6; tab-size: 2; }
.tok-k { color: #ff9fb2; } .tok-s { color: #b8e28f; } .tok-c { color: var(--code-dim); font-style: italic; } .tok-t { color: #8fd3ff; } .tok-f { color: #ffd88a; }
.callout { margin: 1.8rem 0; padding: 1.2rem 1.4rem 1.2rem 1.4rem; border-radius: var(--r-md); display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.callout p { margin: 0; }
.callout .ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.callout.why { background: var(--ground); box-shadow: var(--raised-sm); border: var(--edge-w) solid var(--edge-soft); border-left: 5px solid var(--accent); }
.callout.why .ico { box-shadow: var(--inset-sm); color: var(--accent); }
.callout.ask { background: var(--ground-deep); box-shadow: var(--inset); border: var(--edge-w) dashed var(--edge); }
.callout.ask .ico { background: var(--ground); box-shadow: var(--raised-sm); color: var(--signal); border: 1px solid var(--edge-soft); }
.callout.note { background: var(--ground); box-shadow: var(--raised-sm); border: var(--edge-w) solid var(--edge-soft); border-left: 5px solid var(--signal); }
.callout.note .ico { box-shadow: var(--inset-sm); color: var(--signal); }
.callout .kicker { display: block; font-family: var(--font-mono); font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-bottom: .25rem; }
.share-zone { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }

/* ---------- patterns ---------- */
.three-ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 800px) { .three-ways { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 1rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.5rem; }
.toolbar .search { flex: 1 1 360px; }
.toolbar .sort { flex: 0 0 220px; }
.result-line { display: flex; gap: 1rem; align-items: center; margin: 0 0 1.5rem; font-weight: 700; min-height: 44px; }
.pcard .thumb { aspect-ratio: 16/10; }
.pcard .goodfor { font-size: .9375rem; }
.pcard .goodfor b { color: var(--ink); }
.mini { width: 78%; height: 70%; display: grid; gap: 6px; }
.mini i { display: block; border-radius: 6px; background: var(--ground); box-shadow: 2px 2px 4px var(--lo), -2px -2px 4px var(--hi); }
.mini.data { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 2fr; }
.mini.data i:nth-child(n+5) { grid-column: span 4; background: linear-gradient(90deg, var(--accent) 0 62%, var(--ground) 62%); }
.mini.layout { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.mini.layout i:first-child { grid-row: span 2; }
.mini.inter { grid-template-columns: 1fr; grid-template-rows: repeat(3, 1fr); }
.mini.inter i:nth-child(2) { box-shadow: inset 2px 2px 4px var(--lo), inset -2px -2px 4px var(--hi); border: 2px solid var(--accent); }
.mini.forms { grid-template-rows: 1fr 1fr 1fr; }
.mini.forms i { border-radius: 999px; box-shadow: inset 2px 2px 4px var(--lo), inset -2px -2px 4px var(--hi); }
.mini.forms i:last-child { width: 45%; justify-self: end; background: var(--accent); box-shadow: none; }
.mini.color { grid-template-columns: repeat(5, 1fr); }
.mini.color i:nth-child(1) { background: #364f6a; } .mini.color i:nth-child(2) { background: #5d8ab4; } .mini.color i:nth-child(3) { background: #9dbde0; } .mini.color i:nth-child(4) { background: #e6a15a; } .mini.color i:nth-child(5) { background: #1d6b50; }
.empty { text-align: center; padding: 3rem 1.5rem; }
.empty[hidden] { display: none; }

.panes { padding: 12px; }
.pane-bar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; padding: .3rem .3rem 1rem; }
.pane { border-radius: var(--r-md); }
.pane[hidden] { display: none; }
.pane-stage { padding: clamp(1rem, 3vw, 2rem); background: var(--ground-deep); box-shadow: var(--inset); border-radius: var(--r-md); }
.pane pre { margin: 0; padding: 1.2rem 1.3rem; border-radius: var(--r-md); background: var(--code-bg); color: var(--code-ink); overflow-x: auto; font-size: .9375rem; line-height: 1.6; max-height: 560px; }
.pane .prompt { padding: 1.5rem; border-radius: var(--r-md); background: var(--ground-deep); box-shadow: var(--inset); font-size: 1.0625rem; max-width: none; }
.pane .note { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: var(--r-sm); border: 1.5px dashed var(--edge); color: var(--ink-2); }

/* the demo pattern, reinterpreted: hairlines are grid gap */
.hss-strip { display: grid; gap: 1px; background: var(--edge); border: 1px solid var(--edge); border-radius: var(--r-md); overflow: hidden; grid-template-columns: 1fr; box-shadow: var(--raised-sm); }
.hss-tile { background: var(--ground); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; text-align: left; }
.hss-tile .lab { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.hss-tile .fig { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hss-tile .fig.none { color: var(--ink-2); }
.hss-tile .sub { font-size: .9375rem; color: var(--ink-2); }
button.hss-tile { border: 0; font: inherit; color: var(--ink); cursor: pointer; min-height: 44px; }
button.hss-tile:hover .lab { color: var(--ink); text-decoration: underline; }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--ground)); box-shadow: var(--inset-sm); }
button.hss-tile[aria-pressed="true"] .lab::before { content: "● "; color: var(--accent); }
button.hss-tile:focus-visible { outline-offset: -4px; box-shadow: none; border-radius: 0; }
@media (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 42rem) { .hss-strip.four { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 42rem) { .hss-strip.five { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 64rem) { .hss-strip.five { grid-template-columns: repeat(5, 1fr); } }
.hss-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.hss-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-radius: var(--r-sm); background: var(--ground); border: 1px solid var(--edge-soft); flex-wrap: wrap; }
.hss-list li[hidden] { display: none; }
.hss-status { margin: .9rem 0 0; font-weight: 700; }
.cap { color: var(--ink-2); margin: 0 0 .8rem; }
.two-col { columns: 2; column-gap: 2rem; padding-left: 1.2rem; }
@media (max-width: 640px) { .two-col { columns: 1; } }

.coming { opacity: 1; }
.coming .thumb .t-in { background: repeating-linear-gradient(135deg, var(--ground-deep) 0 12px, var(--ground) 12px 24px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .card:hover { transform: none; }
}

[hidden] { display: none !important; }
.hss-strip + .cap, .hss-status + .cap { margin-top: 1.6rem; }
.mini.data i:nth-child(n+5) { background: linear-gradient(90deg, var(--accent) 0 var(--p, 62%), var(--ground) var(--p, 62%)); }
.mini.layout i:first-child, .mini.inter i:nth-child(2) { background: color-mix(in srgb, var(--accent) var(--p, 30%), var(--ground)); }
