/* ==========================================================
   TRIANGULATION — A Field Guide to Serious Research
   Across Three AI Platforms.

   Identity: the High Council stage. Violet-black ground,
   violet for the platforms (the players), gold for the
   human at the podium (the researcher who adjudicates).
   Worksheets and templates are warm paper — the chart table
   under lamplight. Dark by design.
========================================================== */

/* ----------------------------- 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;   /* Claude   — terracotta */
  --seat-b: #7fc9b4;   /* ChatGPT  — teal */
  --seat-c: #8fa6e8;   /* Grok     — steel blue */
  --seat-d: #b98fd4;   /* Perplexity — the fourth seat */

  /* 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);
}

::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;
}
.brand-tag {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.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) {
  .brand-tag { display: none; }
  .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[data-seat="d"] { --seat: var(--seat-d); }
.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; }
.seat--fourth { border-style: dashed; border-top-style: solid; background: var(--surface); }

/* ----------------------------- 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: #0e0b15;
  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; }
}
