/* Modrn Magic site styles. Tokens and rules are documented in _docs/DESIGN.md. */

@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-var.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
/* Arial sized to Figtree's widths and vertical metrics (measured in Chromium), so text that
   paints before Figtree loads wraps the same way and the home hero does not jump when it
   swaps in. Two faces: Arial Bold is wider than Figtree at 650, Arial regular is not.
   Where Arial is not installed (Android), the stack falls through to the system font as before. */
@font-face {
  font-family: "Figtree Fallback";
  src: local("Arial"), local("ArialMT");
  font-weight: 100 549;
  size-adjust: 102%;
  ascent-override: 93.14%;
  descent-override: 24.51%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Figtree Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Arial");
  font-weight: 550 900;
  size-adjust: 96.1%;
  ascent-override: 98.86%;
  descent-override: 26.01%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #eef0f4;
  --wash-1: rgb(255 122 89 / .16);
  --wash-2: rgb(80 170 255 / .14);
  --wash-3: rgb(120 220 160 / .12);
  --surface: rgb(255 255 255 / .62);
  --surface-solid: #fafbfc;
  --surface-sunk: rgb(20 24 34 / .045);
  --line: rgb(20 24 34 / .09);
  --highlight: rgb(255 255 255 / .75);
  --ink: #14161b;
  --ink-2: #474d59;
  --ink-3: #5f6674;
  --accent: #d9482a;
  --accent-ink: #ffffff;
  --status-live: #1f7a45;
  --status-lab: #875700;
  --status-archived: var(--ink-3);
  /* Text on a near-black product cell, the same in both themes */
  --on-dark: #eceef3;
  --on-dark-2: #c3c8d2;
  --on-dark-3: #aab0bb;
  --on-dark-live: #62d394;
  --on-dark-sunk: rgb(255 255 255 / .1);
  --shot-shadow: rgb(20 24 34 / .18);   /* drop shadow under framed device shots */
  --shadow-icon: 0 6px 16px rgb(20 24 34 / .12);
  --on-tint: #14161b;   /* letter on a light icon tile, the same in both themes */
  --shadow-1: 0 1px 2px rgb(20 24 34 / .04), 0 8px 24px rgb(20 24 34 / .06);
  --shadow-2: 0 2px 6px rgb(20 24 34 / .06), 0 24px 56px rgb(20 24 34 / .12);

  --t-display: clamp(2.5rem, 1.7rem + 3.4vw, 4.25rem);
  --t-h1: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  --t-h2: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);
  --t-h3: 1.25rem;
  --t-body: 1.0625rem;
  --t-small: .9375rem;
  --t-meta: .8125rem;
  --t-micro: .6875rem;   /* store button sub-line only ("Download on the") */

  --r-pill: 999px;
  --r-card: 22px;
  --r-sheet: 32px;
  --r-shot: 18px;
  --r-shot-phone: 28px;   /* phone shots echo device corners */
  --r-icon: 22.5%;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --w-content: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: var(--s-9);

  --d-fast: 140ms;
  --d-base: 240ms;
  --d-slow: 520ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --d-stagger: 50ms;   /* delay between items in one reveal */
  --d-settle: 900ms;   /* the hero's one-time settle on load */

  --nav-clear: 88px;   /* sticky nav height plus its offset and air: scroll margin and sticky tops */

  /* z-index scale: content 0, nav 10, skip link 20 */
  --z-nav: 10;
  --z-skip: 20;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0d10;
    --wash-1: rgb(255 110 80 / .11);
    --wash-2: rgb(70 140 255 / .10);
    --wash-3: rgb(90 200 140 / .07);
    --surface: rgb(28 30 36 / .58);
    --surface-solid: #16181d;
    --surface-sunk: rgb(255 255 255 / .045);
    --line: rgb(255 255 255 / .085);
    --highlight: rgb(255 255 255 / .07);
    --ink: #eceef3;
    --ink-2: #b0b5c0;
    --ink-3: #9197a3;
    --accent: #ff7d5c;
    --accent-ink: #1a0d09;
    --status-live: #62d394;
    --status-lab: #f0b44c;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .28);
    --shadow-2: 0 2px 6px rgb(0 0 0 / .35), 0 24px 56px rgb(0 0 0 / .45);
    --shot-shadow: rgb(0 0 0 / .5);
    --shadow-icon: 0 6px 16px rgb(0 0 0 / .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0d10;
  --wash-1: rgb(255 110 80 / .11);
  --wash-2: rgb(70 140 255 / .10);
  --wash-3: rgb(90 200 140 / .07);
  --surface: rgb(28 30 36 / .58);
  --surface-solid: #16181d;
  --surface-sunk: rgb(255 255 255 / .045);
  --line: rgb(255 255 255 / .085);
  --highlight: rgb(255 255 255 / .07);
  --ink: #eceef3;
  --ink-2: #b0b5c0;
  --ink-3: #9197a3;
  --accent: #ff7d5c;
  --accent-ink: #1a0d09;
  --status-live: #62d394;
  --status-lab: #f0b44c;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .28);
  --shadow-2: 0 2px 6px rgb(0 0 0 / .35), 0 24px 56px rgb(0 0 0 / .45);
  --shot-shadow: rgb(0 0 0 / .5);
  --shadow-icon: 0 6px 16px rgb(0 0 0 / .4);
}

@media (max-width: 767px) {
  :root { --section: var(--s-8); }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Figtree", "Figtree Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--t-body);
  font-weight: 420;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  overflow-x: clip;
}
/* Fixed color wash behind the glass. Painted once, never scrolls. */
body::before {
  content: "";
  position: fixed;
  inset: -10vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40vmax 34vmax at 8% 4%, var(--wash-1), transparent 70%),
    radial-gradient(42vmax 36vmax at 96% 12%, var(--wash-2), transparent 70%),
    radial-gradient(46vmax 36vmax at 60% 100%, var(--wash-3), transparent 70%);
}
img { display: block; max-width: 100%; height: auto; }
a {
  color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color var(--d-fast) var(--ease-out);
}
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 620; text-wrap: balance; overflow-wrap: break-word; }
p, li, dd, summary { overflow-wrap: break-word; }   /* a long word or URL wraps instead of widening the page under large text */
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s-4); top: var(--s-4); z-index: var(--z-skip); transform: translateY(-80px);
  background: var(--ink); color: var(--bg); padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill); text-decoration: none;
}
.skip:focus { transform: none; color: var(--bg); }

.about > *, .p-body > *, .hero > *, .bento > *, .features > * { min-width: 0; }
.wrap { width: min(var(--w-content), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: var(--section); }
.prose { max-width: 62ch; color: var(--ink-2); }
.prose p + p { margin-top: var(--s-4); }
.lead { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); color: var(--ink-2); max-width: 29.477em; } /* 46ch of Figtree 400, in em so the fallback font gets the same box */
.h2 { font-size: var(--t-h2); letter-spacing: -.025em; line-height: 1.1; }
.h3 { font-size: var(--t-h3); letter-spacing: -.01em; line-height: 1.3; font-weight: 600; }
.meta { font-size: var(--t-meta); font-weight: 550; letter-spacing: .01em; color: var(--ink-3); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); margin-bottom: var(--s-7); }

/* ---------- Glass ---------- */
.glass {
  background: var(--surface);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-1);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--surface-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: var(--s-3); z-index: var(--z-nav);
  width: min(var(--w-content), 100% - 2 * var(--gutter));
  margin: var(--s-3) auto 0;
  min-height: 56px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2);   /* wraps only under large text zoom, never sideways off screen */
  padding: 0 var(--s-2) 0 var(--s-3);
  border-radius: var(--r-pill);
}
.brand {
  display: flex; align-items: center; gap: var(--s-2);
  text-decoration: none; font-weight: 650; letter-spacing: -.01em; margin-right: auto;
  white-space: nowrap;
  min-height: 44px; padding: 0 var(--s-2); margin-left: calc(-1 * var(--s-2)); border-radius: var(--r-pill);   /* 44px touch floor from padding; the mark stays where it was */
}
.brand img { width: 30px; height: 30px; }
.brand:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;   /* touch floor */
  text-decoration: none; font-size: var(--t-small); font-weight: 520; color: var(--ink-2);
  padding: 0 var(--s-3); border-radius: var(--r-pill);
  transition: background-color var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--surface-sunk); color: var(--ink); }
.theme-toggle {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background-color var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out), transform var(--d-fast) var(--ease-out);
}
/* Without JavaScript the toggle cannot work, so it keeps its slot but is not shown or focusable. */
:root:not(.js) .theme-toggle { visibility: hidden; }
.theme-toggle:hover { background: var(--surface-sunk); color: var(--ink); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
@media (max-width: 560px) {
  .nav .brand span { display: none; }
  .nav-links a { padding: 0 var(--s-2); }
}
@media (max-width: 360px) {
  .nav { gap: 0; padding-inline: var(--s-3) var(--s-1); }
  .brand { margin-right: auto; flex: none; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 0 var(--s-1); font-size: var(--t-meta); }
}

/* ---------- Buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  border-radius: var(--r-pill); border: 1px solid transparent;
  font: inherit; font-size: var(--t-small); font-weight: 600; white-space: nowrap; max-width: 100%;
  text-decoration: none; cursor: pointer;
  transition: transform var(--d-base) var(--ease-spring), background-color var(--d-fast) var(--ease-out);
}
.btn svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 480px) { .btn { white-space: normal; overflow-wrap: anywhere; } }   /* a long label wraps instead of widening the page under large text */
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.98); transition-duration: var(--d-fast); }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-1); }
.btn-primary:hover { color: var(--bg); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.btn-accent:hover { color: var(--accent-ink); }

/* Lifted shadow (HQ decision 2026-10-02): box-shadow never transitions. A
   pseudo-element carries --shadow-2 and fades in with opacity on hover. */
.btn-primary, .btn-accent, .cell, .card, .w-card { position: relative; isolation: isolate; }
.btn-primary::after, .btn-accent::after, .cell::before, .card::before, .w-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  box-shadow: var(--shadow-2); opacity: 0; transition: opacity var(--d-base) var(--ease-out);
}
.btn-primary:hover::after, .btn-accent:hover::after, .cell:hover::before, .card:hover::before, .w-card:hover::before { opacity: 1; }
.btn-glass { color: var(--ink); }
.btn-glass:hover { color: var(--ink); }
.btn .sub { display: block; font-size: var(--t-micro); font-weight: 500; opacity: .75; line-height: 1.1; }
.btn .two { display: grid; text-align: left; line-height: 1.15; }

/* ---------- Hero (home) ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center;
  gap: var(--s-7); min-height: min(640px, calc(100dvh - 80px));
  padding-block: var(--s-7) var(--s-6);
}
.hero h1 {
  font-size: var(--t-display); letter-spacing: -.035em; line-height: 1.02; font-weight: 650;
  max-width: 8.408em; /* 13ch of Figtree 650, in em so the fallback font gets the same box */
}
.hero h1 em { font-style: normal; color: var(--ink-3); }
.hero .lead { margin-top: var(--s-5); }
.hero .btns { margin-top: var(--s-6); }
.hero-art { position: relative; aspect-ratio: 1 / 1; max-width: 540px; justify-self: end; width: 100%; }
.hero-art .phone {
  position: absolute; top: 50%; left: 50%; width: 42%;
  border-radius: var(--r-shot-phone); overflow: hidden; background: var(--surface-solid);
  box-shadow: var(--shadow-2); border: 1px solid var(--line);
  translate: -50% -50%;
}
.hero-art .p0 { z-index: 2; width: 44%; }
.hero-art .p1 { translate: -112% -44%; rotate: -8deg; }
.hero-art .p2 { translate: 12% -44%; rotate: 8deg; }
.hero-art img { width: 100%; height: auto; }
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: var(--s-7); gap: var(--s-6); }
  .hero-art { justify-self: center; max-width: 460px; }
}

/* ---------- Product bento (home) ---------- */
.bento {
  display: grid; gap: var(--s-4);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(200px, auto); grid-auto-flow: dense;
}
.cell {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-5); border-radius: var(--r-card);
  text-decoration: none; color: var(--ink);
  background-image: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--glow, transparent) 34%, transparent), transparent 62%);
  transition: transform var(--d-base) var(--ease-out);
}
.cell:hover { transform: translateY(-2px); color: var(--ink); }
.cell:active { transform: scale(.98); }
.cell .top { display: flex; align-items: center; gap: var(--s-3); }
.cell .top > :last-child { min-width: 0; }   /* a long name wraps under large text instead of widening the cell */
.cell .name { font-size: var(--t-h3); font-weight: 620; letter-spacing: -.01em; line-height: 1.2; }
.cell .one { color: var(--ink-2); font-size: var(--t-small); max-width: 36ch; }
.cell .foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.cell .arrow {
  position: absolute; right: var(--s-5); top: var(--s-5); width: 20px; height: 20px; color: var(--ink-3);
  transition: transform var(--d-base) var(--ease-spring), color var(--d-fast) var(--ease-out);
}
.cell:hover .arrow { transform: translate(2px, -2px); color: var(--ink); }
.cell-shots { display: flex; gap: var(--s-3); margin-top: var(--s-2); }
.cell-shots img { border-radius: var(--r-shot); border: 1px solid var(--line); box-shadow: var(--shadow-1); }

/* Cell sizes come from render.py by position (bento_sizes), never by product. */
.cell-lead { grid-column: span 3; grid-row: span 2; }
.cell-half { grid-column: span 3; }
.cell-wide {
  grid-column: span 6; display: grid; column-gap: var(--s-6); align-content: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); grid-template-rows: 1fr auto auto auto 1fr;
}
.cell-shots img { width: 100%; }
.cell-lead .cell-shots { margin-top: auto; justify-content: center; }
.cell-lead .cell-shots.pair img { width: 40%; }
.cell-lead .cell-shots.pair { padding-bottom: var(--s-4); }   /* room for the dropped second shot, so it never meets the chips */
.cell-lead .cell-shots.pair img:nth-child(2) { translate: 0 var(--s-4); }
.cell-wide > :not(.cell-shots):not(.arrow):not(.peek-clip) { grid-column: 1; }
.cell-wide > .top { grid-row: 2; }
.cell-wide > .one { grid-row: 3; }
.cell-wide > .foot { grid-row: 4; margin-top: var(--s-2); }
.cell-wide .cell-shots { grid-column: 2; grid-row: 1 / -1; margin: 0; align-self: center; }
.cell-wide:has(.cell-shots) .arrow { display: none; }
/* The cell no longer clips (its lift shadow sits outside it), so the peek clips itself. */
.peek-clip { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; pointer-events: none; }
.cell .peek {
  position: absolute; right: var(--s-6); top: 34%; width: 30%; max-width: 180px; z-index: -1;
  rotate: 6deg; transition: translate var(--d-base) var(--ease-out);
}
.cell .peek img { border-radius: var(--r-shot); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.cell:hover .peek { translate: 0 -8px; }
.cell .peek.wide { width: 40%; max-width: 240px; rotate: 3deg; }   /* a half with only wide shots: their top corner peeks in */
.cell.has-peek .one { max-width: 26ch; }
/* A near-black product color becomes the cell itself. A product opts into a faint night sky with `stars` in app.json. */
.cell.dark { --ink: var(--on-dark); --ink-2: var(--on-dark-2); --ink-3: var(--on-dark-3); --status-live: var(--on-dark-live); --surface-sunk: var(--on-dark-sunk); color: var(--ink); background-color: color-mix(in srgb, var(--tint) 92%, transparent); }
.cell.dark.stars::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none; border-radius: inherit;
  background-image:
    radial-gradient(1px 1px at 20% 30%, var(--on-dark), transparent),
    radial-gradient(1px 1px at 70% 20%, var(--on-dark), transparent),
    radial-gradient(1.5px 1.5px at 85% 70%, var(--on-dark), transparent),
    radial-gradient(1px 1px at 40% 80%, var(--on-dark), transparent),
    radial-gradient(1px 1px at 60% 55%, var(--on-dark), transparent),
    radial-gradient(1.5px 1.5px at 10% 75%, var(--on-dark), transparent);
}
.cell.dark:hover, .cell.dark:hover .arrow { color: var(--ink); }
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell-lead, .cell-wide { grid-column: span 2; grid-row: auto; }
  .cell-half { grid-column: span 1; }
  .cell-wide { display: flex; }
  .cell-wide .cell-shots { margin-top: var(--s-2); }
  .peek-clip { display: none; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento > * { grid-column: auto; }
}

/* ---------- Icons, chips, status ---------- */
.icon {
  --size: 56px;
  width: var(--size); height: var(--size); flex: none;
  border-radius: var(--r-icon); overflow: hidden;
  background: var(--tint, var(--surface-solid));
  box-shadow: 0 0 0 1px var(--line), var(--shadow-icon);
}
.icon img { width: 100%; height: 100%; object-fit: cover; }
.icon.mono {
  display: grid; place-items: center;
  font-weight: 700; font-size: calc(var(--size) * .42); letter-spacing: -.03em; color: var(--on-tint);
}
.chip {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 var(--s-3);
  border-radius: var(--r-pill); background: var(--surface-sunk);
  font-size: var(--t-meta); font-weight: 550; color: var(--ink-2); white-space: nowrap; max-width: 100%;
}
@media (max-width: 480px) { .chip { white-space: normal; } }
.status { font-size: var(--t-meta); font-weight: 650; letter-spacing: .01em; }
.status-live { color: var(--status-live); }
.status-lab { color: var(--status-lab); }
.status-archived { color: var(--status-archived); }

/* ---------- About (home) ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s-7); align-items: start; }
.about .prose { font-size: 1.125rem; }
.founder { border-radius: var(--r-card); padding: var(--s-6); display: grid; gap: var(--s-4); }
.founder .who { display: flex; align-items: center; gap: var(--s-4); }
.founder .avatar {
  width: 56px; height: 56px; border-radius: var(--r-pill); flex: none;
  display: grid; place-items: center; font-weight: 700; letter-spacing: -.02em;
  background: var(--ink); color: var(--bg);
}
.founder .links { display: grid; gap: 2px; }
.founder .links a {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-3); margin-inline: calc(-1 * var(--s-3)); border-radius: var(--r-pill); text-decoration: none; font-weight: 550;
  transition: background-color var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.founder .links a:hover { background: var(--surface-sunk); }
.founder .links a span { color: var(--ink-3); font-weight: 450; font-size: var(--t-small); min-width: 0; overflow-wrap: anywhere; text-align: right; }
.founder .links a { gap: var(--s-3); }
.facts-inline { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
@media (max-width: 860px) { .about { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Contact band ---------- */
.contact-band { border-radius: var(--r-sheet); padding: clamp(32px, 6vw, 72px); text-align: center; display: grid; justify-items: center; gap: var(--s-4); }
.contact-band .h2 { max-width: 20ch; overflow-wrap: anywhere; }
.contact-band .mail { max-width: 100%; overflow-wrap: anywhere; font-size: clamp(1.25rem, 1rem + 1.4vw, 2rem); font-weight: 620; letter-spacing: -.02em; text-decoration: none; }
.contact-band .mail:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding-block: var(--s-7) var(--s-8); color: var(--ink-3); font-size: var(--t-small); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
.footer h2 { font-size: var(--t-meta); font-weight: 650; color: var(--ink); margin-bottom: var(--s-3); letter-spacing: .01em; }
.footer li + li { margin-top: var(--s-2); }
.footer a { text-decoration: none; color: var(--ink-2); }
.footer p a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 28%, transparent); }
.footer a:hover { color: var(--accent); }
.footer .fine { margin-top: var(--s-7); display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; overflow-wrap: anywhere; }
.footer .fine > * { min-width: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Product page ---------- */
.crumbs { font-size: var(--t-meta); color: var(--ink-3); margin-top: var(--s-7); }
.crumbs a { text-decoration: none; color: var(--ink-3); padding-block: 5px; }   /* 24px tall target; vertical padding on an inline link leaves the line where it was */
.crumbs a:hover { color: var(--accent); }
.p-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-6); align-items: center; padding-block: var(--s-5) var(--s-7); }
.p-hero .icon { --size: clamp(88px, 12vw, 132px); box-shadow: 0 0 0 1px var(--line), var(--shadow-2); }
.p-hero h1 { font-size: var(--t-h1); letter-spacing: -.03em; line-height: 1.05; font-weight: 650; }
.p-hero .lead { margin-top: var(--s-3); }
.p-hero .row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-top: var(--s-3); }
.p-hero .btns { margin-top: var(--s-5); }
@media (max-width: 640px) { .p-hero { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); } }

.rail {
  position: relative;
  display: flex; gap: var(--s-4); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), calc(50vw - var(--w-content) / 2));
  padding: var(--s-2) var(--gutter) var(--s-5);
  margin-inline: calc(50% - 50vw); padding-inline: max(var(--gutter), calc(50vw - var(--w-content) / 2));
  scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
}
.rail figure { margin: 0; flex: none; scroll-snap-align: start; }
.rail img { border-radius: var(--r-shot); border: 1px solid var(--line); box-shadow: var(--shadow-1); background: var(--surface-solid); }
.rail .phone img { height: min(560px, 70vh); width: auto; border-radius: var(--r-shot-phone); }
/* Wide shots: up to 440px tall, never wider than the content column (a very wide shot would run off the page, and a lone shot has no rail buttons). */
.rail .wide img { height: min(440px, 52vw, calc(min(var(--w-content), 100vw - 2 * var(--gutter)) / var(--ar, 1))); width: auto; }
@media (max-width: 600px) { .rail .phone img { height: 440px; } .rail .wide img { height: auto; width: 86vw; } }

/* Rail controls: shown by site.js only when the rail overflows. */
.rail-ctl { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); margin-top: calc(-1 * var(--s-2)); }
.rail-ctl[hidden] { display: none; }
.rail-btn {
  width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-1); cursor: pointer;
  transition: transform var(--d-base) var(--ease-spring), opacity var(--d-fast) var(--ease-out);
}
.rail-btn svg { width: 18px; height: 18px; }
.rail-btn:hover { transform: translateY(-2px); }
.rail-btn:active { transform: scale(.94); transition-duration: var(--d-fast); }
.rail-btn[aria-disabled="true"] { opacity: .4; cursor: default; transform: none; }
.rail-pos { min-width: 7ch; text-align: center; }

/* Framed shots: the image already includes the device, so no card chrome. */
.rail.framed img, .hero-art.framed img { border: 0; border-radius: 0; box-shadow: none; background: none; }
.rail.framed { gap: var(--s-6); }
.rail.framed figure { width: 240px; display: grid; gap: var(--s-4); align-content: start; }
.rail.framed img { width: 100%; height: auto; filter: drop-shadow(0 18px 28px var(--shot-shadow)); }
.rail figcaption { display: grid; gap: var(--s-1); font-size: var(--t-small); color: var(--ink-2); }
.rail figcaption .h3 { color: var(--ink); font-size: var(--t-body); }
.hero-art.framed .phone { background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.hero-art.framed img { filter: drop-shadow(0 24px 40px var(--shot-shadow)); }
@media (max-width: 600px) { .rail.framed figure { width: 62vw; } }

/* Product site (apps/<id>/home/) */
.ps-hero { min-height: 0; padding-top: var(--s-5); }
.ps-brand { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-5); }
.ps-brand .icon { --size: 48px; }
.ps-hero .btns { margin-top: var(--s-6); }
.ps-price { margin-top: var(--s-3); }

.p-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s-7); align-items: start; }
.p-body .prose { font-size: 1.125rem; }
.facts { border-radius: var(--r-card); padding: var(--s-5) var(--s-6); }
.facts dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-3) var(--s-5); }
.facts dt { color: var(--ink-3); font-size: var(--t-small); }
.facts dd { font-weight: 550; font-size: var(--t-small); min-width: 0; overflow-wrap: anywhere; }
.facts dd a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 28%, transparent); }
@media (max-width: 860px) { .p-body { grid-template-columns: minmax(0, 1fr); } }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.feature { padding: var(--s-5); border-radius: var(--r-card); display: grid; gap: var(--s-2); align-content: start; }
.feature p { color: var(--ink-2); font-size: var(--t-small); }
.features.n3 .feature:first-child { grid-row: span 2; background: color-mix(in srgb, var(--glow, transparent) 12%, var(--surface)); }
@media (max-width: 640px) { .features { grid-template-columns: minmax(0, 1fr); } .features.n3 .feature:first-child { grid-row: auto; } }

.faq { max-width: 62ch; }
.faq details { border-radius: var(--r-card); padding: 0 var(--s-5); }
.faq details + details { margin-top: var(--s-3); }
.faq summary {
  list-style: none; cursor: pointer; padding: var(--s-5) 0; font-weight: 600;
  display: flex; justify-content: space-between; gap: var(--s-4); align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-weight: 400; font-size: 1.4rem; line-height: 1; color: var(--ink-3);
  transition: transform var(--d-base) var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: var(--s-5); color: var(--ink-2); }

.more { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-3); }
.more a {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-card);
  text-decoration: none; transition: background-color var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.more a:hover { background: var(--surface-sunk); color: var(--ink); }
.more .icon { --size: 44px; }
.more .one { font-size: var(--t-meta); color: var(--ink-3); }

/* ---------- Flagship panel (home) ---------- */
.flagship {
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-sheet);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); align-items: center;
  padding: clamp(24px, 4vw, 48px); margin-bottom: var(--s-4);
}
.flagship.has-art { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.flagship::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--glow, transparent) 30%, transparent), transparent 64%);
}
.fl-copy { display: grid; gap: var(--s-4); justify-items: start; }
.fl-eyebrow { display: flex; align-items: center; gap: var(--s-2); }
.fl-head { display: flex; align-items: center; gap: var(--s-4); }
.fl-head .icon { --size: 64px; }
.fl-head h2 a { text-decoration: none; }
.fl-news a { display: block; text-decoration: none; color: var(--ink-2); max-width: 52ch; }
.fl-news .meta { display: block; margin-bottom: 2px; }
.fl-art { justify-self: center; width: 100%; display: grid; place-items: center; }
.fl-art img { border-radius: var(--r-shot); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.fl-art.phone img { max-height: 420px; width: auto; border-radius: var(--r-shot-phone); }
.fl-art.wide img { width: 100%; }
.fl-art.framed img { border: 0; border-radius: 0; box-shadow: none; filter: drop-shadow(0 18px 28px var(--shot-shadow)); }
@media (max-width: 767px) { .flagship.has-art { grid-template-columns: minmax(0, 1fr); } .fl-art.phone img { max-height: 340px; } }

/* ---------- Cards: experiments strip and /work/ ---------- */
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.strip > * { min-width: 0; }
.card {
  display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); border-radius: var(--r-card);
  text-decoration: none; color: var(--ink);
  transition: transform var(--d-base) var(--ease-out);
}
.card, .w-card { background-image: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--glow, transparent) var(--glow-mix, 22%), transparent), transparent 60%); }
/* A /work/ row with no outcome line is short, so its years sit in the glow; pale tints there need a fainter glow in dark. */
:root[data-theme="dark"] .w-card { --glow-mix: 17%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .w-card { --glow-mix: 17%; } }
.card:hover, .w-card:hover { transform: translateY(-2px); color: var(--ink); }
.card:active, .w-card:active { transform: scale(.98); }
.card-top { display: flex; align-items: center; gap: var(--s-3); }
.card-top .icon { --size: 48px; }
.card .name, .w-card .name { font-size: var(--t-h3); font-weight: 620; letter-spacing: -.01em; line-height: 1.2; }
.card-status, .w-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.card .one, .w-card .one { color: var(--ink-2); font-size: var(--t-small); }
.card .foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.strip-more { margin-top: var(--s-5); }
.numbers { margin-top: var(--s-5); }
.numbers a { text-decoration: none; color: inherit; }
@media (max-width: 900px) { .strip { grid-template-columns: minmax(0, 1fr); } }

/* ---------- /work/ ---------- */
.ftarget { position: fixed; top: 0; left: 0; width: 0; height: 0; }   /* :target hooks; fixed, so a filter never scrolls */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); align-items: center; }
.fgroup { position: relative; isolation: isolate; border-radius: var(--r-pill); background: var(--surface-sunk); }
.fgroup, .flabels { display: flex; flex-wrap: wrap; gap: var(--s-1); padding: var(--s-1); }
.fchip, .flabels > span {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 var(--s-4);
  border-radius: var(--r-pill); font-size: var(--t-small); font-weight: 560;
  transition: background-color var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out), transform var(--d-base) var(--ease-spring);
}
.fchip { text-decoration: none; color: var(--ink-2); }
.fchip:hover { color: var(--ink); background: var(--surface); }
.fchip:active { transform: scale(.96); }
.filters:not(.pill) [data-filter="all"] { background: var(--ink); color: var(--bg); }   /* without JavaScript the chip itself is the pill */
/* With JavaScript, one pill per group sits over the chips and site.js moves it (--x, --y, --w, --h in px).
   It is one layer the size of the group: the pill's fill with a copy of the labels in the pill's text color,
   clipped to the pill's shape. Only the clip moves, so the labels invert exactly where the pill covers them,
   with no color animation and nothing to keep in sync. */
.fpill {
  display: none; position: absolute; inset: 0; z-index: 1; pointer-events: none; user-select: none;
  background: var(--ink); opacity: 0;
  clip-path: inset(calc(var(--y, 0) * 1px) calc(100% - (var(--x, 0) + var(--w, 44)) * 1px) calc(100% - (var(--y, 0) + var(--h, 44)) * 1px) calc(var(--x, 0) * 1px) round calc(var(--h, 44) * .5px));
  transition: opacity var(--d-fast) var(--ease-out), clip-path var(--d-base) var(--ease-out);
}
.filters.pill .fpill { display: block; }
.fpill.on { opacity: 1; }
.flabels > span { color: var(--bg); }
.fpill.still { transition: none; }
.filters.pill .fchip[aria-current="true"]:hover { background: transparent; }
/* A pressed chip's copy presses with it, so the two never part at the pill's edge. */
.fgroup:has(> .fchip:nth-of-type(1):active) .flabels > :nth-child(1),
.fgroup:has(> .fchip:nth-of-type(2):active) .flabels > :nth-child(2),
.fgroup:has(> .fchip:nth-of-type(3):active) .flabels > :nth-child(3),
.fgroup:has(> .fchip:nth-of-type(4):active) .flabels > :nth-child(4),
.fgroup:has(> .fchip:nth-of-type(5):active) .flabels > :nth-child(5),
.fgroup:has(> .fchip:nth-of-type(6):active) .flabels > :nth-child(6) { transform: scale(.96); }
.work-count { margin: var(--s-4) 0 var(--s-5); min-height: 1.4em; }
.work-count span { display: none; }
.work-count [data-for="all"] { display: inline; }
.work-list { list-style: none; margin: 0 0 var(--section); padding: 0; display: grid; gap: var(--s-3); }
.work-item { view-transition-class: work-item; }
.w-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-4); align-items: center;
  padding: var(--s-4) var(--s-5); border-radius: var(--r-card); text-decoration: none; color: var(--ink);
  transition: transform var(--d-base) var(--ease-out);
}
.w-card .icon { --size: 56px; }
.w-main { display: grid; gap: var(--s-1); min-width: 0; }
.w-outcome { color: var(--ink-3); font-size: var(--t-small); }
.w-meta { display: grid; justify-items: end; gap: var(--s-2); }
@media (max-width: 640px) {
  .w-card { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .w-meta { grid-column: 2; justify-items: start; display: flex; gap: var(--s-3); align-items: center; }
  .w-card .icon { --size: 44px; }
  /* On a narrow row the status sits under the top-right corner, so the glow is smaller and fainter there. */
  .w-card { background-image: radial-gradient(70% 60% at 100% 0%, color-mix(in srgb, var(--glow, transparent) 14%, transparent), transparent 60%); }
  .fgroup { width: 100%; }
}
@media (max-width: 400px) { .fchip, .flabels > span { padding: 0 var(--s-2); } .fgroup, .flabels { gap: 0; } }   /* four status chips fit one row at 320px */

/* Outcome, lessons, and drafts */
.outcome-tag { color: var(--ink); font-weight: 600; }
.record { border-radius: var(--r-card); padding: var(--s-5); margin-top: var(--s-5); max-width: 62ch; display: grid; gap: var(--s-3); }
.record .outcome-line { color: var(--ink-2); }
.record .outcome-line strong { color: var(--ink); font-weight: 620; }
.lessons { display: grid; gap: var(--s-2); color: var(--ink-2); list-style: disc; padding-left: 1.25em; }
.draft-mark {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 var(--s-2); vertical-align: 1px;
  border-radius: var(--r-pill); border: 1px dashed var(--status-lab); color: var(--status-lab);
  font-size: var(--t-meta); font-weight: 650; letter-spacing: .01em; white-space: nowrap;
}
.draft-banner { border-radius: var(--r-card); padding: var(--s-3) var(--s-4); margin-top: var(--s-5); color: var(--ink-2); font-size: var(--t-small); display: flex; gap: var(--s-3); align-items: baseline; }
.draft-banner .draft-mark { margin: 0; flex: none; }

/* What's new (push cycle updates) */
.updates { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); max-width: 62ch; }
.update { border-radius: var(--r-card); padding: var(--s-4) var(--s-5); display: grid; grid-template-columns: 9ch minmax(0, 1fr); gap: var(--s-4); align-items: baseline; scroll-margin-top: var(--nav-clear); }
.update p { color: var(--ink-2); }
.update-date { text-decoration: none; }
.update { position: relative; }
/* The linked update gets an accent ring that fades in, so a shared link shows which entry it means. */
.update::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 2px var(--accent); opacity: 0; pointer-events: none; transition: opacity var(--d-base) var(--ease-out); }
.update:target::after { opacity: 1; }
@media (max-width: 600px) { .update { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); } }

.notice { border-radius: var(--r-card); padding: var(--s-4) var(--s-5); color: var(--ink-2); font-size: var(--t-small); max-width: 62ch; }

/* ---------- Simple pages ---------- */
.page-hero { padding-block: var(--s-8) var(--s-6); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
.page-hero h1 { font-size: var(--t-h1); letter-spacing: -.03em; line-height: 1.05; font-weight: 650; }

/* ---------- Legal pages ---------- */
.legal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 280px); gap: var(--s-7); align-items: start; padding-bottom: var(--section); }
.legal > * { min-width: 0; }
.legal .page-hero { padding-block: var(--s-5) var(--s-6); }
.legal-body { border-radius: var(--r-card); padding: var(--s-6); color: var(--ink-2); overflow-wrap: anywhere; }
.legal-body > * { max-width: 68ch; }
.legal-body > * + * { margin-top: var(--s-4); }
.legal-body h2 { font-size: var(--t-h3); letter-spacing: -.01em; line-height: 1.3; color: var(--ink); margin-top: var(--s-6); scroll-margin-top: var(--nav-clear); }
.legal-body h3 { font-size: var(--t-body); font-weight: 620; color: var(--ink); margin-top: var(--s-5); scroll-margin-top: var(--nav-clear); }
.legal-body > :first-child { margin-top: 0; }
.legal-body strong { color: var(--ink); font-weight: 620; }
.legal-body ul { list-style: disc; padding-left: 1.25em; }
.legal-body li + li { margin-top: var(--s-1); }
.legal-body a, .legal-side a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 28%, transparent); }
.legal-side { position: sticky; top: var(--nav-clear); }
.legal-side .facts { display: grid; gap: var(--s-2); }
.legal-side .facts, .legal-side .facts * { overflow-wrap: anywhere; }
.legal-side .meta + * { margin-bottom: var(--s-3); }
.legal-side .facts > :last-child { margin-bottom: 0; }
.legal-links { display: grid; gap: var(--s-1); font-size: var(--t-small); }
@media (max-width: 860px) {
  .legal { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
  .legal-side { position: static; }
}
@media (max-width: 600px) { .legal-body { padding: var(--s-5); } }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--d-base); animation-timing-function: var(--ease-out); }
  ::view-transition-group(*) { animation-duration: var(--d-slow); animation-timing-function: var(--ease-out); }
  /* Theme switch: a slower cross-fade so the repaint reads as one change. */
  :root.theme-vt::view-transition-old(root), :root.theme-vt::view-transition-new(root) { animation-duration: var(--d-slow); }
  .theme-toggle.swapped svg { animation: icon-pop var(--d-base) var(--ease-spring); }
  @keyframes icon-pop { from { opacity: 0; transform: rotate(-45deg) scale(.6); } }

  /* FAQ: the answer settles in on open and lifts out on close (site.js). */
  .faq details[open] p { animation: answer-in var(--d-base) var(--ease-out); }
  .faq details.reopened p { animation: none; }   /* a close that was reversed (site.js) already ends fully shown */
  .faq details.closing p { animation: answer-out var(--d-fast) var(--ease-out) forwards; }
  .faq details.closing summary::after { transform: none; }
  @keyframes answer-in { from { opacity: 0; transform: translateY(-6px); } }
  @keyframes answer-out { to { opacity: 0; transform: translateY(-6px); } }

  .skip { transition: transform var(--d-base) var(--ease-spring); }

  /* /work/ filters: with the View Transitions API, items glide to their new
     places and the leaving ones fade (site.js). Without it, newly shown items
     settle in, since display: none to block restarts the animation. */
  .work-item { animation: item-in var(--d-base) var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 6) * var(--d-stagger)); }
  @keyframes item-in { from { opacity: 0; transform: translateY(8px); } }
  .vt-filters .work-item { animation: none; }   /* the view transition animates instead; never both */
  ::view-transition-group(*.work-item) { animation-duration: var(--d-base); animation-timing-function: var(--ease-out); }
  /* A filter change is a small move: every group finishes within --d-base, so the page is interactive again quickly. */
  :root.filter-vt::view-transition-group(*), :root.filter-vt::view-transition-old(root), :root.filter-vt::view-transition-new(root) { animation-duration: var(--d-base); }
  ::view-transition-old(*.work-item) { animation-duration: var(--d-fast); }
  /* The filter bar sits out of the page cross-fade: only its live new state shows, so the pill's own
     transform transition is the one motion there, with no old snapshot fading beside it. */
  .vt-filters .filters { view-transition-name: filters; }
  :root.filter-vt::view-transition-old(filters) { display: none; }
  :root.filter-vt::view-transition-new(filters), :root.filter-vt::view-transition-group(filters) { animation: none; }

  .js .reveal { opacity: 0; transform: translateY(12px); transition: opacity var(--d-slow) var(--ease-out), transform var(--d-slow) var(--ease-out); transition-delay: calc(var(--i, 0) * var(--d-stagger)); }
  .js .reveal.in { opacity: 1; transform: none; }

  .hero-art > * { animation: settle var(--d-settle) var(--ease-out) both; }
  .hero-art .p1 { animation-delay: calc(2 * var(--d-stagger)); }
  .hero-art .p2 { animation-delay: calc(4 * var(--d-stagger)); }
  @keyframes settle { from { opacity: 0; transform: translateY(18px) scale(.98); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* ---------- Forced colors ----------
   Selection elsewhere is a background pill, which forced colors paint over. A system-colored
   outline marks the current nav item and filter instead, and the moving pill layer is dropped. */
@media (forced-colors: active) {
  .nav-links a[aria-current="page"], .fchip[aria-current="true"], .filters:not(.pill) [data-filter="all"] {
    outline: 2px solid Highlight; outline-offset: -2px;
  }
  .fpill { display: none !important; }
}
