/* Hallmark · macrostructure: Image-led editorial · tone: architectural · anchor hue: cobalt
 * design-system: docs/portfolio-design (direction A — white, cobalt, ink · IBM Plex Sans)
 * nav: N1b three-section · footer: Ft5 statement · enrichment: generated architectural stills
 * pre-emit critique: P4 H5 E4 S5 R4 V4
 * Tokens follow this stamp (tokens.py); the rules below use no raw colour. */
:root {
  color-scheme: light;
  --font-display: "IBM Plex Sans", "Plex Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Plex Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.375rem, 1.2rem + 0.75vw, 1.75rem);
  --text-2xl: clamp(2rem, 1.35rem + 2.7vw, 3.5rem);
  --text-display: clamp(2.5rem, 12.5vw, 5.5rem);
  --text-display-wide: clamp(3.75rem, 6.6vw, 6.5rem);
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.5rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --wrap-max: 80rem;
  --header-h: 4.5rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --dur-long: 480ms;
  --dur-enter: 900ms;
  --z-raised: 10;
  --z-sticky: 200;
  --color-paper: #fcfdff;
  --color-paper-2: #f3f6fb;
  --color-paper-3: #e5edfc;
  --color-rule: #dbe0e9;
  --color-rule-strong: #748099;
  --color-muted: #4d586f;
  --color-ink: #0e172d;
  --color-accent: #104aee;
  --color-accent-strong: #0939c5;
  --color-accent-text: #104aee;
  --color-accent-quiet: #e5edfc;
  --color-on-accent: #ffffff;
  --color-focus: #0939c5;
  --color-card: #fefeff;
  --color-card-rule: #dbe0e9;
  --color-stage: #e7e9ee;
  --color-contact: #0126a3;
  --color-contact-veil: rgb(16 74 238 / 0.45);
  --color-contact-seam: rgb(0 3 28 / 0.75);
  --color-on-contact: #ffffff;
  --color-on-contact-muted: #dde8ff;
  --color-contact-rule: rgb(255 255 255 / 0.36);
  --shadow-card: 0 1px 2px rgb(14 23 45 / 0.06), 0 12px 32px -8px rgb(14 23 45 / 0.18);
  --shadow-pop: 0 1px 2px rgb(14 23 45 / 0.08), 0 24px 56px -16px rgb(14 23 45 / 0.22);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-paper: #070d1a;
    --color-paper-2: #0e1626;
    --color-paper-3: #15213a;
    --color-rule: #263045;
    --color-rule-strong: #63728f;
    --color-muted: #a7b1c5;
    --color-ink: #eff2f7;
    --color-accent: #2662fe;
    --color-accent-strong: #104aee;
    --color-accent-text: #89b0ff;
    --color-accent-quiet: #15213a;
    --color-on-accent: #ffffff;
    --color-focus: #89b0ff;
    --color-card: #0e1626;
    --color-card-rule: #263045;
    --color-stage: #030612;
    --color-contact: #021557;
    --color-contact-veil: rgb(3 8 25 / 0.3);
    --color-contact-seam: rgb(0 1 8 / 0.85);
    --color-on-contact: #ffffff;
    --color-on-contact-muted: #d1def9;
    --color-contact-rule: rgb(255 255 255 / 0.3);
    --shadow-card: 0 0 0 1px #263045, 0 16px 40px -12px rgb(1 2 5 / 0.7);
    --shadow-pop: 0 0 0 1px #263045, 0 28px 64px -16px rgb(1 2 5 / 0.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-paper: #070d1a;
  --color-paper-2: #0e1626;
  --color-paper-3: #15213a;
  --color-rule: #263045;
  --color-rule-strong: #63728f;
  --color-muted: #a7b1c5;
  --color-ink: #eff2f7;
  --color-accent: #2662fe;
  --color-accent-strong: #104aee;
  --color-accent-text: #89b0ff;
  --color-accent-quiet: #15213a;
  --color-on-accent: #ffffff;
  --color-focus: #89b0ff;
  --color-card: #0e1626;
  --color-card-rule: #263045;
  --color-stage: #030612;
  --color-contact: #021557;
  --color-contact-veil: rgb(3 8 25 / 0.3);
  --color-contact-seam: rgb(0 1 8 / 0.85);
  --color-on-contact: #ffffff;
  --color-on-contact-muted: #d1def9;
  --color-contact-rule: rgb(255 255 255 / 0.3);
  --shadow-card: 0 0 0 1px #263045, 0 16px 40px -12px rgb(1 2 5 / 0.7);
  --shadow-pop: 0 0 0 1px #263045, 0 28px 64px -16px rgb(1 2 5 / 0.8);
}
@supports (color: oklch(0% 0 0)) {
  :root {
    color-scheme: light;
    --color-paper: oklch(99.4% 0.003 264);
    --color-paper-2: oklch(97.2% 0.008 264);
    --color-paper-3: oklch(94.4% 0.022 264);
    --color-rule: oklch(90.5% 0.014 264);
    --color-rule-strong: oklch(60% 0.04 264);
    --color-muted: oklch(46% 0.04 264);
    --color-ink: oklch(21% 0.045 264);
    --color-accent: oklch(50% 0.25 264);
    --color-accent-strong: oklch(43% 0.22 264);
    --color-accent-text: oklch(50% 0.25 264);
    --color-accent-quiet: oklch(94.4% 0.022 264);
    --color-on-accent: oklch(100% 0 0);
    --color-focus: oklch(43% 0.22 264);
    --color-card: oklch(99.8% 0.002 264);
    --color-card-rule: oklch(90.5% 0.014 264);
    --color-stage: oklch(93.5% 0.006 264);
    --color-contact: oklch(36% 0.2 264);
    --color-contact-veil: oklch(50% 0.25 264 / 0.45);
    --color-contact-seam: oklch(12% 0.06 264 / 0.75);
    --color-on-contact: oklch(100% 0 0);
    --color-on-contact-muted: oklch(93% 0.035 264);
    --color-contact-rule: oklch(100% 0 0 / 0.36);
    --shadow-card: 0 1px 2px oklch(21% 0.045 264 / 0.06), 0 12px 32px -8px oklch(21% 0.045 264 / 0.18);
    --shadow-pop: 0 1px 2px oklch(21% 0.045 264 / 0.08), 0 24px 56px -16px oklch(21% 0.045 264 / 0.22);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --color-paper: oklch(16% 0.03 264);
      --color-paper-2: oklch(20% 0.035 264);
      --color-paper-3: oklch(25% 0.05 264);
      --color-rule: oklch(31% 0.04 264);
      --color-rule-strong: oklch(55% 0.05 264);
      --color-muted: oklch(76% 0.03 264);
      --color-ink: oklch(96% 0.008 264);
      --color-accent: oklch(56% 0.24 264);
      --color-accent-strong: oklch(50% 0.25 264);
      --color-accent-text: oklch(76% 0.13 264);
      --color-accent-quiet: oklch(25% 0.05 264);
      --color-on-accent: oklch(100% 0 0);
      --color-focus: oklch(76% 0.13 264);
      --color-card: oklch(20% 0.035 264);
      --color-card-rule: oklch(31% 0.04 264);
      --color-stage: oklch(12.5% 0.03 264);
      --color-contact: oklch(24% 0.12 264);
      --color-contact-veil: oklch(14% 0.04 264 / 0.3);
      --color-contact-seam: oklch(8% 0.03 264 / 0.85);
      --color-on-contact: oklch(100% 0 0);
      --color-on-contact-muted: oklch(90% 0.04 264);
      --color-contact-rule: oklch(100% 0 0 / 0.3);
      --shadow-card: 0 0 0 1px oklch(31% 0.04 264), 0 16px 40px -12px oklch(8% 0.02 264 / 0.7);
      --shadow-pop: 0 0 0 1px oklch(31% 0.04 264), 0 28px 64px -16px oklch(8% 0.02 264 / 0.8);
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --color-paper: oklch(16% 0.03 264);
    --color-paper-2: oklch(20% 0.035 264);
    --color-paper-3: oklch(25% 0.05 264);
    --color-rule: oklch(31% 0.04 264);
    --color-rule-strong: oklch(55% 0.05 264);
    --color-muted: oklch(76% 0.03 264);
    --color-ink: oklch(96% 0.008 264);
    --color-accent: oklch(56% 0.24 264);
    --color-accent-strong: oklch(50% 0.25 264);
    --color-accent-text: oklch(76% 0.13 264);
    --color-accent-quiet: oklch(25% 0.05 264);
    --color-on-accent: oklch(100% 0 0);
    --color-focus: oklch(76% 0.13 264);
    --color-card: oklch(20% 0.035 264);
    --color-card-rule: oklch(31% 0.04 264);
    --color-stage: oklch(12.5% 0.03 264);
    --color-contact: oklch(24% 0.12 264);
    --color-contact-veil: oklch(14% 0.04 264 / 0.3);
    --color-contact-seam: oklch(8% 0.03 264 / 0.85);
    --color-on-contact: oklch(100% 0 0);
    --color-on-contact-muted: oklch(90% 0.04 264);
    --color-contact-rule: oklch(100% 0 0 / 0.3);
    --shadow-card: 0 0 0 1px oklch(31% 0.04 264), 0 16px 40px -12px oklch(8% 0.02 264 / 0.7);
    --shadow-pop: 0 0 0 1px oklch(31% 0.04 264), 0 28px 64px -16px oklch(8% 0.02 264 / 0.8);
  }
}
@media print {
  :root, :root[data-theme="dark"], :root[data-theme="system"] {
    color-scheme: light;
    --color-paper: #fcfdff;
    --color-paper-2: #f3f6fb;
    --color-paper-3: #e5edfc;
    --color-rule: #dbe0e9;
    --color-rule-strong: #748099;
    --color-muted: #4d586f;
    --color-ink: #0e172d;
    --color-accent: #104aee;
    --color-accent-strong: #0939c5;
    --color-accent-text: #104aee;
    --color-accent-quiet: #e5edfc;
    --color-on-accent: #ffffff;
    --color-focus: #0939c5;
    --color-card: #fefeff;
    --color-card-rule: #dbe0e9;
    --color-stage: #e7e9ee;
    --color-contact: #0126a3;
    --color-contact-veil: rgb(16 74 238 / 0.45);
    --color-contact-seam: rgb(0 3 28 / 0.75);
    --color-on-contact: #ffffff;
    --color-on-contact-muted: #dde8ff;
    --color-contact-rule: rgb(255 255 255 / 0.36);
    --shadow-card: 0 1px 2px rgb(14 23 45 / 0.06), 0 12px 32px -8px rgb(14 23 45 / 0.18);
    --shadow-pop: 0 1px 2px rgb(14 23 45 / 0.08), 0 24px 56px -16px rgb(14 23 45 / 0.22);
  }
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("plex.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Fallback";
  src: local("Arial");
  size-adjust: 101.4%;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
  background: var(--color-paper);
}
body {
  margin: 0;
  overflow-x: clip;
  background: var(--color-paper);
  color: var(--color-ink);
  font: 400 var(--text-md) / 1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection { background: var(--color-accent); color: var(--color-on-accent); }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap-max));
  margin-inline: auto;
}
.icon { width: 1.125rem; height: 1.125rem; flex: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.mono { font-family: var(--font-mono); }

.skip {
  position: fixed;
  inset-inline-start: var(--gutter);
  top: -5rem;
  z-index: 300;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--color-ink);
  color: var(--color-paper);
  font-weight: 500;
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

/* theme-bound artwork: one of the two is shown, on every path */
.art-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .art-light { display: none; }
  :root:not([data-theme="light"]) .art-dark { display: block; }
}
:root[data-theme="dark"] .art-light { display: none; }
:root[data-theme="dark"] .art-dark { display: block; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-rule);
}
/* The header never leaves the screen, so taking focus inside it must not scroll the page. Without this,
   Chrome treats its controls as hidden by the scroll-padding reserved for the header and jumps about half
   a screen up, and a language switch made from the keyboard then carries the wrong reading position. */
.site-header :is(a, button, summary) { scroll-margin-top: calc(-1 * (var(--header-h) + 1.25rem)); }
.header-row {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}
.brand svg { flex: none; width: 1.125rem; height: 1.375rem; color: var(--color-accent-text); }
@media (max-width: 22.49rem) {
  .header-row { gap: var(--space-sm); }
  .brand { font-size: 1rem; }
  .menu summary { gap: 0.375rem; padding: 0 0.625rem; }
}

.primary { display: none; }
.primary a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.primary a span { padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.primary a:hover { color: var(--color-ink); background: var(--color-paper-2); }
.primary a[aria-current="true"] { color: var(--color-ink); }
.primary a[aria-current="true"] span { border-bottom-color: var(--color-accent); }

.tools { display: none; }

.lang { display: flex; align-items: center; }
.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.75rem;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color var(--dur-micro) var(--ease-out);
}
.lang a span { padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.lang a:hover { color: var(--color-ink); }
.lang a[aria-current="page"] { color: var(--color-ink); }
.lang a[aria-current="page"] span { border-bottom-color: var(--color-accent); }

.theme {
  display: inline-flex;
  padding: 0.25rem;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-sm);
}
.theme button {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 0.3125rem;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.theme button:hover { color: var(--color-ink); }
.theme button[aria-pressed="true"] { background: var(--color-ink); color: var(--color-paper); }

.menu { margin-inline-start: auto; }
.menu summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.875rem;
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu:not([open]) .when-open, .menu[open] .when-closed { display: none; }
.menu-panel {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  padding: var(--space-xs) var(--gutter) var(--space-lg);
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-rule);
  box-shadow: var(--shadow-pop);
}
.menu-panel .menu-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  border-bottom: 1px solid var(--color-rule);
  font-size: var(--text-lg);
  font-weight: 500;
  text-decoration: none;
}
.menu-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-top: var(--space-md);
}
.menu-tools .theme button { width: 2.75rem; height: 2.75rem; }
.menu-tools { flex-wrap: wrap; }
.menu-tools .lang { margin-inline-start: -0.8rem; }
.menu-tools .lang a { min-width: 2.75rem; }

.progress {
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

@media (min-width: 75rem) {
  .header-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .brand { justify-self: start; }
  .primary { display: flex; gap: 0.125rem; }
  .tools { display: flex; align-items: center; gap: var(--space-md); justify-self: end; }
  .menu { display: none; }
}

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 3.25rem;
  padding: 0 1.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out),
    color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn .icon { transition: transform var(--dur-short) var(--ease-out); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-accent); color: var(--color-on-accent); }
.btn-primary:hover { background: var(--color-accent-strong); }
.btn-secondary { border-color: var(--color-rule-strong); background: transparent; color: var(--color-ink); }
.btn-secondary:hover { border-color: var(--color-ink); background: var(--color-paper-2); }
@media (hover: hover) {
  .btn:hover .i-down { transform: translateY(3px); }
  .btn:hover .i-ne { transform: translate(2px, -2px); }
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-accent-text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  white-space: nowrap;
}
.link:hover { text-decoration-thickness: 2px; }
.link .icon { width: 0.875rem; height: 0.875rem; transition: transform var(--dur-short) var(--ease-out); }
@media (hover: hover) { .link:hover .icon { transform: translate(2px, -2px); } }

.primary a:active, .lang a:active, .theme button:active, .menu summary:active,
.replay:active, .contact-links a:active { transform: translateY(1px); }

/* ---------- hero ---------- */
.hero { padding-top: var(--space-xl); }
.hero-grid {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr) var(--gutter);
  row-gap: var(--space-xl);
}
.hero-copy { grid-column: 2; min-width: 0; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-lg);
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}
.eyebrow::before { content: ""; flex: none; width: 2rem; height: 2px; background: var(--color-accent); }
.hero h1 {
  min-width: 0;
  font: 600 var(--text-display) / 0.94 var(--font-display);
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}
.hero h1, .contact h2, .case-top h1, .nf h1 { margin-inline-start: -0.055em; }
.section-head h2, .next .t { margin-inline-start: -0.04em; }
.hero h1 .line { display: block; overflow: hidden; padding: 0.12em 0 0.12em 0.06em; margin: -0.12em 0 -0.12em -0.06em; }
.hero h1 .line > span { display: block; }
.hero h1 .accent { color: var(--color-accent-text); }
.lead {
  max-width: 34rem;
  margin-top: var(--space-lg);
  color: var(--color-muted);
  font-size: var(--text-lg);
  line-height: 1.5;
  text-wrap: pretty;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: var(--space-xl); }
.actions .btn { flex: 1 1 12rem; }
@media (min-width: 30rem) { .actions .btn { flex: none; } }
.hero-art {
  grid-column: 1 / -1;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-stage);
}
.hero-art .zoom { width: 100%; height: 100%; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 56% 50%; }

.proof { display: grid; margin-top: var(--space-xl); border-top: 1px solid var(--color-rule); }
.proof li {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  column-gap: var(--space-md);
  align-items: baseline;
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--color-rule);
}
.proof .num {
  font: 500 2rem / 1 var(--font-display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.proof .label { font-size: var(--text-sm); line-height: 1.45; text-wrap: pretty; }
.proof .src {
  grid-column: 2;
  margin-top: 0.375rem;
  color: var(--color-muted);
  font: 400 var(--text-xs) / 1.5 var(--font-mono);
  overflow-wrap: anywhere;
}
.proof .src a { padding: 0.375rem 0.125rem; text-underline-offset: 0.2em; white-space: nowrap; }
.proof time, .nb { white-space: nowrap; }

@media (min-width: 48rem) {
  .proof { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-xl); border-bottom: 1px solid var(--color-rule); }
  .proof li { grid-template-columns: minmax(0, 1fr); align-content: start; padding-block: var(--space-lg) var(--space-xl); border-bottom: 0; }
  .proof .num { margin-bottom: 0.75rem; font-size: 2.75rem; }
  .proof .src { grid-column: auto; }
}
@media (min-width: 62rem) {
  .hero { padding-top: 0; }
  .hero-grid {
    grid-template-columns:
      minmax(var(--gutter), 1fr)
      minmax(0, calc(var(--wrap-max) * 0.5))
      minmax(0, calc(var(--wrap-max) * 0.5))
      minmax(var(--gutter), 1fr);
    row-gap: 0;
  }
  .hero h1 { font-size: var(--text-display-wide); }
  .lead { margin-top: var(--space-xl); }
  .hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: clamp(3rem, 6vw, 5.5rem);
    padding-inline-end: var(--space-xl);
  }
  .hero-art {
    grid-column: 3 / -1;
    aspect-ratio: auto;
    min-height: 34rem;
    margin-block: var(--space-xl);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  }
  .proof { margin-top: 0; }
}

/* ---------- sections ---------- */
.section { padding-block: var(--space-3xl); }
.tint { background: var(--color-paper-2); }
.section-head { display: grid; gap: var(--space-md); margin-bottom: var(--space-2xl); }
.section-head h2 {
  font: 600 var(--text-2xl) / 1.02 var(--font-display);
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  min-width: 0;
}
.section-head p { max-width: 31rem; color: var(--color-muted); text-wrap: pretty; }
.sub {
  margin-bottom: var(--space-lg);
  font: 600 var(--text-xl) / 1.15 var(--font-display);
  letter-spacing: -0.02em;
}
@media (min-width: 62rem) {
  .section { padding-block: var(--space-4xl); }
  .section-head {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: var(--space-xl);
    align-items: end;
  }
  .section-head p { justify-self: end; }
}

/* ---------- cases ---------- */
.case { display: grid; gap: var(--space-lg); min-width: 0; }
.stage {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-stage);
}
.stage-art {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 98%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 98%);
  transform-origin: 50% 30%;
  transition: transform 900ms var(--ease-out);
}
.concept {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  margin: -18% var(--space-md) var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--color-card);
  box-shadow: var(--shadow-card);
  font-size: var(--text-sm);
  line-height: 1.4;
}
.case-flagship .concept { margin-top: -10%; }
.case-flagship .stage-art { aspect-ratio: 1 / 1; object-position: 100% 50%; }
@media (min-width: 40rem) { .case-flagship .stage-art { aspect-ratio: 16 / 9; } }
.concept-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.125rem var(--space-md);
  min-height: 2.25rem;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-card-rule);
}
.concept-title { flex: none; font-weight: 600; white-space: nowrap; }
/* a tag that does not fit beside the title drops under it, whole, instead of breaking beside it */
.concept-tag { min-width: 0; color: var(--color-muted); font: 400 var(--text-xs) / 1.4 var(--font-mono); overflow-wrap: anywhere; }
.concept-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: auto;
  padding-top: var(--space-md);
}
.concept-caption { color: var(--color-muted); font-size: var(--text-xs); line-height: 1.5; text-wrap: pretty; }
.replay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--color-card-rule);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.replay:hover { color: var(--color-ink); border-color: var(--color-rule-strong); }
.replay .icon { width: 1rem; height: 1rem; }

.case-body { display: grid; align-content: start; gap: var(--space-md); min-width: 0; }
.case-client { color: var(--color-muted); font: 400 var(--text-xs) / 1.5 var(--font-mono); }
.case h3 {
  margin-top: 0.375rem;
  font: 600 var(--text-xl) / 1.15 var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  min-width: 0;
}
.case-detail { display: grid; align-content: start; gap: var(--space-md); min-width: 0; }
.part .k, .k {
  margin-bottom: 0.25rem;
  color: var(--color-accent-text);
  font: 500 var(--text-xs) / 1.5 var(--font-mono);
}
.part p:last-child { max-width: 40rem; color: var(--color-muted); text-wrap: pretty; }
.stack { display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 0.375rem; }
.stack li {
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--color-rule);
  border-radius: 999px;
  color: var(--color-muted);
  font: 400 var(--text-xs) / 1 var(--font-mono);
  white-space: nowrap;
}

.go {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
  min-height: 2.75rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
  white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out);
}
.go:hover { color: var(--color-accent-text); }
.go .icon { color: var(--color-accent-text); transition: transform var(--dur-short) var(--ease-out); }
@media (hover: hover) { .go:hover .icon, .rows h4 a:hover .icon { transform: translateX(4px); } }

.case-pairs { display: grid; gap: var(--space-2xl) var(--space-xl); margin-top: var(--space-2xl); }

@media (min-width: 48rem) {
  .case-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto; }
  .case-pair { grid-row: span 3; grid-template-rows: subgrid; row-gap: var(--space-md); align-content: start; }
  .case-pair .case-body { display: contents; }
  .case-pair .case-body > header { margin-top: var(--space-xs); }
  .case-pair .case-detail { grid-template-rows: auto 1fr auto; }
  .concept { margin-inline: var(--space-lg); margin-bottom: var(--space-lg); padding: var(--space-lg); }
}
@media (min-width: 62rem) {
  .case-pairs { margin-top: var(--space-3xl); }
  .case-flagship .case-body {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--space-xl);
    align-items: start;
  }
}
@media (min-width: 75rem) {
  .case-flagship .stage {
    display: grid;
    align-items: center;
    aspect-ratio: 2.1 / 1;
    padding: clamp(1.5rem, 4vw, 3.5rem);
    overflow: clip;
  }
  .case-flagship .stage-art { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; -webkit-mask-image: none; mask-image: none; transform-origin: 70% 50%; }
  .case-flagship .concept { flex: none; width: min(100%, 26.5rem); margin: 0; }
}
@media (min-width: 85rem) {
  .case-flagship .concept { width: min(100%, 31rem); }
}
@media (hover: hover) {
  .case:hover .stage-art { transform: scale(1.03); }
}

/* concept: FunnelChat lanes */
.flow-path { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.25rem; }
.flow-path .chip {
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--color-card-rule);
  border-radius: 0.375rem;
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}
.flow-path li { display: inline-flex; align-items: center; gap: 0.25rem; }
.flow-path li > .icon { width: 0.875rem; height: 0.875rem; color: var(--color-rule-strong); }
.lanes { display: grid; gap: 0.375rem; margin-top: var(--space-md); }
.lane { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: center; column-gap: var(--space-sm); }
.lane-name { color: var(--color-muted); font-size: var(--text-xs); font-weight: 500; }
.track { position: relative; height: 1.75rem; }
.track::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 1px;
  background: var(--color-rule);
}
.tokw { position: absolute; inset: 0; }
.tok {
  position: absolute;
  top: 50%;
  left: var(--x);
  width: 0.75rem;
  height: 0.75rem;
  margin: -0.375rem 0 0 -0.375rem;
  border-radius: 50%;
  background: var(--color-accent);
}
.tok.pending { background: var(--color-card); box-shadow: inset 0 0 0 2px var(--color-accent); }
.tok.receipt { border-radius: 0.25rem; background: var(--color-card); box-shadow: inset 0 0 0 2px var(--color-ink); }
.track .gate {
  position: absolute;
  top: -0.25rem;
  bottom: -0.25rem;
  left: 62%;
  width: 0;
  margin-left: -1px;
  border-inline-start: 2px dashed var(--color-accent);
}
.gate-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin-top: 0.375rem;
  color: var(--color-accent-text);
  font: 500 var(--text-xs) / 1.4 var(--font-mono);
}
.gate-key .gate-name { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.gate-key i { flex: none; width: 0; height: 0.875rem; border-inline-start: 2px dashed var(--color-accent); }
@media (min-width: 30rem) { .gate-key { padding-inline-start: calc(6.5rem + var(--space-sm)); } }
.gate-key .end {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-inline-start: auto;
  color: var(--color-ink);
  font-family: var(--font-body);
  white-space: nowrap;
}
.gate-key .end .icon { width: 0.875rem; height: 0.875rem; color: var(--color-rule-strong); }

/* concept: Maestro steps */
.steps { position: relative; display: grid; gap: 0.5rem; }
.step {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-items: center;
  column-gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-card-rule);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.step > span:last-child, .ledger .hint { text-wrap: balance; }
.step-mark {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--color-accent-quiet);
  color: var(--color-accent-text);
}
.step-mark .icon { width: 0.875rem; height: 0.875rem; }
.step.current { border-color: var(--color-accent); background: var(--color-accent-quiet); }
.step.current .step-mark { background: var(--color-accent); color: var(--color-on-accent); }

/* concept: Host Orchestrator ledger */
.ledger-cols {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: 0.75rem;
  padding: 0 0.75rem 0.375rem;
  color: var(--color-muted);
  font: 400 var(--text-xs) / 1.5 var(--font-mono);
}
.ledger { display: grid; gap: 0.375rem; }
.ledger li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  column-gap: 0.75rem;
  min-height: 2.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--color-card-rule);
  border-radius: var(--radius-sm);
}
.ledger .n { color: var(--color-muted); font: 400 var(--text-xs) / 1 var(--font-mono); font-variant-numeric: tabular-nums; }
.ledger .c { font-weight: 500; }
.ledger .uncertain { border: 1px dashed var(--color-accent); background: var(--color-accent-quiet); }
.ledger .uncertain .c { color: var(--color-accent-text); font-weight: 600; }
.ledger .hint {
  grid-column: 2 / -1;
  margin-top: 0.125rem;
  color: var(--color-ink);
  font: 500 var(--text-xs) / 1.4 var(--font-mono);
}

/* ---------- rows: more cases, other work ---------- */
.more { margin-top: var(--space-3xl); }
.rows { border-top: 1px solid var(--color-rule); }
.rows > li {
  display: grid;
  gap: var(--space-sm);
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--color-rule);
}
.rows h4 { font: 600 var(--text-lg) / 1.25 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; }
.rows h4 a { text-decoration: none; transition: color var(--dur-micro) var(--ease-out); }
.rows h4 a:hover { color: var(--color-accent-text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
.rows .case-client { margin-top: 0.375rem; }
.rows .row-part { color: var(--color-muted); font-size: var(--text-sm); text-wrap: pretty; }
.cols3 { display: grid; gap: var(--space-lg); border-top: 1px solid var(--color-rule); padding-top: var(--space-lg); }
.cols3 h4 { margin-bottom: 0.375rem; font: 600 var(--text-md) / 1.3 var(--font-display); }
.cols3 p { color: var(--color-muted); font-size: var(--text-sm); text-wrap: pretty; }
@media (min-width: 62rem) {
  .more { margin-top: var(--space-4xl); }
  .rows > li {
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr);
    column-gap: var(--space-xl);
    align-items: start;
  }
  .rows .stack { justify-content: flex-end; }
  .cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-xl); }
}

/* ---------- case study page ---------- */
.case-page { padding-bottom: var(--space-xl); }
.case-top { display: grid; gap: var(--space-xl); padding-block: var(--space-xl) var(--space-2xl); }
.case-copy { min-width: 0; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  margin-bottom: var(--space-md);
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out);
}
.back:hover { color: var(--color-ink); }
.back .icon { transition: transform var(--dur-short) var(--ease-out); }
@media (hover: hover) { .back:hover .icon { transform: translateX(-3px); } }
.case-top h1, .nf h1 {
  min-width: 0;
  font: 600 clamp(2.125rem, 1.3rem + 3.4vw, 4rem) / 1.04 var(--font-display);
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.case-meta { display: grid; gap: var(--space-md); margin: var(--space-xl) 0 0; padding-top: var(--space-lg); border-top: 1px solid var(--color-rule); }
.case-meta > div { display: grid; gap: 0.375rem; }
.case-meta dt { color: var(--color-accent-text); font: 500 var(--text-xs) / 1.6 var(--font-mono); }
.case-meta dd { margin: 0; font-size: var(--text-sm); }
.stage.plain .stage-art { -webkit-mask-image: none; mask-image: none; }
@media (min-width: 30rem) {
  .case-meta > div { grid-template-columns: 7.5rem minmax(0, 1fr); column-gap: var(--space-md); align-items: baseline; }
}
@media (min-width: 62rem) {
  .case-top {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: var(--space-2xl);
    align-items: start;
    padding-block: var(--space-2xl) var(--space-3xl);
  }
}

.block { padding-block: var(--space-2xl); border-top: 1px solid var(--color-rule); }
.block h2 { margin-bottom: var(--space-lg); font: 600 var(--text-xl) / 1.15 var(--font-display); letter-spacing: -0.02em; }
.tldr { display: grid; gap: var(--space-lg); }
.tldr p:last-child { text-wrap: pretty; }
.flow-steps { display: grid; gap: var(--space-lg) var(--space-xl); counter-reset: step; }
.flow-steps li { counter-increment: step; padding-top: var(--space-md); border-top: 2px solid var(--color-ink); }
.flow-steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-accent-text);
  font: 500 var(--text-xs) / 1.5 var(--font-mono);
}
.flow-steps h3 { margin-bottom: 0.375rem; font: 600 var(--text-md) / 1.3 var(--font-display); }
.flow-steps p { color: var(--color-muted); font-size: var(--text-sm); text-wrap: pretty; }
.contract {
  max-width: 44rem;
  margin-top: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--color-paper-2);
  text-wrap: pretty;
}
.decision-table { border-top: 1px solid var(--color-rule); }
.decision-table li { display: grid; gap: var(--space-sm); padding-block: var(--space-lg); border-bottom: 1px solid var(--color-rule); }
.decision-table li:last-child { padding-bottom: 0; border-bottom: 0; }
.decision-table .d { font: 600 var(--text-lg) / 1.3 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; }
.decision-table .w { margin: 0; color: var(--color-muted); font-size: var(--text-sm); text-wrap: pretty; }
.decision-table .w dt { margin-bottom: 0.25rem; color: var(--color-ink); font: 500 var(--text-xs) / 1.5 var(--font-mono); }
.decision-table .w dd { margin: 0; }
.duo { display: grid; gap: var(--space-xl); }
.duo p { max-width: 36rem; color: var(--color-muted); text-wrap: pretty; }
.longform { display: grid; gap: var(--space-lg); }
.toc ol { display: none; }
.prose section + section { margin-top: var(--space-xl); }
.prose h3 { margin-bottom: 0.5rem; font: 600 var(--text-lg) / 1.3 var(--font-display); letter-spacing: -0.015em; }
.prose p { max-width: 42rem; text-wrap: pretty; }
.next {
  display: grid;
  gap: 0.5rem;
  padding-block: var(--space-2xl) var(--space-xl);
  border-top: 1px solid var(--color-rule);
  text-decoration: none;
}
.next .t {
  max-width: 24ch;
  font: 600 var(--text-2xl) / 1.05 var(--font-display);
  letter-spacing: -0.035em;
  text-wrap: balance;
  transition: color var(--dur-micro) var(--ease-out);
}
.next .t .icon {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-inline-start: 0.35em;
  color: var(--color-accent-text);
  vertical-align: -0.04em;
  transition: transform var(--dur-short) var(--ease-out);
}
.next:hover .t { color: var(--color-accent-text); }
@media (hover: hover) { .next:hover .t .icon { transform: translateX(6px); } }
@media (min-width: 40rem) { .flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 48rem) {
  .tldr { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-xl); }
  .duo { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-xl); }
}
@media (min-width: 62rem) {
  .flow-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .decision-table li { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-xl); }
  .longform { grid-template-columns: 16rem minmax(0, 1fr); column-gap: var(--space-2xl); align-items: start; }
  .toc { position: sticky; top: calc(var(--header-h) + var(--space-lg)); }
  .toc ol { display: grid; gap: 0.125rem; }
  .toc a { display: block; padding-block: 0.375rem; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.35; text-decoration: none; }
  .toc a:hover { color: var(--color-ink); }
}

/* ---------- experience ---------- */
.timeline { border-top: 1px solid var(--color-rule); }
.timeline > li {
  display: grid;
  gap: var(--space-sm);
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--color-rule);
}
.when { color: var(--color-muted); font: 400 var(--text-xs) / 1.6 var(--font-mono); font-variant-numeric: tabular-nums; }
.timeline h3 { font: 600 var(--text-lg) / 1.25 var(--font-display); letter-spacing: -0.015em; }
.timeline .org { display: inline-block; color: var(--color-accent-text); font-weight: 500; }
.timeline .desc { max-width: 42rem; margin-top: 0.25rem; color: var(--color-muted); text-wrap: pretty; }
.bullets { display: grid; gap: 0.5rem; max-width: 40rem; margin-top: var(--space-md); }
.bullets li { position: relative; padding-inline-start: 1.25rem; font-size: var(--text-sm); text-wrap: pretty; }
.bullets li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.7em;
  width: 0.5rem;
  height: 2px;
  background: var(--color-accent);
}
.timeline .note { max-width: 40rem; margin-top: var(--space-sm); color: var(--color-muted); font: 400 var(--text-xs) / 1.6 var(--font-mono); }
@media (min-width: 48rem) {
  .timeline > li { grid-template-columns: 11rem minmax(0, 1fr); column-gap: var(--space-xl); padding-block: var(--space-xl); }
  .when { padding-top: 0.25rem; }
}

/* ---------- open source ---------- */
.oss { display: grid; gap: var(--space-lg) var(--space-xl); }
.oss > li {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-rule);
}
/* the marker stays on the first line when a long label wraps */
.state { display: inline-flex; align-items: flex-start; gap: 0.5rem; color: var(--color-muted); font: 400 var(--text-xs) / 1.5 var(--font-mono); }
.state i { flex: none; width: 0.5rem; height: 0.5rem; margin-top: calc((1.5em - 0.5rem) / 2); background: var(--color-accent); }
.state .s-merged { border-radius: 50%; }
.state .s-open { border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1.5px var(--color-accent); }
.state .s-ack { background: transparent; box-shadow: inset 0 0 0 1.5px var(--color-accent); }
.oss h3 { font: 600 var(--text-md) / 1.3 var(--font-display); }
.oss .text { color: var(--color-muted); font-size: var(--text-sm); text-wrap: pretty; }
.oss .links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.125rem; }
.oss .links .link { min-height: 1.75rem; font-size: var(--text-xs); font-family: var(--font-mono); }
@media (min-width: 40rem) { .oss { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .oss { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--space-xl); } }
@media (min-width: 62rem) { .oss.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- stack ---------- */
.families { display: grid; gap: var(--space-lg) var(--space-xl); }
.families > li { padding-top: var(--space-md); border-top: 2px solid var(--color-ink); }
.families h3 { margin-bottom: var(--space-sm); font: 600 var(--text-md) / 1.3 var(--font-display); }
.families ul { display: grid; gap: 0.375rem; }
.families ul li { color: var(--color-muted); font-size: var(--text-sm); line-height: 1.45; text-wrap: pretty; }
@media (min-width: 40rem) { .families { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .families { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- contact ---------- */
.contact {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--color-contact);
  color: var(--color-on-contact);
}
.contact-art { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.contact-art img { position: absolute; inset: 0 0 auto; width: 100%; height: 150%; object-fit: cover; object-position: 50% 0; }
.contact::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--color-contact-veil); pointer-events: none; }
.contact :focus-visible { outline-color: var(--color-on-contact); }
.contact-inner { padding-block: var(--space-3xl) var(--space-xl); }
.contact h2 {
  max-width: 17ch;
  font: 600 clamp(2.25rem, 1.2rem + 5vw, 5rem) / 1 var(--font-display);
  letter-spacing: -0.04em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  min-width: 0;
}
.contact-text { max-width: 30rem; margin-top: var(--space-lg); color: var(--color-on-contact-muted); font-size: var(--text-lg); line-height: 1.5; text-wrap: pretty; }
.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  margin-top: var(--space-xl);
  font-size: clamp(1.0625rem, 4.6vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  white-space: nowrap;
}
.contact-mail:hover { text-decoration-thickness: 2px; }
.contact-mail .icon { width: 0.9em; height: 0.9em; transition: transform var(--dur-short) var(--ease-out); }
.contact-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; max-width: 26rem; margin-top: var(--space-lg); }
.contact-links li:first-child { grid-column: 1 / -1; }
.contact-links a { justify-content: center; width: 100%; }
@media (min-width: 40rem) {
  .contact-links { display: flex; flex-wrap: wrap; max-width: none; }
  .contact-links a { width: auto; }
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0 1.125rem;
  border: 1px solid var(--color-contact-rule);
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.contact-links a:hover { border-color: var(--color-on-contact); }
.contact-links a.solid { border-color: var(--color-on-contact); background: var(--color-on-contact); color: var(--color-contact); }
.contact-links .icon { width: 1rem; height: 1rem; transition: transform var(--dur-short) var(--ease-out); }
@media (hover: hover) {
  .contact-mail:hover .icon, .contact-links a:hover .i-ne { transform: translate(2px, -2px); }
}
.contact-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-xl);
  position: relative;
  margin-top: var(--space-3xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-contact-seam);
  color: var(--color-on-contact-muted);
  font-size: var(--text-sm);
}
.contact-foot a { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.75rem; color: var(--color-on-contact); text-decoration: none; white-space: nowrap; }
.contact-foot a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.bolts {
  position: absolute;
  inset-inline-end: 0;
  top: -0.5px;
  translate: 0 -50%;
  width: min(20.125rem, 62%);
  height: auto;
  aspect-ratio: 536 / 80;
  pointer-events: none;
}
@media (min-width: 62rem) { .contact-inner { padding-block: var(--space-4xl) var(--space-xl); } }

.sample-note {
  padding-block: var(--space-md);
  color: var(--color-muted);
  font: 400 var(--text-xs) / 1.6 var(--font-mono);
}

/* ---------- motion ---------- */
/* stagger steps and token positions as classes, so the markup carries no inline style */
.i0 { --i: 0; }
.i1 { --i: 1; }
.i2 { --i: 2; }
.i3 { --i: 3; }
.i4 { --i: 4; }
.i5 { --i: 5; }
.i6 { --i: 6; }
.i7 { --i: 7; }
.i8 { --i: 8; }
.i9 { --i: 9; }
.x40 { --x: 40%; }
.x54 { --x: 54%; }
.x78 { --x: 78%; }
.x92 { --x: 92%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @supports (animation-timeline: scroll()) {
    .progress { animation: progress linear both; animation-timeline: scroll(root block); }
  }
}
@keyframes progress { to { transform: scaleX(1); } }

/* html.motion is set by the head script only when motion is welcome; without it the page is static and complete */
html.motion .hero h1 .line > span {
  transform: translateY(112%);
  animation: line-up 900ms var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 60ms);
}
html.motion .rise {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 700ms var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 60ms);
}
html.motion .case-top > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 700ms var(--ease-out) 60ms forwards;
}
html.motion .case-top > :nth-child(2) { animation-delay: 200ms; }
html.motion .hero-art { clip-path: inset(0 0 0 100%); animation: art-in var(--dur-enter) var(--ease-in-out) 160ms forwards; }
html.motion .hero-art .zoom { transform: scale(1.08); animation: settle 1500ms var(--ease-out) 160ms forwards; }
@keyframes line-up { to { transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes art-in { to { clip-path: inset(0); } }
@keyframes settle { to { transform: none; } }

/* hiding is instant, so nothing near the fold fades out while the page loads; only the reveal is animated */
html.reveal-on .reveal { opacity: 0; transform: translateY(22px); }
html.reveal-on .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* concept sequences: the card is complete at rest; when it is seen, each part plays through once in order */
html.motion .concept.run .seq { animation: seq-in 560ms var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 280ms + 160ms); }
@keyframes seq-in { from { opacity: 0.2; transform: translateY(8px); } to { opacity: 1; transform: none; } }
html.motion .concept.run .tokw { animation: tok-in 1300ms var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 240ms + 700ms); }
@keyframes tok-in {
  from { opacity: 0; transform: translateX(calc(-1 * var(--x))); }
  12% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
html.motion .concept.run .tok.receipt::after {
  content: "";
  position: absolute;
  inset: -0.25rem;
  border-radius: 0.3125rem;
  box-shadow: 0 0 0 2px var(--color-accent);
  opacity: 0;
  animation: wait-ring 900ms var(--ease-out) 2900ms 2;
}
@keyframes wait-ring { from { opacity: 0.9; transform: scale(0.7); } to { opacity: 0; transform: scale(1.6); } }


/* theme change: one circular reveal from the control that was used */
html.theme-vt::view-transition-old(root) { animation: none; }
html.theme-vt::view-transition-new(root) { animation: vt-reveal 520ms var(--ease-in-out) both; }
@keyframes vt-reveal {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); }
  to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 0)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .reveal, .rise, .hero h1 .line > span, .hero-art, .hero-art .zoom, .case-top > * {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    animation: none !important;
    transition: none !important;
  }
  .site-header { position: static; }
  .progress, .menu, .theme, .replay { display: none !important; }
  .art-dark { display: none !important; }
  .art-light { display: block !important; }
}

@media (forced-colors: active) {
  .btn, .stack li, .step, .ledger li, .flow-path .chip, .concept, .contact-links a { border: 1px solid CanvasText; }
  .progress, .eyebrow::before, .bullets li::before, .track::before { background: CanvasText; }
  .theme button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .lang a span, .primary a span { border-bottom-color: Canvas; }
  .lang a[aria-current="page"] span, .primary a[aria-current="true"] span { border-bottom-color: Highlight; }
  .step.current, .ledger .uncertain { border: 2px solid Highlight; }
  .tok { background: CanvasText; forced-color-adjust: none; }
  .tok.pending, .tok.receipt { background: Canvas; box-shadow: inset 0 0 0 2px CanvasText; }
  .track .gate, .gate-key i { border-inline-start-color: Highlight; }
}
