/* ============================================================
   LVRD · Article — Expressive Primitives
   Layout + primitive styles. Tokens come from colors_and_type.css.
   ============================================================ */
@import url("colors_and_type.css");

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--fg); }

/* ---------- Header (lifted from the lvrd.ai chrome) ---------- */
.lvrd-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.lvrd-header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 20px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 48px;
}
.lvrd-wordmark-link { font-family: var(--font-sans); font-weight: 900; letter-spacing: 0.12em; color: var(--fg-strong); text-decoration: none; border: 0; font-size: 18px; }
.lvrd-nav { display: flex; gap: 36px; }
.lvrd-nav a {
  font-size: 14px; font-weight: 500; color: var(--fg-muted);
  text-decoration: none; border: 0; transition: color 200ms;
}
.lvrd-nav a.active, .lvrd-nav a:hover { color: var(--fg-strong); }
.lvrd-header-cta {
  font-size: 14px; font-weight: 500; color: var(--fg-strong);
  text-decoration: none; padding: 9px 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: all 200ms;
}
.lvrd-header-cta:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Article shell
   Two-track layout: a 680px reading column + a 200px gutter
   for margin annotations. Primitives can break the column to
   the full 920px max-bleed when the thought needs the room.
   ============================================================ */
.article {
  --col: 680px;
  --bleed: 920px;
  --gutter: 200px;
  display: grid;
  grid-template-columns:
    [gutter-start] minmax(0, var(--gutter))
    [col-start] minmax(0, var(--col))
    [col-end] minmax(0, var(--gutter))
    [gutter-end];
  justify-content: center;
  column-gap: 32px;
  padding: 96px 24px 192px;
}
.article > * { grid-column: col-start / col-end; }
.article > .bleed {
  grid-column: gutter-start / gutter-end;
  max-width: var(--bleed); margin: 0 auto; width: 100%;
}
.article > .full {
  grid-column: 1 / -1;
  max-width: 1120px; margin: 0 auto; width: 100%;
}

/* ---------- Article head ---------- */
.article-head { margin-bottom: 64px; }
.article-eyebrow-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px;
}
.article-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-subtle);
  display: inline-flex; align-items: center; gap: 10px;
}
.article-back {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-subtle);
  text-decoration: none; border: 0;
}
.article-back:hover { color: var(--fg-strong); }
.article-title {
  font-size: 64px; line-height: 64px; font-weight: 700;
  letter-spacing: -0.025em; color: var(--fg-strong);
  margin: 0 0 40px; max-width: 14ch;
  text-wrap: balance;
}
.article-meta {
  display: flex; gap: 16px; align-items: center;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--fg-subtle); letter-spacing: 0.04em; text-transform: uppercase;
  padding-bottom: 32px; border-bottom: 1px solid var(--border);
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--fg-faint); }

/* ---------- Body type ---------- */
.article p {
  font-size: 18px; line-height: 30px; color: var(--fg);
  margin: 0 0 24px;
  text-wrap: pretty;
}
.article p.lede { font-size: 22px; line-height: 34px; color: var(--fg); margin-bottom: 32px; }
.article p.lede em, .article p.lede .serif { font-size: 1.06em; }
.article h2 {
  font-size: 28px; line-height: 36px; font-weight: 600;
  letter-spacing: -0.01em; color: var(--fg-strong);
  margin: 80px 0 24px;
  text-wrap: balance;
}
.article h3 {
  font-size: 18px; line-height: 26px; font-weight: 600;
  color: var(--fg-strong); margin: 40px 0 12px;
}

/* ============================================================
   PRIMITIVES
   ============================================================ */

/* ---- Primitive frame: every primitive carries a label,
   a thin top rule, and breathing room. This is the "framework". ---- */
.prim {
  margin: 56px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  position: relative;
}
.prim-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 24px;
}
.prim-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-subtle);
  display: inline-flex; align-items: center; gap: 10px;
}
.prim-label .n {
  color: var(--accent);
  font-feature-settings: "tnum";
}
.prim-caption {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.04em;
  color: var(--fg-faint);
  text-transform: uppercase;
}

/* ============================================================
   P-01 · Audit (five questions, pass/fail)
   ============================================================ */
.audit { display: grid; gap: 0; border-top: 1px solid var(--border); }
.audit-row {
  display: grid;
  grid-template-columns: 56px 1fr 88px;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 200ms;
}
.audit-row:hover { background: var(--surface); }
.audit-row .idx {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-faint); letter-spacing: 0.04em;
  padding: 18px 0 0 0;
}
.audit-row .q {
  padding: 16px 16px 16px 0;
}
.audit-row .q-text { font-size: 16px; line-height: 24px; color: var(--fg); }
.audit-row .q-note {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-faint); letter-spacing: 0.04em;
  margin-top: 4px; text-transform: uppercase;
  max-height: 0; overflow: hidden;
  transition: max-height 300ms, margin-top 300ms;
}
.audit-row[data-open="true"] .q-note { max-height: 40px; margin-top: 8px; }
.audit-row .status {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 18px 0;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
  gap: 8px;
}
.audit-row .status .mark {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.audit-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0 0;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-subtle); letter-spacing: 0.08em; text-transform: uppercase;
}
.audit-summary strong { color: var(--fg-strong); font-weight: 600; }

/* ============================================================
   P-02 · Gate sequence
   ============================================================ */
.gates {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.gate {
  padding: 28px 28px 32px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  position: relative;
}
.gate:last-child { border-right: 0; }
.gate .gate-n {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.gate .gate-n::after {
  content: ""; flex: 1; height: 1px;
  background: color-mix(in oklab, var(--accent) 30%, transparent);
}
.gate .gate-name { font-size: 18px; font-weight: 600; color: var(--fg-strong); margin: 0 0 6px; letter-spacing: -0.005em; }
.gate .gate-actor { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 16px; }
.gate .gate-desc { font-size: 14px; line-height: 22px; color: var(--fg-muted); margin: 0; }
.gate-flow { display: block; position: absolute; right: -7px; top: 50%; transform: translateY(-50%); z-index: 2; }
.gate-flow svg { display: block; }

/* ============================================================
   P-03 · Canon bundle (the four files)
   ============================================================ */
.bundle {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.bundle-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-subtle); letter-spacing: 0.08em; text-transform: uppercase;
}
.bundle-files { display: grid; grid-template-columns: 1fr 1fr; }
.bundle-file {
  padding: 24px 20px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 200ms;
}
.bundle-file:nth-child(2n) { border-right: 0; }
.bundle-file:nth-last-child(-n+2) { border-bottom: 0; }
.bundle-file:hover { background: var(--surface); }
.bundle-file .bf-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bundle-file .bf-name { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--fg-strong); letter-spacing: 0.02em; }
.bundle-file .bf-size { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); letter-spacing: 0.04em; }
.bundle-file .bf-desc { font-size: 14px; line-height: 22px; color: var(--fg-muted); margin: 0 0 12px; }
.bundle-file .bf-open {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase;
}
.bundle-file.open { background: var(--surface-2); }
.bundle-file .bf-body {
  display: none;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono); font-size: 12px; line-height: 20px;
  color: var(--fg-muted);
  white-space: pre-wrap;
}
.bundle-file.open .bf-body { display: block; }
.bundle-file.open .bf-open { color: var(--fg-faint); }

/* ============================================================
   P-04 · Refusal marker (inline strike block)
   ============================================================ */
.refusal {
  border-left: 1px solid var(--fg-faint);
  padding: 4px 0 4px 20px;
  margin: 20px 0;
  position: relative;
}
.refusal .ref-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.refusal .ref-label .x {
  display: inline-block; width: 10px; height: 10px;
  position: relative;
}
.refusal .ref-label .x::before, .refusal .ref-label .x::after {
  content: ""; position: absolute; inset: 0;
  border-top: 1px solid var(--fg-faint);
  top: 50%;
}
.refusal .ref-label .x::before { transform: rotate(45deg); }
.refusal .ref-label .x::after { transform: rotate(-45deg); }
.refusal .ref-body {
  font-size: 15px; line-height: 24px;
  color: var(--fg-muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in oklab, var(--fg-muted) 40%, transparent);
  text-decoration-thickness: 1px;
}
.refusal .ref-replacement {
  font-size: 14px; line-height: 22px;
  color: var(--fg-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.refusal .ref-replacement strong {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
  display: block; margin-bottom: 4px;
}

/* ============================================================
   P-05 · Contrast ladder
   ============================================================ */
.ladder { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.ladder-col { background: var(--bg); padding: 28px; }
.ladder-col.featured { background: var(--smoke-800); color: var(--smoke-50); }
.ladder-col .l-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 18px;
}
.ladder-col .l-label { color: var(--fg-faint); }
.ladder-col.featured .l-label { color: var(--smoke-400); }
.ladder-col h4 {
  font-size: 16px; line-height: 22px; font-weight: 600;
  margin: 0 0 16px; letter-spacing: -0.005em;
  color: var(--fg-strong);
}
.ladder-col.featured h4 { color: var(--smoke-50); }
.ladder-col ul { list-style: none; padding: 0; margin: 0; }
.ladder-col li {
  padding: 10px 0;
  font-size: 14px; line-height: 22px;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  display: flex; gap: 12px;
}
.ladder-col.featured li { border-top-color: var(--smoke-700); color: var(--smoke-300); }
.ladder-col li:first-child { border-top: 0; }
.ladder-col li .num {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-faint); letter-spacing: 0.04em;
  width: 24px; flex-shrink: 0;
}
.ladder-col.featured li .num { color: var(--smoke-400); }

/* ============================================================
   P-06 · Pivot quote
   ============================================================ */
.pivot {
  padding: 56px 0;
  text-align: left;
}
.pivot-mark {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.pivot-mark::before {
  content: ""; width: 32px; height: 1px; background: var(--accent);
}
.pivot blockquote {
  margin: 0;
  font-size: 32px; line-height: 42px; font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--fg-strong);
  text-wrap: balance;
  max-width: 22ch;
}
.pivot blockquote em { font-size: 1.06em; }
.pivot-attr {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-faint); letter-spacing: 0.08em; text-transform: uppercase;
  margin-top: 24px;
}

/* ============================================================
   P-07 · Cadence strip
   ============================================================ */
.cadence {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  margin: 16px 0 12px;
}
.cad-week {
  height: 56px;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: background 200ms, border-color 200ms;
}
.cad-week:hover { border-color: var(--border-strong); }
.cad-week.shipped { background: var(--bg); border-color: var(--border-strong); }
.cad-week.shipped::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px;
  height: 4px; background: var(--smoke-700); border-radius: 2px;
}
.cad-week.missed { background: var(--bg); }
.cad-week.missed::after {
  content: ""; position: absolute; inset: 18px;
  background: repeating-linear-gradient(45deg, var(--smoke-200), var(--smoke-200) 2px, transparent 2px, transparent 6px);
}
.cad-week.now {
  background: var(--bg); border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.cad-week.now::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px;
  height: 4px; background: var(--accent); border-radius: 2px;
}
.cad-week .cad-label {
  position: absolute; top: 8px; left: 8px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg-faint); letter-spacing: 0.04em;
}
.cad-week.now .cad-label, .cad-week.shipped .cad-label { color: var(--fg-subtle); }
.cad-legend {
  display: flex; gap: 24px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-subtle); letter-spacing: 0.08em; text-transform: uppercase;
}
.cad-legend span { display: inline-flex; align-items: center; gap: 8px; }
.cad-legend .swatch { display: inline-block; width: 16px; height: 8px; border-radius: 2px; }
.cad-legend .swatch.s-ship { background: var(--smoke-700); }
.cad-legend .swatch.s-miss { background: repeating-linear-gradient(45deg, var(--smoke-200), var(--smoke-200) 2px, transparent 2px, transparent 6px); border: 1px solid var(--border); }
.cad-legend .swatch.s-now { background: var(--accent); }

/* ============================================================
   P-08 · Margin standard (gutter annotation)
   Positioned next to a paragraph in the right gutter.
   ============================================================ */
.with-margin { position: relative; }
.margin-note {
  position: absolute;
  left: calc(100% + 32px);
  top: 0;
  width: 168px;
  font-family: var(--font-mono);
  font-size: 11px; line-height: 16px;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
}
.margin-note .mn-tag {
  display: inline-block;
  color: var(--accent);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 4px;
}
.margin-note::before {
  content: ""; display: block;
  position: absolute; left: -16px; top: 8px;
  width: 8px; height: 1px;
  background: var(--accent);
}

/* ============================================================
   P-09 · File chip (inline)
   ============================================================ */
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.86em;
  padding: 2px 8px 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg-strong);
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 200ms, color 200ms;
  vertical-align: 1px;
}
.fchip:hover { border-color: var(--accent); color: var(--accent); }
.fchip::before {
  content: ""; display: inline-block;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
}

/* ============================================================
   P-10 · Standards table (W1–W5)
   ============================================================ */
.standards { border-top: 1px solid var(--border); }
.std-row {
  display: grid; grid-template-columns: 80px 1fr 120px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.std-key {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent); letter-spacing: 0.04em;
  font-weight: 500;
}
.std-text { font-size: 16px; line-height: 22px; color: var(--fg); }
.std-text strong { font-weight: 600; color: var(--fg-strong); }
.std-status {
  text-align: right;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-subtle); letter-spacing: 0.12em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.std-status .mark {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

/* ============================================================
   P-11 · Footnote / aside
   ============================================================ */
.aside {
  display: grid; grid-template-columns: 4px 1fr;
  gap: 20px;
  padding: 4px 0;
  margin: 32px 0;
}
.aside-rail {
  background: var(--smoke-300);
  width: 1px; justify-self: end;
}
.aside-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 8px;
}
.aside-body { font-size: 15px; line-height: 24px; color: var(--fg-muted); }
.aside-body p { margin: 0 0 12px; font-size: inherit; line-height: inherit; }
.aside-body p:last-child { margin: 0; }

/* ============================================================
   P-12 · Specimen
   ============================================================ */
.specimen {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
}
.specimen-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.specimen-meta {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-subtle); letter-spacing: 0.04em;
}
.specimen-name { color: var(--fg-strong); font-weight: 500; letter-spacing: 0.02em; }
.specimen-sep { color: var(--fg-faint); }
.specimen-meta .dotrun {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.specimen-body {
  margin: 0;
  padding: 24px;
  font-family: var(--font-mono); font-size: 13px; line-height: 22px;
  color: var(--fg);
  white-space: pre-wrap;
  background: var(--surface-2);
}

/* ============================================================
   P-13 · Definition
   ============================================================ */
.defn {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 32px 0;
}
.defn-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.defn-term {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.defn-term .dt-word {
  font-size: 32px; line-height: 36px; font-weight: 600;
  letter-spacing: -0.015em; color: var(--fg-strong);
}
.defn-term .dt-lemma {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--fg-faint); letter-spacing: 0.04em;
}
.defn-body { font-size: 16px; line-height: 26px; color: var(--fg); margin: 0; max-width: 64ch; }

/* ============================================================
   P-14 · Step-through
   ============================================================ */
.steps { list-style: none; padding: 0; margin: 32px 0; border-top: 1px solid var(--border); }
.step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.step-n {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); letter-spacing: 0.04em;
  padding-top: 2px;
}
.step-body { font-size: 16px; line-height: 26px; color: var(--fg); }
.step-body strong { font-weight: 600; color: var(--fg-strong); }

/* ============================================================
   P-15 · Heartbeat indicator
   ============================================================ */
.heartbeat {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-family: var(--font-mono); font-size: 12px;
  color: var(--fg-muted); letter-spacing: 0.04em;
}
.heartbeat .hb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.heartbeat .hb-text { display: inline-flex; align-items: center; gap: 8px; }
.heartbeat .hb-text strong { color: var(--fg-strong); font-weight: 500; }
.heartbeat .hb-sep { color: var(--fg-faint); }
.heartbeat .hb-ago { color: var(--fg-subtle); }

/* ============================================================
   P-16 · Before / After diff
   ============================================================ */
.diff {
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.diff-col { padding: 24px; background: var(--bg); }
.diff-was { background: var(--surface); }
.diff-now { background: var(--bg); border-left: 1px solid var(--border); }
.diff-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 12px;
}
.diff-was .diff-label { color: var(--fg-faint); }
.diff-now .diff-label { color: var(--accent); }
.diff-body { font-size: 15px; line-height: 24px; }
.diff-was .diff-body { color: var(--fg-muted); text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--fg-muted) 40%, transparent); }
.diff-now .diff-body { color: var(--fg); }
.diff-arrow {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  color: var(--accent);
  border-left: 1px solid var(--border);
  background: var(--bg);
}
.diff-arrow .diff-tag {
  writing-mode: vertical-rl;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-faint);
}

/* ============================================================
   P-17 · Glossary chip
   ============================================================ */
.gchip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: inherit; font-size: 1em;
  border-bottom: 1px dashed var(--border-strong);
  color: var(--fg-strong);
  cursor: help;
  padding-bottom: 1px;
  transition: border-color 200ms, color 200ms;
}
.gchip:hover { border-bottom-color: var(--accent); color: var(--accent); }
.gchip-mark {
  font-family: var(--font-mono); font-size: 0.78em;
  color: var(--accent); font-weight: 500;
  transform: translateY(-1px);
  display: inline-block;
}

/* ============================================================
   P-18 · Stat block
   ============================================================ */
.stat {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: grid; gap: 12px;
  margin: 40px 0;
}
.stat-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-subtle);
}
.stat-value {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-sans);
  color: var(--fg-strong);
}
.stat .sv-num {
  font-size: 80px; line-height: 1; font-weight: 700;
  letter-spacing: -0.04em;
  font-feature-settings: "tnum";
}
.stat .sv-unit {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--fg-subtle); letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stat-sub { font-size: 14px; line-height: 22px; color: var(--fg-muted); max-width: 48ch; }

/* ============================================================
   P-19 · Article TOC
   ============================================================ */
.toc {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 24px 0 40px;
}
.toc-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 12px;
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-link {
  display: grid; grid-template-columns: 40px 1fr auto;
  align-items: baseline; gap: 16px;
  padding: 10px 0;
  border: 0; text-decoration: none;
  color: var(--fg);
  font-size: 14px; line-height: 22px;
  transition: color 200ms;
}
.toc-link:hover { color: var(--accent); }
.toc-n { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); letter-spacing: 0.04em; }
.toc-dur { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); letter-spacing: 0.04em; text-transform: uppercase; }

/* ============================================================
   P-20 · Next entry
   ============================================================ */
.nextentry {
  display: block;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  text-decoration: none; color: var(--fg);
  border-bottom: 1px solid var(--border);
  transition: border-color 200ms, background 200ms;
}
.nextentry:hover { border-color: var(--accent); background: var(--surface); }
.ne-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.ne-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.ne-meta {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--fg-faint);
}
.ne-title {
  font-size: 24px; line-height: 30px; font-weight: 600;
  letter-spacing: -0.01em; color: var(--fg-strong);
  margin: 0 0 16px;
  text-wrap: balance;
}
.ne-foot {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-subtle); letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; gap: 12px; align-items: center;
}
.ne-foot .ne-sep { color: var(--fg-faint); }

/* ============================================================
   About + canon footer
   ============================================================ */
.byline-block {
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.byline-block h3 { font-size: 14px; font-weight: 600; color: var(--fg-strong); margin: 0 0 12px; letter-spacing: 0.02em; text-transform: uppercase; font-family: var(--font-mono); }

/* ============================================================
   KIT SECTION (the framework laid bare)
   ============================================================ */
.kit {
  background: var(--smoke-900);
  color: var(--smoke-50);
  padding: 128px 0;
}
.kit-inner { max-width: 1120px; margin: 0 auto; padding: 0 48px; }
.kit-head {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px;
  align-items: end;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--smoke-700);
}
.kit-eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--smoke-400);
  margin-bottom: 16px;
}
.kit-head h2 {
  font-size: 48px; line-height: 52px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--smoke-50);
  margin: 0;
  max-width: 12ch;
  text-wrap: balance;
}
.kit-head p {
  font-size: 17px; line-height: 28px;
  color: var(--smoke-300); margin: 0;
  max-width: 56ch;
}
.kit-head p em, .kit-head p .serif { color: var(--smoke-50); }

.kit-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--smoke-700); margin-top: 1px;
}
.kit-card {
  background: var(--smoke-900);
  padding: 32px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
}
.kit-card .kc-n {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--marian-lift); letter-spacing: 0.04em;
}
.kit-card h3 {
  font-size: 17px; font-weight: 600; color: var(--smoke-50);
  margin: 0 0 8px; letter-spacing: -0.005em;
}
.kit-card .kc-purpose {
  font-size: 14px; line-height: 22px; color: var(--smoke-300);
  margin: 0 0 16px;
}
.kit-card .kc-spec {
  font-family: var(--font-mono); font-size: 11px; line-height: 18px;
  color: var(--smoke-400);
  letter-spacing: 0.04em;
}
.kit-card .kc-spec dt { color: var(--smoke-500); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 8px; }
.kit-card .kc-spec dt:first-child { margin-top: 0; }
.kit-card .kc-spec dd { margin: 2px 0 0; color: var(--smoke-300); }

/* Framework spec card */
.framework {
  margin-top: 64px;
  display: grid; grid-template-columns: 1fr 2fr;
  gap: 48px;
  padding: 48px 0;
  border-top: 1px solid var(--smoke-700);
}
.framework h3 {
  font-size: 24px; line-height: 30px; font-weight: 600;
  color: var(--smoke-50); margin: 0;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.framework h3 em, .framework h3 .serif { color: var(--marian-lift); }
.framework-rules { list-style: none; padding: 0; margin: 0; }
.framework-rules li {
  display: grid; grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--smoke-700);
}
.framework-rules li:first-child { border-top: 0; padding-top: 0; }
.framework-rules .fr-n {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--marian-lift); letter-spacing: 0.04em;
}
.framework-rules .fr-body { color: var(--smoke-300); font-size: 15px; line-height: 24px; }
.framework-rules .fr-body strong { color: var(--smoke-50); font-weight: 600; }

/* Site footer */
.site-foot {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 40px 48px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-faint); letter-spacing: 0.08em; text-transform: uppercase;
  max-width: 1280px; margin: 0 auto;
}

/* ============================================================
   RESPONSIVE  —  two breakpoints
     • 900px : tablet · margin notes collapse · grids step down
     • 640px : phone · single column · type scale reduces
   The article column is the spine; everything snaps to it.
   ============================================================ */
/* ============================================================
   RESPONSIVE  —  three tiers
     • 1200px : intermediate · margin notes inline · CTA nowrap
                (the article grid soft-minmax keeps everything
                else readable from 900 → 1200 without overflow)
     • 900px  : tablet · single column · grids step down
     • 640px  : phone · single column · type scale reduces
   ============================================================ */
@media (max-width: 1200px) {
  /* CTA — keep on one line even when the header tightens */
  .lvrd-header-cta { white-space: nowrap; }

  /* Margin notes — at this width the right gutter is too narrow
     to hold a 168px note + its 32px offset. Render inline below
     the paragraph instead. */
  .with-margin { padding-right: 0 !important; }
  .margin-note {
    position: static;
    width: auto;
    margin-top: 12px;
    padding: 12px 0 0 16px;
    border-left: 1px solid var(--accent);
  }
  .margin-note::before { display: none; }
  .margin-note .mn-tag {
    display: inline;
    margin-right: 8px;
    margin-bottom: 0;
  }
  .margin-note br { display: none; }
}

@media (max-width: 900px) {
  /* ---------- Header — collapse nav, tighten ---------- */
  .lvrd-header-inner {
    padding: 16px 24px;
    gap: 16px;
  }
  .lvrd-nav { display: none; }
  .lvrd-header-cta { padding: 8px 12px; font-size: 13px; }

  /* ---------- Article shell  —  collapse to single column.
     Margin annotations move out of the gutter and render
     inline below the paragraph they pin. ---------- */
  .article {
    --col: 100%;
    --gutter: 0px;
    grid-template-columns: 1fr;
    column-gap: 0;
    padding: 48px 24px 96px;
  }
  .article > *, .article > .bleed, .article > .full {
    grid-column: 1 / -1;
    max-width: 100%;
  }

  /* ---------- Article head ---------- */
  .article-head { margin-bottom: 40px; }
  .article-eyebrow-row { margin-bottom: 24px; }
  .article-title {
    font-size: 40px; line-height: 44px;
    margin-bottom: 28px;
    max-width: 100%;
  }
  .article-meta {
    flex-wrap: wrap; gap: 10px;
    padding-bottom: 20px;
  }
  .article-meta .dot { display: none; }
  .article-meta > * + * { padding-left: 0; }

  /* ---------- Body type — tighten without sacrificing readability ---------- */
  .article p { font-size: 17px; line-height: 28px; margin-bottom: 20px; }
  .article p.lede { font-size: 19px; line-height: 30px; margin-bottom: 24px; }
  .article h2 { font-size: 24px; line-height: 30px; margin: 56px 0 16px; }
  .article h3 { font-size: 17px; line-height: 24px; margin: 32px 0 10px; }

  /* ---------- P-01 Audit — keep row, tighten ---------- */
  .audit-row {
    grid-template-columns: 40px 1fr 72px;
  }
  .audit-row .q-text { font-size: 15px; line-height: 22px; }
  .audit-row .idx { padding: 16px 0 0; }
  .audit-summary {
    flex-direction: column; align-items: flex-start; gap: 6px;
    font-size: 10px;
  }

  /* ---------- P-02 Gates — stack vertically ---------- */
  .gates {
    grid-template-columns: 1fr;
  }
  .gate { border-right: 0; border-bottom: 1px solid var(--border); padding: 24px; }
  .gate:last-child { border-bottom: 0; }
  .gate-flow {
    right: 50%; top: auto; bottom: -10px;
    transform: translateX(50%) rotate(90deg);
  }

  /* ---------- P-03 Bundle — single column ---------- */
  .bundle-files { grid-template-columns: 1fr; }
  .bundle-file { border-right: 0; }
  .bundle-file:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .bundle-file:last-child { border-bottom: 0; }

  /* ---------- P-05 Ladder — stack ---------- */
  .ladder { grid-template-columns: 1fr; }

  /* ---------- P-06 Pivot — reduce ---------- */
  .pivot { padding: 40px 0; }
  .pivot blockquote { font-size: 26px; line-height: 34px; max-width: 100%; }

  /* ---------- P-07 Cadence — 6-col + horizontal scroll if needed ---------- */
  .cadence { grid-template-columns: repeat(6, 1fr); gap: 4px; }
  .cad-week { height: 48px; }
  .cad-legend {
    flex-wrap: wrap; gap: 12px 18px;
    font-size: 10px;
  }

  /* ---------- P-08 Margin standard — inline rule already
     fires at the 1200px tier; nothing to add here. ---------- */

  /* ---------- P-10 Standards table ---------- */
  .std-row {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto;
    padding: 16px 0;
    gap: 4px 12px;
  }
  .std-key { grid-column: 1; grid-row: 1; }
  .std-text {
    grid-column: 2; grid-row: 1;
    font-size: 15px; line-height: 22px;
  }
  .std-status {
    grid-column: 2; grid-row: 2;
    justify-content: flex-start;
    text-align: left;
  }

  /* ---------- P-11 Aside ---------- */
  .aside { grid-template-columns: 2px 1fr; gap: 16px; }

  /* ---------- P-12 Specimen ---------- */
  .specimen-bar {
    flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 12px 14px;
  }
  .specimen-body { padding: 18px 16px; font-size: 12px; line-height: 20px; }

  /* ---------- P-13 Definition ---------- */
  .defn-term { gap: 8px; }
  .defn-term .dt-word { font-size: 26px; line-height: 30px; }

  /* ---------- P-14 Steps ---------- */
  .step { grid-template-columns: 56px 1fr; gap: 12px; padding: 16px 0; }
  .step-body { font-size: 15px; line-height: 24px; }

  /* ---------- P-16 Diff — vertical stack, arrow rotates ---------- */
  .diff {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto 1fr;
  }
  .diff-now { border-left: 0; border-top: 1px solid var(--border); }
  .diff-arrow {
    flex-direction: row; padding: 10px 16px;
    border-left: 0; border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .diff-arrow .diff-tag { writing-mode: horizontal-tb; }
  .diff-arrow svg { transform: rotate(90deg); }

  /* ---------- P-18 Stat ---------- */
  .stat { padding: 24px 0; margin: 32px 0; }
  .stat .sv-num { font-size: 56px; }

  /* ---------- P-19 TOC ---------- */
  .toc-link {
    grid-template-columns: 36px 1fr auto;
    gap: 12px; padding: 12px 0;
    font-size: 14px;
  }

  /* ---------- P-20 Next entry ---------- */
  .nextentry { padding: 24px; }
  .ne-title { font-size: 20px; line-height: 26px; }
  .ne-head { gap: 16px; }
  .ne-foot { flex-wrap: wrap; }

  /* ---------- Heartbeat ---------- */
  .heartbeat .hb-text { flex-wrap: wrap; }

  /* ---------- Kit panel (the framework laid bare) ---------- */
  .kit { padding: 80px 0; }
  .kit-inner { padding: 0 24px; }
  .kit-head {
    grid-template-columns: 1fr; gap: 24px;
    align-items: start;
    padding-bottom: 48px;
  }
  .kit-head h2 { font-size: 36px; line-height: 40px; max-width: 100%; }
  .kit-grid { grid-template-columns: 1fr; }
  .kit-card {
    grid-template-columns: 48px 1fr;
    gap: 16px;
    padding: 24px;
  }
  .framework {
    grid-template-columns: 1fr; gap: 24px;
    padding: 32px 0;
  }
  .framework h3 { font-size: 20px; line-height: 26px; }
  .framework-rules li { grid-template-columns: 40px 1fr; padding: 14px 0; }

  /* ---------- Site footer ---------- */
  .site-foot {
    flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 28px 24px;
  }
}

@media (max-width: 640px) {
  /* ---------- Header — keep wordmark, push CTA to fit ---------- */
  .lvrd-header-inner { padding: 14px 20px; }
  .lvrd-wordmark-link { font-size: 16px; }
  .lvrd-header-cta { padding: 7px 10px; font-size: 12px; }

  /* ---------- Article shell ---------- */
  .article { padding: 32px 20px 80px; }
  .article-head { margin-bottom: 32px; }
  .article-title {
    font-size: 32px; line-height: 36px;
    margin-bottom: 24px;
  }
  .article p.lede { font-size: 18px; line-height: 28px; }

  .article h2 { font-size: 22px; line-height: 28px; margin: 48px 0 14px; }

  /* ---------- Pivot ---------- */
  .pivot { padding: 32px 0; }
  .pivot blockquote { font-size: 22px; line-height: 30px; }
  .pivot-mark { font-size: 10px; gap: 8px; }
  .pivot-mark::before { width: 20px; }

  /* ---------- Stat ---------- */
  .stat .sv-num { font-size: 44px; letter-spacing: -0.03em; }
  .stat .sv-unit { font-size: 12px; }

  /* ---------- Definition ---------- */
  .defn-term .dt-word { font-size: 22px; line-height: 28px; }
  .defn-term .dt-lemma { font-size: 11px; }
  .defn-body { font-size: 15px; line-height: 24px; }

  /* ---------- Cadence — wrap to 4 across ---------- */
  .cadence { grid-template-columns: repeat(4, 1fr); }
  .cad-week { height: 44px; }

  /* ---------- Bundle — tighter padding ---------- */
  .bundle-file { padding: 20px 16px; }
  .bundle-bar { padding: 12px 16px; font-size: 10px; }

  /* ---------- Audit ---------- */
  .audit-row { grid-template-columns: 32px 1fr 60px; }
  .audit-row .q-text { font-size: 14px; line-height: 20px; }
  .audit-row .status { font-size: 10px; padding: 16px 0; }
  .audit-row .idx { font-size: 10px; }

  /* ---------- Standards table — kept stacked from 900 ---------- */
  .std-key { font-size: 12px; }
  .std-text { font-size: 14px; line-height: 20px; }

  /* ---------- Ladder ---------- */
  .ladder-col { padding: 24px 20px; }
  .ladder-col h4 { font-size: 15px; line-height: 20px; }
  .ladder-col li { font-size: 13px; line-height: 20px; }

  /* ---------- Steps ---------- */
  .step { grid-template-columns: 48px 1fr; }
  .step-body { font-size: 14px; line-height: 22px; }

  /* ---------- Specimen ---------- */
  .specimen-body { font-size: 11px; line-height: 18px; }
  .specimen-name { font-size: 11px; }

  /* ---------- TOC ---------- */
  .toc-link {
    grid-template-columns: 30px 1fr;
    grid-template-rows: auto auto;
    gap: 2px 10px;
  }
  .toc-link .toc-n { grid-row: 1; grid-column: 1; }
  .toc-link .toc-text { grid-row: 1; grid-column: 2; }
  .toc-link .toc-dur { grid-row: 2; grid-column: 2; padding-top: 2px; }

  /* ---------- Next entry ---------- */
  .nextentry { padding: 20px; }
  .ne-title { font-size: 18px; line-height: 24px; }
  .ne-head { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* ---------- Gates ---------- */
  .gate { padding: 20px 18px; }
  .gate .gate-name { font-size: 16px; }
  .gate-flow { display: none; }

  /* ---------- Diff ---------- */
  .diff-col { padding: 20px 18px; }
  .diff-body { font-size: 14px; line-height: 22px; }

  /* ---------- Aside ---------- */
  .aside { gap: 14px; }
  .aside-body { font-size: 14px; line-height: 22px; }

  /* ---------- Margin note ---------- */
  .margin-note { font-size: 10px; line-height: 14px; }

  /* ---------- Heartbeat — wrap nicely ---------- */
  .heartbeat { padding: 7px 12px 8px 10px; font-size: 11px; }
  .heartbeat .hb-sep { display: none; }

  /* ---------- Kit panel ---------- */
  .kit { padding: 56px 0; }
  .kit-inner { padding: 0 20px; }
  .kit-head h2 { font-size: 30px; line-height: 34px; }
  .kit-head p { font-size: 15px; line-height: 24px; }
  .kit-card { padding: 20px; grid-template-columns: 40px 1fr; gap: 12px; }
  .kit-card h3 { font-size: 16px; }
  .kit-card .kc-purpose { font-size: 13px; line-height: 20px; }

  /* ---------- Site footer ---------- */
  .site-foot { padding: 24px 20px; }
}

/* ============================================================
   Motion · the LVRD breath
   The only ambient motion in the Field Notes surface.
   Fires on the article eyebrow dot and on P-14 Heartbeat (when state === "live").
   ============================================================ */
@keyframes lvrd-breath {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.04); }
}
.lvrd-breath {
  animation: lvrd-breath 800ms cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .lvrd-breath { animation: none; opacity: 1; }
}
