/* ==========================================================================
   A Field Guide to Active Inference — stylesheet
   One visual world: ruled exercise-book sheets laid on a dark desk, after the
   childhood notebook pages Karl Friston reproduced in "Am I autistic?" (2018).
   Reading happens on ruled paper; experiments happen on squared paper; the
   whole theory is pinned up, at the end, on one large sheet.
   ========================================================================== */

:root {
  /* the desk */
  --desk: #22383b;
  --desk-2: #1a2c2e;
  /* the paper */
  --paper: #ebe6d9;
  --paper-edge: #dcd6c6;
  --paper-2: #e3ded0;
  --rule: rgba(92, 128, 176, 0.26);
  --margin: #c9807f;
  --squares: rgba(77, 138, 134, 0.22);
  --tape: #e7d9ad;
  /* ink and pencil */
  --ink: #26241f;
  --ink-soft: #4f4a42;
  --pencil: #6e685c;
  --pencil-light: #9a9385;
  /* pigments taken from the specimens */
  --coral: #cf7d5c;   /* common starfish */
  --coral-deep: #b4603f;
  --teal: #4d8a86;    /* squat lobster */
  --teal-deep: #35635f;
  --violet: #7e6f9c;  /* brittle star */
  --rose: #a8646a;    /* scallop */
  --indigo: #3e4a75;  /* mussel */
  --brass: #b08d3c;
  --wash-coral: rgba(207, 125, 92, 0.18);
  --wash-teal: rgba(77, 138, 134, 0.18);
  --wash-violet: rgba(126, 111, 156, 0.18);
  --wash-rose: rgba(168, 100, 106, 0.16);
  --wash-indigo: rgba(62, 74, 117, 0.14);

  --font-body: "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --font-type: "Special Elite", "Courier Prime", "Courier New", monospace;

  --line: 2rem;             /* the ruling: every line of text sits on a rule */
  --measure: 66ch;
  --sheet-w: 1120px;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  padding-block: 2.5rem 8rem;
  padding-inline: 16px;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(0,0,0,0.25), transparent 60%),
    var(--desk);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: var(--line);
  font-variant-numeric: oldstyle-nums;
}

::selection { background: rgba(207,125,92,0.35); }

a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--coral-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 2px;
}

strong { font-weight: 700; }
em { font-style: italic; }
sup, sub { line-height: 0; }
abbr[title] { text-decoration: none; border-bottom: 1px dotted var(--pencil-light); cursor: help; }

/* --------------------------------------------------------------------------
   The sheet: ruled paper with a red margin and punched holes
   -------------------------------------------------------------------------- */
.sheet {
  position: relative;
  max-width: var(--sheet-w);
  margin: 0 auto 3.5rem;
  padding: 3rem var(--gutter) 3.5rem calc(var(--gutter) + 3.25rem);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px), var(--rule) var(--line)),
    linear-gradient(to right, var(--paper-edge), var(--paper));
  background-size: auto, 24px 100%;
  background-repeat: repeat, no-repeat;
  background-position: 0 1.6rem, 0 0;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.35) inset,
    0 18px 40px -18px rgba(0,0,0,0.65),
    0 2px 6px rgba(0,0,0,0.35);
  border-radius: 2px;
}
/* the red margin rule */
.sheet::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) + 2rem);
  width: 2px; background: var(--margin); opacity: 0.55;
}
/* three punched holes */
.sheet::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 0; width: 2.5rem;
  background:
    radial-gradient(circle at 1.25rem 12%, var(--desk-2) 0 7px, rgba(0,0,0,0.25) 7px 8px, transparent 9px),
    radial-gradient(circle at 1.25rem 50%, var(--desk-2) 0 7px, rgba(0,0,0,0.25) 7px 8px, transparent 9px),
    radial-gradient(circle at 1.25rem 88%, var(--desk-2) 0 7px, rgba(0,0,0,0.25) 7px 8px, transparent 9px);
  pointer-events: none;
}
.sheet > * { position: relative; }

/* two columns: running text, and a margin for drawings and pencil notes */
.sheet__grid {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) minmax(200px, 1fr);
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.sheet__text { min-width: 0; }
.sheet__margin { min-width: 0; display: grid; gap: 1.5rem; align-content: start; }
@media (max-width: 860px) {
  .sheet { padding-left: calc(var(--gutter) + 2.6rem); }
  .sheet__grid { grid-template-columns: minmax(0, 1fr); }
  .sheet__margin { margin-top: 1.5rem; }
}
@media (max-width: 520px) {
  .sheet { padding: 2rem 18px 2.5rem 2.75rem; }
  .sheet::before { left: 2rem; }
  .sheet::after { width: 1.5rem; }
  .sheet::after { background-image:
    radial-gradient(circle at 0.75rem 12%, var(--desk-2) 0 5px, rgba(0,0,0,0.25) 5px 6px, transparent 7px),
    radial-gradient(circle at 0.75rem 50%, var(--desk-2) 0 5px, rgba(0,0,0,0.25) 5px 6px, transparent 7px),
    radial-gradient(circle at 0.75rem 88%, var(--desk-2) 0 5px, rgba(0,0,0,0.25) 5px 6px, transparent 7px); }
}

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-type);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pencil);
  margin: 0 0 var(--line);
  line-height: var(--line);
}
.eyebrow b { color: var(--coral-deep); font-weight: 400; }

h1, h2, h3, h4 { font-family: var(--font-body); font-weight: 400; text-wrap: balance; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: calc(var(--line) * 1.5); margin-bottom: var(--line); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); line-height: calc(var(--line) * 1.5); margin-bottom: var(--line); }
h3 { font-size: 1.32rem; line-height: var(--line); margin-top: var(--line); margin-bottom: 0; font-style: italic; }
h3 + p { margin-top: 0; }
h4 { font-size: 1.05rem; line-height: var(--line); font-weight: 700; }
p { margin: 0 0 var(--line); }
p.lede { font-size: 1.22rem; line-height: var(--line); color: var(--ink-soft); }
.small { font-size: 0.92rem; }
.mute { color: var(--pencil); }

ul, ol { margin: 0 0 var(--line); padding-left: 1.4rem; }
li { margin: 0; }
li + li { margin-top: 0; }
li::marker { color: var(--coral-deep); }
ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps > li { position: relative; padding-left: 3.2rem; margin-bottom: var(--line); }
ol.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0.1rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 1.5px solid var(--coral-deep); color: var(--coral-deep);
  font-family: var(--font-type); font-size: 1rem; display: grid; place-items: center;
  background: rgba(255,255,255,0.35);
}

blockquote {
  margin: 0 0 var(--line);
  padding-left: 1.2rem;
  border-left: 3px solid var(--wash-coral);
  color: var(--ink-soft);
  font-style: italic;
}
blockquote cite { display: block; font-style: normal; font-family: var(--font-type); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--pencil); margin-top: 0; }

.epigraph { font-style: italic; color: var(--ink-soft); margin: 0 0 var(--line); padding: 0; border: 0; }
.epigraph cite { font-family: var(--font-type); font-style: normal; font-size: 0.78rem; letter-spacing: 0.08em; color: var(--pencil); }

hr.pen { border: 0; height: 2px; margin: var(--line) 0; background:
  linear-gradient(90deg, transparent, var(--pencil-light) 15%, var(--pencil-light) 85%, transparent); opacity: 0.6; }

/* handwriting */
.hand { font-family: var(--font-hand); font-size: 1.35rem; line-height: 1.25; color: var(--pencil); }
.hand--ink { color: var(--indigo); }

/* typewriter */
.type { font-family: var(--font-type); font-size: 0.86rem; letter-spacing: 0.04em; }

/* formulas, set as text (no library): a quiet box, monospace-free */
.formula {
  margin: 0 0 var(--line);
  padding: 0.6rem 1rem;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.45);
  border-radius: 2px;
  font-size: 1.05rem;
  line-height: 1.7;
  overflow-x: auto;
}
.formula .var { font-style: italic; }
.formula .op { color: var(--pencil); padding: 0 0.15em; }
.formula .lab { display: inline-block; font-family: var(--font-hand); font-size: 1.15rem; color: var(--coral-deep); margin-left: 0.4em; }
.formula .row { display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; align-items: baseline; }
.formula .row + .row { margin-top: 0.35rem; border-top: 1px dotted rgba(0,0,0,0.12); padding-top: 0.35rem; }
.formula .gloss { font-family: var(--font-hand); color: var(--pencil); font-size: 1.15rem; }

/* key-terms */
dfn { font-style: normal; font-weight: 700; color: var(--teal-deep); }

/* --------------------------------------------------------------------------
   Margin furniture: specimen drawings, pencil notes, labels
   -------------------------------------------------------------------------- */
.specimen {
  margin: 0;
  display: grid;
  gap: 0.25rem;
  justify-items: start;
}
.specimen svg { width: 100%; max-width: 260px; height: auto; display: block; overflow: visible; }
.specimen figcaption { font-family: var(--font-hand); font-size: 1.25rem; line-height: 1.25; color: var(--pencil); }
.specimen figcaption u { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.specimen figcaption .lat { font-style: italic; }

.note {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--pencil);
  transform: rotate(-1.4deg);
  transform-origin: left top;
  margin: 0;
  max-width: 34ch;
}
.note--ink { color: var(--indigo); }
.note--coral { color: var(--coral-deep); }
.note .arrow { display: inline-block; transform: rotate(8deg); }
@media (max-width: 860px) {
  .note { transform: none; border-left: 2px solid var(--pencil-light); padding-left: 0.8rem; }
}

/* museum-style specimen label */
.label {
  font-family: var(--font-type);
  font-size: 0.82rem;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: #f3efe4;
  border: 1px solid rgba(0,0,0,0.25);
  padding: 0.75rem 0.9rem;
  box-shadow: 1px 2px 0 rgba(0,0,0,0.12);
  transform: rotate(0.6deg);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.label dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.1rem 0.8rem; }
.label dt { text-transform: uppercase; color: var(--pencil); font-size: 0.72rem; letter-spacing: 0.12em; }
.label dd { margin: 0; }
.label .no { font-size: 1rem; color: var(--coral-deep); }
@media (max-width: 860px) { .label { transform: none; } }

/* the sheet's header block */
.sheet-head { display: grid; gap: 0.5rem; margin-bottom: var(--line); }
.sheet-head .eyebrow { margin-bottom: 0; }
.tab-mark {
  display: inline-block;
  font-family: var(--font-type);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  padding: 0.15rem 0.7rem;
  color: #fff;
  background: var(--tabc, var(--teal));
  border-radius: 2px 2px 0 0;
  margin-right: 0.6rem;
  vertical-align: 0.2em;
}

/* --------------------------------------------------------------------------
   Experiments: squared paper insets
   -------------------------------------------------------------------------- */
.experiment {
  position: relative;
  margin: calc(var(--line) * 1.5) 0 calc(var(--line) * 1.5);
  padding: 2.4rem 1.25rem 1.25rem;
  border: 1px solid rgba(53,99,95,0.45);
  border-radius: 2px;
  background-color: #eef0e6;
  background-image:
    repeating-linear-gradient(to right, transparent 0 15px, var(--squares) 15px 16px),
    repeating-linear-gradient(to bottom, transparent 0 15px, var(--squares) 15px 16px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 6px 14px -10px rgba(0,0,0,0.35);
  line-height: 1.5;
  grid-column: 1 / -1;
}
.experiment__tape {
  position: absolute; top: -0.8rem; left: 1rem;
  font-family: var(--font-type); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink);
  background: var(--tape);
  padding: 0.25rem 0.9rem;
  transform: rotate(-1.5deg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  opacity: 0.95;
}
.experiment h4 { margin: 0 0 0.5rem; font-style: normal; font-weight: 700; font-size: 1.1rem; }
.experiment p { margin: 0 0 0.9rem; font-size: 0.98rem; }
.experiment p:last-child { margin-bottom: 0; }
.experiment .readme { font-family: var(--font-hand); font-size: 1.25rem; color: var(--pencil); margin: 0.25rem 0 0.75rem; }

.controls { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; align-items: center; margin: 0.4rem 0 0.9rem; }
.controls label { display: inline-flex; flex-direction: column; gap: 0.15rem; font-family: var(--font-type); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.controls label .val { font-family: var(--font-body); font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.controls input[type="range"] { width: 12rem; max-width: 60vw; accent-color: var(--coral-deep); }
.controls .check { flex-direction: row; align-items: center; gap: 0.5rem; }
.controls .check input { accent-color: var(--teal-deep); width: 1.05rem; height: 1.05rem; }

.btn {
  font-family: var(--font-type); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #fff; background: var(--teal-deep); border: 0; border-radius: 2px;
  padding: 0.55rem 0.95rem; cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}
.btn:hover { background: var(--teal); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,0.25); }
.btn--coral { background: var(--coral-deep); }
.btn--coral:hover { background: var(--coral); }
.btn--ghost { background: transparent; color: var(--teal-deep); box-shadow: none; border: 1px solid var(--teal-deep); }
.btn--ghost:hover { background: rgba(77,138,134,0.12); }

.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem 1.5rem; align-items: start; }
.demo-grid > * { min-width: 0; }
.demo-grid canvas, .demo-grid svg { width: 100%; height: auto; display: block; }
canvas.plot { background: rgba(255,255,255,0.55); border: 1px solid rgba(0,0,0,0.2); border-radius: 2px; }

.demo-stack { display: grid; gap: 1rem; }
.demo-stack svg { width: 100%; max-width: 680px; height: auto; display: block; }
#exp-reflex .demo-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.bars { display: grid; gap: 0.4rem; }
.bar { display: grid; grid-template-columns: 7.5rem 1fr 3.5rem; align-items: center; gap: 0.6rem; font-size: 0.95rem; }
.bar__track { height: 1.1rem; background: rgba(0,0,0,0.08); border-radius: 2px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--coral); transition: width 0.25s ease; }
.bar__fill.teal { background: var(--teal); }
.bar__fill.violet { background: var(--violet); }
.bar__val { font-variant-numeric: tabular-nums; text-align: right; }
.readout { font-family: var(--font-type); font-size: 0.85rem; line-height: 1.6; background: rgba(255,255,255,0.55); border: 1px solid rgba(0,0,0,0.15); padding: 0.6rem 0.8rem; border-radius: 2px; }
.readout b { color: var(--coral-deep); font-weight: 400; }
.readout .big { font-family: var(--font-body); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat-line { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-family: var(--font-type); font-size: 0.82rem; margin-top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .bar__fill { transition: none; }
}

/* --------------------------------------------------------------------------
   Figures in the running text (diagrams)
   -------------------------------------------------------------------------- */
figure.diagram { margin: 0 0 var(--line); }
figure.diagram svg { width: 100%; height: auto; display: block; max-width: 100%; }
figure.diagram figcaption { font-family: var(--font-hand); font-size: 1.25rem; line-height: 1.3; color: var(--pencil); margin-top: 0.4rem; }
figure.diagram figcaption b { font-family: var(--font-type); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--coral-deep); font-weight: 400; margin-right: 0.4rem; }
.scrollx { overflow-x: auto; }

/* the ring of free energy (the book's cover motif) */
.ring { display: grid; place-items: center; margin: 0 0 var(--line); }
.ring svg { width: min(100%, 420px); height: auto; }
.ring .spin { transform-origin: 50% 50%; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ring .spin { animation: none; } }

/* tables */
table.field { border-collapse: collapse; width: 100%; margin: 0 0 var(--line); font-size: 0.98rem; line-height: 1.45; }
table.field th, table.field td { text-align: left; vertical-align: top; padding: 0.55rem 0.7rem; border-bottom: 1px solid rgba(0,0,0,0.15); }
table.field th { font-family: var(--font-type); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pencil); font-weight: 400; border-bottom: 1.5px solid var(--pencil-light); }
table.field td:first-child { font-weight: 700; }
.tablewrap { overflow-x: auto; margin: 0 0 var(--line); }
.tablewrap table.field { margin-bottom: 0; min-width: 520px; }

/* the "textbook re-derived" grid of entries */
.entries { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.4rem 1.6rem; margin: 0 0 var(--line); grid-column: 1 / -1; }
.entry { border-top: 2px solid var(--wash-teal); padding-top: 0.6rem; font-size: 0.98rem; line-height: 1.5; }
.entry h4 { margin: 0 0 0.35rem; font-weight: 700; font-style: normal; font-size: 1.05rem; line-height: 1.3; }
.entry h4 small { display: block; font-family: var(--font-type); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pencil); margin-top: 0.15rem; }
.entry p { margin: 0 0 0.6rem; }
.entry p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Frontispiece
   -------------------------------------------------------------------------- */
.frontis { padding-top: 3.5rem; }
.frontis .title { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.05; margin-bottom: 1.25rem; }
.frontis .title .thin { display: block; font-size: 0.42em; font-style: italic; letter-spacing: 0.01em; color: var(--ink-soft); margin-bottom: 0.4rem; }
.frontis .byline { font-size: 1.1rem; color: var(--ink-soft); max-width: 60ch; }
.frontis .pool { margin: var(--line) 0; }
.frontis .pool svg { width: 100%; height: auto; display: block; }
.frontis .pool figcaption { font-family: var(--font-hand); font-size: 1.3rem; color: var(--pencil); text-align: right; }
.contents { columns: 2; column-gap: 2rem; font-size: 0.98rem; line-height: 1.6; margin: 0 0 var(--line); padding: 0; list-style: none; }
.contents li { break-inside: avoid; padding: 0.15rem 0; }
.contents a { text-decoration: none; color: var(--ink); }
.contents a:hover { color: var(--coral-deep); text-decoration: underline; }
.contents .num { display: inline-block; width: 2.2rem; font-family: var(--font-type); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--coral-deep); }
@media (max-width: 600px) { .contents { columns: 1; } }

.exercise {
  border: 1.5px dashed var(--pencil-light);
  padding: 1rem 1.2rem;
  margin: 0 0 var(--line);
  background: rgba(255,255,255,0.3);
}
.exercise .hand { display: block; margin-bottom: 0.4rem; }
.exercise p { margin: 0; }

/* --------------------------------------------------------------------------
   Navigation: index tabs
   -------------------------------------------------------------------------- */
.tabs {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 3px; z-index: 20;
  margin: 0; padding: 0; list-style: none;
}
.tabs a {
  display: block; text-decoration: none;
  font-family: var(--font-type); font-size: 0.72rem; letter-spacing: 0.1em;
  color: #fff; background: var(--tabc, var(--teal));
  padding: 0.35rem 0.55rem 0.35rem 0.7rem;
  border-radius: 3px 0 0 3px;
  opacity: 0.55; min-width: 2.6rem; text-align: center;
  transition: opacity 0.2s, transform 0.2s, min-width 0.2s;
  box-shadow: -1px 1px 3px rgba(0,0,0,0.3);
}
.tabs a:hover, .tabs a:focus-visible { opacity: 1; }
.tabs a.is-active { opacity: 1; min-width: 3.4rem; }
.tabs a span { display: none; }
.tabs a:hover span { display: inline; margin-left: 0.4rem; }
@media (prefers-reduced-motion: reduce) { .tabs a { transition: none; } }

.tabstrip {
  display: none; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  margin: -2.5rem -16px 1.5rem; padding: 0.4rem 12px;
  background: var(--desk-2); overflow-x: auto; white-space: nowrap;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.tabstrip a {
  display: inline-block; text-decoration: none; margin-right: 4px;
  font-family: var(--font-type); font-size: 0.72rem; letter-spacing: 0.1em;
  color: #fff; background: var(--tabc, var(--teal)); opacity: 0.6;
  padding: 0.3rem 0.6rem; border-radius: 2px;
}
.tabstrip a.is-active { opacity: 1; }
@media (max-width: 1300px) {
  .tabs { display: none; }
  .tabstrip { display: block; }
}

/* --------------------------------------------------------------------------
   The one page: a large sheet under a brass clip
   -------------------------------------------------------------------------- */
.poster {
  max-width: 1280px;
  padding-top: 4rem;
  background-image: none;
  background-size: auto;
  background-color: var(--paper-2);
}
.poster::before, .poster::after { display: none; }
.clip {
  position: absolute; top: -0.9rem; left: 50%; transform: translateX(-50%);
  width: min(70%, 420px); height: 1.5rem;
  background: linear-gradient(180deg, #d9bf72, var(--brass) 45%, #7d6127);
  border-radius: 0.3rem;
  box-shadow: 0 3px 6px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.5);
}
.clip::before, .clip::after {
  content: ""; position: absolute; top: 50%; width: 0.7rem; height: 0.7rem; transform: translateY(-50%);
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f0dc9b, #8a6a2b);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.clip::before { left: 0.6rem; } .clip::after { right: 0.6rem; }
.poster svg { width: 100%; height: auto; display: block; }
.poster .poster-title { text-align: center; }
.poster .poster-title .hand { font-size: 1.6rem; }

/* --------------------------------------------------------------------------
   Glossary
   -------------------------------------------------------------------------- */
.gloss-list { columns: 2; column-gap: 2.5rem; margin: 0 0 var(--line); font-size: 0.96rem; line-height: 1.5; }
.gloss-list div { break-inside: avoid; margin-bottom: 0.7rem; }
.gloss-list dt { font-weight: 700; color: var(--teal-deep); }
.gloss-list dd { margin: 0; }
@media (max-width: 720px) { .gloss-list { columns: 1; } }

/* colophon */
.colophon { font-size: 0.95rem; color: var(--ink-soft); }

/* utilities */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.flow > * + * { margin-top: 0; }
img { max-width: 100%; }

/* --------------------------------------------------------------------------
   Drawing kit: classes used inside the inline SVGs
   -------------------------------------------------------------------------- */
.pen { fill: none; stroke: #4a463f; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pen--thin { stroke-width: 1; }
.pen--soft { stroke: #8b857a; }
.hatch { stroke: #8b857a; stroke-width: 0.8; stroke-linecap: round; }
.wash-teal { fill: rgba(77,138,134,0.32); }
.wash-coral { fill: rgba(207,125,92,0.42); }
.wash-violet { fill: rgba(126,111,156,0.36); }
.wash-rose { fill: rgba(168,100,106,0.34); }
.wash-indigo { fill: rgba(62,74,117,0.3); }
.wash-sand { fill: rgba(176,141,60,0.26); }
.hlabel { font-family: var(--font-hand); font-size: 20px; fill: #6e685c; }
.tlabel { font-family: var(--font-type); font-size: 11px; letter-spacing: 0.08em; fill: #6e685c; text-transform: uppercase; }
.dtext { font-family: var(--font-body); font-size: 13px; fill: #26241f; }
.dtext--i { font-style: italic; }
