/* =====================================
   Essay template
   Standalone article design, independent of main.css.
   Usage: <body class="essay"> + /static/js/essay.js
   ===================================== */

:root {
  --paper: #ffffff;
  --paper-deep: #f6f6f7;
  --card: #ffffff;
  --ink: #09090b;
  --ink-soft: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;
  --rule: #e9e9ec;
  --rule-strong: #d4d4d8;
  --accent: #2e5bff;
  --accent-soft: #eef2ff;
  --accent-line: #c3cffd;
  --ok: #0f8a4f;
  --ok-soft: #e7f6ee;
  --info: #2e5bff;
  --info-soft: #eef2ff;
  --warn: #a35f00;
  --warn-soft: #fff4e0;
  --danger: #d6293a;
  --danger-soft: #fdecee;
  --violet: #7c3aed;
  --violet-soft: #f3efff;

  --sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 42.5rem;
  --bleed: 48px;
  --gutter: 24px;
  --topbar: 56px;
}

/* Larger root size on wide, high-density desktops (e.g. 27" 1440p) so every rem-based size scales up together. */
@media (min-width: 1800px) {
  html { font-size: 112.5%; }
}

.essay *,
.essay *::before,
.essay *::after {
  box-sizing: border-box;
}

html:has(body.essay) {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar) + 24px);
}

body.essay {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.essay a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.essay a:hover {
  text-decoration-color: var(--accent);
}

.essay :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Top bar + progress ---------- */

.essay-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.essay-topbar-inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.essay .essay-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.essay .essay-back:hover {
  color: var(--ink);
}

.essay-back svg {
  width: 16px;
  height: 16px;
}

.essay-topbar-title {
  color: var(--faint);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.essay.is-past-hero .essay-topbar-title {
  opacity: 1;
  transform: none;
}

.essay-brand {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.essay-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- Hero ---------- */

.essay-hero {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 88px var(--gutter) 56px;
}

.essay-hero-inner {
  max-width: none;
}

.essay-title {
  max-width: 900px;
  text-wrap: balance;
}

.essay-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.essay-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.essay-title {
  margin: 0;
  font-size: clamp(2.375rem, 5.5vw, 3.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.essay-title em {
  font-style: normal;
  color: var(--accent);
}

.essay-dek {
  max-width: 640px;
  margin: 28px 0 0;
  font-size: 1.25rem;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.essay-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

.essay-meta strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Layout ---------- */

.essay-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter) 120px;
  display: grid;
  grid-template-columns: 220px minmax(0, var(--measure));
  gap: 0 80px;
  align-items: start;
}

.essay-body {
  min-width: 0;
}

/* ---------- Table of contents ---------- */

.essay-toc {
  position: sticky;
  top: calc(var(--topbar) + 32px);
  max-height: calc(100vh - var(--topbar) - 64px);
  overflow-y: auto;
  font-family: var(--sans);
  font-size: 0.8125rem;
  scrollbar-width: thin;
}

.essay-toc-toggle {
  display: none;
}

.essay-toc-label {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.essay-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.essay-toc li {
  margin: 0;
}

.essay .essay-toc a {
  display: flex;
  gap: 10px;
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.essay .essay-toc a:hover {
  color: var(--ink);
}

.essay .essay-toc a.is-active {
  color: var(--ink);
  border-left-color: var(--accent);
  font-weight: 500;
}

.essay-toc a span {
  flex: none;
  width: 18px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.8;
  color: var(--faint);
}

.essay-toc a.is-active span {
  color: var(--accent);
}

.essay-toc .toc-group {
  margin-top: 10px;
  padding: 8px 0 4px 16px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- Prose ---------- */

.essay-body > p,
.essay-body section > p {
  margin: 0 0 1.4em;
}

.essay-body .lead {
  font-size: 1.1875rem;
  color: var(--ink);
}

.essay-body h2 {
  margin: 0 0 20px;
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.essay-body h3 {
  margin: 44px 0 12px;
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.essay-body section {
  padding-top: 88px;
}

.essay-body section:first-of-type {
  padding-top: 0;
}

.essay-body strong {
  color: var(--ink);
  font-weight: 600;
}

.essay-body ul:not([class]) {
  margin: 0 0 1.4em;
  padding: 0;
  list-style: none;
}

.essay-body ul:not([class]) li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 0.45em;
}

.essay-body ul:not([class]) li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.78em;
  width: 10px;
  height: 1.5px;
  background: var(--accent);
}

.essay-body code {
  font-family: var(--mono);
  font-size: 0.8em;
  padding: 0.12em 0.4em;
  border-radius: 4px;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  color: var(--ink);
}

.section-num {
  display: block;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.section-lede {
  margin: -6px 0 28px !important;
  font-size: 1.1875rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--muted);
}

/* ---------- Thesis + pull quote ---------- */

.thesis {
  position: relative;
  margin: 44px 0;
  padding: 28px 32px;
  background: #f9faff;
  border: 1px solid #e8ecfd;
  border-radius: 12px;
}

.thesis::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent-line);
}

.thesis span {
  display: block;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}


.thesis p {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

.pull em {
  display: block;
  font-style: normal;
  color: var(--accent);
}

.pull:last-child {
  margin-bottom: 0;
}



.pull {
  margin: 40px 0;
  padding: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: pretty;
}


/* ---------- Parallels strip ---------- */

.parallels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 8px 0 36px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.5;
}

.parallels > div {
  padding: 14px 16px 16px;
  color: var(--ink-soft);
}

.parallels > div + div {
  border-left: 1px solid var(--rule);
}

.parallels > div:last-child {
  background: var(--accent-soft);
  color: var(--ink);
}

.parallels b {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.parallels > div:last-child b {
  color: var(--accent);
}

/* ---------- Analogy cards ---------- */

.analogies {
  margin: 28px 0 40px;
  border-bottom: 1px solid var(--rule);
}

.analogy {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}

.analogy-num {
  padding-top: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
}


.analogy h3 {
  margin: 2px 0 8px;
}

.analogy p {
  margin: 0 0 0.8em;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.analogy p:last-child {
  margin-bottom: 0;
}

/* ---------- Figures ---------- */

.fig {
  margin: 44px calc(-1 * var(--bleed));
  padding: 32px var(--bleed) 28px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
}

.fig-label {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.fig-title {
  margin: 0 0 24px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.fig figcaption {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--rule-strong);
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

/* Nested rings */

.rings {
  font-family: var(--sans);
}

.ring {
  position: relative;
  border-radius: 14px;
}

.ring-label {
  display: block;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ring-env {
  padding: 18px;
  background: var(--paper-deep);
  border: 1px dashed var(--rule-strong);
}

.ring-env > .ring-label {
  color: var(--muted);
}

.ring-harness {
  padding: 20px;
  background: var(--card);
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.ring-harness > .ring-label {
  color: var(--accent);
}

.ring-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.ring-parts li {
  padding: 5px 11px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.ring-model {
  max-width: 300px;
  margin: 0 auto;
  padding: 18px;
  text-align: center;
  background: var(--paper-deep);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
}

.ring-model > .ring-label {
  margin-bottom: 4px;
  color: var(--faint);
}

.ring-model strong {
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Steps */

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  font-family: var(--sans);
}

.steps.is-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.steps li {
  position: relative;
  padding: 16px 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  counter-increment: step;
}

.steps li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--faint);
}

.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  right: -9px;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid var(--rule-strong);
  border-right: 1.5px solid var(--rule-strong);
  transform: rotate(45deg);
  z-index: 1;
}

.steps li.is-key {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.steps li.is-key::before {
  color: var(--accent);
}

.steps strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.steps span {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Staircase */

.stairs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  height: 260px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
}

.stairs li {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 14px;
  border-radius: 10px 10px 4px 4px;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
}

.stairs li:nth-child(1) { height: 36%; }
.stairs li:nth-child(2) { height: 52%; }
.stairs li:nth-child(3) { height: 68%; }
.stairs li:nth-child(4) { height: 84%; background: var(--accent-soft); border-color: var(--accent-line); }
.stairs li:nth-child(5) { height: 100%; background: var(--accent); border-color: var(--accent); }

.stairs strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.stairs span {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}

.stairs li:nth-child(5) strong,
.stairs li:nth-child(5) span {
  color: #fff;
}

.stairs-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- Code ---------- */

.code {
  margin: 32px 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-deep);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.code-head .dots {
  display: inline-flex;
  gap: 6px;
  margin-right: 10px;
}

.code-head .dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rule-strong);
}

.code-copy {
  appearance: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card);
  padding: 3px 9px;
  font: inherit;
  font-size: 0.6875rem;
  color: var(--muted);
  cursor: pointer;
}

.code-copy:hover {
  color: var(--ink);
  border-color: var(--rule-strong);
}

.code pre {
  margin: 0;
  padding: 20px 20px 22px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink);
  tab-size: 2;
}

.code pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}

.code .k { color: var(--accent); }
.code .c { color: var(--faint); }
.code .s { color: var(--ok); }

/* ---------- Tables ---------- */

.table-wrap {
  margin: 32px 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  overflow-x: auto;
}

.essay-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.5;
}

.essay-body th {
  padding: 12px 16px;
  background: var(--paper-deep);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.essay-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-soft);
}

.essay-body tr:last-child td {
  border-bottom: 0;
}

.essay-body td:first-child {
  color: var(--ink);
  font-weight: 500;
}

.essay-body td.arrow {
  width: 28px;
  padding-left: 0;
  padding-right: 0;
  color: var(--faint);
  text-align: center;
}

.essay-body .col-accent {
  background: var(--accent-soft);
}

.essay-body th.col-accent {
  color: var(--accent);
}

.essay-body td a {
  text-decoration-color: var(--accent-line);
}

.chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
}

.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Evidence pairs ---------- */

.evidence {
  display: grid;
  gap: 10px;
  margin: 28px 0 36px;
  font-family: var(--sans);
}

.evidence > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.4fr);
  align-items: center;
  gap: 8px;
}

.evidence .claim,
.evidence .proof {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.evidence .claim {
  border: 1px dashed var(--rule-strong);
  color: var(--muted);
}

.evidence .proof {
  background: var(--ok-soft);
  color: var(--ink);
}

.evidence .proof::before {
  content: "✓";
  margin-right: 8px;
  color: var(--ok);
  font-weight: 600;
}

.evidence .to {
  text-align: center;
  color: var(--faint);
}

/* ---------- Timeline ---------- */

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 56px 20px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 16px;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline time {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6rem;
  color: var(--faint);
}

.timeline .dot {
  position: relative;
  display: flex;
  justify-content: center;
}

.timeline .dot::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--rule-strong);
  z-index: 1;
}

.timeline li:not(:last-child) .dot::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: -24px;
  width: 1.5px;
  background: var(--rule);
}

.timeline li.pass .dot::before { border-color: var(--ok); background: var(--ok); }
.timeline li.fail .dot::before { border-color: var(--danger); background: var(--danger); }
.timeline li.block .dot::before { border-color: var(--warn); background: var(--warn-soft); }

.timeline p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6rem;
  color: var(--ink-soft);
}

.timeline p .chip {
  margin-left: 6px;
  vertical-align: 1px;
}

/* ---------- Receipt ---------- */

.receipt {
  position: relative;
  max-width: 440px;
  margin: 36px auto;
  padding: 28px 28px 32px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04), 0 8px 24px -12px rgba(9, 9, 11, 0.12);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink);
}

.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 8px;
  background:
    linear-gradient(-45deg, transparent 5px, var(--card) 5px) 0 0 / 12px 8px repeat-x,
    linear-gradient(45deg, transparent 5px, var(--card) 5px) 0 0 / 12px 8px repeat-x;
}

.receipt-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1.5px dashed var(--rule-strong);
  text-align: center;
}

.receipt-head strong {
  display: block;
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
}

.receipt-head span {
  font-size: 0.6875rem;
  color: var(--faint);
}

.receipt dl {
  margin: 0;
}

.receipt dt {
  margin-top: 12px;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.receipt dd {
  margin: 2px 0 0;
}

.receipt dd.ok::before { content: "✓ "; color: var(--ok); }
.receipt dd.no::before { content: "✗ "; color: var(--danger); }
.receipt dd.risk::before { content: "! "; color: var(--warn); }

.receipt-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1.5px dashed var(--rule-strong);
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.receipt-foot b {
  color: var(--accent);
  font-weight: 500;
}

/* ---------- Checklist ---------- */

.checklist {
  margin: 32px 0;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  font-family: var(--sans);
}

.checklist ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-soft);
  transition: background 0.15s ease;
}

.checklist label:hover {
  background: var(--paper);
}

.checklist input {
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  border: 1.5px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--card);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.checklist input::after {
  content: "";
  width: 5px;
  height: 9px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

.checklist input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checklist input:checked::after {
  transform: rotate(45deg) scale(1);
}

.checklist input:checked + span {
  color: var(--ink);
}

.checklist-score {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 4px 4px;
  padding: 14px 12px 8px;
  border-top: 1px solid var(--rule);
}

.checklist-meter {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--paper-deep);
  overflow: hidden;
}

.checklist-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.checklist-count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.checklist-verdict {
  margin: 0 12px 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Evolution ---------- */

.evolution {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 32px 0 40px;
  font-family: var(--sans);
}

.evolution > div {
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
}

.evolution > div:last-child {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.evolution b {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.evolution p {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.evolution > div:last-child b {
  color: var(--accent);
}

.evolution > div:last-child p {
  color: var(--ink);
}

/* ---------- Footer ---------- */

.essay-end {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

.essay-end p {
  margin: 0 0 20px;
}

.essay-end-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.essay .essay-end-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.essay .essay-end-nav a:hover {
  border-color: var(--rule-strong);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .essay-shell {
    display: block;
    max-width: calc(var(--measure) + 2 * var(--gutter));
  }

  .essay-hero {
    max-width: calc(var(--measure) + 2 * var(--gutter));
    padding-top: 64px;
  }


  .essay-toc {
    position: static;
    max-height: none;
    margin: 0 0 56px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--card);
  }

  .essay-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
  }

  .essay-toc-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
  }

  .essay-toc.is-open .essay-toc-toggle svg {
    transform: rotate(180deg);
  }

  .essay-toc-label {
    display: none;
  }

  .essay-toc ol {
    display: none;
    margin: 0 18px 16px;
  }

  .essay-toc.is-open ol {
    display: block;
  }

  .fig {
    --bleed: 24px;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 18px;
  }

  body.essay {
    font-size: 1.0625rem;
  }

  .essay-topbar-title {
    display: none;
  }

  .essay-hero {
    padding-top: 44px;
    padding-bottom: 40px;
  }

  .essay-dek {
    font-size: 1.1875rem;
  }

  .essay-body h2 {
    font-size: 1.75rem;
  }

  .essay-body section {
    padding-top: 64px;
  }

  .section-lede {
    font-size: 1.125rem;
  }

  .thesis {
    padding: 22px 20px;
  }

  .thesis p {
    font-size: 1.1875rem;
  }

  .pull {
    font-size: 1.25rem;
  }

  .fig {
    --bleed: 16px;
    margin-left: 0;
    margin-right: 0;
    padding: 22px 16px 18px;
  }

  .parallels,
  .evolution {
    grid-template-columns: 1fr;
  }

  .parallels > div + div {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .analogy {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 20px 0;
  }

  .steps,
  .steps.is-4 {
    grid-template-columns: 1fr;
  }

  .steps li:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -9px;
    left: 22px;
    transform: rotate(135deg);
  }

  .stairs {
    grid-template-columns: 1fr;
    height: auto;
    align-items: stretch;
  }

  .stairs li {
    height: auto !important;
    border-radius: 4px 10px 10px 4px;
  }

  .stairs li:nth-child(1) { width: 60%; }
  .stairs li:nth-child(2) { width: 70%; }
  .stairs li:nth-child(3) { width: 80%; }
  .stairs li:nth-child(4) { width: 90%; }
  .stairs li:nth-child(5) { width: 100%; }

  .stairs-axis {
    display: none;
  }

  .evidence > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .evidence .to {
    transform: rotate(90deg);
    line-height: 1;
  }

  .receipt {
    transform: none;
    padding: 22px 20px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:has(body.essay) {
    scroll-behavior: auto;
  }

  .essay *,
  .essay *::before,
  .essay *::after {
    transition: none !important;
  }
}

/* ---------- Illustrations ---------- */

.essay-hero-art {
  margin: 44px 0 0;
}

.essay-hero-art .shot-grid {
  gap: 16px;
}

.essay-hero-art figcaption {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

.essay-hero-art img,
.art img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: #fff;
}

.art {
  margin: 44px calc(-1 * var(--bleed));
}

.art figcaption {
  margin-top: 12px;
  padding: 0 var(--bleed);
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .art {
    --bleed: 24px;
  }
}

@media (max-width: 720px) {
  .essay-hero-art {
    margin-top: 32px;
  }

  .essay-hero-art img,
  .art img {
    border-radius: 12px;
  }

  .art {
    margin-left: 0;
    margin-right: 0;
  }

  .art figcaption {
    padding: 0;
  }
}

/* =====================================
   Shared components for technical posts
   ===================================== */

/* Inline emphasis */

.essay-body mark {
  padding: 0.05em 0.3em;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--ink);
}

.essay-body strong.t-danger { color: var(--danger); }
.essay-body strong.t-accent { color: var(--accent); }
.essay-body strong.t-violet { color: var(--violet); }
.essay-body strong.t-ok { color: var(--ok); }
.essay-body strong.t-warn { color: var(--warn); }

.essay-body ol:not([class]) {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.essay-body ol:not([class]) li {
  margin-bottom: 0.45em;
  padding-left: 4px;
}

.essay-body ol:not([class]) li::marker {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--accent);
}

/* Code token colours */

.code .f { color: var(--violet); }
.code .d { color: var(--danger); }
.code .n { color: var(--accent); }

/* Screenshots */

.shot {
  margin: 36px 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper-deep);
}

.shot.is-wide {
  margin-left: calc(-1 * var(--bleed));
  margin-right: calc(-1 * var(--bleed));
}

.shot.is-narrow img {
  width: 72%;
  margin: 0 auto;
}

.shot.is-portrait img {
  width: 52%;
  margin: 0 auto;
}

.shot.is-inline img {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 24px;
  image-rendering: auto;
}

.shot figcaption {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

.shot.is-wide figcaption {
  padding: 0 var(--bleed);
}

.shot figcaption strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.875rem;
  color: var(--ink);
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.shot-grid.is-stack {
  grid-template-columns: 1fr;
}

.shot-grid > div > p {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

[data-zoom] {
  cursor: zoom-in;
}

.zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.zoom-overlay img {
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 60px -30px rgba(9, 9, 11, 0.35);
}

.zoom-overlay button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #fff;
  font: 500 1.25rem/1 var(--sans);
  color: var(--ink);
  cursor: pointer;
}

/* Callouts */

.callout {
  margin: 32px 0;
  padding: 16px 20px 18px;
  background: #fafafa;
  border: 1px solid var(--rule);
  border-radius: 12px;
  font-family: var(--sans);
}

.callout > b {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.callout p {
  margin: 0 !important;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.callout > strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.callout-danger > b { color: var(--danger); }
.callout-warn > b { color: var(--warn); }
.callout-info > b { color: var(--accent); }
.callout-ok > b { color: var(--ok); }

/* Vertical flow */

.flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--sans);
}

.flow-node {
  min-width: 240px;
  max-width: 100%;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  text-align: center;
}

.flow-node b {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.flow-node strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.flow-node span {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.flow-node code {
  font-size: 0.75rem;
}

.flow-node.is-accent { border-color: var(--accent-line); background: var(--accent-soft); }
.flow-node.is-accent b { color: var(--accent); }
.flow-node.is-violet { border-color: #d9ccff; background: var(--violet-soft); }
.flow-node.is-violet b { color: var(--violet); }
.flow-node.is-ok { border-color: #bfe3cf; background: var(--ok-soft); }
.flow-node.is-ok b { color: var(--ok); }
.flow-node.is-danger { border-color: #f5c2c8; background: var(--danger-soft); }
.flow-node.is-danger b { color: var(--danger); }

.flow-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.flow-tags li {
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-deep);
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-soft);
}

.flow-arrow {
  position: relative;
  width: 1.5px;
  height: 32px;
  background: var(--rule-strong);
}

.flow-arrow::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--rule-strong);
  border-bottom: 1.5px solid var(--rule-strong);
  transform: translate(-50%, -1px) rotate(45deg);
}

.flow-arrow[data-label]::before {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.6875rem;
  white-space: nowrap;
  color: var(--faint);
}

.flow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  width: 100%;
}

.flow-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flow-col .flow-node {
  min-width: 0;
  width: 100%;
}

.flow-link {
  align-self: start;
  padding-top: 26px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--faint);
  white-space: nowrap;
}

/* Horizontal chain */

.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.chain > span {
  padding: 9px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.chain > i {
  font-style: normal;
  color: var(--faint);
}

.chain > .is-accent { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.chain > .is-violet { border-color: #d9ccff; background: var(--violet-soft); color: var(--violet); }
.chain > .is-ok { border-color: #bfe3cf; background: var(--ok-soft); color: var(--ok); }
.chain > .is-warn { border-color: #f2d7a6; background: var(--warn-soft); color: var(--warn); }

/* Two-panel diagram */

.duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  font-family: var(--sans);
}

.duo-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.duo-card.is-accent {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.duo-card > b {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.duo-card > strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.duo-card > p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

.duo-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--faint);
}

.duo-bridge i {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
}

.slots,
.kv {
  margin: 0;
  padding: 0;
  list-style: none;
}

.slots li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  margin-top: 6px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--ink);
}

.slots li span {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--faint);
}

.slots li.is-active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.kv li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 0.8125rem;
  color: var(--muted);
}

.kv li:last-child {
  border-bottom: 0;
}

.kv li b {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink);
}

/* Nested boxes */

.nest {
  font-family: var(--sans);
}

.nest-box {
  padding: 14px 16px 16px;
  border: 1px dashed var(--rule-strong);
  border-radius: 14px;
  background: #fff;
}

.nest-box .nest-box {
  margin-top: 12px;
}

.nest-box > b {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nest-box > small {
  display: block;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.nest-box.is-accent {
  border-style: solid;
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.nest-box.is-accent > b {
  color: var(--accent);
}

.nest-box.is-core {
  border-style: solid;
  border-color: var(--accent);
  text-align: center;
}

.nest-box.is-core > b {
  color: var(--accent);
}

.nest-box.is-core > strong {
  display: block;
  margin-top: 2px;
  font-size: 0.9375rem;
  color: var(--ink);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid var(--rule-strong);
  background: #fff;
}

.legend i.is-accent { border-color: var(--accent-line); background: var(--accent-soft); }
.legend i.is-core { border-color: var(--accent); background: #fff; }

/* Mono values in tables */

.essay-body td code {
  word-break: break-all;
}

@media (max-width: 720px) {
  .shot.is-wide {
    margin-left: 0;
    margin-right: 0;
  }

  .shot.is-wide figcaption {
    padding: 0;
  }

  .shot.is-narrow img {
    width: 100%;
  }

  .shot.is-portrait img {
    width: 80%;
  }

  .shot-grid {
    grid-template-columns: 1fr;
  }

  .flow-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .flow-link {
    padding: 8px 0;
    text-align: center;
  }

  .flow-node {
    min-width: 0;
    width: 100%;
  }

  .duo {
    grid-template-columns: 1fr;
  }

  .duo-bridge {
    flex-direction: row;
  }

  .duo-bridge i {
    width: 40px;
  }

  .chain {
    justify-content: flex-start;
  }
}

/* ---------- Summary box and further reading ---------- */

.callout ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.callout ul li {
  position: relative;
  margin: 0;
  padding: 6px 0 6px 20px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.callout ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.05em;
  width: 8px;
  height: 1.5px;
  background: var(--accent);
}

.further {
  margin-top: 56px;
  padding-top: 0 !important;
}

.further ul li {
  font-size: 0.9375rem;
}

/* ---------- Field notes ---------- */

.field-notes {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.field-notes > li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}

.fn-num {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 2.2;
  color: var(--accent);
}

.field-notes h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.field-notes p {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.7;
}

.field-notes p:last-child {
  margin-bottom: 0;
}

.field-notes p b {
  display: block;
  margin-bottom: 2px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-notes p + p b {
  color: var(--accent);
}

/* ---------- Narrow corridor figure ---------- */

.corridor-axis {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.corridor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  font-family: var(--sans);
}

.corridor-zone {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 20px;
}

.corridor-zone b {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.corridor-zone strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.corridor-zone span {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.corridor-zone.is-wild {
  background: var(--danger-soft);
}

.corridor-zone.is-wild b {
  color: var(--danger);
}

.corridor-zone.is-corridor {
  background: #fff;
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.corridor-zone.is-corridor b {
  color: var(--accent);
}

.corridor-zone.is-rigid {
  background: var(--paper-deep);
}

.corridor-zone.is-rigid b {
  color: var(--muted);
}

@media (max-width: 720px) {
  .field-notes > li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .corridor {
    grid-template-columns: 1fr;
  }

  .corridor-zone.is-corridor {
    border-left: 0;
    border-right: 0;
    border-top: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
  }
}

.essay-toc .toc-group.toc-first {
  margin-top: 0;
  padding-top: 2px;
}

/* ---------- Compact, grouped contents (desktop) ---------- */

@media (min-width: 1101px) {
  .essay .essay-toc a {
    padding-top: 4px;
    padding-bottom: 4px;
    line-height: 1.35;
  }

  .essay-toc li.is-collapsed {
    display: none;
  }

  .essay-toc .toc-group[role="button"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding: 8px 0 6px 16px;
    cursor: pointer;
    transition: color 0.15s ease;
  }

  .essay-toc .toc-group[role="button"]::after {
    content: "+";
    font-size: 0.75rem;
    color: var(--faint);
  }

  .essay-toc .toc-group[role="button"]:hover,
  .essay-toc .toc-group.is-current {
    color: var(--ink);
  }

  .essay-toc .toc-group.is-current::after {
    content: "−";
    color: var(--accent);
  }
}

/* In-article illustrations draw their own panels; no extra frame. */
.art img {
  border: 0;
  border-radius: 0;
  background: transparent;
}
