/* ==========================================================
   CLAUDE DESIGN — A Field Tutorial.

   The house system, shared with AI Triangulation and the
   Cowork Field Guide: violet-black ground, violet for the
   machine, gold for the human who decides. Worksheets and
   templates are warm paper — the chart table under lamplight.
   Dark by design.

   Core tokens and components are held in common across the
   field guides; keep them in step. Everything specific to
   this guide lives in the CLAUDE DESIGN block at the foot
   of the file.
========================================================== */

/* ----------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.12; text-wrap: balance; overflow-wrap: break-word; }
p { overflow-wrap: break-word; }
ul { padding: 0; }

/* ----------------------------- Tokens */
:root {
  /* Stage */
  --bg: #14101c;
  --surface: #1c1726;
  --surface-2: #241d31;
  --surface-3: #2d2440;
  --line: #332b47;
  --line-strong: #453a61;

  /* Ink */
  --ink: #efeaf7;
  --muted: #a89bc0;
  --faint: #6f6488;

  /* The players */
  --violet: #9b8cf5;
  --violet-deep: #6a58d8;
  /* The podium */
  --gold: #d9a94e;
  --gold-bright: #edc272;
  --gold-ink: #14101c;

  /* Paper (worksheets — the chart table) */
  --paper: #f2ecdd;
  --paper-2: #e9e1cd;
  --paper-line: #d8cdb2;
  --paper-ink: #241d31;
  --paper-muted: #6d6353;

  /* Semantic */
  --ok: #7fc98f;
  --warn: #e0b34c;
  --bad: #e0808f;
  --info: #7fb3e0;

  /* Per-seat accents (distinct bearings) */
  --seat-a: #d98e6a;   /* terracotta */
  --seat-b: #7fc9b4;   /* teal */
  --seat-c: #8fa6e8;   /* steel blue */
  --seat-d: #b98fd4;   /* orchid — the fourth bearing */

  /* Type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --text-sm: clamp(0.85rem, 0.8rem + 0.2vw, 0.95rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem);
  --text-xl: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --text-2xl: clamp(2.1rem, 1.5rem + 2.8vw, 3.4rem);
  --text-hero: clamp(2.6rem, 1.6rem + 5vw, 5.2rem);

  --radius: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================
   THEME — Light / Dark / System
   Dark is the base above: these pages were designed with the
   house lights down. Light is a full counterpart, not an
   inversion — the violet and gold darken so they still carry
   text and borders on a pale ground.
========================================================== */

/* System preference, unless the reader has explicitly chosen dark */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
  /* Stage, lit */
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f5f0e8;
  --surface-3: #ebe4d8;
  --line: #e3dbcd;
  --line-strong: #c8bda9;

  /* Ink */
  --ink: #241d31;
  --muted: #5a5170;
  --faint: #857b96;

  /* The players */
  --violet: #5b45c9;
  --violet-deep: #402d9c;
  /* The podium — dark enough to carry text and borders on a light ground */
  --gold: #9a6b12;
  --gold-bright: #7d550c;
  --gold-ink: #fffdf8;

  /* Paper consoles stay warm, one step deeper than the page */
  --paper: #f0e8d6;
  --paper-2: #e7dcc3;
  --paper-line: #cfc2a4;
  --paper-ink: #241d31;
  --paper-muted: #6d6353;

  /* Semantic */
  --ok: #1f7a4d;
  --warn: #8a6011;
  --bad: #a83246;
  --info: #2b6ca8;

  --code-bg: #f6f1e8;

  --seat-a: #a8532a;
  --seat-b: #1f7d68;
  --seat-c: #3f57b8;
  --seat-d: #7a4aa0;
  }
}

/* Explicit choice always wins */
:root[data-theme="light"] {
  /* Stage, lit */
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f5f0e8;
  --surface-3: #ebe4d8;
  --line: #e3dbcd;
  --line-strong: #c8bda9;

  /* Ink */
  --ink: #241d31;
  --muted: #5a5170;
  --faint: #857b96;

  /* The players */
  --violet: #5b45c9;
  --violet-deep: #402d9c;
  /* The podium — dark enough to carry text and borders on a light ground */
  --gold: #9a6b12;
  --gold-bright: #7d550c;
  --gold-ink: #fffdf8;

  /* Paper consoles stay warm, one step deeper than the page */
  --paper: #f0e8d6;
  --paper-2: #e7dcc3;
  --paper-line: #cfc2a4;
  --paper-ink: #241d31;
  --paper-muted: #6d6353;

  /* Semantic */
  --ok: #1f7a4d;
  --warn: #8a6011;
  --bad: #a83246;
  --info: #2b6ca8;

  --code-bg: #f6f1e8;

  --seat-a: #a8532a;
  --seat-b: #1f7d68;
  --seat-c: #3f57b8;
  --seat-d: #7a4aa0;
}

/* Dark needs the code surface token the light block introduces */
:root, :root[data-theme="dark"] { --code-bg: #0e0b15; }

/* ---- Inline SVG diagrams carry hard-coded stage colours.
        Remap them when the lights come up. CSS beats presentation
        attributes, so no markup has to change. */
:root[data-theme="light"] [fill="#efeaf7"] { fill: var(--ink); }
:root[data-theme="light"] [fill="#a89bc0"] { fill: var(--muted); }
:root[data-theme="light"] [stroke="#a89bc0"] { stroke: var(--muted); }
:root[data-theme="light"] [fill="#6f6488"] { fill: var(--faint); }
:root[data-theme="light"] [stroke="#6f6488"] { stroke: var(--faint); }
:root[data-theme="light"] [fill="#d9a94e"] { fill: var(--gold); }
:root[data-theme="light"] [stroke="#d9a94e"] { stroke: var(--gold); }
:root[data-theme="light"] [fill="#9b8cf5"] { fill: var(--violet); }
:root[data-theme="light"] [stroke="#9b8cf5"] { stroke: var(--violet); }
:root[data-theme="light"] [fill="#14101c"] { fill: var(--gold-ink); }
:root[data-theme="light"] [fill="#1c1726"] { fill: var(--surface-2); }
:root[data-theme="light"] [fill="#d98e6a"] { fill: var(--seat-a); }
:root[data-theme="light"] [stroke="#d98e6a"] { stroke: var(--seat-a); }
:root[data-theme="light"] [fill="#7fc9b4"] { fill: var(--seat-b); }
:root[data-theme="light"] [stroke="#7fc9b4"] { stroke: var(--seat-b); }
:root[data-theme="light"] [fill="#8fa6e8"] { fill: var(--seat-c); }
:root[data-theme="light"] [stroke="#8fa6e8"] { stroke: var(--seat-c); }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) [fill="#efeaf7"] { fill: var(--ink); }
  :root:not([data-theme="dark"]) [fill="#a89bc0"] { fill: var(--muted); }
  :root:not([data-theme="dark"]) [stroke="#a89bc0"] { stroke: var(--muted); }
  :root:not([data-theme="dark"]) [fill="#6f6488"] { fill: var(--faint); }
  :root:not([data-theme="dark"]) [stroke="#6f6488"] { stroke: var(--faint); }
  :root:not([data-theme="dark"]) [fill="#d9a94e"] { fill: var(--gold); }
  :root:not([data-theme="dark"]) [stroke="#d9a94e"] { stroke: var(--gold); }
  :root:not([data-theme="dark"]) [fill="#9b8cf5"] { fill: var(--violet); }
  :root:not([data-theme="dark"]) [stroke="#9b8cf5"] { stroke: var(--violet); }
  :root:not([data-theme="dark"]) [fill="#14101c"] { fill: var(--gold-ink); }
  :root:not([data-theme="dark"]) [fill="#1c1726"] { fill: var(--surface-2); }
  :root:not([data-theme="dark"]) [fill="#d98e6a"] { fill: var(--seat-a); }
  :root:not([data-theme="dark"]) [stroke="#d98e6a"] { stroke: var(--seat-a); }
  :root:not([data-theme="dark"]) [fill="#7fc9b4"] { fill: var(--seat-b); }
  :root:not([data-theme="dark"]) [stroke="#7fc9b4"] { stroke: var(--seat-b); }
  :root:not([data-theme="dark"]) [fill="#8fa6e8"] { fill: var(--seat-c); }
  :root:not([data-theme="dark"]) [stroke="#8fa6e8"] { stroke: var(--seat-c); }
}

/* ---- The control itself */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--gold); }
.theme-toggle svg { display: none; flex-shrink: 0; }
:root:not([data-theme-pref]) .theme-toggle .icon-system,
:root[data-theme-pref="system"] .theme-toggle .icon-system { display: block; }
:root[data-theme-pref="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme-pref="dark"] .theme-toggle .icon-moon { display: block; }

.header-tools { display: flex; align-items: center; gap: 0.6rem; }
@media (max-width: 1040px) {
  .theme-toggle .theme-label { display: none; }
  .theme-toggle { padding: 0.45rem 0.6rem; }
}

::selection { background: var(--violet-deep); color: var(--ink); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
}

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--gold-bright); }

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

.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
.container-narrow { max-width: 900px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--gold);
  color: var(--gold-ink);
  padding: 0.6rem 1.1rem;
  border-radius: 0 0 var(--radius) 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: var(--gold-ink); }

/* ----------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.85rem;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  color: var(--ink);
}
.brand svg { align-self: center; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

/* Wordmark stands alone now — keep it on one line and give the nav room. */
.brand { flex-shrink: 0; }
.brand-name { white-space: nowrap; }
.nav-links {
  display: flex;
  gap: 0.1rem;
  list-style: none;
}
.nav-links a {
  display: block;
  white-space: nowrap;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 999px;
  transition: color 150ms var(--ease), background 150ms var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.is-current { color: var(--gold-bright); }

/* Mobile nav — the toggle is injected by app.js */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 36px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--muted);
  border-radius: 2px;
  transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 1040px) {
    .nav-toggle { display: flex; }
  .site-header nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }
  .site-header nav.is-open { display: block; }
  .nav-links {
    flex-direction: column;
    gap: 0;
    padding: 0.6rem clamp(1.25rem, 4vw, 2.5rem) 1.1rem;
  }
  .nav-links a {
    padding: 0.7rem 0.4rem;
    font-size: 0.95rem;
    border-radius: var(--radius);
    border-bottom: 1px solid var(--line);
  }
  .nav-links li:last-child a { border-bottom: none; }
}

/* ----------------------------- Sections */
section { padding-block: clamp(4rem, 9vw, 7rem); }
section[id] { scroll-margin-top: 76px; }
.section-alt { background: var(--surface); }
.section-tight { padding-block: clamp(2rem, 5vw, 3.5rem); }

.section-head { max-width: 680px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head--wide { max-width: 820px; }
.section-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.section-topline .section-eyebrow { margin-bottom: 0; }
.to-top {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}
.to-top:hover { color: var(--gold-bright); border-color: var(--gold); }
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.section-eyebrow::before {
  content: attr(data-num);
  display: inline-grid;
  place-items: center;
  padding: 0.15rem 0.5rem;
  background: var(--gold);
  color: var(--gold-ink);
  border-radius: 6px;
  letter-spacing: 0.05em;
}
.section-head h1,
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-2xl);
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}
.section-head p { color: var(--muted); font-size: var(--text-lg); line-height: 1.55; }
.section-head p + p { margin-top: 0.9rem; font-size: var(--text-base); }

/* Body prose inside chapters */
.prose { max-width: 68ch; }
.prose p { color: var(--muted); line-height: 1.7; margin-bottom: 1.1rem; }
.prose p strong { color: var(--ink); font-weight: 600; }
.prose p em { color: var(--ink); font-style: italic; }
.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 2.4rem 0 0.9rem;
}
.prose h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 2rem 0 0.8rem;
}
.prose ul, .prose ol { color: var(--muted); line-height: 1.7; margin: 0 0 1.2rem 1.2rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li strong { color: var(--ink); font-weight: 600; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  color: var(--gold-bright);
}

/* ----------------------------- Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ----------------------------- Hero */
.hero { padding-block: clamp(4rem, 9vw, 7.5rem) clamp(3rem, 6vw, 5rem); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; margin-inline: auto; width: 100%; }
}
.hero-visual svg { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
}
.hero-eyebrow::before { content: ''; width: 2.2rem; height: 1px; background: var(--gold); }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-hero);
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
}
.hero h1 .accent { color: var(--gold-bright); font-style: italic; }
.hero-lede {
  max-width: 34rem;
  color: var(--muted);
  font-size: var(--text-lg);
  line-height: 1.6;
  margin-bottom: 2.2rem;
}
.hero-lede em { color: var(--ink); font-style: italic; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* Bearing lines animate in on the hero triangle */
.bearing { stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw-bearing 2.2s var(--ease) forwards; }
.bearing--b { animation-delay: 0.35s; }
.bearing--c { animation-delay: 0.7s; }
@keyframes draw-bearing { to { stroke-dashoffset: 0; } }
.fix-dot { opacity: 0; animation: fix-in 700ms var(--ease) 2.4s forwards; }
@keyframes fix-in { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }

/* ----------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 150ms var(--ease), background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--gold); color: var(--gold-ink); }
.btn-primary:hover { background: var(--gold-bright); color: var(--gold-ink); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--violet); color: var(--ink); background: var(--surface-2); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ----------------------------- Marquee */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--surface);
  padding-block: 0.8rem;
}
.marquee-track {
  display: flex;
  gap: 2.75rem;
  width: max-content;
  animation: marquee 40s linear infinite;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.marquee-track span::after { content: '·'; margin-left: 2.75rem; color: var(--gold); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ----------------------------- Home: chapter grid */
.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}
.toc-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: var(--ink);
  transition: transform 200ms var(--ease), border-color 200ms var(--ease);
}
.toc-card:hover { transform: translateY(-4px); border-color: var(--gold); color: var(--ink); }
.toc-card__num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.8rem;
}
.toc-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin-bottom: 0.45rem; }
.toc-card p { color: var(--muted); font-size: var(--text-sm); line-height: 1.55; flex-grow: 1; }
.toc-card__go {
  margin-top: 1.1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color 150ms var(--ease);
}
.toc-card:hover .toc-card__go { color: var(--gold-bright); }

/* ----------------------------- Stat row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.1rem;
}
.stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.stat__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 1.6rem + 2vw, 3rem);
  line-height: 1;
  color: var(--gold-bright);
  margin-bottom: 0.6rem;
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.6rem;
}
.stat p { color: var(--muted); font-size: var(--text-sm); line-height: 1.55; }
.stat cite {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* ----------------------------- Seat cards (the platforms) */
.seat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.seat {
  --seat: var(--violet);
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--seat);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease);
}
.seat[data-seat="a"] { --seat: var(--seat-a); }
.seat[data-seat="b"] { --seat: var(--seat-b); }
.seat[data-seat="c"] { --seat: var(--seat-c); }
.seat:hover { transform: translateY(-4px); }
.seat__role {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seat);
  margin-bottom: 0.7rem;
}
.seat h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; margin-bottom: 0.3rem; }
.seat__sub { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); letter-spacing: 0.06em; margin-bottom: 1rem; }
.seat p { color: var(--muted); font-size: var(--text-sm); line-height: 1.6; margin-bottom: 1rem; }
.seat dl { margin-top: auto; padding-top: 0.9rem; border-top: 1px dashed var(--line); }
.seat dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.9rem;
}
.seat dt:first-child { margin-top: 0; }
.seat dd { color: var(--muted); font-size: var(--text-sm); line-height: 1.55; margin: 0.25rem 0 0; }
.seat dd strong { color: var(--ink); font-weight: 600; }

/* ----------------------------- Comparison matrix */
.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
}
.matrix {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.matrix th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line-strong);
  vertical-align: bottom;
}
.matrix th[data-seat="a"] { color: var(--seat-a); }
.matrix th[data-seat="b"] { color: var(--seat-b); }
.matrix th[data-seat="c"] { color: var(--seat-c); }
.matrix td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--muted);
  line-height: 1.5;
}
.matrix tbody tr:last-child td { border-bottom: none; }
.matrix tbody tr:hover td { background: var(--surface); }
.matrix td:first-child { color: var(--ink); font-weight: 600; }
.matrix .best { color: var(--gold-bright); }
.matrix caption {
  caption-side: bottom;
  padding: 0.9rem 1.1rem;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--faint);
  letter-spacing: 0.04em;
  line-height: 1.6;
}

/* ----------------------------- Claim ledger states */
.state {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid;
}
.state--flag { background: color-mix(in oklab, var(--bad) 16%, transparent); color: var(--bad); border-color: color-mix(in oklab, var(--bad) 45%, transparent); }
.state--open { background: color-mix(in oklab, var(--warn) 12%, transparent); color: var(--warn); border-color: color-mix(in oklab, var(--warn) 40%, transparent); }
.state--ok   { background: color-mix(in oklab, var(--ok) 16%, transparent); color: var(--ok); border-color: color-mix(in oklab, var(--ok) 45%, transparent); }

.ledger-key {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 1.2rem;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.55;
}
.ledger-key > div { flex: 1 1 220px; }
.ledger-key .state { margin-bottom: 0.5rem; }

/* ----------------------------- Protocol steps */
.protocol {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.protocol > li {
  counter-increment: step;
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 1.4rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.6rem;
}
@media (max-width: 620px) {
  .protocol > li { grid-template-columns: 1fr; gap: 0.8rem; }
}
.protocol > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}
.protocol h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin-bottom: 0.5rem; }
.protocol p { color: var(--muted); font-size: var(--text-sm); line-height: 1.65; margin-bottom: 0.8rem; }
.protocol p:last-child { margin-bottom: 0; }
.protocol .rule {
  display: block;
  margin-top: 0.9rem;
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--gold);
  background: color-mix(in oklab, var(--gold) 7%, var(--bg));
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.protocol .rule strong { color: var(--gold-bright); }
.protocol__time {
  display: inline-block;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ----------------------------- Conflict taxonomy cards */
.conflict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
}
.conflict {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.conflict__tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid;
  margin-bottom: 0.9rem;
}
.conflict__tag[data-act="resolve"] { color: var(--ok); border-color: color-mix(in oklab, var(--ok) 55%, transparent); }
.conflict__tag[data-act="verify"]  { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 55%, transparent); }
.conflict__tag[data-act="stop"]    { color: var(--bad); border-color: color-mix(in oklab, var(--bad) 55%, transparent); }
.conflict h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin-bottom: 0.5rem; }
.conflict p { color: var(--muted); font-size: var(--text-sm); line-height: 1.6; flex-grow: 1; }
.conflict__do {
  margin-top: 1.1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--ink);
}
.conflict__do b {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

/* ----------------------------- Disagreement triage tool */
.triage {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 860px) { .triage { grid-template-columns: 1fr; } }

.triage__form {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
}
.triage__q { border: none; padding: 0; margin: 0 0 1.5rem; }
.triage__q:last-of-type { margin-bottom: 0; }
.triage__q legend {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
  padding: 0;
}
.triage__q p { color: var(--ink); font-size: var(--text-sm); line-height: 1.55; margin-bottom: 0.8rem; }
.triage__opts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.triage__opts label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease);
}
.triage__opts label:hover { color: var(--ink); border-color: var(--violet); }
.triage__opts input { position: absolute; opacity: 0; width: 0; height: 0; }
.triage__opts input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.triage__opts label:has(input:checked) {
  background: var(--violet);
  border-color: var(--violet);
  color: var(--gold-ink);
}

.triage__result {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  min-height: 100%;
}
.triage__result h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin-bottom: 0.7rem; }
.triage__result p { color: var(--muted); font-size: var(--text-sm); line-height: 1.65; }
.triage__result .conflict__tag { display: inline-block; margin-bottom: 0.9rem; }
.triage__hint { color: var(--faint); font-style: italic; }

/* ----------------------------- Pro / con panels */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 780px) { .split { grid-template-columns: 1fr; } }
.panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 1.6rem;
}
.panel h3 { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.2rem; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.panel .glyph {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
}
.panel--pro .glyph { background: color-mix(in oklab, var(--ok) 16%, transparent); color: var(--ok); }
.panel--con .glyph { background: color-mix(in oklab, var(--bad) 16%, transparent); color: var(--bad); }
.panel ul { list-style: none; display: flex; flex-direction: column; gap: 1.1rem; }
.panel li { display: flex; flex-direction: column; gap: 0.2rem; padding-left: 1rem; border-left: 2px solid; }
.panel--pro li { border-color: color-mix(in oklab, var(--ok) 55%, transparent); }
.panel--con li { border-color: color-mix(in oklab, var(--bad) 55%, transparent); }
.panel li strong { font-weight: 600; }
.panel li span { color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }

.mitigation {
  margin-top: 1.25rem;
  padding: 1.3rem 1.5rem;
  border: 1px solid color-mix(in oklab, var(--gold) 45%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--gold) 7%, var(--bg));
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.mitigation strong { color: var(--gold-bright); font-weight: 600; }

/* ----------------------------- Failure table */
.failure-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
}
.failure-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.failure-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line-strong);
}
.failure-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--muted);
  line-height: 1.5;
}
.failure-table tbody tr:last-child td { border-bottom: none; }
.failure-table tbody tr:hover td { background: var(--surface); }
.failure-table td:first-child { color: var(--ink); font-weight: 600; }
.sev {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.sev--high { background: color-mix(in oklab, var(--bad) 18%, transparent); color: var(--bad); }
.sev--med  { background: color-mix(in oklab, var(--warn) 18%, transparent); color: var(--warn); }
.sev--low  { background: color-mix(in oklab, var(--info) 18%, transparent); color: var(--info); }

/* ----------------------------- Worked example transcript */
.worked-step {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 1.6rem;
  padding-block: 2rem;
  border-top: 1px solid var(--line);
}
.worked-step:first-of-type { border-top: none; padding-top: 0; }
@media (max-width: 700px) {
  .worked-step { grid-template-columns: 1fr; gap: 0.9rem; }
}
.worked-step__stage {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.5;
}
.worked-step__stage span { display: block; color: var(--faint); margin-top: 0.3rem; letter-spacing: 0.08em; }
.worked-step h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin-bottom: 0.7rem; }
.worked-step p { color: var(--muted); line-height: 1.7; margin-bottom: 0.9rem; }
.worked-step p:last-child { margin-bottom: 0; }

.reply {
  border: 1px solid var(--line);
  border-left: 3px solid var(--seat);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.9rem;
}
.reply[data-seat="a"] { --seat: var(--seat-a); }
.reply[data-seat="b"] { --seat: var(--seat-b); }
.reply[data-seat="c"] { --seat: var(--seat-c); }
.reply__who {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--seat);
  margin-bottom: 0.5rem;
}
.reply p { color: var(--muted); font-size: var(--text-sm); line-height: 1.6; margin-bottom: 0; }

/* ----------------------------- Templates (paper worksheets) */
.template {
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.template__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid var(--paper-line);
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.template pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--paper-ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.copy-btn {
  background: transparent;
  border: 1px solid var(--paper-line);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.copy-btn:hover { background: var(--paper-ink); color: var(--paper); }
.copy-btn.is-copied { background: #2a7d5a; border-color: #2a7d5a; color: #fff; }

/* ----------------------------- Checklist */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.checklist li {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem 0.9rem 2.9rem;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 1.1rem;
  top: 1.15rem;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--gold);
  border-radius: 4px;
}
.checklist li strong { color: var(--ink); font-weight: 600; }

/* ----------------------------- Field note */
.fieldnote {
  margin-top: 2.4rem;
  padding: 1.3rem 1.5rem;
  border: 1px solid color-mix(in oklab, var(--gold) 45%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--gold) 7%, var(--bg));
}
.fn-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 0.5rem;
}
.fieldnote p { color: var(--ink); font-style: italic; line-height: 1.6; }
.fieldnote p + p { margin-top: 0.7rem; }

/* Caution variant */
.fieldnote--warn { border-color: color-mix(in oklab, var(--bad) 45%, transparent); background: color-mix(in oklab, var(--bad) 7%, var(--bg)); }
.fieldnote--warn .fn-label { color: var(--bad); }
.fieldnote--warn p { font-style: normal; color: var(--muted); }
.fieldnote--warn p strong { color: var(--ink); }

/* ----------------------------- Code block */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ink);
}
.code-block .cm { color: var(--faint); font-style: italic; }
.code-block .kw { color: var(--violet); }
.code-block .fn { color: var(--gold-bright); }
.code-block .str { color: var(--ok); }

/* ----------------------------- Diagram wrapper */
.figure { overflow-x: auto; margin-block: 2rem; }
.figure svg { min-width: 620px; width: 100%; height: auto; }
.figure figcaption {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  line-height: 1.6;
}

/* ----------------------------- Sources list */
.sources { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.sources li {
  padding-left: 1rem;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.sources li strong { color: var(--ink); font-weight: 600; }

/* ----------------------------- Chapter pager */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.pager__link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}
.pager__link:hover { color: var(--gold-bright); border-color: var(--gold); }

/* ----------------------------- Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 3.5rem 2.5rem;
}
.site-footer .container {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
}
@media (max-width: 780px) { .site-footer .container { grid-template-columns: 1fr; } }
.footer-brand { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; }
.footer-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0.4rem 0 1rem;
}
.footer-note { max-width: 46ch; color: var(--faint); font-size: var(--text-sm); line-height: 1.6; margin-bottom: 0.8rem; }
.footer-note--gold { color: var(--muted); }
.footer-note--gold em { color: var(--gold-bright); }
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.9rem;
}
.site-footer a { display: block; color: var(--muted); font-size: var(--text-sm); padding-block: 0.25rem; }
.site-footer a:hover { color: var(--gold-bright); }
.fine {
  grid-column: 1 / -1;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  line-height: 1.7;
}

/* ----------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bearing { stroke-dashoffset: 0; animation: none; }
  .fix-dot { opacity: 1; animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ==========================================================
   SHELL COMPONENTS — shared with the Cowork Field Guide.
   Kept byte-identical there; change both or neither.
========================================================== */

/* Centred hero */
.hero--center { text-align: center; padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 5vw, 4rem); }
.hero--center h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 1.5rem + 3vw, 3.6rem);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.hero-mark { width: 96px; height: 96px; margin: 0 auto 1.5rem; }
.hero--center .hero-lede {
  max-width: 30rem;
  margin: 0 auto 1.2rem;
  color: var(--ink);
  font-size: var(--text-lg);
}
.hero-sub {
  max-width: 38rem;
  margin-inline: auto;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.75;
}

/* Small uppercase section label */
.eyebrow-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1.2rem;
}

/* Quick links */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.8rem; }
.quick-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  color: var(--ink);
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
.quick-link:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--ink); }
.quick-link strong { font-weight: 600; font-size: 0.95rem; }
.quick-link span { color: var(--muted); font-size: var(--text-sm); }

/* ==========================================================
   CLAUDE DESIGN — components specific to this guide.
   Everything above this line is house system.
========================================================== */

/* ----------------------------- The brief comparator
   One control flips three worked examples between a
   specification and a brief. The point is the contrast,
   so both readings stay in the same place on the page. */
.comparator {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.3rem, 3vw, 1.8rem);
}
.seg {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.28rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  margin-bottom: 1.5rem;
}
.seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-selected="true"] { background: var(--violet); color: var(--gold-ink); }
.comparator[data-mode="briefed"] .seg-btn[aria-selected="true"] { background: var(--gold); }

.prompt-row {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.35rem;
}
.prompt-row + .prompt-row { margin-top: 0.9rem; }
.prompt-kind {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.75rem;
}
.prompt-text {
  border-left: 2px solid var(--line-strong);
  padding-left: 1rem;
  color: var(--ink);
  line-height: 1.65;
  font-size: var(--text-sm);
  transition: border-color 200ms var(--ease);
}
.comparator[data-mode="briefed"] .prompt-text { border-left-color: var(--gold); }
.prompt-why {
  margin-top: 0.85rem;
  padding-left: 1rem;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.prompt-why b {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-bottom: 0.25rem;
}
.comparator[data-mode="briefed"] .prompt-why b { color: var(--gold); }

/* ----------------------------- Note cards
   A labelled card for enumerated material: use cases,
   bundle contents, limitations. */
.note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.note {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease);
}
.note:hover { transform: translateY(-3px); border-color: var(--gold); }
.note__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.7rem;
}
.note h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; margin-bottom: 0.5rem; }
.note p { color: var(--muted); font-size: var(--text-sm); line-height: 1.65; flex-grow: 1; }
.note p + p { margin-top: 0.7rem; flex-grow: 0; }
.note p em { color: var(--ink); font-style: italic; }
.note__reach {
  margin-top: 1.1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--muted);
}
.note__reach b {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

/* ----------------------------- The relay
   Chat → Design → Code, as three stations on one line. */
.relay { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.relay__node {
  --stn: var(--seat-c);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--stn);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
}
.relay__node[data-stn="chat"] { --stn: var(--seat-c); }
.relay__node[data-stn="design"] { --stn: var(--seat-a); }
.relay__node[data-stn="code"] { --stn: var(--seat-b); }
.relay__where {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stn);
  margin-bottom: 0.6rem;
}
.relay__node h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; margin-bottom: 0.4rem; }
.relay__node p { color: var(--muted); font-size: var(--text-sm); line-height: 1.6; }

/* ----------------------------- Reduced motion, this guide's additions */
@media (prefers-reduced-motion: reduce) {
  .note:hover, .quick-link:hover { transform: none; }
}

/* ----------------------------- The family band
   Seven field guides, one house system. Every guide carries this same
   band with itself marked, so a reader can move between them without
   a hub page that does not exist. Kept in step across all seven —
   change it here and mirror it. */
.family {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.family__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.5rem;
}
.family__lede {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  max-width: 52ch;
  margin-bottom: 1.5rem;
}
.family__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.8rem;
}
.family__item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  color: var(--ink);
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
a.family__item:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--ink); }
.family__item strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.family__item span { color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
/* Cards stretch to a common height; pin the domain to the foot so the
   mono line reads as a baseline across the row rather than floating
   wherever each description happens to end. */
.family__item em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-top: auto;
  padding-top: 0.6rem;
}
/* The guide you are already reading: marked, not linked. */
.family__item[aria-current="page"] {
  border-color: color-mix(in oklab, var(--gold) 55%, transparent);
  background: color-mix(in oklab, var(--gold) 7%, var(--bg));
}
.family__item[aria-current="page"] em { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  a.family__item:hover { transform: none; }
}
