/* ==========================================================================
   Harness Lab: the public website (b41), Night Shift.
   Loads after tokens.css and brand.css (copied from the app at build time). Tokens only: no colour literal anywhere in this file
   (a test checks it). Light and dark both follow the tokens. Only the AI elements (the Ask box light, its avatar) and the
   harness banner move on their own; everything else moves in answer to the user. No inline styles are used by the pages.
   ========================================================================== */

:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 96px;
  --measure: 65ch;
  --wrap: 1120px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: auto; scroll-padding-top: 72px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--background); color: var(--muted-foreground);
  font-family: var(--font-sans); font-size: var(--text-base); line-height: var(--text-base--line-height); overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased; }
main { flex: 1 0 auto; display: block; }
main:focus { outline: none; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { color: var(--foreground); margin: 0; }
p { margin: 0 0 var(--s4); }
ul, ol { margin: 0; padding: 0; }
a { color: var(--primary-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }
code, pre { font-family: var(--font-mono); font-size: 13px; }
code { padding: 1px 5px; border-radius: var(--radius-sm); background: var(--code-bg); color: var(--foreground); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: var(--s4); top: -100px; z-index: 50; padding: var(--s2) var(--s4); border-radius: var(--radius-md);
  background: var(--primary); color: var(--primary-foreground); text-decoration: none; }
.skip-link:focus { top: var(--s2); }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap.narrow { max-width: calc(760px + 2 * var(--gutter)); }
.nums { font-variant-numeric: tabular-nums slashed-zero; }
.muted-s { font-size: var(--text-sm); color: var(--subtle-foreground); }
.fine { font-size: var(--text-sm); line-height: var(--text-sm--line-height); color: var(--subtle-foreground); margin: var(--s3) 0 0; }
.lede { font-size: var(--text-lg); line-height: var(--text-lg--line-height); color: var(--muted-foreground); max-width: 40em; margin: var(--s3) 0 0; }
.display-page { font-size: clamp(1.75rem, 4.2vw, 2.5rem); line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--elevation-card); }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: var(--text-xs); color: var(--muted-foreground); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s5); border: 1px solid transparent;
  border-radius: var(--radius-md); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out-quart), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out-quart); }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-sm { min-height: 40px; padding: 0 var(--s4); font-size: var(--text-sm); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-foreground); }
.btn-secondary { background: var(--surface-2); color: var(--foreground); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-3); color: var(--foreground); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-md);
  background: transparent; color: var(--muted-foreground); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--foreground); }
.icon-btn[hidden] { display: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }

/* ---------- header and footer ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in oklch, var(--background) 88%, transparent); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); min-height: 64px; padding-block: var(--s2); }
.brand-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--foreground); text-decoration: none; margin-inline-end: auto; }
.brand-link:hover { color: var(--foreground); }
.site-nav { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s1); order: 3; flex: 1 1 100%; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s3); border-radius: var(--radius-md); color: var(--muted-foreground);
  font-weight: 500; text-decoration: none; }
.site-nav a:hover { background: var(--surface-3); color: var(--foreground); }
.site-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); }
.header-actions { display: flex; align-items: center; gap: var(--s2); }
@media (min-width: 760px) {
  .site-nav { order: 0; flex: 0 1 auto; margin-inline-start: var(--s4); }
  .brand-link { margin-inline-end: 0; }
  .header-actions { margin-inline-start: auto; }
}
.theme-toggle .ti { display: none; }
.theme-toggle[data-mode="system"] .ti-system, .theme-toggle[data-mode="light"] .ti-light, .theme-toggle[data-mode="dark"] .ti-dark { display: inline-flex; }
.theme-toggle:not([data-mode]) .ti-system { display: inline-flex; }

.site-footer { margin-top: var(--s9); border-top: 1px solid var(--border); background: var(--bg-sunken); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); padding-block: var(--s7) var(--s5); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); } }
.footer-about p { max-width: 36em; margin-top: var(--s3); font-size: var(--text-sm); }
.footer-h { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--s3); }
.footer-col ul { list-style: none; display: grid; gap: var(--s2); }
.footer-col a { font-size: var(--text-sm); }
.footer-end { padding-block: var(--s4) var(--s6); border-top: 1px solid var(--border); }
.footer-end p { margin: 0; }

/* ---------- the harness banner (the owner's one moving exception, with the AI elements) ---------- */
.mq { overflow: hidden; padding: var(--s3) 0; border-bottom: 1px solid var(--border); background: var(--bg-sunken);
  -webkit-mask-image: linear-gradient(to right, transparent, var(--foreground) 5%, var(--foreground) 95%, transparent);
  mask-image: linear-gradient(to right, transparent, var(--foreground) 5%, var(--foreground) 95%, transparent); }
.mq-track { display: flex; width: max-content; animation: marquee 56s linear infinite; }
.mq:hover .mq-track, .mq:focus-within .mq-track { animation-play-state: paused; }
.mq-group { display: flex; flex: none; justify-content: space-around; gap: var(--s3); min-width: 100vw; margin: 0; padding: 0 var(--s3) 0 0; list-style: none; }
.mq-chip { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 4px 18px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-1); box-shadow: var(--elevation-card); color: var(--foreground); text-decoration: none; white-space: nowrap; }
.mq-chip:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--foreground); }
.mq-text { display: flex; align-items: center; gap: var(--s3); }
.mq-chip .htag { padding: 0; border: 0; font-size: var(--text-base); font-weight: 600; color: var(--foreground); }
.mq-chip .htag-dot { width: 10px; height: 10px; }
.mq-tag { font-size: 12.5px; color: var(--subtle-foreground); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .mq { overflow-x: auto; scrollbar-width: thin; }
  .mq-track { animation: none; }
  .mq-group.dup { display: none; }
  .mq-group { min-width: 0; }
}

/* ---------- harness identity ---------- */
.htag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 24px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: 999px; font-size: 12.5px; font-weight: 550; line-height: 1.25; color: var(--muted-foreground); vertical-align: middle; }
.htag-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.htag-dot.t0 { box-shadow: inset 0 0 0 1.5px var(--subtle-foreground); }
.htag-dot.t1 { background: var(--tool-1); } .htag-dot.t2 { background: var(--tool-2); } .htag-dot.t3 { background: var(--tool-3); }
.htag-dot.t4 { background: var(--tool-4); } .htag-dot.t5 { background: var(--tool-5); } .htag-dot.t6 { background: var(--tool-6); }
.htag-name { min-width: 0; overflow-wrap: anywhere; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); padding-block: var(--s7) var(--s7); }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero > .wrap { position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "visual" "ask"; gap: var(--s6); align-items: center; }
.hero-text { grid-area: text; }
.hero-grid > .hv { grid-area: visual; }      /* the motion scene (b43): beside the headline on wide screens, under the text on phones */
.hero-grid > .ask { grid-area: ask; }
@media (min-width: 960px) {
  .hero { padding-block: var(--s8) var(--s7); }
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "text visual" "ask visual"; gap: var(--s6) var(--s7); }
  .hero-grid > .ask { align-self: start; }
}
.hero .display-hero { font-size: clamp(2.125rem, 5.4vw, 3.5rem); max-width: 17em; }
.hero-text .lede { margin-top: var(--s4); }
.proof { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); margin-top: var(--s7); }
@media (min-width: 960px) { .proof { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s5); margin: 0; padding: var(--s5); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--elevation-card); }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { min-width: 0; }
.stat dt { font-size: var(--text-2xl); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; color: var(--foreground); }
.stat dd { margin: var(--s1) 0 0; font-size: var(--text-sm); line-height: var(--text-sm--line-height); color: var(--muted-foreground); }
.bar-card { padding: var(--s5); }
.bar-h { font-size: var(--text-base); font-weight: 600; margin-bottom: var(--s3); }
.mbar { display: block; width: 100%; height: 10px; margin-bottom: var(--s3); }
.seg.mat-settled { fill: var(--success); } .seg.mat-open { fill: var(--warning); } .seg.mat-emerging { fill: var(--subtle-foreground); } .seg.mat-depends { fill: var(--muted-foreground); }
.bar-text { margin: 0; font-size: var(--text-sm); color: var(--muted-foreground); }

/* ---------- the Ask box (the AI: its light moves on its own) ---------- */
.ask { padding: var(--s5); border-color: var(--border-strong); box-shadow: var(--elevation-pop); }
.ask-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); min-height: 28px; }
.ask-head h2 { font-size: var(--text-lg); font-weight: 600; }
.ask-face { display: inline-flex; flex: none; }
.ask-face .bm-ring { width: 28px; height: 28px; }
.bm-ring-svg { width: 100%; height: 100%; }
.ask-inner { display: flex; align-items: center; gap: var(--s2); padding: 6px 6px 6px 14px; }
.ask-inner input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--foreground); font: inherit; font-size: 16px; }
.ask-inner input::placeholder { color: var(--subtle-foreground); }
.ask-inner input:focus-visible { outline: none; }
.ask-send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-md); cursor: pointer;
  background: var(--ai-solid); color: var(--ai-solid-foreground); transition: background-color var(--dur-fast) var(--ease-out-quart), transform var(--dur-fast) var(--ease-out-quart); }
.ask-send:hover { background: color-mix(in oklch, var(--ai-solid) 86%, var(--foreground)); }
.ask-send:active { transform: scale(0.95); }
.ask-send:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.ask-note { margin: var(--s3) 0 0; font-size: var(--text-sm); color: var(--subtle-foreground); }

/* ---------- sections ---------- */
.section { padding-block: var(--s8) 0; }
.section.tight { padding-block-start: var(--s6); }
.display-section + .lede { margin-bottom: var(--s5); }
.page-head { padding-block: var(--s6) var(--s5); border-bottom: 1px solid var(--border); background-image: var(--glow-hero); }
.page-head .lede { max-width: 38em; }
.more-link { margin: var(--s5) 0 0; font-weight: 500; }
.more-link a { display: inline-flex; align-items: center; gap: var(--s2); }
.sub-h { font-size: var(--text-lg); font-weight: 600; margin: var(--s5) 0 var(--s3); }
.block { margin-top: var(--s7); }
.block h2 { font-size: var(--text-xl); line-height: var(--text-xl--line-height); font-weight: 600; letter-spacing: -0.015em; margin-bottom: var(--s3); }
.page { padding-block: var(--s5) 0; }

/* ---------- agent types, the stack ---------- */
.ex-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: var(--s4); }
.ex-types .ty-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 720px) { .ex-types { grid-template-columns: repeat(5, minmax(0, 1fr)); } .ex-types .ty-card:last-child:nth-child(odd) { grid-column: auto; } }
.ty-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); min-width: 0; padding: 14px 16px; text-align: start;
  color: var(--foreground); background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--elevation-card); }
.ty-card[role="button"] { cursor: pointer; transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast); }
.ty-card[role="button"]:hover { background: var(--surface-2); border-color: var(--border-strong); }
.ty-card[role="button"]:active { transform: scale(0.985); }
.ty-card.is-current { background: var(--primary-soft); border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ty-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ty-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--bg-sunken); color: var(--primary-text); }
.ty-card.is-current .ty-ico { background: var(--surface-1); }
.ty-name { font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.ty-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 7px; }
.ty-count strong { font-size: var(--text-xl); font-weight: 700; line-height: 1; color: var(--foreground); }
.ty-label { font-size: var(--text-sm); color: var(--muted-foreground); }
.ty-note { font-size: 12.5px; line-height: 1.45; color: var(--muted-foreground); }

.stack { display: flex; flex-direction: column; gap: 8px; padding: var(--s4); border-radius: var(--radius-2xl); }
.stack-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s5); padding: 2px 4px 6px; }
.stack-summary { margin: 0; font-size: var(--text-base); font-weight: 600; line-height: 1.35; color: var(--foreground); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--text-xs); color: var(--muted-foreground); }
.legend-set { display: contents; }
.legend-set[hidden] { display: none; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-sw { display: inline-block; width: 12px; height: 12px; border: 1px solid; border-radius: 3px; }
.st-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; box-sizing: border-box; }
.st-dot.mat-settled { background: var(--success); }
.st-dot.mat-open { border: 2px solid var(--warning); }
.st-dot.mat-emerging { border: 2px dashed var(--subtle-foreground); }
.st-dot.mat-depends { background: var(--subtle-foreground); }
.st-dot.mat-none { border: 1.5px dotted var(--subtle-foreground); }
.st-rows { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.st-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.st-lead { order: 1; flex: 1 1 0; display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-id { flex: none; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted-foreground); }
.st-lead .st-id { width: 22px; }
.st-name { font-size: 14.5px; font-weight: 600; line-height: 1.25; color: var(--foreground); min-width: 0; }
.st-tail { order: 2; flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.st-tail strong { font-size: var(--text-base); font-weight: 600; color: var(--foreground); }
.st-tail-label { font-size: 11.5px; color: var(--muted-foreground); }
.st-chips { order: 3; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
@media (min-width: 960px) {
  .st-lead { flex: 0 0 200px; }
  .st-chips { order: 2; flex: 1 1 0; }
  .st-tail { order: 3; flex: 0 0 120px; }
}
.st-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 28px; padding: 4px 9px; border: 1px solid; border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.3; text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out-quart), box-shadow var(--dur-fast), border-color var(--dur-fast); }
.st-chip:hover { transform: translateY(-1px); border-color: var(--primary); box-shadow: var(--elevation-card); }
.st-chip-name { min-width: 0; overflow-wrap: anywhere; }
/* level shades: last, so they win over the border of the element they colour */
.lv-m { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.lv-s { background: var(--surface-3); color: var(--foreground); border-color: var(--border-strong); }
.lv-o { background: var(--surface-1); color: var(--muted-foreground); border-color: var(--border); }
.lv-n, .lv-x { background: transparent; color: var(--subtle-foreground); border-color: var(--border-strong); border-style: dashed; }
.lv-x { border-style: dotted; }
.lv-m:hover { color: var(--background); }
.lv-s:hover { color: var(--foreground); }
.lv-o:hover { color: var(--muted-foreground); }
.lv-n:hover, .lv-x:hover { color: var(--subtle-foreground); }
.st-chip.lv-m .st-dot.mat-open { border-color: var(--warning); }
.st-chip.lv-m .st-dot.mat-settled { background: var(--success); }
.st-chip.lv-m .st-dot.mat-emerging { border-color: var(--background); }

/* ---------- harness lists ---------- */
.hlist { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.hlist-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.hcard[hidden] { display: none; }
.hcard-link { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); height: 100%; padding: var(--s3) var(--s4); text-decoration: none; color: var(--foreground);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--elevation-card);
  transition: border-color var(--dur-base), box-shadow var(--dur-base), transform var(--dur-base) var(--ease-out-quart); }
.hcard-link:hover { border-color: var(--lift-edge); box-shadow: 0 10px 28px -12px var(--ai-glow); transform: translateY(-2px); color: var(--foreground); }
.hcard-link .htag { padding: 0; border: 0; font-size: var(--text-base); font-weight: 600; color: var(--foreground); }
.hcard-link .htag-dot { width: 10px; height: 10px; }
.hcard-meta { font-size: var(--text-sm); color: var(--muted-foreground); }
.name-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); }
.name-list li { padding: 4px 10px; border: 1px dashed var(--border-strong); border-radius: 999px; font-size: var(--text-sm); color: var(--muted-foreground); }

/* ---------- how it works (cards), CTA band ---------- */
.how-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s4); margin-top: var(--s5); }
.how-card { padding: var(--s5); }
.how-card h3 { font-size: var(--text-base); font-weight: 600; margin: var(--s4) 0 var(--s2); }
.how-card p { margin: 0; font-size: var(--text-sm); line-height: 1.55; }
.tile { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-text); }
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s5); padding: var(--s6); border-radius: var(--radius-2xl); background-image: var(--gradient-surface); }
.cta-band > div:first-child { flex: 1 1 360px; min-width: 0; }
.cta-band .cta-row { margin-top: 0; }
.cta-band .lede { margin-bottom: 0; }

/* ---------- topic and harness pages ---------- */
.crumbs { margin: 0 0 var(--s4); font-size: var(--text-sm); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; }
.crumbs li { color: var(--subtle-foreground); }
.crumbs li + li::before { content: "/"; margin-inline: var(--s2); color: var(--border-strong); }
.crumbs a { color: var(--muted-foreground); }
.topic-head .layer-tag { margin: 0 0 var(--s2); font-size: var(--text-sm); color: var(--muted-foreground); }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: var(--s4) 0 0; }
.mat-line { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--muted-foreground); }
.prose-p { max-width: var(--measure); }
.build-card { padding: var(--s4) var(--s5); margin: 0; font-size: var(--text-lg); line-height: var(--text-lg--line-height); font-weight: 600; color: var(--foreground); }
.lvl-list { list-style: none; display: grid; gap: var(--s2); max-width: 36rem; }
.lvl-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) var(--s4); background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); }
.lvl-type { color: var(--foreground); font-weight: 500; }
.lv-badge { flex: none; padding: 3px 10px; border: 1px solid; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.facts { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s7); margin: 0; }
.facts > div { min-width: 0; }
.facts dt { font-size: var(--text-sm); color: var(--muted-foreground); }
.facts dd { margin: var(--s1) 0 0; font-size: var(--text-xl); font-weight: 700; color: var(--foreground); }
.facts-wide { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: var(--s4); }
.facts-wide dd { font-size: var(--text-base); font-weight: 600; }
.cta-block { margin-top: var(--s7); padding: var(--s6); border-radius: var(--radius-xl); background-image: var(--gradient-surface); }
.cta-block h2 { font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.015em; }
.cta-block p { margin: var(--s3) 0 0; max-width: 40em; }
.cta-block .cta-row { margin-top: var(--s4); }
.topic-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; margin-top: var(--s4); }
.topic-card { position: relative; display: flex; flex-direction: column; gap: var(--s2); min-width: 0; padding: 18px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--elevation-card); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.topic-card:hover { border-color: var(--lift-edge); box-shadow: 0 10px 28px -12px var(--ai-glow); }
.topic-card-name { font-size: var(--text-lg); font-weight: 600; color: var(--foreground); text-decoration: none; }
.topic-card-name::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.topic-card-name:focus-visible { outline: none; }
.topic-card:has(.topic-card-name:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.topic-card-line { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted-foreground); }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: var(--s2); }
.lv-pill { padding: 2px 7px; border: 1px solid; border-radius: 5px; font-size: 11.5px; line-height: 1.4; }
.lv-pill-type { opacity: 0.8; }
.layer-sec { margin-top: var(--s7); scroll-margin-top: 80px; }
.layer-sec h3 { font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.015em; display: flex; align-items: baseline; gap: var(--s3); }
.layer-sec .st-id { font-size: var(--text-sm); }
.layer-sec .lede { font-size: var(--text-base); margin-top: var(--s2); }
.strengths { list-style: none; display: grid; gap: var(--s3); }
.strengths li { padding: var(--s4) var(--s5); background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--elevation-card); }
.strengths p { margin: var(--s2) 0 0; font-size: 14px; line-height: 1.6; }
.strength-topic { font-weight: 600; }

/* ---------- samples, legal, prose ---------- */
.sample-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.sample { padding: var(--s5); min-width: 0; }
.sample-label { display: inline-flex; margin: 0 0 var(--s3); padding: 2px 8px; border-radius: var(--radius-sm); background: var(--ribbon-soft); color: var(--ribbon-text); font-size: var(--text-xs); font-weight: 600; }
.sample-q { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--s3); }
.sample-cites { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border); font-size: var(--text-sm); }
.sample-cites p { margin: 0 0 var(--s2); color: var(--subtle-foreground); }
.inline-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.prose p, .prose li { max-width: var(--measure); }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 var(--s4); }
.prose li { margin-bottom: var(--s1); }
.prose h4, .prose h5, .prose h6 { margin: var(--s4) 0 var(--s2); font-size: var(--text-base); }
.prose pre.code { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); overflow-x: auto; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-md); }
.prose pre.code code { padding: 0; background: none; }
.prose-page pre.code { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); overflow-x: auto; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-md); max-width: 100%; }
.prose-page pre.code code { padding: 0; background: none; }
.prose-page .block:first-of-type { margin-top: var(--s5); }
.prose-page p, .prose-page li { max-width: var(--measure); }
.prose-page ul { padding-inline-start: 1.4em; margin: 0 0 var(--s4); }
.prose-page li { margin-bottom: var(--s2); }
.prose-page h3 { font-size: var(--text-lg); font-weight: 600; margin: var(--s5) 0 var(--s3); }
.defs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1) 0; margin: var(--s4) 0 0; }
.defs dt { margin-top: var(--s3); font-weight: 600; color: var(--foreground); }
.defs dd { margin: 0; max-width: var(--measure); }
@media (min-width: 640px) { .defs { grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s3) var(--s5); } .defs dt { margin-top: 0; } }
.draft-note { margin: var(--s5) 0 0; padding: var(--s3) var(--s4); border: 1px solid var(--warning); border-radius: var(--radius-md); background: var(--warning-soft); color: var(--warning-text); font-size: var(--text-sm); }

/* ---------- H6, the bracket curtain (b43): a short page transition between our own pages ----------
   Cross-document View Transitions: where the browser lacks them (Firefox, Safari before 18) navigation is plain. Two brackets close
   in from the edges, the core pops, the new page shows under the wash and the brackets open again: 380 ms in all. Nothing waits
   for it: the new page is already loaded, and under Reduce motion there is no transition at all. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.vt-curtain { position: fixed; inset: 0; z-index: 90; pointer-events: none; visibility: hidden; --vt-s: clamp(150px, 42vmin, 280px); --vt-dur: 380ms; }
:root:active-view-transition .vt-curtain { visibility: visible; }
.vt-wash, .vt-piece { position: fixed; display: block; }
.vt-wash { inset: 0; background: var(--background); view-transition-name: vt-wash; }
.vt-piece { left: 50%; top: 50%; width: var(--vt-s); height: var(--vt-s); margin: calc(var(--vt-s) / -2) 0 0 calc(var(--vt-s) / -2); overflow: visible; }
.vt-l { view-transition-name: vt-l; }
.vt-r { view-transition-name: vt-r; }
.vt-c { view-transition-name: vt-c; }
.vt-br { fill: none; stroke: var(--bm-body); stroke-width: 3.8; stroke-linecap: round; stroke-linejoin: round; }
.vt-core { fill: var(--bm-agent); }
::view-transition-group(vt-wash), ::view-transition-group(vt-l), ::view-transition-group(vt-r), ::view-transition-group(vt-c) { animation: none; }
::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: vt-page 380ms linear both; mix-blend-mode: normal; }
::view-transition-new(vt-wash) { animation: vt-wash 380ms linear both; mix-blend-mode: normal; }
::view-transition-new(vt-l) { animation: vt-bracket-l 380ms linear both; mix-blend-mode: normal; }
::view-transition-new(vt-r) { animation: vt-bracket-r 380ms linear both; mix-blend-mode: normal; }
::view-transition-new(vt-c) { animation: vt-core 380ms linear both; mix-blend-mode: normal; }
@keyframes vt-page { 0%, 40% { opacity: 0; } 54%, 100% { opacity: 1; } }
@keyframes vt-wash { 0% { opacity: 0; } 34%, 50% { opacity: 0.94; } 100% { opacity: 0; } }
@keyframes vt-bracket-l {
  0% { transform: translateX(-58vw); opacity: 0; animation-timing-function: var(--ease-out-quart); }
  38%, 52% { transform: translateX(0); opacity: 1; animation-timing-function: var(--ease-in-out-cubic); }
  100% { transform: translateX(-58vw); opacity: 0; }
}
@keyframes vt-bracket-r {
  0% { transform: translateX(58vw); opacity: 0; animation-timing-function: var(--ease-out-quart); }
  38%, 52% { transform: translateX(0); opacity: 1; animation-timing-function: var(--ease-in-out-cubic); }
  100% { transform: translateX(58vw); opacity: 0; }
}
@keyframes vt-core {
  0%, 22% { transform: scale(0); opacity: 0; animation-timing-function: var(--ease-out-expo); }
  40% { transform: scale(1.12); opacity: 1; }
  52% { transform: scale(1); opacity: 1; animation-timing-function: var(--ease-in-out-cubic); }
  100% { transform: scale(0.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .vt-curtain { display: none; }
  .btn, .st-chip, .hcard-link, .topic-card, .ty-card, .ask-send { transition: none; }
  .btn:active, .ask-send:active, .st-chip:hover, .hcard-link:hover { transform: none; }
}
@media (max-width: 759px) { .site-header { position: static; } }
@media (max-width: 479px) {
  .header-cta { display: none; }
  .site-nav a { padding: 0 var(--s2); }
  .cta-row .btn { flex: 1 1 100%; }
  .cta-block, .cta-band { padding: var(--s5); }
  .section { padding-block-start: var(--s7); }
}
