/* Loom site · Selvedge. The design language is apps/showcase/site/DESIGN.md; change tokens there first.
   One stylesheet for every page: tokens, fonts, base, chrome (header, mega-menu, drawer, footer),
   page templates, the landing and the woven visuals. Demos add css/demos.css. */

/* ---------- Fonts (SIL OFL, self-hosted, Latin subset; licences in fonts/OFL-*.txt) ---------- */
@font-face {
  font-family: "Archivo";
  src: url(../fonts/archivo-var.woff2) format("woff2-variations"), url(../fonts/archivo-var.woff2) format("woff2");
  font-weight: 400 900; font-stretch: 88% 125%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url(../fonts/martian-mono-var.woff2) format("woff2-variations"), url(../fonts/martian-mono-var.woff2) format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
/* Metric-matched fallbacks keep the first paint close to Archivo, so the swap does not move the page. */
@font-face { font-family: "Archivo Wide Fallback"; src: local("Arial Black"), local("Arial Bold"), local("Arial"), local("Liberation Sans"); size-adjust: 104%; ascent-override: 88%; descent-override: 22%; }
@font-face { font-family: "Archivo Fallback"; src: local("Arial"), local("Helvetica"), local("Liberation Sans"); size-adjust: 98%; ascent-override: 90%; descent-override: 22%; }

/* ---------- Tokens ---------- */
:root {
  --cotton: #f3eee3; --surface: #fbf8f1; --surface-2: #ebe4d6;
  --ink: #17140f; --ink-2: #4a443a; --line: #d9d0bf;
  --indigo: #1e2a78; --indigo-2: #3a4bb0; --madder: #b02a1e; --madder-2: #d4574a;
  --saffron: #e9a21b; --saffron-2: #f3bb4c; --teal: #0b6b66; --teal-2: #1d948c; --ai: #6b3fc2;
  /* Thread colours used as text or rules on the ground (switch to light inks in dark mode). */
  --indigo-ink: #1e2a78; --madder-ink: #b02a1e; --teal-ink: #0b6b66; --saffron-ink: #7a5208;
  --on-field: #fbf8f1; --on-field-2: #e3e6f7;
  --field-bg: var(--indigo); --field-fg: var(--on-field); --field-fg-2: #dfe3ff;
  --focus: #1e2a78;
  --shadow-float: 0 24px 48px -24px rgb(23 20 15 / .45);

  /* Aliases read by the interactive demos (css/demos.css) */
  --bg: var(--cotton); --muted: var(--ink-2); --line-strong: var(--ink);
  --accent: var(--indigo); --accent-ink: #ffffff; --accent-soft: #e2e5f6;
  --signal: var(--madder); --signal-soft: #f6dfda;
  --ok: var(--teal); --ok-soft: #d8ebe8; --warn: #7a5208; --warn-soft: #f6e6c4; --crit: var(--madder); --crit-soft: #f6dfda;
  --band-bg: var(--ink); --band-fg: var(--cotton);
  --term-bg: #17140f; --term-fg: #efe9dc; --term-muted: #b3a994; --term-accent: #c7cdff;
  --sample-1: #22324a; --sample-2: #3d6fb6; --sample-3: #e0a458; --sample-4: #f4f1ea;
  --mark-ink: var(--ink); --mark-thread: var(--indigo); --mark-light: #8f9be0; --mark-warm: var(--madder);

  --display: "Archivo", "Archivo Wide Fallback", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  --text: "Archivo", "Archivo Fallback", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  --body: var(--text);
  --mono: "Martian Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --shuttle: cubic-bezier(.2, .7, .1, 1);
  --out-expo: cubic-bezier(.16, 1, .3, 1);
  --gutter: 16px;
  --max: 1320px;
  --section: clamp(72px, 10vw, 160px);
  --header-h: 68px;
  --radius: 2px;
  color-scheme: light;
}
@media (min-width: 900px) { :root { --gutter: 40px; --header-h: 76px; } }
@media (prefers-color-scheme: dark) {
  :root {
    --cotton: #13110d; --surface: #1d1a15; --surface-2: #26221b;
    --ink: #f3eee3; --ink-2: #c4b9a6; --line: #3a3328;
    --indigo: #26338e; --madder: #a3271c; --teal: #0d6f69;
    --indigo-ink: #aab4ff; --madder-ink: #ff9a8c; --teal-ink: #72d3c9; --saffron-ink: #f3bb4c;
    --on-field: #fbf8f1; --focus: #aab4ff;
    --shadow-float: 0 24px 48px -20px rgb(0 0 0 / .7);
    --accent: #aab4ff; --accent-ink: #13110d; --accent-soft: #232a55;
    --signal: #ff9a8c; --signal-soft: #3b211d; --ok: #72d3c9; --ok-soft: #15302d; --warn: #f3bb4c; --warn-soft: #382c14; --crit: #ff9a8c; --crit-soft: #3b211d;
    --band-bg: #0b0a07; --band-fg: #f3eee3; --term-bg: #0b0a07;
    --mark-ink: #f3eee3; --mark-thread: #aab4ff; --mark-light: #d6dbff;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--cotton); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text); font-stretch: 100%; font-synthesis: none;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { text-decoration-color: currentColor; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
code, kbd, samp { font-family: var(--mono); font-size: .86em; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--radius); }
main:focus { outline: none; }
::selection { background: var(--saffron); color: #17140f; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
:lang(ja) { line-break: strict; word-break: auto-phrase; overflow-wrap: anywhere; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { letter-spacing: 0; font-stretch: 100%; }
:lang(ja) em { font-style: normal; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.skip-link { position: absolute; left: 12px; top: -100px; z-index: 100; padding: 12px 16px; background: var(--ink); color: var(--cotton); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Type roles */
.display, h1 { font: 900 clamp(2.75rem, 7.2vw, 6rem)/.92 var(--display); font-stretch: 125%; letter-spacing: -.02em; }
h2, .h2 { font: 850 clamp(2rem, 4.4vw, 3.5rem)/.98 var(--display); font-stretch: 125%; letter-spacing: -.015em; }
h3, .h3 { font: 800 clamp(1.25rem, 2vw, 1.55rem)/1.12 var(--display); font-stretch: 112%; letter-spacing: -.005em; }
h4 { font: 750 1.05rem/1.25 var(--display); font-stretch: 106%; }
.lede { font-size: clamp(1.125rem, 1.6vw, 1.35rem); line-height: 1.45; max-width: 40ch; }
.figure-num { font: 600 .8125rem/1.4 var(--mono); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.label { font: 600 .75rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.small, .note-small, .source { font-size: .875rem; line-height: 1.5; color: var(--ink-2); }
.note-small a, .source a { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  --bar: 6px; position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px 0 calc(var(--bar) + 18px);
  border: 0; border-radius: var(--radius); font: 700 1rem/1 var(--text); font-stretch: 112%; text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--cotton); box-shadow: inset var(--bar) 0 0 var(--saffron);
  transition: box-shadow 220ms var(--out-expo), transform 120ms var(--out-expo), background-color 160ms;
}
.btn .arrow { transition: transform 220ms var(--out-expo); }
.btn:active { transform: scale(.97); }
@media (hover: hover) { .btn:hover { --bar: 10px; } .btn:hover .arrow { transform: translateX(3px); } }
.btn-light { background: var(--on-field); color: #17140f; }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; padding-left: 20px; }
@media (hover: hover) { .btn-ghost:hover { box-shadow: inset 0 0 0 3px currentColor; } }
.btn-small { min-height: 40px; font-size: .9375rem; padding-right: 16px; padding-left: calc(var(--bar) + 12px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.text-link { font-weight: 700; text-decoration-thickness: 2px; }
.arrow-link { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; text-underline-offset: 5px; }

/* ---------- Pixel mark ---------- */
.mark { width: 28px; height: 28px; flex: none; image-rendering: pixelated; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--cotton); border-bottom: 4px solid var(--ink); }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; padding: 6px 0; }
.wordmark b { font: 900 1.5rem/1 var(--display); font-stretch: 125%; letter-spacing: -.01em; }
.mega { display: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--radius); }
.lang-switch a { display: inline-grid; place-items: center; min-width: 44px; min-height: 36px; padding: 0 8px; font: 600 .8125rem/1 var(--mono); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--cotton); }
.header-cta { display: none; }

/* Mega-menu (≥ 1000px): five disclosures, each opens a panel under the bar. */
@media (min-width: 1000px) {
  .mega { display: flex; align-items: stretch; align-self: stretch; gap: 2px; margin-right: 8px; }
  .mega > details { position: static; display: flex; }
  .mega summary { display: flex; align-items: center; gap: 8px; padding: 0 14px; font: 700 1rem/1 var(--text); font-stretch: 108%; list-style: none; cursor: pointer; position: relative; }
  .mega summary::-webkit-details-marker { display: none; }
  .mega summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 200ms var(--out-expo); }
  .mega details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
  .mega summary::before { content: ""; position: absolute; left: 14px; right: 14px; bottom: -4px; height: 4px; background: var(--thread, var(--indigo)); transform: scaleX(0); transform-origin: left; transition: transform 240ms var(--out-expo); }
  .mega details[open] > summary::before, .mega summary[aria-current="true"]::before { transform: scaleX(1); }
  @media (hover: hover) { .mega summary:hover::before { transform: scaleX(1); } }
  .mega summary:focus-visible { outline-offset: -3px; }
  .mega-panel { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); box-shadow: var(--shadow-float); border-top: 6px solid var(--thread, var(--indigo)); }
  .mega-panel .wrap { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 40px; padding-top: 32px; padding-bottom: 36px; }
  .mega-intro h2 { font-size: 2rem; }
  .mega-intro p { margin-top: 10px; color: var(--ink-2); max-width: 30ch; }
  .mega-intro a { display: inline-flex; margin-top: 16px; font-weight: 700; }
  .mega-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 24px; align-content: start; }
  .mega-links a { display: grid; grid-template-columns: 6px 1fr; gap: 0 14px; padding: 12px 12px 12px 0; text-decoration: none; border-radius: var(--radius); }
  .mega-links a::before { content: ""; grid-row: span 2; border-radius: 3px; background: var(--thread, var(--indigo)); transition: transform 220ms var(--out-expo); transform-origin: top; transform: scaleY(.55); }
  .mega-links a:hover::before, .mega-links a:focus-visible::before, .mega-links a[aria-current="page"]::before { transform: scaleY(1); }
  .mega-links b { font: 800 1.0625rem/1.2 var(--display); font-stretch: 110%; }
  .mega-links span { font-size: .9375rem; line-height: 1.4; color: var(--ink-2); }
  .mega-links a[aria-current="page"] b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .header-cta { display: inline-flex; }
  .drawer { display: none; }
}
@media (min-width: 1000px) and (prefers-reduced-motion: no-preference) {
  .mega details[open] .mega-panel { animation: panel-in 260ms var(--out-expo); }
  @keyframes panel-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
}

/* Drawer (< 1000px) */
.drawer > summary { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 2px solid var(--ink); border-radius: var(--radius); font-weight: 700; list-style: none; cursor: pointer; }
.drawer > summary::-webkit-details-marker { display: none; }
.drawer-icon { width: 18px; height: 12px; position: relative; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.drawer-icon::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid currentColor; }
.drawer[open] .drawer-icon { border-color: transparent; }
.drawer[open] .drawer-icon::after { top: 3px; transform: rotate(45deg); }
.drawer[open] .drawer-icon::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid currentColor; transform: rotate(-45deg); }
.drawer-panel { position: fixed; left: 0; right: 0; top: calc(var(--header-h) + 4px); bottom: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); padding: 8px 0 40px; box-shadow: var(--shadow-float); }
.drawer-panel details { border-bottom: 2px solid var(--line); }
.drawer-panel summary { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 0 var(--gutter); font: 850 1.5rem/1 var(--display); font-stretch: 120%; list-style: none; cursor: pointer; border-left: 8px solid var(--thread, var(--indigo)); }
.drawer-panel summary::-webkit-details-marker { display: none; }
.drawer-panel summary::after { content: "+"; font: 400 1.75rem/1 var(--text); }
.drawer-panel details[open] > summary::after { content: "−"; }
.drawer-panel ul { padding: 0 var(--gutter) 16px calc(var(--gutter) + 8px); }
.drawer-panel li a { display: block; padding: 10px 0; text-decoration: none; }
.drawer-panel li b { display: block; font-weight: 700; font-size: 1.0625rem; }
.drawer-panel li span { display: block; font-size: .9375rem; color: var(--ink-2); line-height: 1.4; }
.drawer-panel li a[aria-current="page"] b { text-decoration: underline; text-underline-offset: 4px; }
.drawer-foot { padding: 24px var(--gutter) 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .drawer[open] .drawer-panel { animation: drawer-in 280ms var(--out-expo); }
  @keyframes drawer-in { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (max-width: 420px) { .lang-switch a { min-width: 40px; padding: 0 6px; } .wordmark b { font-size: 1.25rem; } }

.review-banner { margin: 0; padding: 10px var(--gutter); background: var(--saffron); color: #17140f; font-size: .9375rem; font-weight: 600; text-align: center; }
.lang-note { padding: 10px var(--gutter); background: var(--surface-2); font-size: .9375rem; text-align: center; }

/* ---------- The fell (page hero field) and the selvedge edge ---------- */

/* ---------- Thread fields ---------- */
.field-indigo { --field-bg: var(--indigo); --field-fg: var(--on-field); --field-fg-2: #dfe3ff; --thread: var(--indigo); }
.field-madder { --field-bg: var(--madder); --field-fg: var(--on-field); --field-fg-2: #ffe3dc; --thread: var(--madder); }
.field-saffron { --field-bg: var(--saffron); --field-fg: #17140f; --field-fg-2: #3a2a06; --thread: var(--saffron); }
.field-teal { --field-bg: var(--teal); --field-fg: var(--on-field); --field-fg-2: #d6f3ef; --thread: var(--teal); }
.field-ink { --field-bg: #17140f; --field-fg: #f3eee3; --field-fg-2: #d8cfbd; --thread: #17140f; }
@media (prefers-color-scheme: dark) { .field-ink { --field-bg: #0b0a07; } }
.field-saffron .btn { background: #17140f; color: #f3eee3; box-shadow: inset var(--bar) 0 0 var(--on-field); }
.field-saffron .btn-ghost { background: transparent; color: #17140f; box-shadow: inset 0 0 0 2px #17140f; }
.field-saffron :focus-visible { outline-color: #17140f; }

/* Breadcrumbs (navigation, set in the figure face) */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0; margin: 0 0 clamp(24px, 4vw, 44px); list-style: none; font: 600 .75rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.crumbs li { display: inline-flex; gap: 12px; align-items: center; }
.crumbs li + li::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; opacity: .8; }
.crumbs a { text-decoration: none; color: var(--field-fg-2); }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--field-fg); }

/* Persona switcher (solutions) */
.personas { background: var(--field-bg); color: var(--field-fg); }
.personas ul { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 0; margin: 0; list-style: none; }
.personas ul::-webkit-scrollbar { display: none; }
.personas a { display: block; white-space: nowrap; padding: 12px 16px 14px; font-weight: 700; text-decoration: none; border-top: 6px solid transparent; }
.personas a:hover { border-top-color: color-mix(in srgb, currentColor 40%, transparent); }
.personas a[aria-current="page"] { background: var(--cotton); color: var(--ink); border-top-color: var(--saffron); }
.personas-label { padding-top: 14px; font: 600 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--field-fg-2); }

/* ---------- Page body (read mode) ---------- */
.page-body { padding-block: clamp(48px, 7vw, 96px) var(--section); }
.page-grid { display: grid; gap: 48px; }
@media (min-width: 1100px) { .page-grid.has-toc { grid-template-columns: 220px minmax(0, 1fr); gap: 64px; } }
.toc { display: none; }
@media (min-width: 1100px) {
  .toc { display: block; position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
  .toc h2 { font: 600 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
  .toc ol { padding: 0; margin: 0; list-style: none; border-left: 4px solid var(--line); }
  .toc a { display: block; padding: 6px 0 6px 16px; margin-left: -4px; border-left: 4px solid transparent; text-decoration: none; font-size: .9375rem; line-height: 1.35; color: var(--ink-2); }
  .toc a:hover { color: var(--ink); }
  .toc a.is-current { color: var(--ink); font-weight: 700; border-left-color: var(--thread, var(--indigo)); }
}
.prose { max-width: none; }
.prose > :not(figure):not(section):not(.demo-replay):not(.audits):not(.parity):not(.table-wrap):not(.terminal):not(.faq):not(pre) { max-width: 72ch; }
.prose > .faq { max-width: 80ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: clamp(56px, 7vw, 96px); font-size: clamp(1.85rem, 3.4vw, 2.75rem); }
.prose h2:first-child { margin-top: 0; }
.prose h2 + * { margin-top: 20px; }
.prose h3 { margin-top: 40px; }
.prose h3 + * { margin-top: 10px; }
.prose ul:not([class]), .prose ol:not([class]) { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose > ul:not([class]) > li::marker { color: var(--thread, var(--indigo-ink)); content: "■  "; font-size: .7em; }
.prose a { color: var(--indigo-ink); }
.prose strong { font-weight: 750; }
.prose blockquote { padding: 4px 0 4px 24px; border-left: 6px solid var(--saffron); font-size: 1.2rem; line-height: 1.45; }
.prose code { background: var(--surface-2); padding: 1px 5px; border-radius: var(--radius); }
.prose pre { background: var(--term-bg); color: var(--term-fg); padding: 20px; overflow-x: auto; border-radius: var(--radius); font-size: .875rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; height: 18px; margin: 48px 0; background: repeating-linear-gradient(90deg, var(--ink) 0 10px, transparent 10px 20px) 0 6px / 100% 6px no-repeat; opacity: .2; }
.prose .table-wrap, .table-wrap { overflow-x: auto; max-width: 100%; }
.prose table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line); vertical-align: top; }
.prose thead th { border-bottom: 4px solid var(--ink); font-weight: 750; }
.prose > .wide, .prose > figure.visual, .prose > .demo, .prose > .demo-replay, .prose > .audits, .prose > .parity { max-width: none; }
.page-body .prose-wide { max-width: none; }
.prose > .wide, .prose > figure.visual, .prose > section.demo, .prose > .demo-replay, .prose > .audits { margin-top: 40px; margin-bottom: 16px; }

/* FAQ */
.faq { border-top: 4px solid var(--ink); }
.faq details { border-bottom: 2px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; font: 750 1.125rem/1.35 var(--display); font-stretch: 106%; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.5rem/1 var(--text); flex: none; transition: transform 200ms var(--out-expo); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > :not(summary) { padding-bottom: 18px; max-width: 64ch; }

/* Status badges (claims register) */
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border-radius: var(--radius); font: 600 .75rem/1.2 var(--mono); letter-spacing: .02em; vertical-align: middle; white-space: normal; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.badge::before { content: ""; width: 9px; height: 9px; flex: none; border-radius: 50%; background: currentColor; }
.badge-live { background: var(--teal); color: var(--on-field); box-shadow: none; }
.badge-live::before { background: var(--on-field); }
.badge-mixed { background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink), inset 8px 0 0 var(--saffron); padding-left: 16px; }
.badge-mixed::before { background: var(--saffron-ink); }
.badge-dev { background: transparent; box-shadow: inset 0 0 0 2px var(--ink-2); color: var(--ink); }
.badge-dev::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.cap-list { display: grid; gap: 4px; margin-top: 24px; }
.cap-list > li { display: grid; gap: 8px; padding: 20px 0; border-top: 2px solid var(--line); }
.cap-list > li:first-child { border-top: 4px solid var(--ink); }
.cap-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.cap-head h3 { font-size: 1.25rem; }

/* ---------- Index rows (hubs, related pages, roles) ---------- */
.rows { display: grid; }
.rows a { --t: var(--thread, var(--indigo)); position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 4px 22px; align-items: center; padding: 22px 8px 22px 0; text-decoration: none; border-top: 2px solid var(--line); }
.rows li:last-child a { border-bottom: 2px solid var(--line); }
.rows a::before { content: ""; grid-row: 1 / span 2; align-self: stretch; border-radius: 5px; background: var(--t); transition: transform 280ms var(--out-expo); }
.rows a > b { font: 850 clamp(1.4rem, 2.6vw, 2.1rem)/1.05 var(--display); font-stretch: 122%; letter-spacing: -.01em; }
.rows a > span { grid-column: 2; color: var(--ink-2); max-width: 60ch; }
.rows a > svg { grid-row: 1 / span 2; grid-column: 3; font-style: normal; font-size: 1.5rem; transition: transform 280ms var(--out-expo); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .rows a:hover::before { transform: translateX(8px) scaleX(1.4); }
  .rows a:hover > svg { transform: translateX(6px); }
}
.rows a:hover > b { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.rows .t-indigo a { --t: var(--indigo); } .rows .t-madder a { --t: var(--madder); } .rows .t-saffron a { --t: var(--saffron); } .rows .t-teal a { --t: var(--teal); } .rows .t-ink a { --t: var(--ink); }
.rows .tag { font: 600 .75rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-left: 10px; vertical-align: middle; font-stretch: 100%; }

.section-cta { padding: clamp(56px, 8vw, 112px) 0; }
.section-cta .wrap { display: grid; gap: 20px 48px; align-items: end; }
@media (min-width: 900px) { .section-cta .wrap { grid-template-columns: 1fr auto; } }
.section-cta h2 { max-width: 18ch; }
.section-cta p { margin-top: 14px; max-width: 46ch; color: var(--field-fg-2); }

/* ---------- Footer: the selvedge ---------- */
.site-footer { position: relative; background: #17140f; color: #efe9dc; padding: calc(clamp(48px, 6vw, 80px) + 18px) 0 40px; }
@media (prefers-color-scheme: dark) { .site-footer { background: #0b0a07; } }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18px;
  background:
    repeating-linear-gradient(90deg, var(--cotton) 0 10px, transparent 10px 20px) 0 0 / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 10px, var(--cotton) 10px 20px) 0 6px / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--cotton) 0 10px, transparent 10px 20px) 0 12px / 100% 6px no-repeat; }
.site-footer a { color: inherit; }
.site-footer :focus-visible { outline-color: #f3eee3; }
.footer-top { display: grid; gap: 40px; }
@media (min-width: 900px) { .footer-top { grid-template-columns: minmax(240px, 1.3fr) 4fr; gap: 56px; } }
.footer-brand b, .footer-name { display: flex; align-items: center; gap: 10px; font: 900 2rem/1 var(--display); font-stretch: 125%; }
.footer-brand p { margin-top: 14px; color: #d1c7b3; max-width: 32ch; }
.footer-threads { display: flex; gap: 6px; margin-top: 22px; }
.footer-threads i { width: 40px; height: 8px; border-radius: 4px; }
.footer-threads i:nth-child(1) { background: #6f7fe0; } .footer-threads i:nth-child(2) { background: #d4574a; }
.footer-threads i:nth-child(3) { background: #e9a21b; } .footer-threads i:nth-child(4) { background: #1d948c; }
.footer-map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
@media (min-width: 700px) { .footer-map { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.footer-map h2 { font: 600 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #d1c7b3; margin-bottom: 14px; }
.footer-map ul { padding: 0; margin: 0; list-style: none; display: grid; gap: 4px; }
.footer-map a { display: inline-block; padding: 4px 0; text-decoration: none; font-size: .9375rem; }
.footer-map a:hover { text-decoration: underline; }
.footer-small { margin-top: 48px; padding-top: 20px; border-top: 2px solid #3a3328; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .875rem; color: #d1c7b3; }
.footer-small a { color: #efe9dc; }

/* ---------- Woven swatches and bands ---------- */
.swatch { display: block; width: 100%; height: 100%; }
.band-meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: end; padding: 0; margin: 0; list-style: none; }
.band-meter li { font-size: .8125rem; line-height: 1.25; }
.band-meter svg { height: 40px; margin-bottom: 8px; }
.band-meter li.is-current svg { height: 64px; outline: 3px solid currentColor; outline-offset: 2px; }
.band-meter li.is-current { font-weight: 750; }
.band-meter small { display: block; font: 600 .6875rem/1.3 var(--mono); opacity: .85; }

/* ---------- Visual frames (diagrams on any page) ---------- */
figure.visual { position: relative; }
.visual-frame { position: relative; background: var(--surface); border-top: 6px solid var(--ink); padding: clamp(18px, 3vw, 32px); }
.visual figcaption, .visual-caption { margin-top: 12px; font-size: .875rem; line-height: 1.5; color: var(--ink-2); max-width: 70ch; }
.visual-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 20px; margin-bottom: 16px; }
.visual-head h3 { font-size: 1.15rem; }
.sample-tag { display: inline-flex; align-items: center; padding: 4px 8px; border: 2px solid currentColor; border-radius: var(--radius); font: 600 .6875rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.visual-placeholder { padding: 28px; border: 2px dashed var(--ink-2); color: var(--ink-2); }

/* Loom hero canvas */
.loom { position: relative; }
.loom-stage { position: relative; aspect-ratio: 4 / 3; width: 100%; }
.loom-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.loom-static { position: absolute; inset: 0; width: 100%; height: 100%; }
.loom.is-live .loom-static { visibility: hidden; }
.loom-status { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; min-height: 44px; font-size: .875rem; color: var(--field-fg-2, var(--ink-2)); }
.loom-status button { min-height: 44px; padding: 0 2px; background: none; border: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; color: inherit; }

/* Drift diagram */
.drift svg { width: 100%; height: auto; overflow: visible; }
.drift .d-axis { stroke: var(--ink-2); stroke-width: 2; }
.drift .d-label { font: 600 12px var(--mono); fill: var(--ink-2); letter-spacing: .04em; }
.drift .d-force { font: 800 15px var(--display); font-stretch: 112%; }
.drift .d-system { fill: var(--ink); }
.drift-controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 16px; }
.drift-controls label { font-weight: 700; }
.drift-controls input[type="range"] { flex: 1 1 200px; accent-color: var(--madder); min-height: 44px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 10px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--surface); font-weight: 700; }
.toggle[aria-pressed="true"] { background: var(--ink); color: var(--cotton); }
.toggle i { width: 34px; height: 18px; border-radius: 9px; background: var(--line); position: relative; transition: background-color 200ms; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform 220ms var(--out-expo); }
.toggle[aria-pressed="true"] i { background: var(--teal-2); }
.toggle[aria-pressed="true"] i::after { transform: translateX(16px); background: var(--cotton); }
.drift-readout { font: 600 .8125rem/1.5 var(--mono); color: var(--ink-2); min-height: 3em; }

/* Cloth health map */
.cloth-wrap { display: grid; gap: 28px; }
@media (min-width: 1000px) { .cloth-wrap { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; } }
table.cloth { border-collapse: separate; border-spacing: 4px; width: 100%; table-layout: fixed; }
.cloth caption { text-align: left; caption-side: top; padding-bottom: 6px; }
.cloth th { font: 600 .6875rem/1.2 var(--mono); letter-spacing: .02em; text-align: left; padding: 0 2px 4px; vertical-align: bottom; overflow-wrap: anywhere; }
.cloth th[scope="row"] { font: 700 .9375rem/1.2 var(--text); letter-spacing: 0; width: 34%; padding-right: 8px; vertical-align: middle; }
@media (min-width: 600px) { .cloth th[scope="row"] { width: 128px; } .cloth th { font-size: .75rem; } }
.cloth td { height: 44px; padding: 0; }
.cloth td svg { width: 100%; height: 44px; }
.cloth button { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; position: relative; border-radius: 1px; }
.cloth button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cloth button[aria-pressed="true"] svg { outline: 3px solid var(--ink); outline-offset: 2px; }
.cloth .is-loose button::after { content: ""; position: absolute; right: 4px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 3px var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .cloth .is-loose button::after { animation: knot 2.4s var(--shuttle) infinite; }
  @keyframes knot { 0%, 60%, 100% { transform: scale(1); } 30% { transform: scale(1.35); } }
}
.cloth-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: .8125rem; padding: 0; list-style: none; }
.cloth-legend li { display: inline-flex; align-items: center; gap: 8px; }
.cloth-legend svg { width: 30px; height: 16px; }
.thread-card { background: var(--cotton); padding: 20px; border-top: 6px solid var(--madder); min-height: 220px; }
.thread-card[data-band="h"] { border-top-color: var(--saffron); }
.thread-card[data-band="s"] { border-top-color: var(--teal); }
.thread-card[data-band="w"] { border-top-color: var(--indigo); }
.thread-card h4 { font-size: 1.15rem; margin: 6px 0 10px; }
.thread-card .where { font: 600 .75rem/1.4 var(--mono); letter-spacing: .04em; color: var(--ink-2); }
.thread-card dl { display: grid; gap: 10px; margin-top: 12px; }
.thread-card dt { font: 600 .6875rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.thread-card dd { margin-top: 4px; font-size: .9375rem; line-height: 1.45; }
.cloth-list { margin-top: 18px; padding: 0; list-style: none; display: grid; gap: 0; }
.cloth-list li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 9px 0; border-top: 2px solid var(--line); font-size: .9375rem; line-height: 1.35; }
.cloth-list li::before { content: ""; width: 12px; height: 12px; margin-top: 3px; border-radius: 50%; background: var(--madder); }
.cloth-list li.h::before { background: var(--saffron); }

/* Token flip */
.flip { display: grid; gap: 24px; }
@media (min-width: 800px) { .flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 40px; } }
.flip-stage { display: grid; place-items: center; min-height: 200px; background: var(--sample-4); border-radius: var(--radius); padding: 32px 16px; color: #22324a; }
.flip-stage .sample-tag { position: absolute; }
.flip-buttons { display: grid; place-items: center; position: relative; }
.flip-buttons > * { grid-area: 1 / 1; }
.sample-button-raw { background: #3d6fb6; color: #ffffff; border: 0; border-radius: 6px; padding: 12px 20px; font: 600 16px/1.2 var(--text); font-stretch: 100%; letter-spacing: 0; box-shadow: 0 1px 2px rgba(34, 50, 74, .24); }
.sample-button-tok {
  --palette-blue-500: #3d6fb6; --palette-white: #ffffff; --space-3: 12px; --space-5: 20px; --radius-md: 6px; --font-size-md: 16px; --shadow-1: 0 1px 2px rgba(34, 50, 74, .24);
  --action-primary: var(--palette-blue-500); --on-action: var(--palette-white);
  background: var(--action-primary); color: var(--on-action); border: 0; border-radius: var(--radius-md); padding: var(--space-3) var(--space-5);
  font: 600 var(--font-size-md)/1.2 var(--text); font-stretch: 100%; letter-spacing: 0; box-shadow: var(--shadow-1);
}
.flip-code { position: relative; background: var(--term-bg); color: var(--term-fg); border-radius: var(--radius); padding: 18px 20px; font: 500 .8125rem/1.75 var(--mono); overflow-x: auto; min-height: 236px; }
.flip-code .prop { color: var(--term-muted); }
.flip-code .v { display: inline-grid; }
.flip-code .v > span { grid-area: 1 / 1; white-space: nowrap; }
.flip-code .v-raw { color: #ffb4a8; }
.flip-code .v-tok { color: #a8f0e6; }
.flip[data-state="raw"] .v-tok, .flip[data-state="tok"] .v-raw { visibility: hidden; position: absolute; }
.flip-code .v { position: relative; }
.flip-controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 16px; }
.flip-result { font: 600 .8125rem/1.5 var(--mono); color: var(--teal-ink); }
@media (prefers-reduced-motion: no-preference) {
  .flip.is-animating .v > span { transition: transform 420ms var(--out-expo), clip-path 420ms var(--out-expo); }
  .flip[data-state="tok"] .v-raw, .flip[data-state="raw"] .v-tok { transform: translateY(-6px); clip-path: inset(0 0 100% 0); visibility: visible; }
  .flip[data-state="tok"] .v-tok, .flip[data-state="raw"] .v-raw { transform: none; clip-path: inset(0 0 0 0); }
}

/* Weave of the four threads (idea) */
.weave-figure svg { width: 100%; height: auto; }

/* ---------- Icons ---------- */
.arrow { width: 1em; height: 1em; flex: none; }
.rows a > svg { width: 24px; height: 24px; }

/* ---------- Copy pieces from the writer's directives ---------- */
.statement { font: 800 clamp(1.4rem, 2.4vw, 2rem)/1.15 var(--display); font-stretch: 112%; max-width: 26ch; }
.data-note { font-size: .9375rem; line-height: 1.5; color: var(--ink-2); padding-left: 14px; box-shadow: inset 4px 0 0 var(--line); }
.data-note b { color: var(--ink); }
.more { margin-top: 24px; }
.source { margin-top: 12px; max-width: 70ch; }
.tag { display: inline-flex; align-items: center; padding: 3px 7px; margin-left: 6px; border-radius: var(--radius); font: 600 .6875rem/1 var(--mono); letter-spacing: .04em; vertical-align: middle; box-shadow: inset 0 0 0 2px currentColor; white-space: nowrap; }
.tag-concept, .tag-planned { color: var(--ink-2); }

/* ---------- Landing ---------- */
.page-landing main > section { position: relative; }

.loom-stage { aspect-ratio: 440 / 290; }
.loom-threads { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-weight: 700; font-size: .9375rem; }
.loom-threads li { display: inline-flex; align-items: center; gap: 8px; }
.loom-threads i { width: 26px; height: 8px; border-radius: 4px; }

.l-split { display: grid; gap: 40px; padding-block: var(--section); }
@media (min-width: 1000px) { .l-split.has-figure { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; } }
.l-copy { display: grid; gap: 18px; align-content: start; max-width: 60ch; }
.l-copy h2 { margin-bottom: 8px; }
.l-copy p strong:first-child { font-weight: 750; }
.l-figures { display: grid; gap: 24px; min-width: 0; }
@media (min-width: 1000px) { .l-problem .l-copy { position: sticky; top: calc(var(--header-h) + 32px); } }


.l-proof { padding-block: var(--section); }
.l-proof-grid { display: grid; gap: 40px 64px; }
@media (min-width: 1000px) { .l-proof-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); } .l-proof-head { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 64px; align-items: end; } }
.l-proof-head p { max-width: 50ch; }
.facts { display: grid; counter-reset: none; }
.facts li { padding: 22px 0 24px; border-top: 4px solid var(--ink); display: grid; gap: 8px; }
.facts li + li { border-top-width: 2px; border-top-color: var(--line); }
.fact-lead { font: 850 clamp(1.4rem, 2.4vw, 2rem)/1.05 var(--display); font-stretch: 118%; letter-spacing: -.01em; }
.facts p { max-width: 58ch; }
.l-proof-side { display: grid; gap: 20px; align-content: start; min-width: 0; }
@media (min-width: 1000px) { .l-proof-side { position: sticky; top: calc(var(--header-h) + 32px); } }
.l-proof-side .flip { grid-template-columns: 1fr; gap: 16px; }
.teasers { display: grid; gap: 10px; }
.demo-teaser { display: grid; gap: 6px; padding: 18px 20px; background: var(--saffron); color: #17140f; text-decoration: none; border-radius: var(--radius); transition: transform 160ms var(--out-expo); }
.demo-teaser-title { display: inline-flex; align-items: center; gap: 10px; font: 850 1.25rem/1.1 var(--display); font-stretch: 116%; }
.demo-teaser-title .arrow { transition: transform 220ms var(--out-expo); }
.demo-teaser-text { font-size: .9375rem; line-height: 1.45; }
.demo-teaser .badge { justify-self: start; background: transparent; color: #17140f; box-shadow: inset 0 0 0 2px #17140f; }
.demo-teaser .badge-live { background: #17140f; color: #f3eee3; }
.demo-teaser .badge-mixed { box-shadow: inset 0 0 0 2px #17140f, inset 8px 0 0 #17140f; }
.demo-teaser:active { transform: scale(.98); }
@media (hover: hover) { .demo-teaser:hover .arrow { transform: translateX(4px); } .demo-teaser:hover .demo-teaser-title { text-decoration: underline; text-underline-offset: 5px; } }
.demo-teaser:focus-visible { outline-color: var(--ink); }

.l-cta { background: var(--field-bg); color: var(--field-fg); padding: var(--section) 0 calc(var(--section) + 24px); overflow: hidden; }
.l-cta-grid { display: grid; gap: 28px 64px; }
@media (min-width: 1000px) { .l-cta-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; } }
.display-2 { font-size: clamp(2.5rem, 6vw, 5rem); line-height: .92; }
.l-cta-copy { display: grid; gap: 22px; }
.l-cta-copy .actions + .small { margin-top: 4px; }
.l-cta .small { color: var(--field-fg-2); }
.cta-weave { position: absolute; left: 0; right: 0; bottom: 0; height: 24px;
  background:
    repeating-linear-gradient(90deg, var(--indigo) 0 12px, transparent 12px 24px) 0 0 / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 12px, var(--madder) 12px 24px) 0 6px / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--teal) 0 12px, transparent 12px 24px) 0 12px / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 12px, #17140f 12px 24px) 0 18px / 100% 6px no-repeat; }

/* ---------- Hubs and demo pages ---------- */
.hub { padding: clamp(40px, 6vw, 80px) 0 var(--section); }
.hub .prose { margin-top: 56px; }
.demo-page > * + * { margin-top: 24px; }
.demo-page > p, .demo-page > ul { max-width: 68ch; }
.demo-page .demo { margin-top: 0; }

/* ---------- Diagrams ---------- */
.diagram .visual-head h3 { font-size: 1.15rem; }
.flow-thread { position: relative; display: grid; gap: 0; counter-reset: step; }
.flow-thread li { position: relative; display: grid; gap: 4px; padding: 0 0 22px 36px; }
.flow-thread li::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: -6px; width: 6px; border-radius: 3px; background: var(--t, var(--indigo)); }
.flow-thread li:last-child::before { bottom: auto; height: 14px; }
.flow-thread li::after { content: ""; position: absolute; left: 3px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 4px var(--t, var(--indigo)); }
.flow-thread b { font: 800 1.0625rem/1.25 var(--display); font-stretch: 108%; }
.flow-thread span { font-size: .9375rem; color: var(--ink-2); line-height: 1.4; }
.t-indigo { --t: var(--indigo); } .t-madder { --t: var(--madder); } .t-saffron { --t: var(--saffron); } .t-teal { --t: var(--teal); }
@media (prefers-color-scheme: dark) { .t-indigo { --t: var(--indigo-ink); } .t-madder { --t: var(--madder-ink); } .t-teal { --t: var(--teal-ink); } }
@media (min-width: 900px) {
  .flow-thread { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
  .flow-thread li { padding: 34px 6px 0 0; }
  .flow-thread li::before { left: 0; right: -12px; top: 8px; bottom: auto; width: auto; height: 6px; }
  .flow-thread li:last-child::before { right: 0; height: 6px; }
  .flow-thread li::after { left: 0; top: 3px; }
  .flow-thread.is-loop li:last-child::before { right: 0; }
}
.c2c { display: grid; gap: 12px; }
.c2c > div, .c2c li { display: grid; gap: 2px; padding: 14px 16px; background: var(--cotton); border-radius: var(--radius); }
.c2c b { font: 800 1.0625rem/1.2 var(--display); font-stretch: 108%; }
.c2c span { font-size: .9375rem; color: var(--ink-2); }
.c2c-contract { box-shadow: inset 0 6px 0 var(--ink); }
.c2c-outputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.c2c-outputs li { box-shadow: inset 6px 0 0 var(--t); }
.c2c-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.c2c-checks li { padding: 6px 12px; font: 600 .8125rem/1.2 var(--mono); background: transparent; box-shadow: inset 0 0 0 2px var(--teal-ink); }
.c2c-review { box-shadow: inset 6px 0 0 var(--saffron); }
.c2c-release { color: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); background: transparent !important; display: flex !important; align-items: center; }
.repo { display: grid; gap: 24px; }
@media (min-width: 800px) { .repo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; } }
.repo-tree { font: 500 .875rem/1.9 var(--mono); }
.repo-tree li { padding-left: calc(var(--depth) * 20px); }
.repo-tree .is-loom { color: var(--teal-ink); font-weight: 700; }
.repo-arrows { display: grid; gap: 12px; }
.repo-arrows li { display: grid; gap: 2px; padding: 12px 16px; background: var(--cotton); box-shadow: inset 6px 0 0 var(--t); }
.repo-arrows b { font-weight: 800; }
.repo-arrows span { font-size: .9375rem; color: var(--ink-2); }
.value { display: grid; gap: 12px; }
@media (min-width: 700px) { .value { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.value-col { padding: 16px; background: var(--cotton); box-shadow: inset 0 6px 0 var(--t); }
.value-col h4 { font-size: 1.25rem; font-stretch: 120%; margin-bottom: 10px; }
.value-col ul { padding-left: 1.1em; display: grid; gap: 6px; font-size: .9375rem; }
.sos, .sos ul { list-style: none; padding: 0; margin: 0; }
.sos ul { padding-left: clamp(14px, 3vw, 28px); border-left: 4px solid var(--line); margin-left: 6px; }
.sos li { margin-top: 8px; }
.sos li > b, .sos li > span { display: inline; }
.sos li > b { font-weight: 800; margin-right: 10px; }
.sos li > span { font-size: .875rem; color: var(--ink-2); margin-right: 10px; }
.sos .range { font-family: var(--mono); font-size: .8125rem; }
.sos .is-out > b, .sos .is-out > .range { color: var(--madder-ink); }
.sos .is-out > b::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--madder-ink); }
.arch { display: grid; gap: 12px; }
@media (min-width: 900px) { .arch { grid-template-columns: 1fr .8fr 1.2fr 1fr; align-items: stretch; } }
.arch > div { padding: 16px; background: var(--cotton); }
.arch h4 { margin-bottom: 8px; }
.arch ul { padding-left: 1.1em; display: grid; gap: 4px; font-size: .9375rem; }
.arch-core { box-shadow: inset 0 6px 0 var(--indigo); }
.arch-core p { font-size: .875rem; color: var(--ink-2); margin-bottom: 8px; }
.arch-links { background: transparent !important; display: grid; align-items: center; }
.arch-links ul { list-style: none; padding: 0; }
.arch-links li { padding: 6px 10px; font: 600 .8125rem/1.2 var(--mono); box-shadow: inset 0 0 0 2px var(--saffron); text-align: center; }
.arch-cloud { margin-top: 12px; font-weight: 700; }
table.coverage { border-collapse: separate; border-spacing: 2px; font-size: .8125rem; }
.coverage th { font: 600 .75rem/1.2 var(--mono); text-align: left; padding: 2px 8px 2px 0; white-space: nowrap; }
.coverage thead th { writing-mode: horizontal-tb; vertical-align: bottom; }
.coverage td { width: 44px; height: 18px; }
.cv-full { background: var(--indigo); }
.cv-part { background: repeating-linear-gradient(45deg, var(--saffron) 0 4px, transparent 4px 8px); box-shadow: inset 0 0 0 2px var(--saffron); }
.cv-none { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.coverage-wrap { max-height: 520px; overflow: auto; }
.coverage-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: .8125rem; }
.coverage-legend li { display: inline-flex; align-items: center; gap: 8px; background: none !important; box-shadow: none !important; }
.coverage-legend li::before { content: ""; width: 22px; height: 12px; }
.coverage-legend .cv-full::before { background: var(--indigo); } .coverage-legend .cv-part::before { background: repeating-linear-gradient(45deg, var(--saffron) 0 4px, transparent 4px 8px); box-shadow: inset 0 0 0 2px var(--saffron); } .coverage-legend .cv-none::before { box-shadow: inset 0 0 0 2px var(--line); }
.weave-figure .visual-frame { padding: 0; background: none; border: 0; }

/* Cloth: rows weave in once on first view; loose squares fray in the fray variant */
.cloth-pick { all: unset; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.cloth-pick:hover { text-decoration-color: currentColor; }
.cloth-pick:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cloth-list li.is-current { font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .cloth.will-weave tbody tr { clip-path: inset(0 100% 0 0); transition: clip-path 520ms var(--out-expo); }
  .cloth.is-woven tbody tr { clip-path: inset(0 0 0 0); }
  .cloth.is-woven tbody tr:nth-child(2) { transition-delay: 40ms; } .cloth.is-woven tbody tr:nth-child(3) { transition-delay: 80ms; } .cloth.is-woven tbody tr:nth-child(4) { transition-delay: 120ms; } .cloth.is-woven tbody tr:nth-child(5) { transition-delay: 160ms; } .cloth.is-woven tbody tr:nth-child(6) { transition-delay: 200ms; } .cloth.is-woven tbody tr:nth-child(7) { transition-delay: 240ms; }
  .cloth[data-variant="fray"] .is-loose svg { animation: fray 3.2s ease-in-out infinite; }
  @keyframes fray { 0%, 100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); } 50% { clip-path: polygon(0 4%, 96% 0, 100% 92%, 3% 100%); } }
}
.cloth.will-weave table.cloth tbody tr { will-change: clip-path; }

/* ---------- Explore (owner review) ---------- */
.explore-nav ol { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 24px 0; font-weight: 700; }
.study { padding: clamp(40px, 6vw, 80px) 0; border-top: 4px solid var(--ink); }
.study-head { display: grid; gap: 14px 48px; margin-bottom: 32px; }
@media (min-width: 900px) { .study-head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: end; } }
.study-head p { max-width: 62ch; }
.study-options { display: grid; gap: 32px; }
@media (min-width: 1100px) { #loom .study-options { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.option { display: grid; gap: 10px; align-content: start; }
.option-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.option-note { color: var(--ink-2); max-width: 60ch; }
.option-stage { min-width: 0; }
.option-stage.field-indigo { background: var(--field-bg); color: var(--field-fg); padding: 20px; }
.option.is-picked .option-head h3 { text-decoration: underline; text-decoration-color: var(--saffron); text-decoration-thickness: 4px; text-underline-offset: 6px; }

/* ---------- Reveal (only when motion is allowed and the script runs) ---------- */
.motion-ok .reveal { transform: translateY(20px); transition: transform 600ms var(--out-expo); transition-delay: calc(var(--i, 0) * 70ms); }
.motion-ok .reveal.is-in { transform: none; }

/* ---------- Responsive and print ---------- */
@media (max-width: 599px) {
  .rows a { grid-template-columns: 8px minmax(0, 1fr) auto; gap: 4px 14px; padding: 18px 4px 18px 0; }
  .btn { width: 100%; justify-content: center; }
  .actions .btn { width: auto; flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .drawer, .mega { display: none; } .fell { background: none; color: #000; } }

/* Grid children may shrink below their content width (long code lines scroll inside their own box). */
.hero-grid > *, .l-split > *, .l-proof-grid > *, .l-roles-grid > *, .l-cta-grid > *, .l-idea-head > *, .fell-grid > *, .page-grid > *, .study-head > *, .option { min-width: 0; }
.btn { max-width: 100%; text-align: left; line-height: 1.15; padding-top: 10px; padding-bottom: 10px; }
.section-cta .wrap > *, .flip > *, .cloth-wrap > *, .visual-frame, .study-options > * { min-width: 0; }
.flip { grid-template-columns: minmax(0, 1fr); }
.prose { overflow-wrap: break-word; }
.prose a { overflow-wrap: anywhere; }
@media (max-width: 380px) {
  .drawer > summary { padding: 0 10px; }
  .drawer > summary .drawer-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .header-inner { gap: 6px; }
  .wordmark { gap: 6px; }
  .wordmark .mark { width: 24px; height: 24px; }
}
.table-wrap { position: relative; }
.l-proof-head { display: grid; gap: 20px; }
.l-idea-head { row-gap: 24px; }
@media (max-width: 599px) {
  .drift .d-label { display: none; }
  .drift .d-force { font-size: 30px; }
}
.prose .btn { color: var(--cotton); text-decoration: none; }
.prose .btn-ghost { color: var(--ink); }
.prose .arrow-link { color: var(--ink); }
.field-indigo .loom-status, .field-indigo .visual figcaption { color: var(--field-fg-2); }
.option-stage.field-indigo .loom-threads li { color: var(--field-fg); }
.prose .terminal code, .prose .flip-code code, .prose .ba code { background: none; padding: 0; }
/* Demo frames in the Selvedge language: a raised panel framed by a 6px ink rule, square corners. */
main .demo { border: 0; border-top: 6px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
main .demo h3, main .demo .demo-title { font: 800 clamp(1.3rem, 2.2vw, 1.75rem)/1.1 var(--display); font-stretch: 116%; letter-spacing: -.005em; }
main .terminal { border: 0; border-top: 6px solid var(--ink); }
.explore-nav ol { list-style: none; padding-left: 0; gap: 8px 28px; }
.drift .visual-frame > div > svg, .drift [data-drift-svg] svg { max-width: 820px; margin-inline: auto; }
.mega-intro .h2 { color: var(--ink); margin: 0; }
.mega-links li { --t: var(--thread); }
.personas { border-top: 2px solid color-mix(in srgb, var(--field-fg) 25%, transparent); }
.drawer-panel ul { list-style: none; margin: 0; }
.flow-thread code { overflow-wrap: normal; word-break: keep-all; font-size: .8em; }
.arch-links li::marker { content: none; }
/* Japanese: the system fonts have no 900 cut everywhere; allow a synthesised weight rather than a thin headline. */
:lang(ja) { font-synthesis: weight; }
:lang(ja) h2, :lang(ja) .band-verb { font-weight: 800; }
:lang(ja) .hero-text p strong, :lang(ja) .fact-lead { line-height: 1.4; }
/* The loom still: loose threads first; the finished cloth with reduced motion (and once the canvas takes over, neither). */
.loom-static.is-woven { display: none; }
@media (prefers-reduced-motion: reduce) { .loom-static.is-woven { display: block; } .loom-static.is-loose { display: none; } }

/* =====================================================================================
   Direction A, the colour-block annual (owner, 25 Oct 2026).
   Oversized tight titles on cotton; flat full-bleed fields of the four thread colours carry the
   argument; a woven strip at the foot of each field, in the next thread's colour, ties a row of fields
   into one cloth. Motion: fields rise once on load (transform and clip-path); still with reduced motion.
   ===================================================================================== */
.weave-strip { display: block; height: 40px; overflow: hidden; }
.weave-strip svg { display: block; width: 100%; height: 100%; }
.weave-edge { height: 24px; }

/* Colour fields */
.fields { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0; margin: 0; list-style: none; }
@media (min-width: 700px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .fields-hero { grid-template-columns: repeat(4, minmax(0, 1fr)); } .fields-hub, .fields-roles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fields-related { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.field-card { background: var(--field-bg); color: var(--field-fg); }
.field-card > a { --pad: clamp(20px, 2.4vw, 32px); display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; height: 100%; min-height: 220px; padding: var(--pad) var(--pad) 0; text-decoration: none; color: inherit; }
.field-verb { font: 900 clamp(2.4rem, 4.4vw, 4.25rem)/.86 var(--display); font-stretch: 125%; letter-spacing: -.03em; transition: transform 320ms var(--out-expo); overflow-wrap: anywhere; }
.fields-hub .field-verb, .fields-related .field-verb, .fields-roles .field-verb { font-size: clamp(1.9rem, 3.2vw, 3rem); }
.field-verb .tag { display: inline-block; margin-left: 10px; vertical-align: middle; font: 600 .75rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; box-shadow: inset 0 0 0 2px currentColor; }
.field-head { font: 800 1.15rem/1.2 var(--display); font-stretch: 110%; }
.field-text { font-size: 1rem; line-height: 1.45; max-width: 34ch; color: var(--field-fg); }
.field-card .weave-strip { margin: 20px calc(-1 * var(--pad)) 0; }
.field-card :focus-visible, .field-card > a:focus-visible { outline: 3px solid currentColor; outline-offset: -8px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .field-card > a:hover .field-verb { transform: translateX(8px); } }
.field-card > a:hover .field-head { text-decoration: underline; text-underline-offset: 4px; }
.field-card .badge { margin-top: 10px; background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.field-card .badge-live { background: var(--on-field); color: #17140f; box-shadow: none; }
.field-saffron.field-card .badge-live { background: #17140f; color: #f3eee3; }
.field-card .badge-live::before { background: var(--teal); }
.field-card .badge-mixed { box-shadow: inset 0 0 0 2px currentColor, inset 8px 0 0 currentColor; }
.field-card .badge-mixed::before, .field-card .badge-dev::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .fields-hero .field-card { animation: field-rise 700ms var(--out-expo) both; animation-delay: calc(120ms + var(--i) * 70ms); }
  @keyframes field-rise { from { transform: translateY(28px); clip-path: inset(16% 0 0 0); } to { transform: none; clip-path: inset(0 0 0 0); } }
}

/* Landing hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: calc(100svh - var(--header-h) - 4px); }
.hero-head { display: grid; gap: 24px; padding-top: clamp(32px, 5vw, 64px); padding-bottom: clamp(28px, 4vw, 48px); }
.hero-title { font: 900 clamp(2.9rem, 7.6vw, 7.75rem)/.86 var(--display); font-stretch: 125%; letter-spacing: -.03em; max-width: none; }
.hero-row { display: grid; gap: 24px 64px; }
@media (min-width: 1000px) { .hero-row { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; } .hero-row .actions { justify-content: flex-end; } }
.hero-lede p { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.45; max-width: 46ch; }
.hero-row .actions { margin: 0; }
.fields-hero .field-card > a { min-height: 260px; }

/* Landing: the lead spread (operations or tools) */
.l-lead { padding-block: var(--section); }
.l-lead-head { display: grid; gap: 24px 64px; }
@media (min-width: 1000px) { .l-lead-head { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); align-items: start; } }
.l-lead-head h2 { max-width: 14ch; }
.l-lead-copy { display: grid; gap: 18px; max-width: 56ch; }
.l-lead-copy p:first-child strong { font: 800 clamp(1.15rem, 1.6vw, 1.35rem)/1.3 var(--display); font-stretch: 110%; }
.l-lead-cells { display: grid; gap: 0 24px; margin: clamp(40px, 6vw, 72px) 0 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .l-lead-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .l-lead-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.l-lead-cells li { --t: var(--indigo); padding: 20px 0 28px; border-top: 10px solid var(--t); display: grid; gap: 10px; align-content: start; }
.l-lead-cells .t-madder { --t: var(--madder); } .l-lead-cells .t-saffron { --t: var(--saffron); } .l-lead-cells .t-teal { --t: var(--teal); }
.l-lead-cells b { font: 850 clamp(1.4rem, 2.2vw, 1.9rem)/1.02 var(--display); font-stretch: 120%; letter-spacing: -.01em; }
.l-lead-cells p { max-width: 34ch; }
.l-lead .more { margin-top: 24px; }

/* Landing: the problem on a madder field */
.l-problem { position: relative; background: var(--field-bg); color: var(--field-fg); padding-top: var(--section); }
.l-problem-grid { display: grid; gap: 32px 64px; padding-bottom: var(--section); }
@media (min-width: 1000px) { .l-problem-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); } }
.l-problem h2 { max-width: 13ch; }
.l-problem-copy { display: grid; gap: 22px; }
.l-problem-copy p { max-width: 54ch; }
.l-problem .source, .l-problem .small { color: var(--field-fg-2); }
.l-problem a { color: inherit; }
.figs { display: grid; padding: 0; margin: 0; list-style: none; }
.figs li { display: grid; grid-template-columns: minmax(4.2ch, auto) 1fr; gap: 20px; align-items: baseline; padding: 14px 0; border-top: 2px solid color-mix(in srgb, var(--field-fg) 35%, transparent); }
.figs b { font: 900 clamp(2.4rem, 4vw, 3.5rem)/1 var(--display); font-stretch: 125%; }

/* Landing: roles as fields */
.l-roles { padding-top: var(--section); background: var(--surface); }
.l-roles-head { display: grid; gap: 16px 64px; padding-bottom: clamp(32px, 5vw, 56px); }
@media (min-width: 1000px) { .l-roles-head { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); align-items: end; } }
.l-roles-head p { max-width: 44ch; }

/* The page head (fell) */
.fell { position: relative; }
.fell-head { padding-top: clamp(24px, 3.5vw, 44px); padding-bottom: clamp(28px, 4vw, 48px); }
.fell .crumbs a { color: var(--ink-2); }
.fell .crumbs [aria-current="page"] { color: var(--ink); }
.fell-title { font: 900 clamp(2.4rem, 6.6vw, 6.25rem)/.88 var(--display); font-stretch: 125%; letter-spacing: -.03em; max-width: 18ch; hyphens: manual; }
.fell-title.is-mid { font-size: clamp(2.2rem, 5.4vw, 5rem); max-width: 20ch; }
.fell-title.is-long { font-size: clamp(2rem, 4.4vw, 4rem); max-width: 24ch; line-height: .94; }
.fell-field { background: var(--field-bg); color: var(--field-fg); }
.fell-field a { color: inherit; }
.fell-field .fell-grid { display: grid; gap: 24px 56px; padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(28px, 4vw, 48px); }
@media (min-width: 900px) { .fell-field .fell-grid.has-aside { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; } }
.fell-field .lede { font-size: clamp(1.15rem, 1.7vw, 1.45rem); line-height: 1.42; max-width: 50ch; color: var(--field-fg); }
.fell-field .lede strong { font-weight: 800; }
.fell-field .actions { margin-top: 24px; }
.fell-field :focus-visible { outline-color: currentColor; }
.fell-field .badge { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.fell-field .badge-live { background: var(--on-field); color: #17140f; box-shadow: none; }
.field-saffron.fell-field .badge-live { background: #17140f; color: #f3eee3; }
.fell-field .badge-mixed::before, .fell-field .badge-dev::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.fell-field.is-bare .weave-edge { height: 24px; }
.field-indigo .btn, .field-madder .btn, .field-teal .btn { background: var(--on-field); color: #17140f; }
.field-indigo .btn-ghost, .field-madder .btn-ghost, .field-teal .btn-ghost { background: transparent; color: var(--field-fg); box-shadow: inset 0 0 0 2px currentColor; }

/* Read mode in the annual's voice: heavier, tighter chapter titles */
.prose h2 { font-weight: 900; font-size: clamp(2rem, 3.8vw, 3.25rem); line-height: .94; letter-spacing: -.025em; max-width: 18ch; }

.closing { margin-top: clamp(48px, 6vw, 72px); padding-top: 20px; border-top: 10px solid var(--thread, var(--ink)); font: 850 clamp(1.4rem, 2.4vw, 2rem)/1.15 var(--display); font-stretch: 116%; letter-spacing: -.01em; max-width: 30ch; }

/* Related pages and hubs as fields */
.related { padding-top: clamp(56px, 7vw, 96px); background: var(--surface); }
.related h2 { margin-bottom: 28px; font-size: clamp(1.75rem, 3vw, 2.5rem); }
.hub { padding: 0 0 0; }
.hub-tail { padding-block: clamp(48px, 6vw, 80px); }
.section-cta { position: relative; }
:lang(ja) .hero-title, :lang(ja) .fell-title { font-weight: 800; line-height: 1.1; letter-spacing: 0; font-size: clamp(2.2rem, 5.2vw, 5rem); max-width: 16em; }
:lang(ja) .field-verb { font-weight: 800; }
.field-ink .btn { background: var(--saffron); color: #17140f; box-shadow: none; }
.field-ink .btn-ghost { background: transparent; color: #f3eee3; box-shadow: inset 0 0 0 2px #f3eee3; }
.field-ink :focus-visible { outline-color: #f3eee3; }
.section-cta.field-ink { border-top: 10px solid var(--saffron); }
@media (max-width: 699px) { .field-card > a, .fields-hero .field-card > a { min-height: 0; padding-top: 24px; } .field-card .weave-strip { margin-top: 24px; height: 28px; } }
.field-card > a { display: flex; flex-direction: column; }
.field-card .weave-strip { margin-top: auto; padding-top: 0; }
.field-card .field-text { margin-bottom: 24px; }
@media (min-width: 1100px) {
  .fields-hub > li:last-child:nth-child(3n+2), .fields-roles > li:last-child:nth-child(3n+2), .fields-related > li:last-child:nth-child(3n+2) { grid-column: span 2; }
  .fields-hub > li:last-child:nth-child(3n+1), .fields-roles > li:last-child:nth-child(3n+1), .fields-related > li:last-child:nth-child(3n+1) { grid-column: span 3; }
}
@media (min-width: 700px) and (max-width: 1099px) { .fields > li:last-child:nth-child(2n+1) { grid-column: span 2; } }
.section-cta h2 { line-height: 1; }
.section-cta p { margin-top: 20px; }
/* The audit card: real audit output on the landing */
.audit-card { background: var(--surface); border-top: 6px solid var(--ink); padding: clamp(18px, 2.4vw, 28px); margin: 0; }
.ac-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding-bottom: 14px; border-bottom: 4px solid var(--ink); }
.ac-sys { font: 850 clamp(1.3rem, 2vw, 1.75rem)/1 var(--display); font-stretch: 120%; }
.ac-total { display: flex; align-items: baseline; gap: 10px; }
.ac-total b { font: 900 clamp(2.8rem, 4.6vw, 4.25rem)/.8 var(--display); font-stretch: 125%; color: var(--madder-ink); }
.ac-total span { font-weight: 700; }
.ac-rows { padding: 0; margin: 0; list-style: none; }
.ac-rows li { border-bottom: 2px solid var(--line); }
.ac-rows summary { display: grid; grid-template-columns: minmax(7.5rem, 10rem) minmax(0, 1fr) 2.25rem; gap: 12px; align-items: center; min-height: 46px; padding: 6px 0; cursor: pointer; list-style: none; }
.ac-rows summary::-webkit-details-marker { display: none; }
.ac-rows summary:hover .ac-name, .ac-rows details[open] .ac-name { text-decoration: underline; text-underline-offset: 4px; }
.ac-name { font-weight: 700; font-size: .9375rem; line-height: 1.2; }
.ac-strip { display: block; height: 24px; width: var(--w); }
.ac-strip svg { display: block; width: 100%; height: 100%; }
.ac-score { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.ac-rows details p { padding: 0 0 14px; font-size: .9375rem; max-width: 60ch; }
.audit-card figcaption { margin-top: 14px; font-size: .875rem; color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .audit-card .ac-strip { clip-path: inset(0 0 0 0); transition: clip-path 900ms var(--out-expo); }
}
.ac-track { position: relative; display: block; }
.ac-was { position: absolute; top: -4px; bottom: -4px; left: var(--x); width: 3px; margin-left: -1px; background: var(--ink); z-index: 1; }
.ac-score s, .ac-total s { color: var(--ink-2); font-weight: 600; text-decoration-thickness: 2px; }
.ac-total s { font: 800 clamp(1.6rem, 2.4vw, 2.2rem)/1 var(--display); font-stretch: 120%; }
.ac-arrow { font-weight: 800; font-size: 1.5rem; }
.ac-rows summary { grid-template-columns: minmax(7.5rem, 10rem) minmax(0, 1fr) 4.2rem; }
.ac-head { flex-wrap: wrap; }

/* ---------- Critic round 1 ---------- */
/* Hero field fragments: one real artefact per job */
.field-frag { display: block; margin-top: 16px; padding: 12px 14px; font-size: .9375rem; line-height: 1.4; font-weight: 650; background: color-mix(in srgb, var(--field-fg) 12%, transparent); border-left: 4px solid var(--field-fg); max-width: 40ch; }
.field-text p { margin: 0; }
.field-text p + p { margin-top: 0; }
/* Status words: a small word in the text face, not a mono chip */
.badge, main .badge { font: 700 .72rem/1.1 var(--text); letter-spacing: 0; text-transform: none; padding: 2px 7px 3px 6px; gap: 5px; vertical-align: .18em; }
.badge::before { width: 7px; height: 7px; }
/* Sentence case in the text face instead of tracked mono capitals */
.crumbs ol { font: 600 .875rem/1.4 var(--text); letter-spacing: 0; text-transform: none; }
.toc h2, #toc-title { font: 800 1rem/1.2 var(--display) !important; letter-spacing: 0 !important; text-transform: none !important; }
.site-footer h2, .site-footer h3, .footer-col h2, .footer-col h3 { font-family: var(--display) !important; letter-spacing: 0 !important; text-transform: none !important; font-size: 1rem !important; }
.sample-tag, .rows .tag, .field-verb .tag { font-family: var(--text) !important; letter-spacing: 0 !important; text-transform: none !important; font-weight: 700; }
/* Engagement steps */
.l-engagement { background: var(--surface); }
.l-engagement .l-lead-cells b { font-size: clamp(1.25rem, 1.9vw, 1.6rem); }
/* Founder */
.l-founder { background: var(--field-bg); color: var(--field-fg); padding-block: var(--section); }
.l-founder-grid { display: grid; gap: 32px 64px; }
@media (min-width: 1000px) { .l-founder-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.l-founder h2 { max-width: 14ch; }
.l-founder-copy { display: grid; gap: 20px; }
.l-founder blockquote { margin: 0; padding: 0 0 0 24px; border-left: 10px solid var(--saffron); font: 850 clamp(1.5rem, 2.6vw, 2.4rem)/1.15 var(--display); font-stretch: 112%; letter-spacing: -.01em; }
.l-founder .source { color: var(--field-fg-2); font-size: .9375rem; }
.l-founder a { color: inherit; }
.l-founder p { max-width: 56ch; }
/* Japanese line breaking */
:lang(ja) h1, :lang(ja) h2, :lang(ja) .field-verb, :lang(ja) .field-head { word-break: auto-phrase; line-break: strict; }
/* Contact form */
.contact-form { display: grid; gap: 16px; margin-top: clamp(32px, 5vw, 56px); padding: clamp(20px, 3vw, 32px); background: var(--surface); border-top: 10px solid var(--saffron); scroll-margin-top: calc(var(--header-h) + 16px); }
.contact-form .contact-title { margin: 0; font-size: clamp(1.75rem, 3vw, 2.5rem); }
.cf-grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .cf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact-form label { display: grid; gap: 6px; font-weight: 700; }
.contact-form input:not([type="checkbox"]), .contact-form select, .contact-form textarea { font: 400 1rem/1.4 var(--text); padding: 12px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--cotton); color: var(--ink); min-height: 48px; width: 100%; }
.contact-form .cf-consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.contact-form .cf-consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--indigo); }
.cf-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-status { min-height: 1.5em; font-weight: 700; }
.cf-status.is-error { color: var(--madder-ink); }
.contact-form .btn { justify-self: start; }
.field-frag { background: rgb(0 0 0 / .2); }
.field-saffron .field-frag { background: rgb(255 255 255 / .28); }
.display-2 { font-size: clamp(2.05rem, 6vw, 5rem); }
:lang(ja) .field-verb { font-size: clamp(1.7rem, 2.6vw, 2.9rem); white-space: nowrap; }
@media (max-width: 420px) { :lang(ja) .field-verb { white-space: normal; } }
/* Japanese: break between phrases only (the build adds <wbr> after particles), never inside a word. */
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ja) .field-head { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
/* Proof: the intro sentence sits under its heading, not adrift in the other column. */
@media (min-width: 1000px) { .l-proof-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; } }
.l-proof-head p { max-width: 56ch; font-size: 1.125rem; }
.prose pre { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Japanese display headings: sized so the longest phrase (デザインシステムを) fits the column. */
:lang(ja) .display-2, :lang(ja) .l-lead-head h2, :lang(ja) .l-problem h2, :lang(ja) .l-founder h2 { font-size: clamp(1.8rem, 3.4vw, 3.2rem); line-height: 1.2; max-width: none; letter-spacing: 0; }
:lang(ja) .prose h2, :lang(ja) .l-proof-head h2, :lang(ja) .l-roles-head h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); line-height: 1.25; letter-spacing: 0; }
:lang(ja) .hero-title { font-size: clamp(1.85rem, 5.2vw, 5rem); }
/* Fields with a fragment outside the link */
.field-card.has-frag { --pad: clamp(20px, 2.4vw, 32px); display: flex; flex-direction: column; }
.field-card.has-frag > a { min-height: 0 !important; height: auto; padding-bottom: 0; flex: none; }
.field-card.has-frag > a .field-text { margin-bottom: 0; }
.field-frag-wrap { padding: 0 var(--pad); }
.field-card.has-frag > .weave-strip { margin: 24px 0 0; margin-top: auto; padding-top: 24px; box-sizing: content-box; height: 40px; }
@media (max-width: 699px) { .field-card.has-frag > .weave-strip { height: 28px; } }
/* Govern: one governed change, step by step */
.gov-steps { margin-top: 16px; padding: 14px; background: rgb(255 255 255 / .28); border-left: 4px solid #17140f; }
.gs-label { font-weight: 800; font-size: .875rem; }
.gs-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 0; margin: 10px 0; list-style: none; counter-reset: none; }
.gs-list li { font-size: .75rem; font-weight: 750; padding-top: 6px; border-top: 4px solid rgb(23 20 15 / .25); }
.gs-list li.is-on, .gov-steps:not(.is-live) .gs-list li { border-top-color: #17140f; }
.gs-text { font-size: .9375rem; line-height: 1.4; min-height: 4.2em; }
.gs-next { margin-top: 10px; min-height: 40px; padding: 8px 14px; font: 750 .9375rem/1 var(--text); color: #f3eee3; background: #17140f; border: 0; border-radius: var(--radius); cursor: pointer; }
.gs-next:focus-visible { outline: 3px solid #17140f; outline-offset: 3px; }
@media (hover: hover) { .gs-next:hover { background: #2a251c; } }
.gs-next:active { transform: scale(.97); }
/* Problem: the drift scrubber under the heading */
.l-problem-side { display: grid; gap: 28px; align-content: start; }
.l-problem .drift { margin: 0; color: var(--ink); }
.l-problem .drift .visual-frame { background: var(--surface); color: var(--ink); }
.l-problem .drift figcaption { color: var(--field-fg-2); }
@media (prefers-color-scheme: dark) { .l-problem .drift .visual-frame { background: var(--surface); } }
.drift .d-label, .drift-readout { font-family: var(--text); letter-spacing: 0; }
/* Simple header variant: five plain links */
.simple-nav { display: none; }
@media (min-width: 1000px) { .simple-nav { display: block; margin-left: auto; margin-right: 8px; } }
.simple-nav ul { display: flex; gap: 4px 28px; padding: 0; margin: 0; list-style: none; }
.simple-nav a { display: inline-block; padding: 10px 0; font: 750 1.0625rem/1 var(--display); font-stretch: 110%; text-decoration: none; color: var(--ink); border-bottom: 3px solid transparent; }
.simple-nav a:hover { border-bottom-color: currentColor; }
.simple-nav a[aria-current="page"] { border-bottom-color: var(--saffron); }
.drawer-simple { list-style: none; margin: 0; padding: 8px 0; }
.drawer-simple a { display: block; padding: 16px var(--gutter); font: 850 1.5rem/1 var(--display); font-stretch: 120%; text-decoration: none; color: inherit; border-left: 8px solid var(--indigo); }
.drawer-simple li + li { margin-top: 6px; }
/* Roles as an index: each role, what changes for it, and where it meets Loom */
.l-roles-index { padding-bottom: var(--section); }
.roles-index { list-style: none; padding: 0; margin: 0; border-top: 4px solid var(--ink); }
.roles-index li { --t: var(--indigo); border-bottom: 2px solid var(--line); }
.roles-index .t-madder { --t: var(--madder); } .roles-index .t-saffron { --t: var(--saffron); } .roles-index .t-teal { --t: var(--teal); }
.roles-index a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; padding: 22px 0 22px 22px; text-decoration: none; color: var(--ink); position: relative; }
.roles-index a::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 8px; border-radius: 4px; background: var(--t); transition: transform 280ms var(--out-expo); transform-origin: center; }
.ri-role { font: 900 clamp(1.6rem, 2.6vw, 2.3rem)/.98 var(--display); font-stretch: 118%; letter-spacing: -.02em; grid-column: 1; }
.ri-text { grid-column: 1; max-width: 56ch; }
.ri-meet { grid-column: 1; font-weight: 700; color: var(--ink-2); max-width: 56ch; }
.ri-arrow { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-size: 1.75rem; transition: transform 280ms var(--out-expo); }
@media (min-width: 1000px) {
  .roles-index a { grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 4fr) auto; align-items: baseline; gap: 24px 40px; }
  .ri-role, .ri-text, .ri-meet { grid-column: auto; }
  .ri-arrow { grid-row: auto; grid-column: auto; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .roles-index a:hover .ri-arrow { transform: translateX(6px); } .roles-index a:hover::before { transform: scaleY(1.15); } }
.roles-index a:hover .ri-role { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.roles-index a:focus-visible { outline-offset: 4px; }
/* Artefacts in reading pages: code and records use the full width of the reading area, with an ink rule. */
.prose > pre { max-width: min(100%, 112ch); border-top: 6px solid var(--saffron); margin-top: 28px; margin-bottom: 8px; }
@media (min-width: 900px) { .prose pre { white-space: pre; overflow-wrap: normal; } }
/* A real contract, read at build time */
.cx-grid { display: grid; gap: 14px 32px; margin: 0 0 20px; }
@media (min-width: 800px) { .cx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cx-grid dt { font-weight: 800; font-size: .875rem; }
.cx-grid dd { margin: 4px 0 0; }
.cx-grid ul { padding-left: 1.1em; margin: 0; }
.cx-chain caption { text-align: left; font-weight: 750; padding-bottom: 8px; }
.cx-chain td, .cx-chain th { vertical-align: top; }
.cx-tier { display: block; font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.cx-val i { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; border: 1px solid var(--line); }
.table-wrap + .cx-grid { margin-top: 24px; }
/* One draft, checked twice */
.ct-grid { display: grid; gap: 16px; }
@media (min-width: 800px) { .ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ct-col { padding: 16px 18px; border-top: 6px solid var(--madder); background: var(--surface-2); }
.ct-on { border-top-color: var(--teal); }
.ct-verdict { font: 800 1.05rem/1.3 var(--display); font-stretch: 108%; }
.ct-col ul { margin: 10px 0 0; padding-left: 1.1em; font-size: .9375rem; }
.ct-col li + li { margin-top: 8px; }
.ct-col .small { margin-top: 10px; }
.bd-list { list-style: none; padding: 0; margin: 0; display: grid; }
.bd-list li { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; border-bottom: 2px solid var(--line); }
.bd-list em { grid-column: 2; font-style: normal; font-size: .8125rem; color: var(--ink-2); }
.cx-chain .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dmx { background: var(--term-bg); color: var(--term-fg); padding: 18px; border-radius: var(--radius); font-size: .8125rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.cx-chain th[scope="row"] code { white-space: nowrap; }
.prose .dmx { white-space: pre-wrap; overflow-wrap: anywhere; }
.contract-x .visual-frame > p.small + .table-wrap { margin-top: 12px; } .contract-x .visual-frame > .table-wrap + p.small { margin-top: 10px; }
.screen-shot img { display: block; width: 100%; height: auto; border: 2px solid var(--line); }
.cx-chain td code { overflow-wrap: normal; word-break: normal; }
