/* ==========================================================================
   AntJanus — Variable Font Expression
   Two variable families, one axis system:
   - Roboto Flex: display. Width (font-stretch → wdth), weight, grade (GRAD).
   - Recursive: text, UI, code. Casual (CASL), Mono (MONO), slant, cursive.
   Weight and width ride the inherited high-level properties; the custom axes
   ride custom properties so a child never wipes a parent's axis values.
   ========================================================================== */

:root {
  /* primitives */
  --paper-50: #f5f2ea;
  --paper-0: #fffdf7;
  --paper-100: #ebe6d9;
  --ink-900: #15181e;
  --ink-600: #4a525e;
  --slate-600: #364f6a;
  --slate-300: #93b3d6;
  --rust-600: #9d3a12;
  --rust-300: #ff9f70;
  --night-950: #0f1217;
  --night-900: #171b22;
  --night-800: #202631;
  --bone-100: #ece7db;
  --bone-400: #a7afbb;

  /* semantic (light) */
  --ground: var(--paper-50);
  --surface: var(--paper-0);
  --surface-2: var(--paper-100);
  --ink: var(--ink-900);
  --muted: var(--ink-600);
  --line: #cfc8b8;
  --line-strong: #8f8a7e;
  --brand: var(--slate-600);
  --signal: var(--rust-600);
  --on-brand: #ffffff;
  --code-bg: #1c212a;
  --code-ink: #e8e4d8;
  --code-dim: #9aa4b2;
  --focus: #0b62d6;

  /* axis defaults (inherited through every element) */
  --casl: 0;
  --mono: 0;
  --crsv: 0.5;
  --slnt: 0;
  --grad: 0;

  /* reader-tunable (the Axes console writes these) */
  --u-casl: 0;
  --u-mono: 0;
  --u-wght: 400;
  --u-wdth: 100%;

  --wrap: 1320px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: var(--night-950);
    --surface: var(--night-900);
    --surface-2: var(--night-800);
    --ink: var(--bone-100);
    --muted: var(--bone-400);
    --line: #2f3643;
    --line-strong: #5a6474;
    --brand: var(--slate-300);
    --signal: var(--rust-300);
    --on-brand: #0f1217;
    --code-bg: #0a0d11;
    --focus: #7cb4ff;
    --grad: -40;
    --u-wght-dark-offset: -20;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: var(--night-950);
  --surface: var(--night-900);
  --surface-2: var(--night-800);
  --ink: var(--bone-100);
  --muted: var(--bone-400);
  --line: #2f3643;
  --line-strong: #5a6474;
  --brand: var(--slate-300);
  --signal: var(--rust-300);
  --on-brand: #0f1217;
  --code-bg: #0a0d11;
  --focus: #7cb4ff;
  --grad: -40;
  color-scheme: dark;
}

*, *::before, *::after {
  box-sizing: border-box;
  font-variation-settings: "CASL" var(--casl), "MONO" var(--mono), "CRSV" var(--crsv), "slnt" var(--slnt), "GRAD" var(--grad);
}

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Recursive", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: var(--u-wght);
  --casl: var(--u-casl);
  --mono: var(--u-mono);
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
em, i { font-style: normal; --slnt: -12; --crsv: 1; }
strong, b { font-weight: 750; }
code, kbd, pre, samp { font-family: "Recursive", ui-monospace, monospace; --mono: 1; --casl: 0; --slnt: 0; }
:not(pre) > code { font-size: .92em; background: var(--surface-2); padding: .08em .35em; border-radius: 4px; border: 1px solid var(--line); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

[hidden] { display: none !important; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--ground); padding: .6rem 1rem; border-radius: 6px; text-decoration: none; font-weight: 700;
}
.skip:focus { top: 1rem; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* --------------------------------------------------------------------------
   Type roles
   -------------------------------------------------------------------------- */

.display {
  font-family: "Roboto Flex", "Recursive", system-ui, sans-serif;
  font-optical-sizing: auto;
  font-weight: 780;
  font-stretch: var(--u-wdth);
  line-height: .95;
  letter-spacing: -.01em;
  margin: 0;
  text-wrap: balance;
}

.h-page { font-size: clamp(2.9rem, 8.5vw, 7.5rem); }
.h-section { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1; }
.h-sub { font-family: "Recursive", sans-serif; font-size: clamp(1.35rem, 2vw, 1.6rem); font-weight: 720; line-height: 1.2; margin: 0; }

.label {
  font-family: "Recursive", monospace;
  --mono: 1; --casl: 0; --slnt: 0;
  font-size: .875rem;
  font-weight: 520;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede { font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.5; color: var(--ink); max-width: 44ch; }
.muted { color: var(--muted); }

/* Axis coordinate annotations: decorative, echo the values in use */
.coord {
  font-family: "Recursive", monospace;
  --mono: 1; --casl: 0; --slnt: 0;
  font-size: .875rem; font-weight: 450;
  color: var(--signal);
  letter-spacing: .02em;
}

/* Collection voices: identity carried by axes, not by color */
.voice-ai { --casl: 1; }
.voice-garden { --casl: 0; }
.voice-tools { --mono: 1; --casl: 0; }
.voice-story { --casl: 1; --slnt: -14; --crsv: 1; }

/* --------------------------------------------------------------------------
   Rulers: tick marks drawn with gradients, used as section separators
   -------------------------------------------------------------------------- */
.ruler {
  height: 18px;
  border-top: 1px solid var(--line-strong);
  background:
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 80px) top left / 100% 16px no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 10px) top left / 100% 7px no-repeat;
}

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 4.25rem; }

.mark { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; margin-right: auto; }
.mark-glyph {
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; border-radius: 8px;
  background: var(--brand); color: var(--on-brand);
  font-family: "Recursive", sans-serif; font-size: 1.2rem; font-weight: 900;
  --casl: 1; --slnt: -8; --crsv: 1;
}
.mark-word {
  font-family: "Roboto Flex", sans-serif; font-size: 1.4rem; font-weight: 700; font-stretch: 80%;
  letter-spacing: -.01em;
  transition: font-stretch .35s var(--ease), font-weight .35s var(--ease);
}
.mark:hover .mark-word, .mark:focus-visible .mark-word { font-stretch: 130%; font-weight: 900; }

.nav-list { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .8rem;
  text-decoration: none; font-size: 1rem; font-weight: 480; border-radius: 6px;
  --casl: 0;
  transition: font-weight .2s var(--ease), font-variation-settings .2s var(--ease), background-color .2s;
}
.nav-list a:hover { font-weight: 760; --casl: 1; background: var(--surface-2); }
.nav-list a[aria-current="page"] { font-weight: 850; --casl: 1; box-shadow: inset 0 -3px 0 var(--signal); border-radius: 6px 6px 0 0; }

.head-tools { display: flex; gap: .4rem; }
.tool-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-width: 44px; min-height: 44px; padding: 0 .75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  font-family: "Recursive", monospace; --mono: 1; font-size: .9375rem; font-weight: 560;
  transition: background-color .15s, border-color .15s;
}
.tool-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.tool-btn[aria-expanded="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.tool-btn svg { width: 20px; height: 20px; }
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-icon-moon { display: none; }
}
.menu-btn { display: none; }

@media (max-width: 880px) {
  .menu-btn { display: inline-flex; }
  .site-head nav { position: absolute; inset: 100% 0 auto 0; }
  .nav-list {
    display: none; flex-direction: column; gap: 0;
    background: var(--ground); border-bottom: 1px solid var(--line); padding: .5rem var(--gutter) 1rem;
  }
  .nav-list.is-open { display: flex; }
  .nav-list a { width: 100%; font-size: 1.35rem; min-height: 52px; }
  .nav-list a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--signal); border-radius: 0; }
  .axes-label { display: none; }
}

/* --------------------------------------------------------------------------
   Axes console (reader-tunable type)
   -------------------------------------------------------------------------- */
.axes-panel {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); top: 5rem; z-index: 60;
  width: min(23rem, calc(100vw - 2rem));
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / .45);
  padding: 1.25rem 1.25rem 1rem;
}
.axes-panel[hidden] { display: none; }
.axes-panel h2 { margin: 0 0 .25rem; font-size: 1.25rem; font-weight: 800; --casl: 1; }
.axes-panel p { margin: 0 0 1rem; font-size: 1rem; color: var(--muted); line-height: 1.45; }
.axis-row { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; margin-bottom: .9rem; }
.axis-row label { font-weight: 650; font-size: 1rem; }
.axis-row output { font-family: "Recursive", monospace; --mono: 1; font-size: .9375rem; color: var(--signal); }
.axis-row input { grid-column: 1 / -1; width: 100%; accent-color: var(--brand); min-height: 32px; }
.axis-row .hint { grid-column: 1 / -1; font-size: .875rem; color: var(--muted); }
.axes-actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-top: 1px solid var(--line); padding-top: .8rem; }

/* --------------------------------------------------------------------------
   Buttons & links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.3rem; border-radius: 8px; cursor: pointer;
  text-decoration: none; font-weight: 650; font-size: 1.0625rem;
  border: 1px solid transparent;
  transition: font-weight .2s var(--ease), font-variation-settings .25s var(--ease), background-color .15s, transform .1s;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { font-weight: 850; --casl: 1; }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: transparent; border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); --casl: 1; font-weight: 780; }
.btn-quiet { background: none; padding-inline: .2rem; color: var(--muted); text-decoration: underline; text-underline-offset: .25em; }
.btn-quiet:hover { color: var(--ink); --slnt: -10; }
.btn[aria-busy="true"] { opacity: .75; cursor: progress; }

.link-axis {
  color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
  font-weight: 620;
  transition: font-weight .2s var(--ease), font-variation-settings .2s var(--ease);
}
.link-axis:hover { font-weight: 820; --casl: 1; text-decoration-thickness: 2px; }

.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem 2rem; margin-bottom: 2rem; }
.section-head p { margin: .6rem 0 0; color: var(--muted); font-size: 1.125rem; }

/* --------------------------------------------------------------------------
   Scroll-driven axis animation (progressive enhancement)
   Unsupported browsers or reduced motion: static at the end state.
   -------------------------------------------------------------------------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .scroll-axis {
      animation: axis-open linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 40%;
    }
    .scroll-slant {
      animation: axis-slant linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 50%;
    }
    .foot-wordmark {
      animation: axis-stretch linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }
  }
}
@keyframes axis-open { from { font-weight: 200; font-stretch: 40%; } to { font-weight: 780; font-stretch: var(--u-wdth); } }
@keyframes axis-slant { from { --slnt: 0; --casl: 0; font-weight: 400; } to { --slnt: -14; --casl: 1; font-weight: 800; } }
@keyframes axis-stretch { from { font-stretch: 25%; font-weight: 150; } to { font-stretch: 151%; font-weight: 1000; } }
@property --slnt { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --casl { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --mono { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --grad { syntax: "<number>"; inherits: true; initial-value: 0; }

/* --------------------------------------------------------------------------
   Home hero
   -------------------------------------------------------------------------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 3rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); align-items: end; }
.hero-title { font-size: clamp(3rem, 7.6vw, 7.4rem); line-height: .93; }
.hero-title .w { display: inline-block; }
.hero-title .w-build { font-weight: 950; font-stretch: 125%; }
.hero-title .w-ai { font-family: "Recursive", monospace; --mono: 1; font-weight: 900; color: var(--brand); letter-spacing: -.04em; }
.hero-title .w-write { font-family: "Recursive", sans-serif; --casl: 1; --slnt: -15; --crsv: 1; font-weight: 800; }
.hero-title .w-learn { font-weight: 250; font-stretch: 60%; }
.hero-title .ch { display: inline-block; transition: font-variation-settings .25s var(--ease); }
.hero-sub { margin: 1.75rem 0 0; }
.hero-coords { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin-top: 1.25rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-top: 2rem; }

.portrait {
  position: relative; margin: 0;
  border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden;
  background: linear-gradient(160deg, var(--surface-2), var(--brand));
  aspect-ratio: 4 / 5;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 25% 30%; }
.portrait figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 2.5rem 1rem .8rem;
  background: linear-gradient(transparent, rgb(8 10 14 / .82));
  color: #f3efe4; font-family: "Recursive", monospace; --mono: 1; font-size: .875rem;
}

/* Stats specimen */
.stat-specimen {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden;
}
.stat-specimen > div { background: var(--surface); padding: 1.4rem 1.5rem 1.2rem; display: grid; gap: .3rem; }
.stat-num { font-family: "Roboto Flex", sans-serif; font-size: clamp(2.6rem, 5vw, 4.5rem); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-specimen > div:nth-child(1) .stat-num { font-weight: 1000; font-stretch: 140%; }
.stat-specimen > div:nth-child(2) .stat-num { font-weight: 560; font-stretch: 100%; }
.stat-specimen > div:nth-child(3) .stat-num { font-weight: 180; font-stretch: 40%; }
.stat-label { font-size: 1.0625rem; font-weight: 600; }

/* Voices legend */
.voices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.voice-card { background: var(--surface); padding: 1.5rem; display: grid; gap: .6rem; align-content: start; text-decoration: none; }
.voice-card .specimen { font-size: 3.4rem; line-height: 1; font-weight: 700; transition: font-weight .3s var(--ease); }
.voice-card:hover .specimen { font-weight: 1000; }
.voice-card .h-sub { font-size: 1.3rem; }
.voice-card p { margin: 0; color: var(--muted); font-size: 1rem; }

/* --------------------------------------------------------------------------
   Sections & lists
   -------------------------------------------------------------------------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section + .section { padding-top: 0; }
.section-band { background: var(--surface); border-block: 1px solid var(--line); }

/* Article rows: the archive format */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.row { border-bottom: 1px solid var(--line); }
.row-link {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) auto; gap: .4rem 2rem; align-items: baseline;
  padding: 1.35rem .25rem; text-decoration: none;
  transition: background-color .15s;
}
.row-link:hover { background: var(--surface); }
.row-date { font-family: "Recursive", monospace; --mono: 1; --casl: 0; --slnt: 0; font-size: .9375rem; color: var(--muted); }
.row-title {
  font-size: clamp(1.3rem, 2.1vw, 1.7rem); font-weight: 650; line-height: 1.2;
  transition: font-weight .25s var(--ease), font-variation-settings .25s var(--ease);
}
.row-link:hover .row-title, .row-link:focus-visible .row-title { font-weight: 880; --slnt: -10; }
.row-desc { grid-column: 2; margin: .35rem 0 0; color: var(--muted); font-size: 1.0625rem; max-width: 70ch; --casl: 0; --slnt: 0; --mono: 0; }
.row-meta { grid-column: 3; grid-row: 1; }
.row-tags { grid-column: 2; display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }

.chip {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 .6rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-family: "Recursive", monospace; --mono: 1; --casl: 0; --slnt: 0; font-size: .875rem; color: var(--muted);
}
.badge {
  display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 5px;
  font-family: "Recursive", monospace; --mono: 1; --casl: 0; --slnt: 0; font-size: .875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--ink); color: var(--ground);
}
.badge-signal { background: var(--signal); color: var(--ground); }
.badge-outline { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }

/* Feature shelf ("start here") */
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 2rem); }
.feature { display: grid; grid-template-rows: auto 1fr; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color .15s, transform .2s var(--ease); }
.feature:hover { border-color: var(--line-strong); }
.feature-img { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--brand) 40%, var(--surface-2))); overflow: hidden; }
.feature-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.feature:hover .feature-img img { transform: scale(1.03); }
.feature-body { padding: 1.3rem 1.4rem 1.5rem; display: grid; gap: .6rem; align-content: start; }
.feature-title { font-size: 1.5rem; line-height: 1.2; font-weight: 700; margin: 0; transition: font-weight .25s var(--ease), font-variation-settings .25s var(--ease); }
.feature:hover .feature-title { font-weight: 900; --slnt: -10; }
.feature-body p { margin: 0; color: var(--muted); font-size: 1.0625rem; --casl: 0; --slnt: 0; }
.feature-meta { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; }

/* Two-column block */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); }
.split-wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

/* Experiment grid (hairline) */
.hairline-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hairline-grid > * { background: var(--surface); padding: 1.5rem; }
.tile { display: grid; gap: .6rem; align-content: start; text-decoration: none; transition: background-color .15s; }
.tile:hover { background: var(--surface-2); }
.tile h3 { margin: 0; font-size: 1.35rem; font-weight: 720; line-height: 1.2; transition: font-weight .25s var(--ease), font-variation-settings .25s var(--ease); }
.tile:hover h3 { font-weight: 900; --casl: 1; }
.tile p { margin: 0; color: var(--muted); font-size: 1.0625rem; }

/* Dark instrument panel */
.panel {
  background: #12161c; color: #ece7db; border-radius: 16px; padding: clamp(1.75rem, 4vw, 3.5rem);
  --muted-panel: #aab3c0;
  border: 1px solid #2a313c;
}
.panel .label { color: #aab3c0; }
.panel .coord { color: #ff9f70; }
.panel .muted { color: #aab3c0; }
.panel .btn-primary { background: #ece7db; color: #12161c; }
.panel a:not(.btn) { color: #cfe0f3; }

/* --------------------------------------------------------------------------
   Page heads (inner pages)
   -------------------------------------------------------------------------- */
.page-head { padding: clamp(2.5rem, 6vw, 5rem) 0 2.5rem; border-bottom: 1px solid var(--line); }
.page-head-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2rem 3rem; align-items: end; }
.page-head .lede { margin: 1.5rem 0 0; }
.axis-readout { display: grid; gap: .35rem; justify-items: start; padding: 1rem 1.1rem; border-left: 3px solid var(--signal); background: var(--surface); border-radius: 0 10px 10px 0; }
.axis-readout .label { color: var(--ink); }
.page-head-img { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; background: linear-gradient(135deg, #1b2a3b, #364f6a); }
.page-head-img img { width: 100%; height: 100%; object-fit: cover; }

/* Jump / filter bar */
.jumpbar { position: sticky; top: 4.25rem; z-index: 20; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.jumpbar ul { display: flex; gap: .4rem; list-style: none; margin: 0; padding: .6rem 0; overflow-x: auto; scrollbar-width: thin; }
.jumpbar a, .filter-btn {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .95rem; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; cursor: pointer;
  font-size: 1rem; font-weight: 520;
  transition: font-weight .2s var(--ease), font-variation-settings .2s var(--ease), background-color .15s;
}
.jumpbar a:hover, .filter-btn:hover { font-weight: 760; --casl: 1; }
.filter-btn[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); font-weight: 800; }
.count { font-family: "Recursive", monospace; --mono: 1; --casl: 0; font-size: .875rem; opacity: .85; }

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */
.featured-project { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden; background: var(--surface); }
.featured-project .fp-body { padding: clamp(1.5rem, 3vw, 2.75rem); display: grid; gap: 1.1rem; align-content: start; }
.featured-project .fp-img { background: #0f2033; min-height: 320px; }
.featured-project .fp-img img { width: 100%; height: 100%; object-fit: cover; }
.fp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fp-stats > div { background: var(--ground); padding: .9rem 1rem; }
.fp-stats strong { display: block; font-family: "Roboto Flex", sans-serif; font-size: 2.4rem; line-height: 1; font-weight: 900; font-stretch: 120%; }

/* Star-weighted specimen list: name weight encodes GitHub stars */
.star-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.star-list li { border-bottom: 1px solid var(--line); }
.star-link { display: grid; grid-template-columns: minmax(0, 1fr) 7rem; gap: .3rem 1.5rem; padding: 1.2rem .25rem; text-decoration: none; align-items: baseline; }
.star-link:hover { background: var(--surface); }
.star-name { font-family: "Roboto Flex", sans-serif; font-size: clamp(1.7rem, 3.4vw, 2.8rem); line-height: 1.05; font-weight: var(--w, 400); font-stretch: var(--s, 100%); transition: font-stretch .3s var(--ease); }
.star-link:hover .star-name { font-stretch: 130%; }
.star-count { justify-self: end; font-family: "Recursive", monospace; --mono: 1; font-size: 1rem; font-weight: 700; }
.star-desc { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 1.0625rem; max-width: 72ch; }
.star-scale { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.25rem; }
.star-scale .ramp { font-family: "Roboto Flex", sans-serif; font-size: 1.5rem; }

.proj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.proj { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; }
.proj:hover { border-color: var(--line-strong); }
.proj-img { aspect-ratio: 16 / 10; background: #0d1116; overflow: hidden; display: grid; place-items: center; }
.proj-img img { width: 100%; height: 100%; object-fit: cover; }
.proj-img.contain img { object-fit: contain; }
.proj-img.no-img { background: repeating-linear-gradient(135deg, var(--surface-2) 0 12px, var(--surface) 12px 24px); }
.proj-img.no-img span { font-family: "Roboto Flex", sans-serif; font-weight: 1000; font-stretch: 151%; font-size: 3.2rem; color: var(--brand); }
.proj-body { padding: 1.2rem 1.3rem 1.4rem; display: grid; gap: .55rem; align-content: start; }
.proj-body h3 { margin: 0; font-size: 1.35rem; font-weight: 750; transition: font-weight .25s, font-variation-settings .25s; }
.proj:hover .proj-body h3 { font-weight: 950; --casl: 1; }
.proj-body p { margin: 0; color: var(--muted); font-size: 1.0625rem; }
.tech { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }

/* --------------------------------------------------------------------------
   Article
   -------------------------------------------------------------------------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 70; background: transparent; }
.progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: var(--signal); }

.article-head { padding: clamp(2.5rem, 5vw, 4.5rem) 0 2.5rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.5rem; }
.crumbs a { font-weight: 650; }
.article-title { font-size: clamp(2.7rem, 7vw, 6.4rem); max-width: 16ch; }
.article-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1.6rem; align-items: center; }
.article-hero { margin: 2.5rem 0 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #0f1720; aspect-ratio: 21 / 8; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }

.article-layout { display: grid; grid-template-columns: 15rem minmax(0, 46rem) minmax(0, 1fr); gap: 3rem; padding-top: 3rem; }
.toc { position: sticky; top: 6rem; align-self: start; }
.toc ol { list-style: none; margin: .8rem 0 0; padding: 0; border-left: 1px solid var(--line-strong); }
.toc a {
  display: block; padding: .45rem 0 .45rem 1rem; margin-left: -1px; border-left: 3px solid transparent;
  text-decoration: none; color: var(--muted); font-size: 1rem; line-height: 1.35;
  transition: font-weight .25s var(--ease), font-variation-settings .25s var(--ease), color .2s;
}
.toc a:hover { color: var(--ink); --casl: 1; }
.toc a[aria-current="true"] { color: var(--ink); font-weight: 800; --casl: 1; border-left-color: var(--signal); }
.toc-mobile { display: none; }

.prose { font-size: 1.1875rem; line-height: 1.7; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.35rem; }
.prose h2 { font-family: "Roboto Flex", sans-serif; font-size: clamp(2rem, 3.4vw, 2.75rem); line-height: 1.05; font-weight: 780; margin: 3.5rem 0 0; scroll-margin-top: 6rem; }
.prose h2 + * { margin-top: 1rem; }
.prose ol, .prose ul { padding-left: 1.4rem; margin-bottom: 0; }
.prose li + li { margin-top: .4rem; }
.prose li::marker { font-family: "Recursive", monospace; --mono: 1; color: var(--signal); font-weight: 700; }
.prose a { color: var(--brand); font-weight: 620; text-underline-offset: .2em; transition: font-weight .2s, font-variation-settings .2s; }
.prose a:hover { font-weight: 800; --casl: 1; }

.callout { margin: 0; padding: 1.1rem 1.3rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.callout p { margin: 0; }
.callout-tag { display: inline-block; margin-bottom: .35rem; }
.callout-why { border-left: 4px solid var(--brand); --casl: 1; --slnt: -6; }
.callout-why .callout-tag { font-family: "Recursive", sans-serif; font-size: 1.15rem; font-weight: 900; --slnt: -15; --crsv: 1; color: var(--brand); }
.callout-q { border: 1px dashed var(--line-strong); background: transparent; }
.callout-q p { --mono: 1; --casl: 0; font-size: 1.0625rem; }
.callout-q .callout-tag { color: var(--signal); }
.callout-note { border-left: 4px solid var(--signal); }
.callout-skill { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }

.code {
  position: relative; margin-inline: 0; border-radius: 12px; overflow: hidden;
  background: var(--code-bg); color: var(--code-ink); border: 1px solid #2a313c;
}
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: .4rem .5rem .4rem 1rem; border-bottom: 1px solid #2a313c; }
.code-bar .label { color: var(--code-dim); }
.copy-btn {
  min-height: 36px; padding: 0 .8rem; border-radius: 6px; cursor: pointer;
  background: #2a313c; color: #ece7db; border: 1px solid #3b4452;
  font-family: "Recursive", monospace; --mono: 1; font-size: .875rem; font-weight: 600;
}
.copy-btn:hover { background: #38414f; }
.code pre { margin: 0; padding: 1.1rem 1.2rem 1.3rem; overflow-x: auto; font-size: .95rem; line-height: 1.6; tab-size: 2; }
.code .c { color: #8e9aab; --slnt: -12; --casl: 1; }
.code .k { color: #ff9f70; font-weight: 650; }
.code .s { color: #a8d8a0; }
.code .t { color: #93c1ef; }

.wide-breakout { margin-inline: -2rem; }

.article-end { border-top: 1px solid var(--line-strong); margin-top: 4rem; padding-top: 2rem; display: grid; gap: 2rem; }
.share { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.news-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
.news-form { display: grid; gap: .6rem; align-content: start; }
.news-form .field { display: flex; gap: .5rem; flex-wrap: wrap; }
.news-form input[type="email"] {
  flex: 1 1 14rem; min-height: 48px; padding: 0 1rem; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 1.0625rem;
}
.panel .news-form input[type="email"] { background: #1d232c; border-color: #3b4452; color: #ece7db; }
.form-msg { min-height: 1.5em; font-size: 1rem; margin: 0; }
.form-msg.is-error { color: var(--signal); }
.panel .form-msg.is-error { color: #ff9f70; }
.form-msg.is-success { font-weight: 700; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: 1rem; }
.consent input { width: 20px; height: 20px; margin-top: .2rem; accent-color: var(--brand); }

/* --------------------------------------------------------------------------
   AI / stories
   -------------------------------------------------------------------------- */
.consult-strip { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; padding: 1.5rem 1.75rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.consult-strip p { margin: 0; font-size: 1.25rem; font-weight: 600; --casl: 1; max-width: 48ch; }

.ai-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.ai-card { display: grid; grid-template-rows: auto 1fr; text-decoration: none; border-top: 3px solid var(--ink); padding-top: 1rem; }
.ai-card .ai-img { aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, #1b2a3b, #364f6a); margin-bottom: 1rem; }
.ai-card .ai-img img { width: 100%; height: 100%; object-fit: cover; }
.ai-card h3 { margin: .4rem 0 .5rem; font-size: 1.45rem; line-height: 1.2; font-weight: 720; --casl: 1; transition: font-weight .25s, font-variation-settings .25s; }
.ai-card:hover h3 { font-weight: 950; --slnt: -12; }
.ai-card p { margin: 0; color: var(--muted); font-size: 1.0625rem; --casl: 0; }

.story-shelf { display: grid; gap: 0; border-top: 1px solid #3a4250; }
.story { display: grid; grid-template-columns: 6rem minmax(0, 1fr) minmax(0, 18rem); gap: 1.5rem 2.5rem; padding: 2rem 0; border-bottom: 1px solid #3a4250; text-decoration: none; align-items: start; }
.story-part { font-family: "Roboto Flex", sans-serif; font-size: 4.5rem; line-height: .9; font-weight: 100; font-stretch: 25%; transition: font-weight .4s var(--ease), font-stretch .4s var(--ease); }
.story:hover .story-part { font-weight: 1000; font-stretch: 151%; }
.story h3 { margin: 0 0 .6rem; font-size: clamp(1.6rem, 2.8vw, 2.3rem); line-height: 1.1; font-weight: 700; }
.story p { margin: 0; color: #c3cad4; font-size: 1.0625rem; --casl: 0; --slnt: 0; --crsv: .5; }
.story-img { border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; background: #1e2733; }
.story-img img { width: 100%; height: 100%; object-fit: cover; }
.story.is-soon { opacity: .75; }
.notice { border: 1px solid #ff9f70; border-radius: 10px; padding: 1rem 1.2rem; color: #ece7db; }
.notice strong { color: #ffc3a3; }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding: clamp(2.5rem, 5vw, 4.5rem) 0; }
.about-photo { border-radius: 16px; overflow: hidden; aspect-ratio: 4/5; background: linear-gradient(160deg, #3b5a3e, #1b2a3b); border: 1px solid var(--line); margin: 0; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.name-stack { font-size: clamp(3rem, 9vw, 8rem); line-height: .88; }
.name-stack span { display: block; }
.name-stack .n1 { font-weight: 200; font-stretch: 35%; }
.name-stack .n2 { font-weight: 1000; font-stretch: 140%; }

.career-bar { display: grid; grid-template-columns: 1.2fr 1fr 1fr .6fr 3fr 5fr 1fr 3fr; gap: 3px; margin: 1.5rem 0 2.5rem; }
.career-bar div { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 6px; padding: .6rem .6rem; min-width: 0; }
.career-bar div:first-child { border-top-color: var(--signal); }
.career-bar b { display: block; font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.career-bar span { font-family: "Recursive", monospace; --mono: 1; font-size: .875rem; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.phase { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1rem 3rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.phase h3 { margin: 0; font-family: "Roboto Flex", sans-serif; font-size: 1.9rem; line-height: 1.05; }
.phase:nth-child(1) h3 { font-weight: 1000; font-stretch: 130%; }
.phase:nth-child(2) h3 { font-weight: 760; font-stretch: 105%; }
.phase:nth-child(3) h3 { font-weight: 520; font-stretch: 80%; }
.phase:nth-child(4) h3 { font-weight: 280; font-stretch: 55%; }
.phase p { margin: 0 0 .8rem; }
.roles { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.roles li { display: flex; flex-wrap: wrap; gap: .2rem 1rem; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: .45rem; }
.roles li span:last-child { font-family: "Recursive", monospace; --mono: 1; font-size: .9375rem; color: var(--muted); }
.role-bullets { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--ink); }
.role-bullets li + li { margin-top: .4rem; }

.principles { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0; counter-reset: pr; }
.principles li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 2rem; align-items: baseline; padding: 1.2rem 0; border-top: 1px solid #2d3440; }
.principles q { font-size: clamp(1.4rem, 2.8vw, 2.25rem); line-height: 1.2; quotes: "“" "”"; }
.principles li:nth-child(1) q { font-weight: 900; --casl: 1; }
.principles li:nth-child(2) q { font-weight: 500; --casl: 1; --slnt: -15; --crsv: 1; }
.principles li:nth-child(3) q { font-weight: 700; --mono: 1; --casl: 0; }
.principles li:nth-child(4) q { font-weight: 350; --casl: 0; }
.principles li:nth-child(5) q { font-weight: 1000; --casl: .5; --slnt: -8; }

.cap-rows { display: grid; gap: 0; margin-top: 1.5rem; }
.cap-row { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: 1rem 3rem; padding: 1.5rem 0; border-top: 1px solid #2d3440; }
.cap-row h3 { margin: 0 0 .35rem; font-size: 1.35rem; font-weight: 800; --casl: 1; }
.cap-row p { margin: 0; color: #aab3c0; font-size: 1rem; }
.cap-chips { display: flex; flex-wrap: wrap; gap: .45rem; align-content: start; }
.cap-chips span { border: 1px solid #3b4452; border-radius: 6px; padding: .35rem .7rem; font-family: "Recursive", monospace; --mono: 1; font-size: .9375rem; background: #1a1f27; color: #ece7db; }

/* --------------------------------------------------------------------------
   Patterns
   -------------------------------------------------------------------------- */
.three-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.three-ways > div { background: var(--surface); padding: 1.4rem 1.5rem; }
.three-ways h3 { margin: .3rem 0 .4rem; font-size: 1.4rem; font-weight: 800; }
.three-ways p { margin: 0; color: var(--muted); font-size: 1.0625rem; }
.three-ways .w1 h3 { font-family: "Roboto Flex", sans-serif; font-stretch: 140%; font-weight: 900; }
.three-ways .w2 h3 { --mono: 1; }
.three-ways .w3 h3 { --casl: 1; --slnt: -14; --crsv: 1; }
.three-ways-foot { margin: 1rem 0 0; color: var(--muted); max-width: 80ch; }

.pattern-tools { display: grid; gap: 1rem; margin: 2.5rem 0 1.5rem; }
.search-field { position: relative; }
.search-field input {
  width: 100%; min-height: 56px; padding: 0 1rem 0 3rem; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 1.125rem;
}
.search-field svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.filter-row .pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.result-line { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.result-line select { min-height: 44px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 .7rem; font-size: 1rem; }

.pattern-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.pcard { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; transition: border-color .15s; }
.pcard:hover { border-color: var(--line-strong); }
.pthumb {
  height: 11rem; position: relative; overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: grid; place-items: center;
}
.pthumb .glyph {
  font-family: "Roboto Flex", sans-serif; font-size: 6.5rem; line-height: 1; color: var(--brand);
  font-weight: var(--gw, 700); font-stretch: var(--gs, 100%);
  transition: font-weight .45s var(--ease), font-stretch .45s var(--ease);
}
.pcard:hover .pthumb .glyph { font-weight: 1000; font-stretch: 151%; }
.pthumb .coord { position: absolute; left: .8rem; bottom: .6rem; }
.pthumb .cat-mark { position: absolute; right: .8rem; top: .7rem; }
.pbody { padding: 1.1rem 1.25rem 1.3rem; display: grid; gap: .5rem; align-content: start; }
.pbody .top { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.pbody h2 { margin: 0; font-size: 1.35rem; line-height: 1.2; font-weight: 750; transition: font-weight .25s, font-variation-settings .25s; }
.pcard:hover .pbody h2 { font-weight: 950; --casl: 1; }
.pbody p { margin: 0; color: var(--muted); font-size: 1.0625rem; }
.empty-state { text-align: center; padding: 4rem 1rem; border: 1px dashed var(--line-strong); border-radius: 12px; }
.empty-state h2 { font-family: "Roboto Flex", sans-serif; font-size: 2rem; margin: 0 0 .5rem; font-weight: 200; font-stretch: 40%; }

/* Pattern detail */
.pd-head { padding: 2.5rem 0 2rem; }
.use-cases { columns: 2; column-gap: 3rem; padding-left: 1.2rem; margin: .8rem 0 0; }
.use-cases li { margin-bottom: .4rem; break-inside: avoid; }
.panes { border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: var(--surface); margin-top: 2.5rem; }
.panes-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .5rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tablist { display: flex; flex-wrap: wrap; gap: .25rem; }
.tablist [role="tab"] {
  min-height: 44px; padding: 0 1rem; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer;
  font-size: 1rem; font-weight: 520; --mono: 1;
  transition: font-weight .2s, font-variation-settings .2s;
}
.tablist [role="tab"]:hover { font-weight: 760; }
.tablist [role="tab"][aria-selected="true"] { background: var(--surface); border-color: var(--line-strong); font-weight: 850; --mono: 0; --casl: 1; }
.pane-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.pane { padding: clamp(1rem, 3vw, 2rem); }
.pane[hidden] { display: none; }
.pane pre { margin: 0; overflow-x: auto; font-size: .95rem; line-height: 1.6; background: var(--code-bg); color: var(--code-ink); padding: 1.2rem; border-radius: 10px; }
.pane-note { margin: 0 0 1rem; color: var(--muted); font-size: 1rem; }
.prompt-text { max-width: 70ch; }
.prompt-text p { margin: 0 0 1rem; }

/* The demo pattern itself */
.stage { background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: clamp(1rem, 3vw, 1.75rem); display: grid; gap: 1rem; }
.stage-cap { margin: 0; color: var(--muted); font-size: 1rem; }
.hss-strip { display: grid; gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; grid-template-columns: 1fr; }
@container stage (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container stage (min-width: 42rem) { .hss-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hss-strip.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container stage (min-width: 50rem) { .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.stage { container: stage / inline-size; }
.hss-tile { background: var(--surface); padding: .9rem 1rem; display: grid; gap: .2rem; min-width: 0; text-align: left; border: 0; }
.hss-tile .label { font-size: .8125rem; overflow-wrap: anywhere; }
.hss-fig { font-family: "Recursive", sans-serif; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hss-fig.empty { color: var(--muted); font-weight: 400; }
.hss-sub { font-size: .9375rem; color: var(--muted); }
button.hss-tile { cursor: pointer; font: inherit; color: inherit; transition: background-color .15s; }
button.hss-tile:hover { background: var(--surface-2); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--brand) 16%, var(--surface)); box-shadow: inset 0 -3px 0 var(--brand); }
button.hss-tile[aria-pressed="true"] .hss-fig { --casl: 1; font-weight: 1000; }
.dl-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.dl-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dl-list li:last-child { border-bottom: 0; }
.dl-list li[hidden] { display: none; }
.status { font-family: "Recursive", monospace; --mono: 1; font-size: .875rem; font-weight: 700; display: inline-flex; gap: .35rem; align-items: center; }
.status::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.st-done { color: #1c6e52; } .st-dl { color: var(--brand); } .st-q { color: var(--muted); } .st-fail { color: #a03227; }
:root[data-theme="dark"] .st-done { color: #4fbe93; } :root[data-theme="dark"] .st-fail { color: #ee8579; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-done { color: #4fbe93; } :root:not([data-theme="light"]) .st-fail { color: #ee8579; } }
.live-line { margin: 0; font-size: 1rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-foot { margin-top: clamp(4rem, 8vw, 7rem); border-top: 1px solid var(--line-strong); background: var(--surface); overflow: clip; }
.foot-wordmark {
  font-family: "Roboto Flex", sans-serif; font-size: 15.5vw; line-height: .85; text-align: center;
  font-weight: 900; font-stretch: 120%; letter-spacing: -.02em; color: var(--brand);
  padding-top: 2rem; white-space: nowrap; user-select: none;
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.6fr; gap: 2.5rem; padding: 3rem 0 2rem; border-top: 1px solid var(--line); margin-top: 2rem; }
.foot-grid h2 { font-size: 1rem; margin: 0 0 .8rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.foot-grid ul a { display: inline-flex; min-height: 36px; align-items: center; text-decoration: none; transition: font-weight .2s, font-variation-settings .2s; }
.foot-grid ul a:hover { font-weight: 780; --casl: 1; text-decoration: underline; }
.foot-grid p { margin: 0; color: var(--muted); font-size: 1.0625rem; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.25rem 0 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 1rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .article-layout { grid-template-columns: 13rem minmax(0, 1fr); }
  .article-layout > .article-aside { display: none; }
  .voices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hairline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .hero-grid, .page-head-grid, .split, .split-wide, .featured-project, .about-hero, .news-card { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 30rem; aspect-ratio: 4 / 3.4; }
  .shelf, .proj-grid, .ai-grid, .pattern-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 1.5rem; }
  .toc { display: none; }
  .toc-mobile { display: block; margin-bottom: 2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .toc-mobile summary { min-height: 52px; display: flex; align-items: center; padding: 0 1rem; cursor: pointer; font-weight: 700; }
  .toc-mobile ol { margin: 0; padding: 0 1rem 1rem 2.2rem; }
  .toc-mobile li { padding: .25rem 0; }
  .wide-breakout { margin-inline: 0; }
  .three-ways { grid-template-columns: minmax(0, 1fr); }
  .story { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .story-img { grid-column: 2; max-width: 22rem; }
  .career-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .about-photo { max-width: 26rem; aspect-ratio: 1; }
}
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .prose { font-size: 1.125rem; }
  .shelf, .proj-grid, .ai-grid, .pattern-grid, .voices, .hairline-grid, .stat-specimen, .fp-stats { grid-template-columns: minmax(0, 1fr); }
  .stat-specimen > div { grid-template-columns: auto 1fr; align-items: baseline; gap: 1rem; }
  .row-link { grid-template-columns: minmax(0, 1fr); }
  .row-desc, .row-tags { grid-column: 1; }
  .row-meta { grid-column: 1; grid-row: auto; }
  .phase, .cap-row { grid-template-columns: minmax(0, 1fr); }
  .career-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .use-cases { columns: 1; }
  .principles li { grid-template-columns: minmax(0, 1fr); }
  .star-link { grid-template-columns: minmax(0, 1fr) auto; }
  .story { grid-template-columns: minmax(0, 1fr); }
  .story-img { grid-column: 1; }
  .article-hero { aspect-ratio: 16 / 9; }
  .hero-title { font-size: clamp(2.7rem, 13vw, 4rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}

/* UI pattern library article */
.prose .prose-fig { margin: 2rem 0; aspect-ratio: auto; background: transparent; }
.prose .prose-fig img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; display: block; }
.prose .callout p + p { margin-top: .8rem; }
.prose .live-pattern a.btn { white-space: normal; text-decoration: none; color: var(--on-brand); }
.prose p code { overflow-wrap: anywhere; }
.prose > * + p, .prose > * + aside { margin-top: 1.35rem; }
