/* ============================================================
   ananke.sh — shared stylesheet
   Spec-document register. Warm ink-on-paper, one seal accent.
   Spectral (display) · Spline Sans (prose) · Spline Sans Mono (code)
   ============================================================ */

/* ---- Tokens ---------------------------------------------- */
:root {
  /* warm near-white paper, warm near-black ink — chroma kept < 0.02 */
  --paper:      oklch(0.987 0.004 85);
  --surface:    oklch(0.966 0.006 85);
  --surface-2:  oklch(0.945 0.007 85);
  --ink:        oklch(0.235 0.010 60);
  --ink-soft:   oklch(0.355 0.010 60);
  --muted:      oklch(0.505 0.010 62);
  --faint:      oklch(0.625 0.009 64);
  --rule:       oklch(0.885 0.006 75);
  --rule-soft:  oklch(0.925 0.005 78);
  --seal:       oklch(0.475 0.132 26);   /* oxblood / sealing-wax */
  --seal-soft:  oklch(0.475 0.132 26 / 0.10);
  --seal-line:  oklch(0.475 0.132 26 / 0.32);
  --ok:         oklch(0.515 0.085 150);
  --warn:       oklch(0.62 0.10 75);
  --gold:       #b08a1f;   /* spindle whorl-centre (brand mark) */

  --font-serif: "Spectral", Georgia, "Times New Roman", serif;
  --font-sans:  "Spline Sans", system-ui, -apple-system, sans-serif;
  --font-mono:  "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --maxw: 1180px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper:      oklch(0.185 0.006 65);
  --surface:    oklch(0.218 0.008 65);
  --surface-2:  oklch(0.250 0.009 65);
  --ink:        oklch(0.918 0.006 80);
  --ink-soft:   oklch(0.815 0.008 78);
  --muted:      oklch(0.685 0.010 72);
  --faint:      oklch(0.560 0.010 68);
  --rule:       oklch(0.315 0.009 65);
  --rule-soft:  oklch(0.270 0.008 65);
  --seal:       oklch(0.660 0.135 32);
  --seal-soft:  oklch(0.660 0.135 32 / 0.13);
  --seal-line:  oklch(0.660 0.135 32 / 0.34);
  --ok:         oklch(0.680 0.095 152);
  --warn:       oklch(0.74 0.105 78);
  --gold:       #d8b860;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      oklch(0.185 0.006 65);
    --surface:    oklch(0.218 0.008 65);
    --surface-2:  oklch(0.250 0.009 65);
    --ink:        oklch(0.918 0.006 80);
    --ink-soft:   oklch(0.815 0.008 78);
    --muted:      oklch(0.685 0.010 72);
    --faint:      oklch(0.560 0.010 68);
    --rule:       oklch(0.315 0.009 65);
    --rule-soft:  oklch(0.270 0.008 65);
    --seal:       oklch(0.660 0.135 32);
    --seal-soft:  oklch(0.660 0.135 32 / 0.13);
    --seal-line:  oklch(0.660 0.135 32 / 0.34);
    --ok:         oklch(0.680 0.095 152);
    --warn:       oklch(0.74 0.105 78);
    --gold:       #d8b860;
    color-scheme: dark;
  }
}

/* ---- Reset ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.003em;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--seal-soft); }

/* ---- Layout shells --------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: var(--measure); }
.lede  { max-width: 60ch; }

/* ---- Skip link ------------------------------------------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; font: 600 0.85rem/1 var(--font-mono);
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---- Header ---------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-head__inner {
  max-width: var(--maxw); margin-inline: auto;
  padding: 0.85rem var(--gutter);
  display: flex; align-items: center; gap: 1.5rem;
}
.brand {
  display: inline-flex; align-items: baseline; gap: 0.5ch;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-serif); font-weight: 600;
  font-size: 1.18rem; letter-spacing: 0.01em;
}
.brand__mark { width: 1.05em; height: 1.05em; flex: none; align-self: center; transform: translateY(0.02em); }
.brand__mark rect, .brand__mark circle { fill: currentColor; }
.brand__mark line { stroke: currentColor; }
.brand__mark .brand__eye { fill: var(--gold); }
.brand__gk { font-style: italic; color: var(--muted); font-size: 0.82em; font-weight: 500; }

.site-nav {
  margin-left: auto;
  display: flex; align-items: center; gap: clamp(0.6rem, 2vw, 1.6rem);
  font: 500 0.84rem/1 var(--font-mono); letter-spacing: 0.01em;
}
.site-nav a {
  text-decoration: none; color: var(--muted);
  padding: 0.3rem 0; white-space: nowrap;
  border-bottom: 1.5px solid transparent; transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--seal-line); }
.site-nav__sep { width: 1px; height: 1.1rem; background: var(--rule); }

.theme-toggle {
  appearance: none; background: transparent; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 999px;
  color: var(--muted); width: 2rem; height: 2rem;
  display: grid; place-items: center; padding: 0; transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--faint); }
.theme-toggle svg { width: 1rem; height: 1rem; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

.nav-hide-sm { }
@media (max-width: 760px) {
  .nav-hide-sm { display: none; }
  body { font-size: 16px; }
}

/* ---- Typography -------------------------------------------*/
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.22rem; line-height: 1.25; }
h4 { font-size: 1rem; }
p  { text-wrap: pretty; }
.prose p + p { margin-top: 1.1rem; }
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

a.link, .prose a {
  color: var(--ink); text-decoration: none;
  background-image: linear-gradient(var(--seal-line), var(--seal-line));
  background-size: 100% 1.5px; background-repeat: no-repeat; background-position: 0 1.1em;
  transition: background-size .15s;
  padding-bottom: 0.04em;
}
.prose a:hover, a.link:hover { background-image: linear-gradient(var(--seal), var(--seal)); }

/* eyebrow / kicker labels */
.kicker {
  font: 600 0.72rem/1 var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--seal); display: inline-flex; align-items: center; gap: 0.6ch;
}
.kicker::before { content: ""; width: 1.6rem; height: 1.5px; background: var(--seal-line); display: inline-block; }

.section-no {
  font-family: var(--font-mono); color: var(--faint);
  font-size: 0.8rem; letter-spacing: 0.1em;
}

/* ---- Thread / divider motif ------------------------------ */
.thread { border: 0; height: 1px; background: var(--rule); margin: 0; }
.thread--seal { background: linear-gradient(90deg, var(--seal-line), transparent 60%); height: 2px; }
.knot { color: var(--seal); font-family: var(--font-mono); }

/* ---- Sections -------------------------------------------- */
.section { padding-block: clamp(3.5rem, 9vw, 7rem); border-top: 1px solid var(--rule); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section__head { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 2.4rem; }
.section__head h2 { max-width: 22ch; }

/* ---- Buttons --------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6ch;
  font: 500 0.92rem/1 var(--font-mono); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  padding: 0.72rem 1.15rem; border-radius: 2px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  transition: transform .12s ease, opacity .15s;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { border-color: var(--ink); opacity: 1; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(2px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---- Code ------------------------------------------------ */
code, kbd, samp { font-family: var(--font-mono); font-size: 0.88em; }
.prose code, p code, li code, dd code, td code {
  background: var(--surface-2); border: 1px solid var(--rule-soft);
  padding: 0.08em 0.38em; border-radius: 3px; font-size: 0.84em;
  color: var(--ink); white-space: nowrap;
}
.codeblock {
  position: relative;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 4px; overflow: hidden; margin-block: 1.3rem;
}
.codeblock__bar {
  display: flex; align-items: center; gap: 0.6ch;
  padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--rule);
  font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2);
}
.codeblock__bar .dot { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--seal-line); }
.codeblock pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; }
.codeblock code { font-size: 0.82rem; line-height: 1.7; color: var(--ink-soft); white-space: pre; background: none; border: 0; padding: 0; }
.codeblock pre::-webkit-scrollbar { height: 8px; }
.codeblock pre::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }

/* JSON-ish syntax tokens */
.t-key { color: var(--seal); }
.t-str { color: var(--ink); }
.t-num { color: var(--ok); }
.t-bool{ color: var(--warn); font-style: italic; }
.t-punc{ color: var(--faint); }
.t-cmt { color: var(--faint); font-style: italic; }
:root[data-theme="dark"] .t-str { color: var(--ink-soft); }

/* prompt lines for shell */
.sh .t-prompt { color: var(--seal); user-select: none; }
.sh .t-cmd { color: var(--ink); }
.sh .t-out { color: var(--muted); }

/* ---- Callouts -------------------------------------------- */
.note {
  border: 1px solid var(--rule); border-left: 2px solid var(--seal-line);
  background: var(--surface); border-radius: 0 4px 4px 0;
  padding: 1.05rem 1.2rem; margin-block: 1.4rem;
}
.note__label { font: 600 0.72rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--seal); margin-bottom: 0.5rem; }
.note p { font-size: 0.95rem; color: var(--ink-soft); }
.note--plain { border-left-color: var(--rule); }
.note--plain .note__label { color: var(--muted); }

/* ---- Footer ---------------------------------------------- */
.site-foot { border-top: 1px solid var(--rule); padding-block: 3rem 3.5rem; background: var(--surface); }
.site-foot__grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem;
}
@media (max-width: 720px) { .site-foot__grid { grid-template-columns: 1fr 1fr; row-gap: 2.2rem; } }
.foot-col h4 { font: 600 0.72rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.9rem; }
.foot-col a { display: block; text-decoration: none; color: var(--ink-soft); font-size: 0.92rem; padding: 0.22rem 0; }
.foot-col a:hover { color: var(--seal); }
.foot-note { font-size: 0.86rem; color: var(--muted); line-height: 1.6; max-width: 40ch; }
.foot-meta { margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; font: 500 0.76rem/1.4 var(--font-mono); color: var(--faint); }
.foot-meta .knot { color: var(--seal); }

/* ---- Badges / chips -------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.5ch;
  font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.04em;
  padding: 0.34rem 0.6rem; border-radius: 999px;
  border: 1px solid var(--rule); color: var(--muted); background: var(--surface);
}
.chip--seal { color: var(--seal); border-color: var(--seal-line); background: var(--seal-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* status glyphs */
.glyph { font-family: var(--font-mono); font-weight: 700; }
.glyph--ok { color: var(--ok); }
.glyph--partial { color: var(--warn); }
.glyph--no { color: var(--seal); }

/* ---- Definition / field reference ------------------------ */
.fieldset { display: grid; gap: 0; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.field { display: grid; grid-template-columns: minmax(170px, 0.4fr) 1fr; gap: 0; border-top: 1px solid var(--rule); }
.field:first-child { border-top: 0; }
.field__name { padding: 1rem 1.1rem; background: var(--surface); border-right: 1px solid var(--rule); }
.field__name code { font-size: 0.86rem; color: var(--ink); background: none; border: 0; padding: 0; white-space: normal; word-break: break-word; }
.field__name .first-class { display: block; width: fit-content; margin-top: 0.55rem; font: 600 0.62rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--seal); }
.field__body { padding: 1rem 1.1rem; }
.field__body p { font-size: 0.93rem; color: var(--ink-soft); }
.field__body .sub { margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }
.field__body code { font-size: 0.82em; white-space: normal; }
@media (max-width: 640px) {
  .field { grid-template-columns: 1fr; }
  .field__name { border-right: 0; border-bottom: 1px solid var(--rule); }
}

/* ---- Two-column generic grid ----------------------------- */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 820px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* ---- Terminal banner card (real /ananke:welcome output) -- */
.term {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 6px; overflow: hidden; box-shadow: 0 1px 0 var(--rule-soft);
}
.term__bar {
  display: flex; align-items: center; gap: 0.5ch;
  padding: 0.6rem 0.95rem; border-bottom: 1px solid var(--rule); background: var(--surface-2);
  font: 500 0.74rem/1 var(--font-mono); color: var(--muted); letter-spacing: 0.04em;
}
.term__dots { display: inline-flex; gap: 0.4rem; margin-right: 0.6rem; }
.term__dots i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--rule); }
.term__dots i:first-child { background: var(--seal-line); }
.term__body { padding: 1.3rem 1.4rem 1.5rem; overflow-x: auto; }
.term__art {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", "DejaVu Sans Mono", Menlo, monospace;
  /* Block ASCII art: rows and columns must touch, or the █ bars show seams and
     look askew. line-height:1 + letter-spacing:0 keep the glyph cells flush. */
  font-size: clamp(8px, 1.7vw, 15px); line-height: 1; letter-spacing: 0; white-space: pre;
  color: var(--seal); margin: 0; font-weight: 400; font-variant-ligatures: none;
}
.term__line { font: 400 0.86rem/1.7 var(--font-mono); white-space: pre-wrap; color: var(--ink-soft); margin-top: 0.6rem; }
.term__line.dim { color: var(--muted); }
.term__line.tag { color: var(--ink); font-weight: 500; margin-top: 1.1rem; }
.term__sep { border: 0; border-top: 1px dashed var(--rule); margin: 1.1rem 0; }
.term__cmd { color: var(--seal); }
.term__cur { display: inline-block; width: 0.55ch; height: 1.05em; background: var(--seal); vertical-align: -0.18em; margin-left: 0.2ch; opacity: 0.85; }
@media (prefers-reduced-motion: no-preference) {
  .term__cur { animation: blink 1.1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
}

/* ---- Hero ------------------------------------------------ */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero__ascii {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", "DejaVu Sans Mono", Menlo, monospace;
  color: var(--ink-soft);
  font-size: clamp(5px, 1.5vw, 12px); line-height: 1; font-weight: 400;
  letter-spacing: 0; white-space: pre; overflow: hidden;
  margin-bottom: 1.9rem; user-select: none; opacity: 0.9;
}
.hero__gk { font-family: var(--font-serif); font-style: italic; color: var(--seal); font-size: 1.05rem; margin-bottom: 1rem; }
.hero__gk .gloss { color: var(--muted); font-style: normal; font-family: var(--font-sans); font-size: 0.9rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 18ch; margin-bottom: 1.4rem; }
.hero__lede { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--ink-soft); max-width: 56ch; line-height: 1.5; }
.hero__lede strong { color: var(--ink); }
.hero__frame {
  margin-top: 1.8rem; padding-left: 1.1rem; border-left: 2px solid var(--seal-line);
  max-width: 54ch; color: var(--muted); font-size: 1rem;
}
.hero__bind { font-family: var(--font-serif); font-style: italic; color: var(--ink); font-size: 1.15rem; }
.hero .btn-row { margin-top: 2.4rem; }

/* ---- Discipline loop diagram ----------------------------- */
.loop {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
  counter-reset: step; position: relative; margin-top: 1rem;
}
.loop__node { position: relative; padding: 0 0.6rem; }
.loop__node::before {
  content: ""; position: absolute; top: 1.05rem; left: 0; right: 0; height: 2px;
  background: var(--rule); z-index: 0;
}
.loop__node:first-child::before { left: 50%; }
.loop__node:last-child::before { right: 50%; }
.loop__node--gate::before { background: var(--seal-line); }
.loop__dot {
  position: relative; z-index: 1; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--rule);
  display: grid; place-items: center; margin-bottom: 1rem;
  font: 600 0.82rem/1 var(--font-mono); color: var(--muted);
}
.loop__node--gate .loop__dot { border-color: var(--seal); color: var(--seal); background: var(--seal-soft); }
.loop__verb { font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; margin-bottom: 0.35rem; }
.loop__gloss { font-size: 0.83rem; color: var(--muted); line-height: 1.45; }
.loop__tag { display: inline-block; margin-top: 0.5rem; font: 600 0.6rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--seal); }
@media (max-width: 760px) {
  .loop { grid-template-columns: 1fr; gap: 0; }
  .loop__node { display: grid; grid-template-columns: 2.1rem 1fr; gap: 0 1rem; padding: 0 0 1.6rem; }
  .loop__node::before { top: 2.1rem; bottom: -0.6rem; left: 1.05rem; right: auto; width: 2px; height: auto; }
  .loop__node:first-child::before { top: 1.05rem; }
  .loop__node:last-child::before { display: none; }
  .loop__dot { margin-bottom: 0; }
  .loop__body { grid-column: 2; }
  .loop__verb { margin-top: 0.15rem; }
}

/* ---- Two-up honest list (who for / not for) -------------- */
.honest { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
@media (max-width: 720px) { .honest { grid-template-columns: 1fr; } }
.honest__col { padding: 1.6rem 1.5rem; }
.honest__col + .honest__col { border-left: 1px solid var(--rule); }
@media (max-width: 720px) { .honest__col + .honest__col { border-left: 0; border-top: 1px solid var(--rule); } }
.honest__col h3 { font-size: 1rem; font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.02em; margin-bottom: 1.1rem; display: flex; align-items: center; gap: 0.6ch; }
.honest__col--for h3 { color: var(--ink); }
.honest__col--not h3 { color: var(--muted); }
.honest ul { list-style: none; padding: 0; display: grid; gap: 0.7rem; }
.honest li { font-size: 0.94rem; color: var(--ink-soft); padding-left: 1.4rem; position: relative; line-height: 1.5; }
.honest li::before { position: absolute; left: 0; top: 0; font-family: var(--font-mono); font-weight: 700; }
.honest__col--for li::before { content: "+"; color: var(--ok); }
.honest__col--not li::before { content: "\2212"; color: var(--seal); }

/* ---- Plain card grid ------------------------------------- */
.card { border: 1px solid var(--rule); border-radius: 4px; padding: 1.5rem 1.4rem; background: var(--surface); }
.card h3 { font-size: 1.08rem; margin-bottom: 0.6rem; }
.card p { font-size: 0.93rem; color: var(--ink-soft); }
.card__no { font: 600 0.72rem/1 var(--font-mono); color: var(--seal); letter-spacing: 0.1em; margin-bottom: 0.9rem; display: block; }

/* ---- Inline definition list (strata etc.) ---------------- */
.deflist { display: grid; gap: 0; }
.deflist__row { display: grid; grid-template-columns: minmax(140px, 0.32fr) 1fr; gap: 1.5rem; padding: 1.15rem 0; border-top: 1px solid var(--rule); }
.deflist__row:first-child { border-top: 0; }
.deflist__term { font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; }
.deflist__term .pill { display: block; margin-top: 0.4rem; font: 500 0.68rem/1 var(--font-mono); letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.deflist__def { color: var(--ink-soft); font-size: 0.96rem; }
@media (max-width: 640px) { .deflist__row { grid-template-columns: 1fr; gap: 0.5rem; } }

/* ---- Numbered steps (getting-started) -------------------- */
.steps { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.step { display: grid; grid-template-columns: 3rem 1fr; gap: 0 1.5rem; padding: 2rem 0; border-bottom: 1px solid var(--rule); }
.step__n {
  font: 600 0.9rem/1 var(--font-mono); color: var(--seal);
  width: 2.6rem; height: 2.6rem; border: 1.5px solid var(--seal-line); border-radius: 50%;
  display: grid; place-items: center; background: var(--seal-soft);
}
.step__body { min-width: 0; }
.step__body h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.step__time { font: 500 0.72rem/1 var(--font-mono); color: var(--faint); letter-spacing: 0.06em; }
.step__body > p { color: var(--ink-soft); font-size: 0.98rem; margin-top: 0.5rem; max-width: 64ch; }
.step__body ul { margin: 0.8rem 0; padding-left: 1.2rem; color: var(--ink-soft); display: grid; gap: 0.45rem; }
.step__body ul li { font-size: 0.95rem; }
@media (max-width: 640px) {
  .step { grid-template-columns: 1fr; gap: 1rem; }
  .step__n { width: 2.3rem; height: 2.3rem; }
}

/* skill chip used in prose */
.skill { font-family: var(--font-mono); font-size: 0.82em; color: var(--seal); background: var(--seal-soft); border: 1px solid var(--seal-line); padding: 0.08em 0.45em; border-radius: 3px; white-space: nowrap; }

/* ---- TOC (spec page) ------------------------------------- */
.spec-layout { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 1000px) {
  .spec-layout { grid-template-columns: 220px 1fr; gap: 3.5rem; align-items: start; }
  .toc { position: sticky; top: 5rem; }
}
.toc { font-size: 0.85rem; }
.toc__label { font: 600 0.68rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--rule); }
.toc ol { list-style: none; padding: 0; counter-reset: toc; display: grid; gap: 0.1rem; }
.toc a { display: block; text-decoration: none; color: var(--muted); padding: 0.4rem 0; border-left: 2px solid transparent; padding-left: 0.9rem; counter-increment: toc; transition: color .15s, border-color .15s; }
.toc a::before { content: counter(toc, decimal-leading-zero) "  "; color: var(--faint); font-family: var(--font-mono); font-size: 0.78em; }
.toc a:hover { color: var(--ink); border-left-color: var(--seal-line); }
@media (max-width: 999px) { .toc { display: none; } }

/* spec section anchors */
.spec-sec { padding-block: clamp(2.2rem, 5vw, 3.4rem); border-top: 1px solid var(--rule); scroll-margin-top: 5rem; }
.spec-sec:first-of-type { border-top: 0; }
.spec-sec > h2 { display: flex; align-items: baseline; gap: 0.9ch; margin-bottom: 1.3rem; }
.spec-sec > h2 .section-no { font-size: 0.95rem; color: var(--seal); }

/* uri display */
.uri {
  font-family: var(--font-mono); font-size: clamp(0.82rem, 2vw, 1.05rem);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 4px;
  padding: 0.7rem 0.9rem; color: var(--ink); word-break: break-all; display: block;
}
.uri .scheme { color: var(--faint); }
.uri .host { color: var(--muted); }
.uri .path { color: var(--seal); }

/* ---- Print (spec page) ----------------------------------- */
@media print {
  .site-head, .site-foot, .theme-toggle, .btn-row, .no-print { display: none !important; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .section { border-color: #ddd; padding-block: 1.2rem; }
  .codeblock, .fieldset, .note { break-inside: avoid; }
  a { color: #111; background: none; }
}
