/* ═══════════════════════════════════════════════════════════════════════════
   Sitting With the Second Existential Risk
   Editorial long-read · Instrument Serif + Inter + JetBrains Mono
   Warm cream palette.
   ═════════════════════════════════════════════════════════════════════════ */

:root {
  --bg:            #f6f2ea;
  --bg-2:          #ece4d2;
  --bg-3:          #e0d6bd;
  --ink:           #141312;
  --ink-2:         rgba(20, 19, 18, 0.72);
  --ink-3:         rgba(20, 19, 18, 0.48);
  --ink-4:         rgba(20, 19, 18, 0.22);
  --rule:          rgba(20, 19, 18, 0.12);
  --rule-2:        rgba(20, 19, 18, 0.22);
  --ember:         oklch(0.58 0.14 46);
  --ember-2:       oklch(0.58 0.14 46 / 0.15);
  --shadow-soft:   0 16px 48px rgba(60, 40, 15, 0.10);

  --serif:         'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:          'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:          'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --content-w:     780px;       /* base content width on desktop */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--ember); color: var(--bg); }

/* Author byline link — discreet at rest, fuller reveal on hover */
.author-link {
  text-decoration: none;
  position: relative;
  border-bottom: 1px dotted var(--ember);
  padding-bottom: 1px;
  transition: color 180ms ease, border-color 180ms ease, border-bottom-style 180ms ease;
}
.author-link::after {
  content: "\2197";                        /* ↗ outbound arrow */
  display: inline-block;
  margin-left: 4px;
  font-size: 0.78em;
  color: var(--ember);
  opacity: 0.65;
  transform: translateY(-1px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.author-link:hover,
.author-link:focus-visible {
  color: var(--ember);
  border-bottom: 1px solid var(--ember);
}
.author-link:hover::after,
.author-link:focus-visible::after {
  opacity: 1;
  transform: translate(1px, -2px);
}

/* ═══════════════ Top bar ═════════════════════════════════════════════════ */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-eyebrow {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.brand-accent { color: var(--ember); font-weight: 500; }
.brand-title {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}
.brand-title em { font-style: italic; color: var(--ink); }
.brand-sub { color: var(--ink-2); font-style: normal; }

.progress-bar {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: transparent;
}
.progress-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ember);
  transition: width 120ms linear;
}

/* ═══════════════ Hero ═══════════════════════════════════════════════════ */

.hero {
  position: relative;
  min-height: min(60vh, 560px);
  display: flex;
  align-items: flex-end;
  padding: 0 32px 48px;
  overflow: hidden;
  isolation: isolate;
}
.hero-image { position: absolute; inset: 0; z-index: -1; }
.hero-image img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  opacity: 0.50;
  filter: sepia(0.15) contrast(0.95);
}
.hero-image-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      color-mix(in oklab, var(--bg) 50%, transparent) 0%,
      color-mix(in oklab, var(--bg) 25%, transparent) 40%,
      color-mix(in oklab, var(--bg) 75%, transparent) 80%,
      var(--bg) 100%);
}

.hero-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  width: 100%;
  padding-top: 72px;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 24px;
}
.hero-eyebrow .sep { color: var(--ink-4); margin: 0 8px; }
.accent { color: var(--ember); font-weight: 500; }

.headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 20px;
}
.headline em { font-style: italic; color: var(--ember); }
.deck {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.3;
  color: var(--ink-2);
  margin-bottom: 28px;
}

.byline {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 16px;
}
.byline-author { color: var(--ink); font-weight: 500; }
.byline-dot { color: var(--ink-4); }
.byline-date, .byline-read {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hero-credit {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ═══════════════ Table of contents ═════════════════════════════════════ */

.toc {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 28px 32px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.toc-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.toc-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;                 /* read top-to-bottom, then right */
  gap: 10px 40px;
}
.toc-list a {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.25;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.toc-n {
  font-family: var(--mono);
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.15em;
  color: var(--ember);
  min-width: 22px;
}
.toc-list a:hover {
  color: var(--ember);
  border-bottom-color: var(--ember);
}

/* ═══════════════ Prose container ═══════════════════════════════════════ */

.prose {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 48px 32px 88px;
}

.chapter {
  padding: 56px 0;
  border-bottom: 1px solid var(--rule);
}
.chapter:last-child { border-bottom: 0; padding-bottom: 24px; }

.chapter-head { margin-bottom: 40px; }
.chapter-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.chapter-seq { color: var(--ember); font-weight: 500; }
.chapter-sep { color: var(--ink-4); }

.chapter-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 5.2vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.018em;
  color: var(--ink);
  text-wrap: balance;
}
.chapter-title em { font-style: italic; color: var(--ember); }

/* ── Prose: paragraphs now span the full container width ─────────────── */
.prose p {
  font-size: 16px;
  line-height: 1.72;
  color: var(--ink);
  margin-bottom: 20px;
  text-wrap: pretty;
}
.prose p strong { color: var(--ink); font-weight: 600; }
.prose p em { color: var(--ink); font-style: italic; }

.lede {
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 24px);
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 24px;
}
.lede em { font-style: italic; color: var(--ember); }

.emphasis {
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.35;
  color: var(--ink);
  margin: 28px 0;
  text-wrap: pretty;
}
.emphasis em { color: var(--ember); font-style: italic; }
.emphasis strong { color: var(--ember); font-weight: 400; font-style: italic; }
.emphasis.big { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.2; }

.kicker {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 26px);
  line-height: 1.3;
  color: var(--ember);
  border-left: 2px solid var(--ember);
  padding: 10px 0 10px 20px;
  margin: 32px 0;
  text-wrap: balance;
}
.kicker em { color: var(--ember); font-style: italic; }

.slogan {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.8vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 44px 0;
  padding: 26px 0;
  border-top: 1px solid var(--rule-2);
  border-bottom: 1px solid var(--rule-2);
  text-wrap: balance;
}
.slogan em { color: var(--ember); font-style: italic; }

.final {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin: 64px 0 48px;
}
.final-logo {
  display: block;
  width: clamp(200px, 26vw, 320px);
  height: auto;
}
.final .pull {
  width: 100%;
  margin: 8px 0 0;
}
.final .pull p {
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ember);
}
.final .pull::before { font-size: clamp(120px, 18vw, 180px); top: -40px; left: -8px; }

/* Pull quote with giant curly opening mark */
.pull {
  position: relative;
  margin: 36px 0;
  padding: 4px 0 4px 48px;
}
.pull::before {
  content: "\201C";
  position: absolute;
  left: -6px; top: -20px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 110px;
  line-height: 1;
  color: var(--ember);
  opacity: 0.55;
}
.pull p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 2.8vw, 28px);
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.pull p em { color: var(--ember); font-style: italic; }

/* Block quote */
.quote {
  margin: 32px 0;
  padding: 24px 28px;
  background: var(--bg-2);
  border-left: 3px solid var(--ember);
  border-radius: 0 4px 4px 0;
}
.quote p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 12px;
}
.quote cite {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.author-note {
  margin: 32px 0;
  padding: 20px 24px;
  border: 1px dashed var(--rule-2);
  border-radius: 4px;
  background: color-mix(in oklab, var(--bg-2) 55%, transparent);
}
.author-note p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
}
.author-note em { color: var(--ink); font-style: italic; }

.subsection-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  color: var(--ink);
  margin: 48px 0 20px;
}
.subsection-title em { font-style: italic; color: var(--ember); }

/* ═══════════════ Figures — smaller ═════════════════════════════════════ */

.figure { margin: 36px auto; }
.figure img {
  width: 100%;
  border-radius: 4px;
  box-shadow: var(--shadow-soft);
}
.figure figcaption {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 12px;
  text-align: center;
}

.figure-inline {
  max-width: 360px;
  margin: 36px auto;
}
.figure-inline-large {
  max-width: 640px;
  margin: 40px auto;
}
.figure-wide {
  max-width: 100%;
  margin: 40px 0;
}

.figure-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-width: 100%;
  margin: 40px 0;
}
.figure-split .split-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
}
.figure-split .split-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}
.figure-split .split-label {
  position: absolute;
  left: 14px; bottom: 14px;
  padding: 5px 12px;
  background: var(--ember);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bg);
  border: 1px solid var(--ember);
  border-radius: 999px;
  font-weight: 500;
}
.figure-split figcaption { grid-column: 1 / -1; }

/* ═══════════════ Converge block (replaces two-col cards) ═══════════════ */

.converge {
  margin: 32px 0;
  padding: 24px 0;
  border-top: 1px solid var(--rule-2);
  border-bottom: 1px solid var(--rule-2);
}
.converge ol {
  list-style: none;
  counter-reset: conv;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.converge li {
  counter-increment: conv;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: baseline;
}
.converge li::before {
  content: counter(conv, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ember);
  padding-top: 4px;
}
.converge-head {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}
.converge-head em { font-style: italic; color: var(--ember); }
.converge-body {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ═══════════════ Witnesses ═════════════════════════════════════════════ */

.witness-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 36px 0;
}
.witness {
  padding: 22px 26px;
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  background: var(--bg-2);
}
.witness-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 4px;
}
.witness-role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 14px;
}
.witness-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0;
}

/* ═══════════════ Criteria — number aligned with text ═══════════════════ */

.criteria {
  display: flex;
  flex-direction: column;
  margin: 40px 0;
}
.criterion {
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.criterion:last-child { border-bottom: 1px solid var(--rule); }

/* Number is inline with the title text, same baseline, same type */
.criterion-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.criterion-title em { font-style: italic; }
.criterion-n {
  font-family: var(--mono);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ember);
  min-width: 22px;
  flex-shrink: 0;
  text-align: left;
  /* no border, no badge – just a mono number inline */
}
.criterion p {
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.criterion-concl {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  padding: 10px 14px;
  background: var(--bg-2);
  border-left: 2px solid var(--ember);
  border-radius: 0 4px 4px 0;
  margin-top: 12px !important;
  line-height: 1.5;
}
.concl-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 500;
  margin-right: 8px;
}

/* ═══════════════ Comparison table ══════════════════════════════════════ */

.table-wrap {
  margin: 24px 0 48px;
  overflow-x: auto;
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  background: var(--bg-2);
}
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.compare colgroup col.c-crit { width: 30%; }
.compare colgroup col.c-climate,
.compare colgroup col.c-ai      { width: 35%; }

.compare thead th {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  text-align: left;
  padding: 14px 16px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--rule-2);
  border-right: 1px solid var(--rule);
  font-weight: 500;
}
.compare thead th:last-child { border-right: 0; }
.compare thead th:first-child { color: var(--ink-3); }

.compare tbody tr { border-bottom: 1px solid var(--rule); }
.compare tbody tr:last-child { border-bottom: 0; }
.compare tbody th {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--ink);
  text-align: left;
  padding: 12px 16px;
  vertical-align: top;
  border-right: 1px solid var(--rule);
}
.compare tbody td {
  padding: 12px 16px;
  color: var(--ink-2);
  line-height: 1.5;
  vertical-align: top;
  border-right: 1px solid var(--rule);
}
.compare tbody td:last-child { border-right: 0; }
.dim { color: var(--ink-3); font-size: 12px; font-style: italic; display: block; margin-top: 2px; }

/* ═══════════════ Pillars ═══════════════════════════════════════════════ */

.pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 36px 0;
}
.pillar {
  padding: 22px 24px;
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  background: var(--bg-2);
}
.pillar:last-child { grid-column: 1 / -1; }
.pillar-n {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ember);
  margin-bottom: 14px;
}
.pillar-h {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 12px;
  text-wrap: balance;
}
.pillar-h em { font-style: italic; }
.pillar p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
}

/* ═══════════════ Declaration (replaces Claude ending image) ════════════ */

.declaration {
  margin: 48px 0 0;
  padding: 32px;
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  background: var(--bg-2);
  text-align: center;
}
.declaration-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 14px;
}
.declaration-body {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
  max-width: 56ch;
  margin-inline: auto;
  text-wrap: pretty;
}
.declaration-body em { color: var(--ember); font-style: italic; }

/* ═══════════════ Colophon ══════════════════════════════════════════════ */

.colophon {
  border-top: 1px solid var(--rule);
  padding: 56px 32px 72px;
  background: var(--bg-2);
}
.colophon-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.colophon-cta {
  font-family: var(--serif);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
}
.colophon-cta em { color: var(--ember); font-style: italic; }
.colophon-meta {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}
.colophon-meta strong { color: var(--ink); }
.to-top {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: all 200ms ease;
}
.to-top:hover {
  border-color: var(--ember);
  color: var(--ember);
}

/* ═══════════════ Footnote references (inline hover citations) ═════════ */

.ref {
  position: relative;
  display: inline;
  cursor: help;
  white-space: nowrap;
}
.ref-mark {
  font-family: var(--mono);
  font-size: 0.68em;
  letter-spacing: 0;
  color: var(--ember);
  vertical-align: super;
  line-height: 0;
  padding: 0 2px 0 1px;
  border-bottom: 1px dotted var(--ember);
  transition: background 180ms ease;
  font-weight: 500;
}
.ref:hover .ref-mark,
.ref:focus-within .ref-mark {
  background: var(--ember-2);
}

.ref-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: min(360px, 80vw);
  padding: 14px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  font-family: var(--sans);
  font-style: normal;
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 40;
  text-align: left;
  text-transform: none;
  text-indent: 0;
}
.ref-tip::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
}
.ref-tip a {
  color: var(--ember);
  border-bottom: 1px solid var(--ember);
  padding-bottom: 0;
  word-break: break-all;
}
.ref-tip a:hover { color: var(--bg); border-bottom-color: var(--bg); }

.ref:hover .ref-tip,
.ref:focus-within .ref-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Keep tooltip on-screen at the edges */
.ref:first-child .ref-tip { left: 0; transform: translateX(0) translateY(4px); }
.ref:first-child:hover .ref-tip,
.ref:first-child:focus-within .ref-tip { transform: translateX(0); }

@media (max-width: 480px) {
  .ref-tip { width: min(280px, 85vw); font-size: 12px; padding: 10px 12px; }
}

/* Declaration tweaks — label removed via HTML */
.declaration { text-align: center; }

/* ═══════════════ Reveal animation ══════════════════════════════════════ */

@media (prefers-reduced-motion: no-preference) {
  .chapter,
  .figure,
  .pull,
  .quote,
  .witness,
  .converge,
  .pillar,
  .criterion,
  .table-wrap,
  .declaration {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 700ms ease, transform 700ms cubic-bezier(.2, .7, .2, 1);
  }
  .revealed { opacity: 1; transform: none; }
}

/* ═══════════════ Responsive ════════════════════════════════════════════ */

@media (max-width: 720px) {
  .pillars { grid-template-columns: 1fr; }
  .pillar:last-child { grid-column: auto; }
  .toc-list {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-auto-flow: row;
  }
  .topbar-inner { padding: 10px 18px; }
  .brand-title { display: none; }
  .hero { padding: 0 18px 40px; min-height: 50vh; }
  .hero-inner { padding-top: 60px; }
  .prose { padding: 36px 18px 64px; }
  .toc { padding: 22px 18px; }
  .colophon { padding: 48px 18px 64px; }
  .chapter { padding: 40px 0; }

  .compare { font-size: 12px; }
  .compare thead th,
  .compare tbody th,
  .compare tbody td { padding: 10px 12px; }
  .compare tbody th { font-size: 13px; }
}

@media (max-width: 480px) {
  html, body { font-size: 15px; }
  .pull { padding-left: 36px; }
  .pull::before { font-size: 80px; top: -12px; }
  .quote { padding: 18px 20px; }
  .witness { padding: 18px 20px; }
  .pillar { padding: 18px 20px; }
  .declaration { padding: 22px 20px; }
}
