/* ==========================================================================
   Layer 8 — a technical manual, not a blog.
   Ruled hairlines, no radii, no shadows. IBM Plex throughout.
   ========================================================================== */

:root {
    --ground:     #EAE7DE;
    --paper:      #FAF8F4;
    --paper-2:    #F1EEE7;
    --ink:        #16181C;
    --ink-2:      #35393F;
    --muted:      #6E747C;
    --rule:       #D5D0C4;
    --rule-2:     #B4AE9F;
    --accent:     #BF3F16;
    --accent-2:   #A03411;
    --accent-wash:#F6E5DC;
    --code-bg:    #15181D;
    --code-ink:   #DAD6CD;
    --code-rule:  #2A2F37;

    --serif: "IBM Plex Serif", ui-serif, Georgia, serif;
    --sans:  "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --frame: 1180px;
    --pad:   clamp(1.1rem, 3.4vw, 3rem);
    --rail:  232px;
    --measure: 72ch;
    --hair: 1px;
}

:root[data-theme="dark"] {
    --ground:     #060709;
    --paper:      #101216;
    --paper-2:    #171A1F;
    --ink:        #E9E7E1;
    --ink-2:      #BFC3C9;
    --muted:      #848B94;
    --rule:       #23272E;
    --rule-2:     #39404A;
    --accent:     #FF7A45;
    --accent-2:   #FF9163;
    --accent-wash:#221008;
    --code-bg:    #090B0E;
    --code-ink:   #D5D1C8;
    --code-rule:  #1E232A;
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        --ground:     #060709;
        --paper:      #101216;
        --paper-2:    #171A1F;
        --ink:        #E9E7E1;
        --ink-2:      #BFC3C9;
        --muted:      #848B94;
        --rule:       #23272E;
        --rule-2:     #39404A;
        --accent:     #FF7A45;
        --accent-2:   #FF9163;
        --accent-wash:#221008;
        --code-bg:    #090B0E;
        --code-ink:   #D5D1C8;
        --code-rule:  #1E232A;
        color-scheme: dark;
    }
}

/* ------------------------------------------------------------- reset ---- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

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

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background-color: var(--ground);
    background-image:
        repeating-linear-gradient(to right,  color-mix(in srgb, var(--rule-2) 26%, transparent) 0 1px, transparent 1px 23px),
        repeating-linear-gradient(to bottom, color-mix(in srgb, var(--rule-2) 26%, transparent) 0 1px, transparent 1px 23px);
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p, ul, ol, figure, pre, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 0; top: 0; z-index: 99; background: var(--ink); color: var(--paper); padding: .6rem 1rem; }

/* small uppercase mono label, used everywhere structure needs naming */
.lbl {
    font-family: var(--mono);
    font-size: .625rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.sep { color: var(--rule-2); margin-inline: .45rem; }

/* ------------------------------------------------------------- frame ---- */

.frame {
    max-width: var(--frame);
    margin-inline: auto;
    background: var(--paper);
    border-inline: var(--hair) solid var(--rule);
    min-height: 100vh;
}

/* ---------------------------------------------------------- masthead ---- */

.masthead-bar {
    display: flex; align-items: stretch;
    border-bottom: var(--hair) solid var(--rule);
    position: sticky; top: 0; z-index: 40;
    background: var(--paper);
}

.brand {
    display: flex; align-items: center; gap: .65rem;
    padding: .7rem var(--pad);
    text-decoration: none;
    border-right: var(--hair) solid var(--rule);
    margin-right: auto;
}

.brand-stack { display: grid; grid-template-rows: repeat(8, 1fr); gap: 1px; width: 15px; height: 24px; }
.brand-stack i { display: block; background: var(--rule-2); }
.brand-stack .lit { background: var(--accent); }
.brand:hover .brand-stack i { background: var(--ink-2); }
.brand:hover .brand-stack .lit { background: var(--accent); }

.brand-name {
    font-family: var(--mono);
    font-size: .95rem; font-weight: 600; letter-spacing: -.01em;
}

.nav ul { display: flex; height: 100%; }
.nav li { display: flex; }
.nav a {
    display: flex; align-items: center;
    padding: 0 1.15rem;
    border-left: var(--hair) solid var(--rule);
    font-family: var(--mono); font-size: .76rem; letter-spacing: .02em;
    color: var(--ink-2); text-decoration: none;
}
.nav a:hover { background: var(--accent-wash); color: var(--accent-2); }

.toggle {
    display: flex; align-items: center; gap: .45rem;
    padding: 0 1.15rem;
    border-left: var(--hair) solid var(--rule);
    cursor: pointer;
    font-family: var(--mono); font-size: .68rem;
    letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.toggle:hover { background: var(--accent-wash); color: var(--accent-2); }
.toggle-val::before { content: "auto"; color: var(--ink-2); }
:root[data-theme="light"] .toggle-val::before { content: "light"; }
:root[data-theme="dark"] .toggle-val::before { content: "dark"; }

@media (max-width: 700px) {
    .nav, .toggle-label { display: none; }
    .brand { padding-inline: var(--pad); }
}

/* -------------------------------------------------------------- hero ---- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 228px 252px;
    border-bottom: var(--hair) solid var(--rule);
}

.portrait {
    border-left: var(--hair) solid var(--rule);
    display: grid; grid-template-rows: 1fr auto;
    background: var(--code-bg);
    min-height: 0;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.portrait figcaption {
    padding: .5rem .85rem;
    border-top: var(--hair) solid var(--rule);
    background: var(--paper-2);
}

.hero-def { padding: clamp(1.8rem, 4vw, 3rem) var(--pad) clamp(1.8rem, 3.5vw, 2.6rem); }

.hero-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 4.4vw, 3.05rem);
    line-height: 1.04;
    letter-spacing: -.025em;
    max-width: 15ch;
}

.hero-body {
    font-family: var(--serif);
    font-size: 1.02rem;
    line-height: 1.62;
    color: var(--ink-2);
    max-width: 58ch;
    margin-top: 1.15rem;
}
.hero-body strong { color: var(--ink); font-weight: 600; }

.hero-sig {
    margin-top: 1.6rem; padding-top: 1rem;
    border-top: var(--hair) solid var(--rule);
    display: grid; gap: .2rem; max-width: 58ch;
}
.hero-sig-name { font-family: var(--mono); font-size: .82rem; font-weight: 600; }
.hero-sig-role { font-family: var(--mono); font-size: .72rem; color: var(--muted); }

/* the stack diagram — the brand, made literal */

.stack {
    border-left: var(--hair) solid var(--rule);
    padding: clamp(1.4rem, 3vw, 2rem) 1.6rem;
    display: flex; flex-direction: column; justify-content: center;
    background: var(--paper-2);
}

.stack figcaption { margin-bottom: .9rem; }

.stack-list { display: grid; gap: 2px; }

.stack-row {
    display: grid;
    grid-template-columns: 1.5rem 1fr 46px;
    align-items: center; gap: .5rem;
    padding: .28rem 0;
    border-bottom: var(--hair) solid var(--rule);
}

.stack-n {
    font-family: var(--mono); font-size: .7rem; color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.stack-name { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.stack-bar { height: 4px; background: var(--rule-2); opacity: .7; }

.stack-row.is-lit { border-bottom-color: var(--accent); }
.stack-row.is-lit .stack-n,
.stack-row.is-lit .stack-name { color: var(--accent); font-weight: 600; }
.stack-row.is-lit .stack-bar { background: var(--accent); opacity: 1; height: 6px; }

.stack-note {
    margin-top: .95rem;
    font-family: var(--mono); font-size: .66rem; line-height: 1.5; color: var(--muted);
}

@media (max-width: 1040px) {
    .hero { grid-template-columns: minmax(0, 1fr) 240px; }
    .portrait { grid-column: 2; grid-row: 1; }
    .stack { grid-column: 1 / -1; border-left: 0; border-top: var(--hair) solid var(--rule); padding-inline: var(--pad); }
    .stack-list { grid-template-columns: repeat(2, 1fr); display: grid; column-gap: 2rem; }
}

@media (max-width: 720px) {
    .hero { grid-template-columns: 1fr; }
    .portrait { grid-column: 1; grid-row: auto; border-left: 0; border-top: var(--hair) solid var(--rule); max-height: 340px; }
    .stack-list { grid-template-columns: 1fr; }
    .stack-row { grid-template-columns: 1.5rem 1fr 70px; }
}

/* ----------------------------------------------------------- pillars ---- */

.pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: var(--hair) solid var(--rule);
}

.pillar {
    border-right: var(--hair) solid var(--rule);
    display: grid; grid-template-rows: auto 1fr;
    background: var(--code-bg);
}
.pillar:last-child { border-right: 0; }

.pillar img {
    width: 100%; height: 132px; object-fit: cover;
    filter: saturate(.85) contrast(1.03);
    transition: filter .2s ease;
}
.pillar:hover img { filter: saturate(1) contrast(1.03); }

.pillar figcaption {
    display: grid; gap: .2rem;
    padding: .7rem .9rem .85rem;
    background: var(--paper-2);
    border-top: var(--hair) solid var(--rule);
}

.pillar-n {
    font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; color: var(--accent);
}
.pillar-name { font-family: var(--sans); font-size: .92rem; font-weight: 600; color: var(--ink); }
.pillar-note { font-size: .76rem; line-height: 1.4; color: var(--muted); }

@media (max-width: 720px) {
    .pillars { grid-template-columns: 1fr; }
    .pillar { border-right: 0; border-bottom: var(--hair) solid var(--rule); }
    .pillar:last-child { border-bottom: 0; }
    .pillar img { height: 150px; }
}

/* ------------------------------------------------------------ topics ---- */

.topics {
    display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
    padding: .75rem var(--pad);
    border-bottom: var(--hair) solid var(--rule);
    background: var(--paper-2);
}

.topics-list { display: flex; flex-wrap: wrap; gap: .4rem; }

.topics-list a {
    display: inline-flex; align-items: baseline; gap: .4rem;
    padding: .2rem .5rem;
    border: var(--hair) solid var(--rule);
    font-family: var(--mono); font-size: .7rem; color: var(--ink-2);
    text-decoration: none; background: var(--paper);
}
.topics-list a:hover { border-color: var(--accent); color: var(--accent-2); }
.topics-n { color: var(--muted); font-size: .64rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ ledger ---- */

.pagehead { padding: clamp(1.6rem, 3.5vw, 2.4rem) var(--pad) 1.2rem; border-bottom: var(--hair) solid var(--rule); }
.pagehead-title { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -.02em; }
.pagehead-desc { font-family: var(--serif); color: var(--ink-2); margin-top: .5rem; max-width: 60ch; }
.pagehead-meta { margin-top: .8rem; }

.ledger-wrap { counter-reset: led; }

.ledger-head,
.ledger-link {
    display: grid;
    grid-template-columns: 2.6rem 6.6rem 96px minmax(0, 1fr) 9rem 4rem;
    gap: 1rem;
    padding-inline: var(--pad);
    align-items: start;
}

.ledger-thumb {
    display: block; width: 96px; aspect-ratio: 3 / 2;
    background: var(--code-bg);
    border: var(--hair) solid var(--rule);
    overflow: hidden;
}
.ledger-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ledger-link:hover .ledger-thumb { border-color: var(--accent); }

.ledger-head {
    padding-block: .5rem;
    border-bottom: var(--hair) solid var(--rule-2);
    background: var(--paper-2);
}

.ledger-row { counter-increment: led; border-bottom: var(--hair) solid var(--rule); }

.ledger-link {
    padding-block: 1.05rem;
    text-decoration: none;
    transition: background .12s linear;
}
.ledger-link:hover { background: var(--accent-wash); }

.ledger-n {
    font-family: var(--mono); font-size: .74rem; color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.ledger-n::before { content: counter(led, decimal-leading-zero); }
.ledger-link:hover .ledger-n { color: var(--accent); }

.ledger-date {
    font-family: var(--mono); font-size: .74rem; color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.ledger-main { display: grid; gap: .28rem; min-width: 0; }

.ledger-title {
    font-family: var(--serif);
    font-size: 1.24rem; line-height: 1.24; letter-spacing: -.012em; font-weight: 600;
    color: var(--ink);
}
.ledger-link:hover .ledger-title { color: var(--accent-2); }

.ledger-sub {
    font-size: .875rem; line-height: 1.5; color: var(--muted);
    max-width: 74ch;
}

.ledger-topic {
    font-family: var(--mono); font-size: .68rem; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted);
    overflow-wrap: anywhere;
}
.ledger-link:hover .ledger-topic { color: var(--accent-2); }

.ledger-len {
    font-family: var(--mono); font-size: .7rem; color: var(--muted);
    text-align: right; font-variant-numeric: tabular-nums;
}

.ledger-related { border-top: var(--hair) solid var(--rule); margin-top: 0; }

@media (max-width: 940px) {
    .ledger-head { display: none; }
    .ledger-link {
        grid-template-columns: 76px minmax(0, 1fr);
        row-gap: .3rem; column-gap: .85rem;
    }
    .ledger-n { display: none; }
    .ledger-thumb { grid-row: 1 / span 2; width: 76px; }
    .ledger-date { grid-column: 2; }
    .ledger-main { grid-column: 2; }
    .ledger-topic { grid-column: 2; grid-row: 3; }
    .ledger-len { display: none; }
}

/* ----------------------------------------------------------- entry ------ */

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); }

.entry-head {
    padding: clamp(1.8rem, 4vw, 3rem) var(--pad) clamp(1.4rem, 2.6vw, 2rem);
    border-bottom: var(--hair) solid var(--rule);
}

.entry-kicker {
    font-family: var(--mono); font-size: .72rem;
    letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
    margin-bottom: .95rem;
}
.entry-kicker a { color: var(--accent-2); text-decoration: none; }
.entry-kicker a:hover { text-decoration: underline; }

.entry-title {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 4.2vw, 2.95rem);
    line-height: 1.06; letter-spacing: -.026em;
    max-width: 24ch;
}

.entry-standfirst {
    margin-top: 1rem;
    font-family: var(--serif); font-style: italic;
    font-size: 1.08rem; line-height: 1.55; color: var(--ink-2);
    max-width: 62ch;
}

.entry-plate { border-bottom: var(--hair) solid var(--rule); background: var(--code-bg); }
.entry-plate img { width: 100%; max-height: 380px; object-fit: cover; }
.entry-plate figcaption {
    font-family: var(--mono); font-size: .7rem; color: var(--muted);
    padding: .6rem var(--pad); border-top: var(--hair) solid var(--rule);
    background: var(--paper);
}

.entry-cols {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
}

/* left rail — metadata and section index, so the width is never dead */

.rail {
    border-right: var(--hair) solid var(--rule);
    background: var(--paper-2);
}

.rail-inner {
    position: sticky; top: 46px;
    padding: 1.6rem 1.2rem 2rem var(--pad);
    display: grid; gap: 1.5rem;
}

.rail-block { display: grid; gap: .4rem; }
.rail-block .lbl { margin-bottom: .15rem; }
.rail-val { font-family: var(--mono); font-size: .76rem; color: var(--ink-2); }
.rail-dim { color: var(--muted); }
.rail-val a { color: var(--accent-2); text-decoration: none; }
.rail-val a:hover { text-decoration: underline; }

.rail-tags { display: grid; gap: .3rem; }
.rail-tags a {
    font-family: var(--mono); font-size: .72rem; color: var(--ink-2); text-decoration: none;
    border-bottom: var(--hair) solid transparent;
}
.rail-tags a:hover { color: var(--accent-2); border-bottom-color: var(--accent); }

.toc { display: grid; gap: .38rem; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
    display: grid; grid-template-columns: 1.35rem 1fr; gap: .3rem;
    font-size: .78rem; line-height: 1.35; color: var(--muted); text-decoration: none;
}
.toc a::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--mono); font-size: .66rem; padding-top: .1rem;
}
.toc a:hover { color: var(--accent-2); }
.toc .is-current a { color: var(--ink); }
.toc .is-current a::before { color: var(--accent); }

@media (max-width: 900px) {
    .entry-cols { grid-template-columns: 1fr; }
    .rail { border-right: 0; border-bottom: var(--hair) solid var(--rule); }
    .rail-inner { position: static; padding: 1.2rem var(--pad); grid-auto-flow: column; grid-auto-columns: max-content; gap: 2rem; overflow-x: auto; }
    .rail-toc { display: none; }
}

/* ------------------------------------------------------- entry body ----- */

.entry-body {
    padding: clamp(1.8rem, 3.5vw, 2.8rem) var(--pad) 3rem;
    font-family: var(--serif);
    font-size: 1.045rem;
    line-height: 1.68;
    color: var(--ink-2);
    counter-reset: sec;
}

.entry-body > * + * { margin-top: 1.15em; }

/* prose keeps a controlled measure; evidence gets the full column */
.entry-body p,
.entry-body ul,
.entry-body ol,
.entry-body blockquote { max-width: var(--measure); }

.entry-body h2 {
    font-family: var(--sans);
    font-size: 1.16rem;
    line-height: 1.3;
    letter-spacing: -.005em;
    color: var(--ink);
    counter-increment: sec;
    margin-top: 2.6rem;
    padding-top: .7rem;
    border-top: var(--hair) solid var(--rule-2);
    display: grid;
    grid-template-columns: 2.4rem 1fr;
    gap: .5rem;
    align-items: baseline;
    scroll-margin-top: 60px;
}

.entry-body h2::before {
    content: counter(sec, decimal-leading-zero);
    font-family: var(--mono); font-size: .72rem; font-weight: 500;
    color: var(--accent);
}

.entry-body h3 {
    font-family: var(--sans);
    font-size: 1rem; color: var(--ink);
    margin-top: 1.9rem;
    padding-left: 2.9rem;
}

.entry-body h4 {
    font-family: var(--mono); font-size: .7rem; font-weight: 500;
    letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
    margin-top: 1.6rem;
}

.entry-body a {
    color: var(--accent-2);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.entry-body a:hover { background: var(--accent-wash); text-decoration-color: var(--accent); }

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

.entry-body ul, .entry-body ol { display: grid; gap: .42rem; }

.entry-body ul > li,
.entry-body ol > li {
    display: grid; grid-template-columns: 1.5rem 1fr; gap: .3rem;
}
.entry-body ul > li::before {
    content: "—"; font-family: var(--mono); font-size: .8rem; color: var(--accent); padding-top: .1rem;
}
.entry-body ol { counter-reset: li; }
.entry-body ol > li { counter-increment: li; }
.entry-body ol > li::before {
    content: counter(li) "."; font-family: var(--mono); font-size: .78rem;
    color: var(--accent); padding-top: .12rem; font-variant-numeric: tabular-nums;
}
.entry-body li > ul, .entry-body li > ol { grid-column: 1 / -1; margin-top: .4rem; padding-left: 1.5rem; }

.entry-body blockquote {
    border-left: 2px solid var(--accent);
    padding: .1rem 0 .1rem 1.1rem;
    font-style: italic; color: var(--ink);
}

.entry-body hr { border: 0; border-top: var(--hair) solid var(--rule); margin-block: 2rem; }

/* code — dark plates, even on light paper */

.entry-body :not(pre) > code {
    font-family: var(--mono); font-size: .84em;
    background: var(--paper-2);
    border: var(--hair) solid var(--rule);
    padding: .06em .32em;
    color: var(--accent-2);
    overflow-wrap: anywhere;
}

.entry-body pre {
    font-family: var(--mono);
    font-size: .82rem;
    line-height: 1.6;
    background: var(--code-bg);
    color: var(--code-ink);
    border: var(--hair) solid var(--code-rule);
    padding: 1rem 1.1rem;
    overflow-x: auto;
    tab-size: 2;
}
.entry-body pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

.entry-body pre.has-lang { padding-top: 2.2rem; position: relative; }
.entry-body .code-lang {
    position: absolute; top: 0; left: 0; right: 0;
    padding: .35rem 1.1rem;
    font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--muted);
    border-bottom: var(--hair) solid var(--code-rule);
}

/* tables — full column width, ruled like a spec sheet */

.entry-body .table-scroll { overflow-x: auto; border: var(--hair) solid var(--rule); }
.entry-body table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .855rem; }
.entry-body th, .entry-body td { text-align: left; padding: .55rem .75rem; vertical-align: top; border-bottom: var(--hair) solid var(--rule); }
.entry-body th {
    font-family: var(--mono); font-size: .66rem; font-weight: 500;
    letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
    background: var(--paper-2); border-bottom-color: var(--rule-2); white-space: nowrap;
}
.entry-body tbody tr:last-child td { border-bottom: 0; }
.entry-body tbody tr:hover { background: var(--paper-2); }

/* ghost cards */

/* Ghost width cards break out of the prose measure, never out of the frame */
.entry-body .kg-width-wide { max-width: none; width: 100%; }
.entry-body .kg-width-full {
    max-width: none;
    width: calc(100% + var(--pad) * 2);
    margin-inline: calc(var(--pad) * -1);
}
.entry-body .kg-width-full img { border-inline: 0; }

.entry-body figure img { border: var(--hair) solid var(--rule); }
.entry-body figcaption { font-family: var(--mono); font-size: .68rem; color: var(--muted); margin-top: .5rem; }
.entry-body .kg-callout-card {
    display: flex; gap: .8rem; padding: .9rem 1rem;
    background: var(--paper-2); border: var(--hair) solid var(--rule); border-left: 2px solid var(--accent);
    font-size: .95rem;
}
.entry-body .kg-callout-text { max-width: none; }

.endnote {
    margin-top: 2.6rem; padding-top: 1rem;
    border-top: var(--hair) solid var(--rule-2);
    font-family: var(--sans); font-size: .875rem; color: var(--muted);
    max-width: var(--measure);
}
.endnote-mark { display: inline-block; width: 22px; height: 2px; background: var(--accent); vertical-align: middle; margin-right: .5rem; }
.endnote a { color: var(--accent-2); }

/* -------------------------------------------------------- pagination ---- */

.pagination {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem var(--pad);
    border-bottom: var(--hair) solid var(--rule);
    font-family: var(--mono); font-size: .72rem; color: var(--muted);
}
.pagination a { color: var(--ink); text-decoration: none; border-bottom: var(--hair) solid var(--rule-2); }
.pagination a:hover { color: var(--accent-2); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------- foot ----- */

.foot { border-top: var(--hair) solid var(--rule-2); background: var(--paper-2); }

.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; }

.foot-cell { padding: 1.5rem var(--pad); border-right: var(--hair) solid var(--rule); }
.foot-cell:last-child { border-right: 0; }
.foot-cell .lbl { display: block; margin-bottom: .7rem; }

.foot-line { font-size: .87rem; line-height: 1.55; color: var(--ink-2); max-width: 52ch; }
.foot-dim { color: var(--muted); font-family: var(--mono); font-size: .74rem; margin-top: .55rem; }

.foot-list { display: grid; gap: .42rem; }
.foot-list a { font-family: var(--mono); font-size: .76rem; color: var(--ink-2); text-decoration: none; }
.foot-list a:hover { color: var(--accent-2); }

.foot-legal {
    display: grid; gap: .35rem;
    padding: .9rem var(--pad);
    border-top: var(--hair) solid var(--rule);
    font-family: var(--mono); font-size: .66rem; line-height: 1.5; color: var(--muted);
}

@media (max-width: 780px) {
    .foot-grid { grid-template-columns: 1fr; }
    .foot-cell { border-right: 0; border-bottom: var(--hair) solid var(--rule); }
}

/* -------------------------------------------------------------- misc ---- */

.error-wrap { padding: clamp(3rem, 8vw, 6rem) var(--pad); }
.error-code { font-family: var(--mono); font-size: 4rem; color: var(--accent); line-height: 1; }
.error-msg { font-family: var(--serif); font-size: 1.5rem; margin-top: .8rem; }
.error-wrap a { color: var(--accent-2); }
