/* Dose Ladder theme. See agent/design-guidelines.md */
:root {
  color-scheme: light;
  --bg: #f4efe6; --surface: #ffffff; --surface-2: #ece4d3; --ink: #232a2e; --muted: #5c6a6f; --rule: #ddd3bf;
  --link: #8a4a1e; --focus: #b23a2f;
  --panel: #232a2e; --panel-2: #2e373c; --panel-ink: #f4efe6; --panel-muted: #a9b3b6;
  --red: #b23a2f; --slate: #5b7480; --ochre: #9c7a2e;
  --display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --wrapw: 74rem;
  --r: 14px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1f22; --surface: #23282c; --surface-2: #1f2427; --ink: #eae4d8; --muted: #a7aeae; --rule: #383f43;
  --link: #e2a479; --focus: #d9622b;
  --panel: #14181a; --panel-2: #1c2124;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1b1f22; --surface: #23282c; --surface-2: #1f2427; --ink: #eae4d8; --muted: #a7aeae; --rule: #383f43;
    --link: #e2a479; --focus: #d9622b;
    --panel: #14181a; --panel-2: #1c2124;
  }
}

/* topic tones: --c fill, --c-ink text on fill, --c-text text on page */
.t-red   { --c: #b23a2f; --c-ink: #fbeee9; --c-text: #b23a2f; }
.t-slate { --c: #5b7480; --c-ink: #eef2f3; --c-text: #48626e; }
.t-ochre { --c: #9c7a2e; --c-ink: #2a2107; --c-text: #7c611f; }
:root[data-theme="dark"] .t-red   { --c-text: #e08579; }
:root[data-theme="dark"] .t-slate { --c-text: #9db6c0; }
:root[data-theme="dark"] .t-ochre { --c-text: #d0af5c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t-red   { --c-text: #e08579; }
  :root:not([data-theme="light"]) .t-slate { --c-text: #9db6c0; }
  :root:not([data-theme="light"]) .t-ochre { --c-text: #d0af5c; }
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  html { scroll-behavior: smooth; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 var(--serif); font-optical-sizing: auto; overflow-x: hidden; transition: background-color .25s, color .25s; padding-bottom: env(safe-area-inset-bottom); }
main { flex: 1; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--red); color: #fbeee9; }
h1, h2, h3 { font-family: var(--display); line-height: 1.06; margin: 0; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
p { text-wrap: pretty; }
.wrap { width: min(var(--wrapw), 100% - 2rem); margin-inline: auto; padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
.short { display: none; }
.sec-title { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 700; }

/* ---------- shop strip ---------- */
.shopbar { background: var(--panel); color: var(--panel-ink); font: 500 .85rem/1.4 var(--display); border-bottom: 1px solid rgba(255,255,255,.08); }
.shopbar-in { width: min(var(--wrapw), 100% - 2rem); margin-inline: auto; padding: .5rem 0; display: flex; gap: .9rem; align-items: baseline; justify-content: center; white-space: nowrap; overflow: hidden; }
.shopbar-in > span { overflow: hidden; text-overflow: ellipsis; color: var(--panel-muted); }
.shopbar a { color: #e6a35c; font-weight: 700; text-decoration: none; }
.shopbar a:hover { text-decoration: underline; }
.shopbar a span { display: inline-block; transition: transform .15s; }
.shopbar a:hover span { transform: translateX(3px); }

/* ---------- masthead ---------- */
.bar { background: var(--bg); border-bottom: 4px double var(--rule); }
.bar-in { width: min(var(--wrapw), 100% - 2rem); margin-inline: auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem 2rem; padding: .9rem 0; }
.brand { color: var(--ink); text-decoration: none; }
.logo { display: inline-flex; align-items: center; gap: .55rem; }
.logo-mark { width: 1.7rem; height: 1.7rem; flex: none; transition: transform .3s ease; }
.brand:hover .logo-mark { transform: translateY(-2px); }
.lm-step { fill: var(--slate); }
.lm-step-top { fill: var(--red); }
.lm-dot { fill: var(--ochre); }
.brand-name { font: 700 1.4rem/1 var(--display); letter-spacing: -.01em; }
.brand-name em { font: italic 600 1.02em/1 var(--serif); color: var(--red); font-style: italic; padding-right: .06em; }
.bar nav { display: flex; justify-content: flex-end; gap: 1.5rem; font: 600 .88rem/1.2 var(--display); white-space: nowrap; }
.bar nav a { color: var(--muted); text-decoration: none; padding: .3rem 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.bar nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.bar nav a[aria-current] { color: var(--ink); border-bottom-color: var(--red); }
.theme-toggle { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 4px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; transition: transform .2s, border-color .2s; }
.theme-toggle:hover { border-color: var(--red); }
.theme-toggle svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-toggle .i-moon { fill: currentColor; stroke: none; }
.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; }

.is-home .bar { background: var(--panel); color: var(--panel-ink); border-bottom-color: rgba(255,255,255,.22); }
.is-home .brand { color: var(--panel-ink); }
.is-home .bar nav a { color: var(--panel-muted); }
.is-home .bar nav a:hover { color: var(--panel-ink); border-bottom-color: rgba(255,255,255,.3); }
.is-home .theme-toggle { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: var(--panel-ink); }

@media (max-width: 52rem) {
  .long { display: none; } .short { display: inline; }
  .bar-in { grid-template-columns: 1fr auto; padding: .7rem 0 .4rem; }
  .bar nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; margin-inline: -.6rem; gap: 0; overflow-x: auto; scrollbar-width: none; font-size: .84rem; }
  .bar nav a { padding: .5rem .6rem; }
  .bar nav::-webkit-scrollbar { display: none; }
  .brand-name { font-size: 1.2rem; }
}

/* ---------- shared bits ---------- */
.kicker { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .6rem; font: 700 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--c-text, var(--muted)); }
.kicker b, .filters b, .crumb-cat b, .idx-tag b, .topic-seg .idx-tag b { display: inline-grid; place-items: center; min-width: 2em; height: 1.7em; padding: 0 .3em; border-radius: 4px; background: var(--c, var(--ink)); color: var(--c-ink, var(--bg)); font: 700 .85em/1 var(--mono); letter-spacing: 0; text-transform: none; }
.meta { margin: .8rem 0 0; font: 400 .76rem/1.3 var(--mono); color: var(--muted); letter-spacing: .01em; }
.desc { margin: .5rem 0 0; color: var(--muted); font-size: .97rem; line-height: 1.5; }
.btn { font: 700 .95rem/1 var(--display); cursor: pointer; border: 1.5px solid var(--ink); background: none; color: var(--ink); padding: .85rem 1.3rem; border-radius: 10px; transition: background .15s, color .15s, transform .15s; }
.btn:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); }
.empty { color: var(--muted); font-family: var(--display); }

.btn-shop, .btn-dark { display: inline-flex; align-items: center; gap: .6rem; font: 700 1.02rem/1 var(--display); text-decoration: none; padding: 1.05rem 1.5rem; border-radius: 6px; transition: transform .2s, box-shadow .2s, background-color .2s, border-color .2s; }
.btn-shop span, .btn-dark span, .read-link span, .btn-line span { display: inline-block; transition: transform .2s; }
.btn-shop:hover span, .btn-dark:hover span, .read-link:hover span, .btn-line:hover span { transform: translateX(4px); }
.btn-shop { background: var(--red); color: #fbeee9; box-shadow: 0 12px 28px -14px rgba(178,58,47,.8); }
.btn-shop:hover { transform: translateY(-3px); background: #963026; }
.btn-dark { background: #14181a; color: #f4efe6; box-shadow: 0 14px 30px -16px rgba(0,0,0,.8); }
.btn-dark:hover { transform: translateY(-3px); background: #0d1011; }
.text-link { display: inline-flex; align-items: baseline; gap: .4rem; font: 600 1.02rem/1 var(--display); color: var(--panel-ink); text-decoration: underline; text-decoration-color: rgba(255,255,255,.38); text-underline-offset: .22em; transition: text-decoration-color .15s; }
.text-link:hover { text-decoration-color: #e6a35c; }
.btn-line { display: inline-flex; align-items: center; gap: .5rem; font: 700 1rem/1 var(--display); color: var(--red); text-decoration: none; white-space: nowrap; }
.btn-line:hover { text-decoration: underline; }

/* ---------- home: hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--panel-ink);
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 26px 26px,
    var(--panel);
}
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: linear-gradient(90deg, var(--red) 0 34%, var(--slate) 34% 67%, var(--ochre) 67%); }
.hero-in { display: grid; gap: 2rem; align-items: center; padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.dateline { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1.2rem; font: 400 .78rem/1 var(--mono); color: var(--panel-muted); letter-spacing: .04em; text-transform: uppercase; }
.dateline::before { content: ""; width: 1.6rem; height: 2px; background: var(--red); }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); font-weight: 700; line-height: 1.04; letter-spacing: -.02em; max-width: 17ch; }
.hero-sub { margin: 1.4rem 0 0; font-size: clamp(1.02rem, 1.7vw, 1.18rem); line-height: 1.55; color: var(--panel-muted); max-width: 32rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1.6rem; align-items: center; margin-top: 2rem; }
@media (max-width: 30rem) { .hero-cta { flex-direction: column; align-items: flex-start; gap: 1.1rem; } .btn-shop { width: 100%; justify-content: center; } }

/* spec box: the hero chart framed as a diagram in a reference document, not decorative art */
.spec-box { position: relative; border: 1.5px solid rgba(244,239,230,.32); border-radius: 3px; padding: 1.6rem 1.4rem 1.1rem; }
.spec-box::before, .spec-box::after { content: ""; position: absolute; width: .65rem; height: .65rem; border: 1.5px solid var(--red); }
.spec-box::before { top: -1.5px; left: -1.5px; border-right: 0; border-bottom: 0; }
.spec-box::after { bottom: -1.5px; right: -1.5px; border-left: 0; border-top: 0; }
.spec-label { margin: 0 0 1rem; font: 600 .68rem/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--panel-muted); }
.hero-art { width: 100%; max-width: 22rem; height: auto; overflow: visible; color: var(--panel-muted); display: block; margin-inline: auto; }
@media (min-width: 60rem) {
  .hero-in { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 3rem; }
}

.ha-axis { stroke: rgba(244,239,230,.35); stroke-width: 2; }
.ha-label { font: 700 12px var(--mono); fill: #f4efe6; letter-spacing: .04em; }
.ha-unit { font-weight: 400; fill: var(--panel-muted); }
.ha-line { stroke: #e6a35c; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ha-dot { fill: #e6a35c; stroke: var(--panel); stroke-width: 2.5; }

/* ---------- home: topic strip (rule-bordered row, not colour tiles) ---------- */
.topics { padding: clamp(2.5rem, 6vw, 4rem) 0 0; }
.topic-strip { display: flex; flex-wrap: wrap; margin-top: 1.3rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.topic-seg { flex: 1 1 13rem; display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.3rem; text-decoration: none; color: var(--ink); border-left: 3px solid var(--c); border-right: 1px solid var(--rule); transition: background-color .15s; }
.topic-seg:last-child { border-right: 0; }
.topic-seg:hover { background: color-mix(in srgb, var(--c) 9%, transparent); }
.topic-name { font: 700 1rem/1.2 var(--display); }
.topic-count { margin-left: auto; font: 400 .78rem/1 var(--mono); color: var(--muted); white-space: nowrap; }
@media (max-width: 40rem) { .topic-seg { flex: 1 1 100%; border-right: 0; border-bottom: 1px solid var(--rule); } .topic-seg:last-child { border-bottom: 0; } }

/* ---------- home: shop callout (compact bordered line, not a coloured band) ---------- */
.shop-callout { padding: clamp(1.8rem, 4vw, 2.6rem) 0; }
.shop-callout-in { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: center; justify-content: space-between; padding: 1.15rem 1.4rem; border: 1.5px solid var(--ink); border-radius: 6px; }
.shop-callout-in p { margin: 0; font: 600 1.05rem/1.35 var(--display); max-width: 36rem; }

/* ---------- lists and cards ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.item { position: relative; display: flex; flex-direction: column; padding: 1.3rem 1.35rem 1.2rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); transition: transform .2s ease, box-shadow .2s, border-color .2s; }
.item::before { content: ""; position: absolute; left: 1.35rem; right: 1.35rem; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c); }
.item:hover { transform: translateY(-3px); border-color: var(--c); box-shadow: 0 16px 28px -24px var(--c); }
.item h2 a::after, .item h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.item[hidden] { display: none; }
.item h2, .item h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.25; letter-spacing: -.008em; }
.item .meta { margin-top: auto; padding-top: .8rem; }
.side .item::before { display: none; }
.cols { display: grid; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 44rem) { .cols { grid-template-columns: 1fr 1fr; } }
@media (min-width: 70rem) { .cols.three { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; } }

/* ---------- library, search, filters ---------- */
.library { padding: 3rem 0 1.5rem; }
.lib-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.search { flex: 1 1 18rem; max-width: 28rem; }
.search input { width: 100%; font: 500 1rem var(--display); color: var(--ink); background: var(--surface) no-repeat .95rem 50% / 1.1rem url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23889890' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m20 20-4.5-4.5'/%3E%3C/svg%3E"); border: 1.5px solid var(--rule); border-radius: 10px; padding: .85rem 1rem .85rem 2.7rem; transition: border-color .15s, box-shadow .15s; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(178,58,47,.16); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.filters button { display: inline-flex; align-items: center; gap: .45rem; font: 600 .88rem/1 var(--display); background: var(--surface); border: 1.5px solid var(--rule); padding: .5rem .8rem .5rem .55rem; border-radius: 9px; color: var(--ink); cursor: pointer; transition: border-color .15s, background-color .15s, color .15s, transform .15s; }
.filters [data-chip="all"] { padding-left: .8rem; }
.filters button > span { font: 500 .78em/1 var(--mono); color: var(--muted); }
.filters button:hover { border-color: var(--c, var(--ink)); transform: translateY(-1px); }
.filters button[aria-pressed="true"] { background: var(--c, var(--ink)); border-color: var(--c, var(--ink)); color: var(--c-ink, var(--bg)); }
.filters button[aria-pressed="true"] > span { color: inherit; opacity: .75; }
.filters button[aria-pressed="true"] b { background: rgba(0,0,0,.14); color: inherit; }
.more { margin: 2rem 0; }

/* ---------- index table: the dense rule-bordered listing that replaces card grids ---------- */
.idx { margin-top: 1.5rem; }
.idx-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.2rem; padding: .95rem 0; border-bottom: 1px solid var(--rule); }
.idx-row:first-child { border-top: 1px solid var(--rule); }
.idx-row[hidden] { display: none; }
.idx-tag { flex: 0 0 auto; width: 9.5rem; display: inline-flex; align-items: center; gap: .5rem; font: 700 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--c-text); }
.idx-title { flex: 1 1 16rem; min-width: 0; font: 600 1.04rem/1.35 var(--display); color: var(--ink); text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: .16em; transition: text-decoration-color .15s; }
.idx-title:hover { text-decoration-color: var(--c); }
.idx-meta { flex: 0 0 auto; font: 400 .78rem/1.3 var(--mono); color: var(--muted); white-space: nowrap; }
.idx-empty { padding: 1.5rem 0; color: var(--muted); font-family: var(--display); }
@media (max-width: 40rem) {
  .idx-row { flex-direction: column; align-items: flex-start; gap: .35rem; padding: 1rem 0; }
  .idx-tag { width: auto; }
}

/* ---------- category + archive headers ---------- */
.page-head { padding: clamp(1.75rem, 4.5vw, 2.75rem) 0 1.5rem; margin-bottom: .5rem; border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.04; }
.page-head p { color: var(--muted); margin: .7rem 0 0; font-size: 1.05rem; max-width: 38rem; }
.page-head .idx-tag { width: auto; margin-bottom: .9rem; }
.library .page-head { padding-top: clamp(1.75rem, 4.5vw, 2.75rem); margin-bottom: 1.5rem; }
.library:has(> .page-head:first-child) { padding-top: 0; }

/* ---------- article (kept calm) ---------- */
.art { display: grid; grid-template-columns: minmax(0, 1fr); padding-bottom: 1rem; }
.art-head { padding: clamp(2rem, 5vw, 3.5rem) 0 2rem; border-bottom: 1px solid var(--rule); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font: 500 .8rem/1.4 var(--mono); color: var(--muted); margin: 0 0 1.2rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumb-cat { display: inline-flex; align-items: center; gap: .4rem; color: var(--c-text) !important; font-weight: 700; }
.art-head h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); font-weight: 700; line-height: 1.06; letter-spacing: -.015em; max-width: 22ch; }
.art-lede { font-size: clamp(1.08rem, 1.9vw, 1.25rem); line-height: 1.5; font-style: italic; color: var(--muted); margin: 1.1rem 0 0; max-width: 44rem; }
.art-meta { font: 400 .78rem/1.4 var(--mono); color: var(--muted); margin: 1.2rem 0 0; }
.toc { display: none; }
@media (min-width: 68rem) {
  .art { grid-template-columns: 15rem minmax(0, 44rem); column-gap: 4rem; justify-content: center; }
  .art-head { grid-column: 1 / -1; }
  .toc { display: block; grid-column: 1; grid-row: 2 / span 2; align-self: start; position: sticky; top: 1.5rem; padding-top: 2.4rem; font: 500 .86rem/1.35 var(--display); }
  .toc p { margin: 0 0 .8rem; font: 600 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
  .toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); counter-reset: s; }
  .toc li { counter-increment: s; }
  .toc a { display: flex; gap: .6rem; padding: .4rem 0 .4rem .9rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; transition: color .15s, border-color .15s; }
  .toc a::before { content: counter(s, decimal-leading-zero); font: 500 .75rem/1.6 var(--mono); opacity: .7; }
  .toc a:hover { color: var(--ink); }
  .toc a[aria-current] { color: var(--c-text); border-left-color: var(--c); }
  .prose, .post-tools { grid-column: 2; }
}

.prose { font-size: 1.0625rem; line-height: 1.72; overflow-wrap: anywhere; padding-top: 1rem; max-width: 44rem; }
@media (min-width: 48rem) { .prose { font-size: 1.1rem; } }
.prose p, .prose ul, .prose ol { margin: 1.1em 0; }
.prose h2 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); margin: 2.2em 0 .3em; scroll-margin-top: 1rem; }
.prose h2::before { content: ""; display: block; width: 2.2rem; height: 4px; border-radius: 2px; background: var(--c); margin-bottom: .7rem; }
.prose h3 { font-size: 1.15rem; margin: 1.9em 0 .2em; }
.prose h2 + p, .prose h3 + p { margin-top: .5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose li::marker { color: var(--c-text); font-weight: 700; }
.prose strong { font-weight: 700; }
.prose a { color: var(--link); }
.prose blockquote { margin: 1.8em 0; padding: 1rem 1.25rem; border-radius: 10px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-left: 4px solid var(--c); font-style: italic; }
.prose blockquote p { margin: .3em 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
.prose code { font: .85em var(--mono); background: var(--surface-2); padding: .12em .35em; border-radius: 5px; }
.table-wrap { overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font: 400 .9rem/1.45 var(--display); font-variant-numeric: tabular-nums; }
.prose th { text-align: left; font: 600 .7rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: .8rem .9rem; background: var(--ink); color: var(--bg); white-space: nowrap; }
.prose thead tr { box-shadow: inset 0 -3px 0 var(--c); }
.prose td { padding: .7rem .9rem; border-top: 1px solid var(--rule); vertical-align: top; }
.prose tbody tr:nth-child(even) td { background: var(--surface-2); }

.post-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.post-tools a { font: 600 .85rem/1 var(--display); color: var(--ink); text-decoration: none; padding: .6rem .85rem; border: 1.5px solid var(--rule); border-radius: 9px; transition: border-color .15s; }
.post-tools a:hover { border-color: var(--c); }

.related { padding-top: 3rem; }
.related h2 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-block: 2rem 3.5rem; }
.pager a { display: block; padding: 1.1rem 1.25rem; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; font: 700 1rem/1.3 var(--display); transition: border-color .2s, transform .2s; }
.pager a:hover { border-color: var(--red); transform: translateY(-2px); }
.pager span { display: block; font: 500 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; }
.pager .next { text-align: right; }
@media (max-width: 36rem) { .pager { grid-template-columns: 1fr; } .pager .next { text-align: left; } }

/* ---------- footer ---------- */
.foot { position: relative; margin-top: 3rem; padding: 3rem 0 2rem; color: var(--panel-muted); font: 400 .92rem/1.5 var(--display); background: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 26px 26px, linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 26px 26px, var(--panel); }
.foot::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--red) 0 34%, var(--slate) 34% 67%, var(--ochre) 67%); }
.is-home .foot { margin-top: 1rem; }
.foot-in { width: min(var(--wrapw), 100% - 2rem); margin-inline: auto; display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: flex-end; }
.foot p { margin: 0; max-width: 26rem; }
.foot-brand { margin-bottom: .7rem !important; color: var(--panel-ink); }
.foot-brand .brand-name { font-size: 1.7rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; }
.foot nav a { display: inline-flex; align-items: center; gap: .45rem; color: var(--panel-ink); text-decoration: none; font-weight: 600; }
.foot nav a i { width: .6rem; height: .6rem; border-radius: 2px; background: var(--c); }
.foot nav a span { font: 400 .78rem var(--mono); color: var(--panel-muted); }
.foot nav a:hover { text-decoration: underline; text-decoration-color: var(--c); }
.foot-copy { width: min(var(--wrapw), 100% - 2rem); margin: 2rem auto 0 !important; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.1); font: 400 .76rem/1 var(--mono); max-width: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
