/* ═══════════════════════════════════════════════════════════════
   THE CURIOUS DISSECT — Editorial Science Notebook
   A quiet, paper-warm reading system. Pastels live only in diagrams.
   Fonts: Fraunces (display) · Newsreader (reading) · JetBrains Mono (code)
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,400;1,9..144,500&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* — Paper & ink — */
  --paper:      #f6f2ea;   /* warm cream page */
  --paper-2:    #efe9dd;   /* slightly deeper panel */
  --card:       #fffdf8;   /* raised surface */
  --ink:        #2a2622;   /* near-black warm */
  --ink-soft:   #56504a;   /* body-secondary */
  --ink-faint:  #8c847a;   /* captions, meta */
  --rule:       rgba(42,38,34,.12);
  --rule-soft:  rgba(42,38,34,.07);

  /* — Single UI accent: clay — */
  --clay:       #bd6a3c;
  --clay-deep:  #9c5227;
  --clay-wash:  rgba(189,106,60,.09);

  /* — Diagram pastels (fill + ink pairs) — */
  --lav:   #d8cdf0;  --lav-ink:   #6a56a0;
  --sage:  #c3ddb8;  --sage-ink:  #517a45;
  --peach: #f4d1b3;  --peach-ink: #b9713e;
  --sky:   #bcd9ea;  --sky-ink:   #3f7ba0;
  --butter:#f5e2a8;  --butter-ink:#a9852a;
  --rose:  #eec2c0;  --rose-ink:  #b0524e;

  /* — Type — */
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --read:    'Newsreader', Georgia, serif;
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* — Metrics — */
  --measure: 47rem;       /* unified reading + figure column */
  --wide:    47rem;       /* figures align to the text boundary */
  --radius:  14px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--read);
  font-size: 1.16rem;
  line-height: 1.72;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--clay-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--clay-wash); }

/* Faint paper grain — subtle, not the old heavy noise */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ═══════════════════ NAV ═══════════════════ */
.site-nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; flex: none;
  border: 1.5px solid var(--clay); border-radius: 6px;
  position: relative; transform: rotate(45deg);
}
.brand-mark::after {
  content: ''; position: absolute; inset: 4px;
  background: var(--clay); border-radius: 2px;
}
.brand-name {
  font-family: var(--display); font-weight: 600; font-size: 1.02rem;
  letter-spacing: -.01em; font-optical-sizing: auto;
}
.nav-meta {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* ═══════════════════ ARTICLE SHELL ═══════════════════ */
.reader { position: relative; z-index: 1; padding-bottom: 6rem; }

/* Column helper: prose sits in the measure, figures can break wider */
.col { max-width: var(--measure); margin-inline: auto; padding-inline: clamp(1.15rem, 5vw, 1.5rem); }
.col-wide { max-width: var(--wide); margin-inline: auto; padding-inline: clamp(1.15rem, 5vw, 1.5rem); }

/* ── Masthead ── */
.masthead { text-align: center; padding: clamp(1.3rem, 3.5vw, 2.2rem) 0 1rem; }
.kicker {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--clay-deep);
  margin-bottom: .9rem;
}
.masthead h1 {
  font-family: var(--display); font-optical-sizing: auto;
  font-weight: 600; font-size: clamp(2.1rem, 5.2vw, 3.2rem);
  line-height: 1.06; letter-spacing: -.02em; margin: 0 0 .9rem;
}
.masthead h1 em { font-style: italic; font-weight: 500; color: var(--clay-deep); }
.standfirst {
  font-size: clamp(1.1rem, 2.2vw, 1.28rem); line-height: 1.55;
  color: var(--ink-soft); max-width: 34rem; margin: 0 auto; font-weight: 400;
}
.byline {
  margin-top: 1.2rem; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
  display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap;
}
.byline span { display: inline-flex; align-items: center; gap: .4rem; }

/* ═══════════════════ CHAPTER TABS ═══════════════════ */
.chapters {
  position: sticky; top: 53px; z-index: 30;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule);
  margin-top: 1.5rem;
}
.chapters-inner {
  max-width: var(--wide); margin-inline: auto;
  display: flex; gap: .2rem; overflow-x: auto;
  scrollbar-width: none; padding: .35rem clamp(.6rem, 3vw, 1.5rem);
  scroll-snap-type: x proximity;
}
.chapters-inner::-webkit-scrollbar { display: none; }
.chap {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: baseline; gap: .5rem;
  padding: .6rem .9rem; border: none; background: none; cursor: pointer;
  font-family: var(--mono); font-size: .74rem; font-weight: 500;
  letter-spacing: .01em; color: var(--ink-faint); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.chap:hover { color: var(--ink); }
.chap-num {
  font-size: .64rem; font-weight: 600; color: var(--clay);
  opacity: .7; font-variant-numeric: tabular-nums;
}
.chap.active { color: var(--ink); border-bottom-color: var(--clay); }
.chap.active .chap-num { opacity: 1; }

/* ═══════════════════ PANELS ═══════════════════ */
.panel { display: none; }
.panel.active { display: block; animation: fadeUp .4s cubic-bezier(.2,.7,.3,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.panel-head { padding: clamp(1.5rem, 4vw, 2.4rem) 0 .5rem; }
.panel-head .ch-label {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--clay-deep); margin-bottom: .9rem;
}
.panel-head h2 {
  font-family: var(--display); font-optical-sizing: auto; font-weight: 600;
  font-size: clamp(1.9rem, 4.5vw, 2.7rem); line-height: 1.1;
  letter-spacing: -.015em; margin: 0;
}
/* The curious question each chapter answers */
.ch-question {
  font-family: var(--read); font-style: italic; font-weight: 400;
  font-size: clamp(1.08rem, 2.1vw, 1.24rem); line-height: 1.5;
  color: var(--ink-soft); max-width: 32rem;
  margin: 1rem 0 0; padding-left: 1rem;
  border-left: 2px solid color-mix(in srgb, var(--clay) 50%, transparent);
}
.ch-question::before { content: '“'; }
.ch-question::after { content: '”'; }

/* ═══════════════════ PROSE ═══════════════════ */
.prose > * + * { margin-top: 1.35rem; }
.prose p { margin: 0; }
.prose h3 {
  font-family: var(--display); font-optical-sizing: auto; font-weight: 600;
  font-size: 1.5rem; line-height: 1.2; letter-spacing: -.01em;
  margin: 2.6rem 0 0; scroll-margin-top: 7rem;
}
.prose h4 {
  font-family: var(--mono); font-size: .82rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--clay-deep);
  margin: 2rem 0 0;
}
.prose .lead {
  font-size: 1.32rem; line-height: 1.6; color: var(--ink); font-weight: 400;
}
.prose .lead:first-letter {
  initial-letter: 2; font-family: var(--display); font-weight: 600;
  color: var(--clay-deep); margin-right: .12em;
}
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; }
.prose a { border-bottom: 1px solid color-mix(in srgb, var(--clay) 40%, transparent); }
.prose a:hover { text-decoration: none; border-bottom-color: var(--clay); }
.prose ul, .prose ol { margin: 1.35rem 0; padding-left: 1.4rem; }
.prose li + li { margin-top: .5rem; }
.prose li::marker { color: var(--clay); }

/* Inline + block code */
code {
  font-family: var(--mono); font-size: .84em;
  background: var(--paper-2); padding: .12em .4em; border-radius: 5px;
  border: 1px solid var(--rule-soft);
}
pre {
  font-family: var(--mono); font-size: .82rem; line-height: 1.65;
  background: #2c2824; color: #ece4d6; border-radius: var(--radius);
  padding: 1.2rem 1.4rem; overflow-x: auto; margin: 1.6rem 0;
  border: 1px solid rgba(0,0,0,.2);
}
pre code { background: none; border: none; padding: 0; font-size: 1em; color: inherit; }
.tok-key { color: #e0b07a; }        /* frontmatter keys / clay */
.tok-str { color: #b8cf9e; }        /* strings / sage */
.tok-com { color: #8f857a; font-style: italic; }
.tok-inj { color: #e79b95; }        /* injected/danger */

/* Pull quote */
.pullquote {
  font-family: var(--display); font-optical-sizing: auto;
  font-size: clamp(1.4rem, 3.2vw, 1.9rem); line-height: 1.3;
  font-weight: 500; font-style: italic; color: var(--ink);
  border-left: 3px solid var(--clay); padding-left: 1.4rem;
  margin: 2.6rem 0; max-width: 34rem;
}

/* ── Callouts ── */
.note {
  border-radius: var(--radius); padding: 1.15rem 1.35rem;
  font-size: 1rem; line-height: 1.6; margin: 1.8rem 0;
  border: 1px solid var(--rule); background: var(--card);
}
.note-label {
  font-family: var(--mono); font-size: .66rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem;
}
.note-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.note.key   { background: color-mix(in srgb, var(--butter) 22%, var(--card)); border-color: color-mix(in srgb, var(--butter-ink) 30%, transparent); }
.note.key .note-label { color: var(--butter-ink); } .note.key .note-label::before { background: var(--butter-ink); }
.note.warn  { background: color-mix(in srgb, var(--rose) 24%, var(--card)); border-color: color-mix(in srgb, var(--rose-ink) 30%, transparent); }
.note.warn .note-label { color: var(--rose-ink); } .note.warn .note-label::before { background: var(--rose-ink); }
.note.tip   { background: color-mix(in srgb, var(--sage) 22%, var(--card)); border-color: color-mix(in srgb, var(--sage-ink) 30%, transparent); }
.note.tip .note-label { color: var(--sage-ink); } .note.tip .note-label::before { background: var(--sage-ink); }

/* ── Figures ── */
figure { margin: 2.6rem 0; }
figure.wide { max-width: 100%; margin-inline: 0; }
.figbox {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 2rem);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 8px 24px rgba(42,38,34,.05);
}
figcaption {
  font-family: var(--mono); font-size: .72rem; line-height: 1.5;
  color: var(--ink-faint); text-align: center; margin-top: .95rem;
  letter-spacing: .01em;
}
figcaption b { color: var(--ink-soft); font-weight: 600; }

/* SVG diagram text defaults */
.diagram text { font-family: var(--mono); }
.d-label { font-family: var(--mono); font-size: 12px; fill: var(--ink-soft); }
.d-title { font-family: var(--display); }

/* ── Stat row ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin: 2.2rem 0; }
.stat { background: var(--card); padding: 1.3rem 1.1rem; text-align: center; }
.stat-val { font-family: var(--display); font-weight: 600; font-size: 2rem; line-height: 1; color: var(--clay-deep); font-variant-numeric: tabular-nums; }
.stat-lab { font-family: var(--mono); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin-top: .55rem; line-height: 1.4; }

/* ── Cards grid (used sparingly) ── */
.grid { display: grid; gap: 1rem; margin: 2rem 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 1.3rem 1.4rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(42,38,34,.07); }
.tile h4 { margin: 0 0 .5rem; font-family: var(--display); font-size: 1.15rem; font-weight: 600; text-transform: none; letter-spacing: -.01em; color: var(--ink); }
.tile p { margin: 0; font-size: .96rem; line-height: 1.55; color: var(--ink-soft); }
.tile .tile-meta { font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--clay); margin-bottom: .6rem; }
.tile a.tile-link { font-family: var(--mono); font-size: .72rem; }

/* ── Spotlight (featured tool) ── */
.spotlight {
  border: 1px solid color-mix(in srgb, var(--clay) 45%, transparent);
  border-radius: var(--radius); overflow: hidden; margin: 1.8rem 0;
  background: linear-gradient(180deg, var(--clay-wash), var(--card) 60%);
  box-shadow: 0 10px 30px rgba(189,106,60,.09);
}
.spotlight-head { padding: 1.2rem 1.5rem .3rem; }
.spotlight-tag { font-family: var(--mono); font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--clay-deep); display: inline-flex; align-items: center; gap: .45rem; }
.spotlight-tag::before { content: '◆'; }
.spotlight h4 { font-family: var(--display); font-size: 1.5rem; font-weight: 600; text-transform: none; letter-spacing: -.01em; color: var(--ink); margin: .5rem 0 .1rem; }
.spotlight h4 .by { font-family: var(--read); font-size: .95rem; font-weight: 400; color: var(--ink-faint); font-style: italic; }
.spotlight-body { padding: .4rem 1.5rem 1.4rem; font-size: 1rem; line-height: 1.6; color: var(--ink-soft); }
.spotlight-body strong { color: var(--ink); }
.spotlight-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0 1.1rem; }
.chip { font-family: var(--mono); font-size: .64rem; letter-spacing: .02em; color: var(--ink-soft); background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 20px; padding: .28rem .65rem; }
.spotlight-cta { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .74rem; font-weight: 600; color: #fff; background: var(--clay); padding: .55rem 1rem; border-radius: 9px; }
.spotlight-cta:hover { background: var(--clay-deep); text-decoration: none; }
.spotlight-link { font-family: var(--mono); font-size: .72rem; margin-left: 1rem; }

/* ── Chapter prev/next navigator ── */
.chapter-nav { display: flex; gap: .8rem; margin-top: 3.5rem; padding-top: 1.7rem; border-top: 1px solid var(--rule); }
.chapter-nav a { flex: 1 1 0; display: block; padding: .9rem 1.1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); transition: transform .2s, box-shadow .2s, border-color .2s; }
.chapter-nav a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(42,38,34,.07); border-color: color-mix(in srgb, var(--clay) 40%, transparent); }
.chapter-nav .cn-dir { font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--clay-deep); display: block; margin-bottom: .35rem; }
.chapter-nav .cn-title { font-family: var(--display); font-size: 1.1rem; font-weight: 600; color: var(--ink); line-height: 1.2; }
.chapter-nav .cn-next { text-align: right; }
@media (max-width: 560px) { .chapter-nav .cn-title { font-size: .98rem; } }

/* Timeline */
.timeline { margin: 2rem 0; border-left: 2px solid var(--rule); padding-left: 1.5rem; }
.tl { position: relative; padding-bottom: 1.6rem; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ''; position: absolute; left: calc(-1.5rem - 6px); top: .5rem; width: 11px; height: 11px; border-radius: 50%; background: var(--clay); border: 2px solid var(--paper); }
.tl-date { font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; color: var(--clay-deep); text-transform: uppercase; }
.tl h4 { font-family: var(--display); font-size: 1.15rem; font-weight: 600; text-transform: none; letter-spacing: -.01em; color: var(--ink); margin: .25rem 0 .35rem; }
.tl p { margin: 0; font-size: .98rem; color: var(--ink-soft); line-height: 1.55; }

/* ── Reading progress bar ── */
.progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--clay); z-index: 60; width: 0; transition: width .1s linear; }

/* ── Footer ── */
.site-foot {
  position: relative; z-index: 1; border-top: 1px solid var(--rule);
  padding: 2.5rem 0; margin-top: 3rem; text-align: center;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .06em;
  color: var(--ink-faint); text-transform: uppercase;
}
.site-foot a { color: var(--clay-deep); }

/* ═══════════════════ INTERACTIVE WIDGETS ═══════════════════ */
.widget {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: clamp(1.3rem, 3vw, 1.9rem);
  box-shadow: 0 8px 24px rgba(42,38,34,.05); margin: 0;
}
.widget-title { font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--clay-deep); margin-bottom: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.widget-title::before { content: '◆'; font-size: .7rem; }
.control-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.control-row label { font-family: var(--mono); font-size: .78rem; color: var(--ink-soft); }
input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: var(--paper-2); outline: none; flex: 1; min-width: 120px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--clay); cursor: pointer; border: 3px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--clay); cursor: pointer; border: 3px solid var(--card); }

/* Segmented toggle */
.seg { display: inline-flex; background: var(--paper-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { font-family: var(--mono); font-size: .72rem; font-weight: 500; border: none; background: none; color: var(--ink-faint); padding: .45rem .85rem; border-radius: 8px; cursor: pointer; transition: all .2s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.bignum { font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 6vw, 3.2rem); line-height: 1; color: var(--clay-deep); font-variant-numeric: tabular-nums; }
.bignum small { font-family: var(--mono); font-size: .8rem; font-weight: 500; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; display: block; margin-top: .5rem; }

/* Token bar viz */
.tokenbar { height: 26px; border-radius: 7px; background: var(--paper-2); overflow: hidden; display: flex; margin-top: 1rem; border: 1px solid var(--rule-soft); }
.tokenbar > span { display: block; height: 100%; transition: width .4s cubic-bezier(.2,.7,.3,1); }

/* Reveal-injection widget */
.skillcard { font-family: var(--mono); font-size: .82rem; line-height: 1.6; background: #2c2824; color: #ece4d6; border-radius: 10px; padding: 1.2rem 1.3rem; position: relative; overflow: hidden; }
.skillcard .hidden-line { background: rgba(231,155,149,.14); border-radius: 4px; padding: 0 .3em; transition: filter .3s, background .3s; }
.skillcard.masked .hidden-line { filter: blur(5px); }
.hidden-line { color: #e79b95; }

/* ═══════════════════ LANDING PAGE ═══════════════════ */
.home { position: relative; z-index: 1; min-height: calc(100vh - 54px); display: flex; flex-direction: column; }
.home-main { flex: 1; max-width: 62rem; margin-inline: auto; width: 100%; padding: clamp(2rem, 6vw, 4rem) clamp(1.2rem, 5vw, 2.5rem); }

/* Hero */
.home-hero { text-align: center; max-width: 40rem; margin: 0 auto clamp(2.2rem, 5vw, 3.4rem); }
.home-hero .eyebrow { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--clay-deep); margin-bottom: 1.2rem; }
.home-hero h1 { font-family: var(--display); font-optical-sizing: auto; font-weight: 600; font-size: clamp(2.4rem, 6vw, 3.8rem); line-height: 1.03; letter-spacing: -.025em; margin: 0 0 1.1rem; }
.home-hero h1 em { font-style: italic; font-weight: 500; color: var(--clay-deep); }
.home-hero p { font-size: 1.15rem; line-height: 1.55; color: var(--ink-soft); max-width: 34rem; margin: 0 auto; }

/* Dissection collection */
.collection-label { font-family: var(--mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); text-align: center; margin-bottom: 1.2rem; display: flex; align-items: center; gap: .8rem; justify-content: center; }
.collection-label::before, .collection-label::after { content: ''; height: 1px; width: 2.2rem; background: var(--rule); }
.dissections { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 340px)); gap: 1.4rem; justify-content: center; }

.d-card { position: relative; display: flex; flex-direction: column; min-height: 340px; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; overflow: hidden; box-shadow: 0 6px 22px rgba(42,38,34,.05); transition: transform .28s cubic-bezier(.2,.7,.3,1), box-shadow .28s, border-color .28s; }
.d-card:hover { transform: translateY(-5px); box-shadow: 0 20px 48px rgba(42,38,34,.13); border-color: color-mix(in srgb, var(--clay) 35%, transparent); text-decoration: none; }
.d-card.soon { opacity: .72; border-style: dashed; box-shadow: none; }
.d-card.soon:hover { transform: none; box-shadow: none; }

.d-top { height: 96px; position: relative; overflow: hidden; display: flex; align-items: flex-start; justify-content: space-between; padding: .9rem 1.2rem; }
.d-card[data-tone="lav"]   .d-top { background: color-mix(in srgb, var(--lav) 55%, var(--card)); }
.d-card[data-tone="sky"]   .d-top { background: color-mix(in srgb, var(--sky) 58%, var(--card)); }
.d-card[data-tone="sage"]  .d-top { background: color-mix(in srgb, var(--sage) 55%, var(--card)); }
.d-card[data-tone="peach"] .d-top { background: color-mix(in srgb, var(--peach) 58%, var(--card)); }
.d-num { font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.d-badge { font-family: var(--mono); font-size: .58rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--clay); padding: .28rem .55rem; border-radius: 20px; }
.d-motif { position: absolute; right: -14px; bottom: -20px; width: 96px; height: 96px; opacity: .5; }

.d-body { padding: 1.2rem 1.3rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.d-cat { font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--clay-deep); margin-bottom: .55rem; }
.d-card h2 { font-family: var(--display); font-weight: 600; font-size: 1.45rem; line-height: 1.14; letter-spacing: -.015em; margin: 0 0 .6rem; color: var(--ink); }
.d-card p { font-size: .93rem; line-height: 1.5; color: var(--ink-soft); margin: 0; flex: 1; }
.d-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 1.1rem; font-family: var(--mono); font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }
.d-cta { color: var(--clay-deep); font-weight: 600; }

.home-foot { border-top: 1px solid var(--rule); padding: 1.4rem clamp(1.2rem, 5vw, 2.5rem); display: flex; justify-content: space-between; font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.home-foot a { color: var(--ink-faint); }
.home-foot a:hover { color: var(--clay-deep); }

/* ═══════════════════ POLISH — motion & craft ═══════════════════ */

/* Crafted micro-details */
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }
html { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 20px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ink) 30%, transparent); }

/* Orchestrated load reveal (staggered) */
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.rise { opacity: 0; animation: riseIn .75s cubic-bezier(.2,.7,.3,1) forwards; }
.rise-1 { animation-delay: .04s; } .rise-2 { animation-delay: .13s; }
.rise-3 { animation-delay: .24s; } .rise-4 { animation-delay: .36s; }
.rise-5 { animation-delay: .48s; } .rise-6 { animation-delay: .60s; }

/* Article masthead reveals on load, staggered */
.masthead > * { animation: riseIn .7s cubic-bezier(.2,.7,.3,1) both; }
.masthead > *:nth-child(1) { animation-delay: .03s; }
.masthead > *:nth-child(2) { animation-delay: .12s; }
.masthead > *:nth-child(3) { animation-delay: .22s; }
.masthead > *:nth-child(4) { animation-delay: .32s; }

/* Scroll reveal — enabled by JS only when motion is allowed */
.reveal-on .reveal-el { opacity: 0; transform: translateY(20px); }
.reveal-on .reveal-el.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .7s cubic-bezier(.2,.7,.3,1); }

/* ── Figure numbering (specimen catalogue) ── */
figcaption .fig-tag { color: var(--clay-deep); font-weight: 600; }

/* ── Card number watermark + read count ── */
.d-card { --wm: rgba(42,38,34,.04); }
.d-card[data-no]::after {
  content: attr(data-no); position: absolute; z-index: 0;
  right: .4rem; bottom: -2.6rem; pointer-events: none;
  font-family: var(--display); font-weight: 700; font-size: 9rem; line-height: 1;
  color: var(--wm); letter-spacing: -.04em;
}
.d-card > * { position: relative; z-index: 1; }
.d-reads { color: var(--ink-faint); }

/* ═══════════════════ COMMAND PALETTE ═══════════════════ */
.kbd-hint {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .05em;
  color: var(--ink-faint); background: var(--card); border: 1px solid var(--rule);
  padding: .3rem .55rem; border-radius: 7px; cursor: pointer; transition: all .2s;
}
.kbd-hint:hover { color: var(--ink); border-color: color-mix(in srgb, var(--clay) 40%, transparent); }
.kbd-hint kbd { font-family: var(--mono); font-weight: 600; }

.palette-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(42,38,34,.28); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding-top: 12vh;
}
.palette-overlay.open { display: block; animation: palFade .18s ease; }
@keyframes palFade { from { opacity: 0; } to { opacity: 1; } }
.palette {
  max-width: 34rem; margin: 0 auto; background: var(--card);
  border: 1px solid var(--rule); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(42,38,34,.28); animation: palRise .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes palRise { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }
.palette-input {
  width: 100%; border: none; border-bottom: 1px solid var(--rule); outline: none;
  background: none; padding: 1.05rem 1.3rem; font-family: var(--read);
  font-size: 1.1rem; color: var(--ink);
}
.palette-input::placeholder { color: var(--ink-faint); }
.palette-list { max-height: 52vh; overflow-y: auto; padding: .5rem; }
.palette-group-label { font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); padding: .8rem .85rem .35rem; }
.palette-item {
  display: flex; align-items: baseline; gap: .7rem; padding: .65rem .85rem;
  border-radius: 10px; cursor: pointer; color: var(--ink);
}
.palette-item .pi-num { font-family: var(--mono); font-size: .66rem; color: var(--clay); flex: none; width: 2.4rem; }
.palette-item .pi-title { font-family: var(--read); font-size: 1rem; }
.palette-item .pi-sub { font-family: var(--mono); font-size: .62rem; color: var(--ink-faint); margin-left: auto; text-transform: uppercase; letter-spacing: .05em; }
.palette-item.sel, .palette-item:hover { background: var(--clay-wash); }
.palette-empty { padding: 1.5rem .85rem; color: var(--ink-faint); font-family: var(--mono); font-size: .8rem; }
.palette-foot { border-top: 1px solid var(--rule); padding: .6rem 1.3rem; display: flex; gap: 1.2rem; font-family: var(--mono); font-size: .6rem; color: var(--ink-faint); letter-spacing: .04em; }

/* ── Richer landing footer ── */
.home-foot-rich { border-top: 1px solid var(--rule); margin-top: clamp(3rem, 8vw, 5rem); }
.home-foot-rich .hf-inner { max-width: 62rem; margin-inline: auto; padding: clamp(2rem,5vw,3rem) clamp(1.2rem,5vw,2.5rem) 1.5rem; display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
.hf-about .brand { margin-bottom: .8rem; }
.hf-about p { font-size: .98rem; line-height: 1.6; color: var(--ink-soft); max-width: 26rem; margin: 0; }
.hf-index-label { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .8rem; }
.hf-index a { display: flex; gap: .7rem; padding: .35rem 0; font-family: var(--read); font-size: .98rem; color: var(--ink); border: none; }
.hf-index a:hover { color: var(--clay-deep); text-decoration: none; }
.hf-index a .hf-no { font-family: var(--mono); font-size: .66rem; color: var(--clay); }
.hf-bar { max-width: 62rem; margin-inline: auto; padding: 1.1rem clamp(1.2rem,5vw,2.5rem); border-top: 1px solid var(--rule-soft); display: flex; justify-content: space-between; font-family: var(--mono); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 860px) {
  .chapters { top: 51px; }
}
@media (max-width: 640px) {
  .dissections { grid-template-columns: minmax(0, 380px); }
}
@media (max-width: 700px) {
  .home-foot-rich .hf-inner { grid-template-columns: 1fr; gap: 1.6rem; }
}
@media (max-width: 560px) {
  body { font-size: 1.08rem; }
  .prose .lead { font-size: 1.18rem; }
  .home-foot { flex-direction: column; gap: .5rem; text-align: center; }
  .site-foot { flex-direction: column; }
  .hf-bar { flex-direction: column; gap: .5rem; text-align: center; }
  .palette-overlay { padding-top: 6vh; }
  .palette { margin-inline: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .rise { opacity: 1 !important; animation: none !important; }
  .reveal-on .reveal-el { opacity: 1 !important; transform: none !important; }
}
