/* =====================================================================
   PREDICTERRA · Ghost theme (built on the Woza sheet)
   The journal as a sheet, like wozalabs.com: static marks on the left,
   the record on the right. One typeface, one weight, three sizes.
   Archivo, the Predicterra greys and one orange. Light and dark.
   ===================================================================== */

@font-face {
    font-family: "Archivo";
    src: url("../fonts/Archivo.woff2") format("woff2");
    font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}

/* ---------- Tokens --------------------------------------------------- */
:root {
    /* Light (default): the Predicterra greys */
    --canvas: #F0F0F0;
    --ink: #1E1E1E;
    --ink-2: #3D3D3D;
    --ink-3: #5E5E5E;
    --accent: #FF3700;
    color-scheme: light;
    --rule: color-mix(in srgb, var(--ink) 16%, transparent);
    --wash: color-mix(in srgb, var(--ink) 6%, transparent);

    /* three sizes, nothing else */
    --t-display: clamp(32px, 3.9vw, 68px);
    --t-read:    clamp(17px, 1.22vw, 22px);
    --t-small:   clamp(13px, .9vw, 16px);

    --m:   clamp(20px, 3.2vw, 64px);
    --gut: clamp(16px, 1.6vw, 28px);
    --top: clamp(26px, 2.1vw, 40px);
    --measure: 64ch;
    --ease: cubic-bezier(.23, 1, .32, 1);

    --font: var(--gh-font-body, "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif);
    --font-head: var(--gh-font-heading, var(--font));
    --font-code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
/* Dark: set by the toggle, or by the system when there is no script */
:root[data-theme="dark"] {
    --canvas: #1E1E1E;
    --ink: #F1F1F1;
    --ink-2: #CECECE;
    --ink-3: #A7A7A7;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --canvas: #1E1E1E; --ink: #F1F1F1; --ink-2: #CECECE; --ink-3: #A7A7A7;
        color-scheme: dark;
    }
}

/* ---------- Base ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--canvas); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-synthesis: none; }
body {
    margin: 0; background: var(--canvas); color: var(--ink);
    font-family: var(--font); font-weight: 400; font-size: var(--t-small); line-height: 1.35;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6, strong, b, dt, th { font-weight: 400; }
h1, h2, h3, h4, h5, h6, p, figure, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--canvas); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.kicker i, .eyebrow i, .sysline i, .pair i, .pager-n i { font-style: normal; color: var(--ink-3); margin: 0 .5em; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 50; background: var(--ink); color: var(--canvas); padding: 10px 14px; }
.skip-link:focus { left: 0; }

/* ---------- The sheet ------------------------------------------------ */
.sheet {
    display: grid;
    grid-template-columns: minmax(240px, 24%) minmax(0, 1fr);
    column-gap: calc(var(--gut) * 2);
    padding: 0 var(--m);
    min-height: 100vh;
}

/* Left: static marks */
.marks {
    position: sticky; top: 0; align-self: start;
    height: 100vh; height: 100svh;
    display: flex; flex-direction: column;
    padding: var(--top) 0 28px;
}
.marks-top { display: flex; align-items: center; justify-content: space-between; }
.brand-logo { height: clamp(18px, 1.5vw, 26px); width: auto; }
.brand-word { font-size: var(--t-read); letter-spacing: -.01em; }
.nav-toggle { display: none; }
.marks-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }


/* On a post, the index becomes its contents */
.toc { margin-top: auto; margin-bottom: clamp(24px, 4svh, 48px); max-height: 52svh; overflow: auto; }
.mk-label, .spec dt, .ml, .sys-l {
    color: var(--ink-3); font-size: var(--t-small); letter-spacing: 0;
}
.mk-label { margin-bottom: .9em; }
.toc-list { counter-reset: t; display: grid; row-gap: .15em; }
.toc-list a {
    display: grid; grid-template-columns: 2.2em 1fr; align-items: baseline;
    font-size: var(--t-read); line-height: 1.25; color: var(--ink-3); transition: color 300ms ease;
}
.toc-list a::before { counter-increment: t; content: counter(t, decimal-leading-zero); font-size: var(--t-small); color: var(--ink-3); }
.toc-list a.is-current, .toc-list a:hover { color: var(--ink); }
.back { font-size: var(--t-small); color: var(--ink-2); margin-bottom: clamp(20px, 3svh, 36px); }
.back:hover { color: var(--ink); }

.spec { display: grid; grid-template-columns: auto 1fr; column-gap: 1.4em; row-gap: .7em; border-top: 1px solid var(--rule); padding-top: 14px; }
.spec dd { display: flex; flex-direction: column; color: var(--ink); }
.spec .k { color: var(--ink-2); }
.spec a:hover { text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }

/* Right: the record */
.pane { min-width: 0; padding: var(--top) 0 28px; display: flex; flex-direction: column; min-height: 100vh; }
.pane-top { display: flex; justify-content: flex-end; border-bottom: 1px solid var(--rule); padding-bottom: 12px; min-height: calc(var(--t-small) * 1.35 + 12px); }
.claim { color: var(--ink); letter-spacing: 0; font-size: var(--t-small); line-height: 1.35; }

/* ---------- Shared marks --------------------------------------------- */
.display { font-family: var(--font-head); font-size: var(--t-display); line-height: 1.02; letter-spacing: -.024em; text-wrap: balance; max-width: 22ch; }
.lede { font-size: var(--t-read); line-height: 1.34; color: var(--ink-2); max-width: 46ch; text-wrap: pretty; }
.eyebrow, .kicker {
    font-size: var(--t-small); letter-spacing: 0; color: var(--ink-2);
    display: flex; flex-wrap: wrap; align-items: baseline;
}
.kicker .k-strong { color: var(--ink); }
.kicker a:hover { text-decoration: underline; text-underline-offset: .18em; }

.go { display: inline-flex; align-items: center; gap: .3em; color: var(--ink); font-size: var(--t-small); }
.go__t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .28em;
    text-decoration-color: color-mix(in srgb, var(--ink) 55%, transparent); transition: text-decoration-color 200ms ease; }
.go:hover .go__t { text-decoration-color: var(--ink); }
.go__arrow { width: 1.05em; height: 1.05em; flex: none; fill: currentColor; transition: transform 240ms var(--ease); }
.go:hover .go__arrow { transform: translate(.14em, -.14em); }

/* ---------- Index pages --------------------------------------------- */
.head { padding-top: clamp(36px, 7svh, 96px); padding-bottom: clamp(28px, 5svh, 64px); display: grid; row-gap: clamp(14px, 2svh, 22px); }
.head .display { max-width: 18ch; }

.lead { border-top: 1px solid var(--ink); padding-top: clamp(16px, 2.4svh, 26px); margin-bottom: clamp(32px, 6svh, 72px); }
.lead-link { display: grid; row-gap: clamp(14px, 2svh, 22px); }
.lead-title { max-width: 20ch; }
.lead-dek { font-size: var(--t-read); line-height: 1.34; color: var(--ink-2); max-width: 52ch; }
.lead-media { aspect-ratio: 16 / 8; overflow: hidden; background: var(--wash); }
.lead-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.35) contrast(1.04); transition: filter 500ms ease; }
.lead-link:hover .lead-media img { filter: none; }
.lead-link:hover .go__t { text-decoration-color: var(--ink); }
.lead-link:hover .go__arrow { transform: translate(.14em, -.14em); }

/* The ledger: date, tag, title, arrow. One line per signal. */
.entries { border-bottom: 1px solid var(--rule); }
.entry-row {
    display: grid; grid-template-columns: 6.2em 10em minmax(0, 1fr) auto; column-gap: var(--gut);
    align-items: baseline; border-top: 1px solid var(--rule); padding: clamp(11px, 1.7svh, 18px) 0;
}
.e-date { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.e-tag { color: var(--ink-3); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-main { display: flex; flex-direction: column; row-gap: .2em; }
.e-title { font-size: var(--t-read); line-height: 1.25; letter-spacing: -.01em; }
.e-dek { color: var(--ink-2); max-width: 70ch; }
.e-go { color: var(--ink-3); display: inline-flex; align-self: center; }
.e-go .go__arrow { width: 1.2em; height: 1.2em; }
.entry-row:hover .e-title { text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
.entry-row:hover .e-go { color: var(--ink); }
.entry-row:hover .go__arrow { transform: translate(.14em, -.14em); }
.empty { padding: 24px 0; color: var(--ink-2); font-size: var(--t-read); }

.pager { display: flex; justify-content: space-between; align-items: baseline; padding: clamp(20px, 3svh, 32px) 0; }
.pager-n { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pager-off { color: var(--ink-3); }

.author-id { display: flex; align-items: center; gap: var(--gut); }
.avatar { width: clamp(48px, 4vw, 72px); aspect-ratio: 1; object-fit: cover; filter: saturate(.35); }

/* ---------- Article -------------------------------------------------- */
.art-head { padding-top: clamp(36px, 7svh, 96px); display: grid; row-gap: clamp(14px, 2svh, 22px); }
.art-head .display { max-width: 22ch; }
.meta {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: var(--gut);
    border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
    padding: 12px 0 14px; margin-top: clamp(6px, 1.4svh, 16px);
}
.meta > div { display: flex; flex-direction: column; row-gap: .3em; min-width: 0; }
.mv { color: var(--ink); }
.mv a:hover { text-decoration: underline; text-underline-offset: .18em; }

.art-media { margin-top: clamp(28px, 5svh, 56px); }
.art-media img { width: 100%; }
figcaption { color: var(--ink-2); padding-top: 10px; max-width: var(--measure); }

.art-foot { max-width: var(--measure); margin-top: clamp(40px, 7svh, 88px); display: grid; row-gap: 22px; }
.sysline { letter-spacing: 0; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: baseline; border-top: 1px solid var(--rule); padding-top: 14px; }
.sysline .sys-l { margin-right: 1.4em; }
.sysline a:hover { color: var(--ink); }
.byline { display: flex; gap: var(--gut); align-items: flex-start; }
.by-name { font-size: var(--t-read); }
.by-name:hover { text-decoration: underline; text-underline-offset: .18em; }
.by-bio { color: var(--ink-2); margin-top: .3em; max-width: 52ch; }

.art-comments, .read-next { margin-top: clamp(48px, 8svh, 104px); display: grid; row-gap: 16px; }

/* ---------- Content (Koenig) ---------------------------------------- */
.gh-content { margin-top: clamp(32px, 5svh, 64px); font-size: var(--t-read); line-height: 1.52; counter-reset: h2; }
.gh-content > * { max-width: var(--measure); }
.gh-content > * + * { margin-top: 1.05em; }
.gh-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
    text-decoration-color: color-mix(in srgb, var(--ink) 50%, transparent); }
.gh-content a:hover { text-decoration-color: var(--ink); }

/* Headings stay in the three sizes: numbered, ruled, full ink. */
.gh-content h2 {
    font-size: var(--t-read); line-height: 1.3; letter-spacing: -.005em;
    border-top: 1px solid var(--rule); padding-top: .9em; margin-top: 2.2em;
    display: grid; grid-template-columns: 2.4em 1fr; align-items: baseline;
}
.gh-content h2::before { counter-increment: h2; content: counter(h2, decimal-leading-zero); font-size: var(--t-small); color: var(--ink-3); }
.gh-content h3, .gh-content h4, .gh-content h5, .gh-content h6 {
    font-size: var(--t-small); letter-spacing: 0; color: var(--ink-2); margin-top: 2em;
}
.gh-content h2 + *, .gh-content h3 + * { margin-top: .7em; }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content ul { list-style: none; }
.gh-content ul li { position: relative; }
.gh-content ul li::before { content: ""; position: absolute; left: -1.2em; top: .68em; width: .42em; height: 1px; background: var(--ink-2); }
.gh-content ol { list-style: decimal-leading-zero; }
.gh-content ol li::marker { color: var(--ink-3); font-size: var(--t-small); }
.gh-content li + li { margin-top: .4em; }
.gh-content blockquote { margin: 0; padding-left: 1.4em; color: var(--ink-2); }
.gh-content blockquote.kg-blockquote-alt { padding: 0; font-size: var(--t-display); line-height: 1.08; letter-spacing: -.02em; color: var(--ink); max-width: 20ch; }
.gh-content hr { border: 0; border-top: 1px solid var(--rule); max-width: none; margin: 2.4em 0; }
.gh-content code { font-family: var(--font-code); font-size: .82em; background: var(--wash); padding: .08em .35em; }
.gh-content pre { font-family: var(--font-code); font-size: var(--t-small); line-height: 1.55; background: var(--wash);
    border-top: 1px solid var(--rule); padding: 1.1em 1.2em; overflow-x: auto; max-width: none; }
.gh-content pre code { background: none; padding: 0; font-size: inherit; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: var(--t-small); display: block; overflow-x: auto; max-width: none; }
.gh-content th { text-align: left; color: var(--ink-3); letter-spacing: 0; border-bottom: 1px solid var(--ink); padding: 0 1.2em .6em 0; }
.gh-content td { border-bottom: 1px solid var(--rule); padding: .7em 1.2em .7em 0; vertical-align: top; }
.gh-content figure img { width: 100%; }
.gh-content .kg-card { max-width: var(--measure); }
.gh-content .kg-width-wide { max-width: min(100%, 1100px); }
.gh-content .kg-width-full { max-width: none; width: 100%; }
.gh-content .kg-image-card img { margin: 0 auto; }
.gh-content .kg-gallery-card { max-width: min(100%, 1100px); }
.gh-content .kg-embed-card { display: block; }
.gh-content .kg-embed-card iframe { width: 100%; }
.gh-content .kg-bookmark-card a.kg-bookmark-container { border: 1px solid var(--rule); border-radius: 0; color: var(--ink); text-decoration: none; background: transparent; }
.gh-content .kg-bookmark-title { font-weight: 400; }
.gh-content .kg-bookmark-description, .gh-content .kg-bookmark-metadata { color: var(--ink-2); }
.gh-content .kg-callout-card { border-radius: 0; }
.gh-content .kg-button-card a.kg-btn { border-radius: 0; font-weight: 400; }
.gh-content .kg-toggle-card { border-radius: 0; }

/* ---------- Footer: one line, one hairline --------------------------- */
.foot { margin-top: auto; padding-top: clamp(48px, 8svh, 96px); }
.foot-line { border-top: 1px solid var(--rule); padding-top: 14px; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: clamp(16px, 2.2vw, 40px); row-gap: .5em; color: var(--ink); }
.foot-line .u { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, var(--ink) 45%, transparent); }
.foot-line .u:hover { text-decoration-color: var(--ink); }
.foot-line .pair a { color: var(--ink-2); }
.foot-line .pair a:hover { color: var(--ink); }
.foot-line .k { color: var(--ink-3); margin-left: auto; }

/* ---------- Narrow and portrait: one column, marks on top ------------ */
@media (max-width: 900px), (orientation: portrait) {
    .sheet { grid-template-columns: 1fr; }
    .marks { position: sticky; top: 0; z-index: 10; height: auto; padding: 14px 0; background: var(--canvas); border-bottom: 1px solid var(--rule); }
    .nav-toggle { display: inline-grid; gap: 5px; width: 28px; }
    .nav-toggle span { display: block; height: 1px; background: var(--ink); transition: transform 300ms var(--ease); }
    .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }
    .marks-panel { display: none; padding-top: 24px; }
    .marks-panel.is-open { display: flex; min-height: calc(100svh - 70px); }
    .menu, .toc { margin-top: 0; }
    .pane-top { display: none; }
    .head, .art-head { padding-top: 32px; }
    .entry-row { grid-template-columns: 1fr auto; row-gap: .3em; }
    .e-date, .e-tag { grid-column: 1; }
    .e-tag { order: -1; }
    .e-main { grid-column: 1; }
    .e-go { grid-column: 2; grid-row: 1 / span 3; }
    .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
    .foot-line .k { margin-left: 0; }
}


/* =====================================================================
   v2.1 · list first, a topic index on the left, one column per article
   ===================================================================== */

/* Left column: site links, then the topic index, then particulars */
.site-links { display: flex; flex-wrap: wrap; column-gap: 1.1em; row-gap: .3em; margin-top: clamp(22px, 3.5svh, 40px); color: var(--ink-2); }
.site-links a:hover, .site-links a.is-current { color: var(--ink); }
.index { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: clamp(28px, 5svh, 64px); margin-bottom: clamp(20px, 3svh, 36px); }
.index-list { overflow: auto; counter-reset: ix -1; display: grid; row-gap: .1em; align-content: start; scrollbar-width: thin; }
.idx {
    display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; column-gap: .4em; align-items: baseline;
    font-size: var(--t-read); line-height: 1.3; color: var(--ink-3); transition: color 300ms ease;
}
.idx::before { counter-increment: ix; content: counter(ix, decimal-leading-zero); font-size: var(--t-small); color: var(--ink-3); }
.idx-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idx-c { font-size: var(--t-small); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.idx:hover { color: var(--ink-2); }
.idx.is-current, .idx.is-current .idx-c { color: var(--ink); }
.toc { margin-top: clamp(28px, 5svh, 64px); margin-bottom: clamp(20px, 3svh, 36px); flex: 1; min-height: 0; max-height: none; }
.back { margin-top: auto; }
.spec { margin-top: auto; }

/* The list opens the page: a compact head, then the ledger */
.list-head {
    display: grid; grid-template-columns: auto 1fr auto; column-gap: 1.2em; align-items: baseline;
    padding: clamp(20px, 3.4svh, 36px) 0 clamp(12px, 1.8svh, 18px);
}
.lh-title { font-size: var(--t-read); line-height: 1.25; letter-spacing: -.01em; }
.lh-count { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lh-desc { grid-column: 1 / -1; color: var(--ink-2); max-width: 70ch; margin-top: .5em; }

/* Rows with an optional thumbnail */
.entry-row { grid-template-columns: 6.2em 10em minmax(0, 1fr) auto; }
.entry-row.has-thumb { grid-template-columns: 6.2em 10em minmax(0, 1fr) clamp(88px, 7vw, 128px) auto; }
.e-thumb { align-self: center; aspect-ratio: 16 / 10; overflow: hidden; background: var(--wash); }
.e-thumb img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.35) contrast(1.04); transition: filter 400ms ease; }
.entry-row:hover .e-thumb img { filter: none; }
.e-dek { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* An article is one column: head, facts, image, body and footer share its width */
.article { max-width: calc(var(--t-read) * 36); }
.art-head { padding-top: clamp(24px, 4.5svh, 56px); }
.art-head .display { max-width: none; }
.meta { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
.art-media { margin-top: clamp(24px, 4svh, 44px); }
.art-media img { width: 100%; }
.gh-content > *, .gh-content .kg-card, .gh-content .kg-width-wide, .gh-content .kg-gallery-card, .art-foot, figcaption { max-width: none; }
.gh-content .kg-width-full { width: 100%; }
.read-next, .art-comments { max-width: calc(var(--t-read) * 36); }

@media (max-width: 900px), (orientation: portrait) {
    .index { margin-top: 24px; }
    .list-head { grid-template-columns: auto 1fr; }
    .entry-row, .entry-row.has-thumb { grid-template-columns: 1fr auto; }
    .e-thumb { display: none; }
    .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* =====================================================================
   v2.2 · posts use the full width, like the list.
   The body reads like the ledger: section headings in the left column,
   text in the right, one hairline across both between sections.
   ===================================================================== */
.article, .read-next, .art-comments { max-width: none; }
.art-head .display { max-width: 24ch; }
.art-head .lede { max-width: 60ch; }
.meta { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.art-media img { width: 100%; }

.gh-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: calc(var(--gut) * 2);
    align-items: start;
}
.gh-content > * { grid-column: 2; max-width: 72ch; margin-top: 1.05em; }
.gh-content > :first-child { margin-top: 0; }

/* Section heading: left column, numbered; a hairline runs across both columns */
.gh-content > h2 {
    grid-column: 1; margin-top: 2.4em; padding-top: .9em; border-top: 1px solid var(--rule);
    position: sticky; top: 16px;
}
.gh-content > h2 + * { margin-top: 2.4em; padding-top: .9em; border-top: 1px solid var(--rule); }
.gh-content > h2:first-child, .gh-content > h2:first-child + * { margin-top: 0; }

/* Media and wide cards run the full width */
.gh-content > figure, .gh-content > .kg-card.kg-image-card, .gh-content > .kg-gallery-card,
.gh-content > .kg-width-wide, .gh-content > .kg-width-full, .gh-content > .kg-embed-card,
.gh-content > .kg-video-card, .gh-content > hr, .gh-content > blockquote.kg-blockquote-alt {
    grid-column: 1 / -1; max-width: none;
}
.gh-content > pre, .gh-content > table { max-width: none; }

.art-foot { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: calc(var(--gut) * 2); align-items: start; }
.art-foot .sysline { grid-column: 1 / -1; }
.art-foot .byline { grid-column: 2; }

@media (max-width: 900px), (orientation: portrait) {
    .gh-content, .art-foot { grid-template-columns: 1fr; }
    .gh-content > *, .gh-content > h2, .art-foot .byline { grid-column: 1; }
    .gh-content > h2 { position: static; }
    .gh-content > h2 + * { border-top: 0; padding-top: 0; margin-top: .7em; }
    .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* one continuous hairline per section: no column gap, the heading carries the spacing */
.gh-content { column-gap: 0; }
.gh-content > h2 { padding-right: calc(var(--gut) * 2); }
.art-foot { column-gap: 0; }
.art-foot .byline { padding-left: 0; }

/* v2.3 · section headings scroll with the text (no stacking) */
.gh-content > h2 { position: static; top: auto; }

/* the mark always takes the ink, so it follows light and dark */
.brand { color: var(--ink); display: inline-flex; }
.brand-svg { display: block; height: clamp(16px, 1.25vw, 22px); width: auto; }
.brand-mask { display: inline-block; background: var(--ink);
    -webkit-mask: var(--logo) left center / contain no-repeat; mask: var(--logo) left center / contain no-repeat; }
.brand-mask img { display: block; height: clamp(18px, 1.5vw, 26px); width: auto; opacity: 0; }

/* =====================================================================
   v2.4 · back to one column. Head, facts, image, body and footer share
   one width, leaving a narrow free band on the right of the pane.
   ===================================================================== */
.article { width: min(84%, 1120px); max-width: none; }
.gh-content { display: block; column-gap: 0; }
.gh-content > *, .gh-content > h2, .gh-content > figure, .gh-content > pre, .gh-content > table,
.gh-content > .kg-card, .gh-content > .kg-width-wide, .gh-content > .kg-width-full, .gh-content > hr,
.gh-content > blockquote.kg-blockquote-alt { grid-column: auto; max-width: none; }
.gh-content > * + * { margin-top: 1.05em; }
.gh-content > h2 {
    display: grid; grid-template-columns: 2.4em 1fr; align-items: baseline;
    border-top: 1px solid var(--rule); padding: .9em 0 0; margin-top: 2.2em; position: static;
}
.gh-content > h2 + * { border-top: 0; padding-top: 0; margin-top: .7em; }
.gh-content > h2:first-child { margin-top: 0; }
.art-foot { display: grid; grid-template-columns: 1fr; row-gap: 22px; }
.art-foot .byline { grid-column: 1; }
@media (max-width: 900px), (orientation: portrait) { .article { width: 100%; } }

/* v2.5 · no rule under the claim; the list starts a little lower */
.pane-top { border-bottom: 0; }
.list-head { padding-top: clamp(34px, 6svh, 72px); }

/* v2.6 · post titles one notch smaller */
.art-head .display { font-size: clamp(28px, 3.3vw, 58px); }

/* v2.7 · under a post title: one line, nothing else */
.art-rule { border-top: 1px solid var(--ink); margin-top: clamp(6px, 1.4svh, 16px); }

/* v2.8 · a narrower left column, set apart from the record by one vertical line */
.sheet { grid-template-columns: minmax(210px, 20%) minmax(0, 1fr); }
.marks { border-right: 1px solid var(--rule); padding-right: calc(var(--gut) * 1.2); }
@media (max-width: 900px), (orientation: portrait) {
    .sheet { grid-template-columns: 1fr; }
    .marks { border-right: 0; padding-right: 0; }
}

/* v2.9 · more air between the line and the record; the article takes the spare room on the right */
.sheet { column-gap: clamp(48px, 6.2vw, 120px); }
.article { width: min(90%, 1120px); }
@media (max-width: 900px), (orientation: portrait) { .sheet { column-gap: 0; } .article { width: 100%; } }

/* =====================================================================
   v3.0 · reading hierarchy inside articles (long-form needs it).
   The site keeps one weight; the body of a post adds a medium step,
   real bold and italic, and a heading scale that reads at a glance.
   ===================================================================== */
.gh-content, .art-head .lede { font-synthesis: weight style; }
.gh-content { line-height: 1.58; }
.gh-content > * + * { margin-top: 1.15em; }

/* bold and italic, visible again */
.gh-content strong, .gh-content b { font-weight: 600; color: var(--ink); }
.gh-content em, .gh-content i { font-style: italic; }

/* H2: one step above the text, medium, numbered and ruled */
.gh-content > h2 {
    font-size: clamp(21px, 1.62vw, 30px); line-height: 1.25; font-weight: 500; letter-spacing: -0.012em;
    margin-top: 2.3em; padding-top: 0.85em; grid-template-columns: 2.1em 1fr;
}
.gh-content > h2::before { font-weight: 400; font-size: var(--t-small); transform: translateY(-0.15em); }
.gh-content > h2 + * { margin-top: 0.8em; }

/* H3: text size, medium weight, sentence case: a clear sub-step */
.gh-content h3 {
    font-size: var(--t-read); line-height: 1.35; font-weight: 500; text-transform: none; letter-spacing: -0.005em;
    color: var(--ink); margin-top: 1.9em;
}
.gh-content h3 + * { margin-top: 0.5em; }

/* H4 and below: the small caps label */
.gh-content h4, .gh-content h5, .gh-content h6 {
    font-size: var(--t-small); font-weight: 400; letter-spacing: 0; color: var(--ink-2); margin-top: 1.8em;
}
.gh-content h4 + *, .gh-content h5 + *, .gh-content h6 + * { margin-top: 0.45em; }

/* quotes: a quiet rule on the left */
.gh-content blockquote:not(.kg-blockquote-alt) { border-left: 1px solid var(--ink-3); padding-left: 1.2em; color: var(--ink-2); }

/* the standfirst under the title reads as an introduction */
.art-head .lede { font-size: clamp(19px, 1.42vw, 26px); line-height: 1.38; max-width: 52ch; }
/* H3 needs a weight that shows with or without the Medium file */
.gh-content h3 { font-weight: 600; }
.gh-content blockquote:not(.kg-blockquote-alt) { margin: 1.7em 0; }

/* =====================================================================
   v3.1 · calmer reading: no rule per section, a finer emphasis.
   Body text sits one tone softer (still AAA); emphasis rises in tone
   and gains a hair of weight, instead of turning heavy.
   ===================================================================== */
.gh-content { color: var(--ink-2); }
.gh-content a { color: var(--ink); }

/* emphasis: full ink plus a hair of weight (works with or without the Medium cut) */
.gh-content strong, .gh-content b {
    font-weight: 500; color: var(--ink); -webkit-text-stroke: 0.016em currentColor; paint-order: stroke fill;
}

/* H2: no rule, space and number only */
.gh-content > h2 {
    border-top: 0; padding-top: 0; margin-top: 2.6em;
    font-size: clamp(20px, 1.5vw, 28px); font-weight: 400; color: var(--ink);
}
.gh-content > h2 + * { margin-top: 0.7em; }

/* H3: text size, full ink, the same fine emphasis */
.gh-content h3 {
    font-weight: 500; color: var(--ink); -webkit-text-stroke: 0.016em currentColor; paint-order: stroke fill; margin-top: 2em;
}

/* quotes: an indent, no side rule */
.gh-content blockquote:not(.kg-blockquote-alt) { border-left: 0; padding-left: 1.4em; color: var(--ink-2); font-style: italic; }

/* the highlighted figure, more contained */
.gh-content blockquote.kg-blockquote-alt { font-size: clamp(24px, 2.2vw, 40px); line-height: 1.12; letter-spacing: -0.015em; }

/* tables: header rule in the same quiet tone as the rest */
.gh-content th { border-bottom-color: var(--rule); }
.gh-content td, .gh-content li { color: inherit; }

/* v3.2 · no automatic numbers inside posts (the left index keeps its own) */
.gh-content > h2, .gh-content h2 { display: block; }
.gh-content > h2::before, .gh-content h2::before { content: none; counter-increment: none; }
.gh-content ol { list-style: decimal; }
.gh-content ol li::marker { font-size: inherit; color: var(--ink-3); }


/* =====================================================================
   v2.2 · Tools at the end of the menu: search and light / dark
   ===================================================================== */
.tools { display: flex; align-items: center; gap: 1.1em; color: var(--ink-2); }
.tools--menu {
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule);
    justify-content: space-between;
}
.marks-panel > .tools--menu:first-child { margin-top: clamp(22px, 3.5svh, 40px); }
.tools--top { display: none; }

/* Search: a quiet field-like line, easy to find, nothing loud */
.t-search {
    display: inline-flex; align-items: center; gap: .55em; flex: 1; min-width: 0;
    color: var(--ink-2); transition: color 200ms ease;
}
.t-search svg { width: 1.05em; height: 1.05em; flex: none; }
.t-search:hover { color: var(--ink); }
.t-kbd {
    margin-left: .35em; font-family: inherit; color: var(--ink-3); font-size: calc(var(--t-small) * .8);
    letter-spacing: 0; border: 1px solid var(--rule); padding: .1em .45em; line-height: 1.3;
}

/* Light / dark: two words, the current one in full ink */
.t-theme { display: inline-flex; align-items: baseline; flex: none; color: var(--ink-3); }
.t-theme i { font-style: normal; margin: 0 .35em; }
.t-theme span { transition: color 200ms ease; }
.t-theme:hover span { color: var(--ink-2); }
:root:not([data-theme="dark"]) .t-theme .t-l,
:root[data-theme="dark"] .t-theme .t-d { color: var(--ink); }

/* Icon buttons for the compact top bar */
.t-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--ink); }
.t-icon svg { width: 18px; height: 18px; }
.t-icon .moon { display: none; }
:root[data-theme="dark"] .t-icon .sun { display: none; }
:root[data-theme="dark"] .t-icon .moon { display: block; }

@media (max-width: 900px), (orientation: portrait) {
    .tools--top { display: flex; margin-left: auto; margin-right: 14px; gap: 6px; }
    .tools--menu { display: none; }
}


/* =====================================================================
   Predicterra touches: the wordmark with its corner bracket, an orange
   square for "you are here", and the bracket frame on feature images.
   ===================================================================== */
.logotype {
    position: relative; display: inline-block; font-weight: 500; letter-spacing: -.03em;
    font-size: clamp(20px, 1.5vw, 26px); line-height: 1; padding: .14em 0 0 .14em; color: var(--ink);
}
.logotype::before {
    content: ""; position: absolute; left: 0; top: 0; width: .3em; height: .3em;
    border-left: .09em solid var(--accent); border-top: .09em solid var(--accent);
}
.display { letter-spacing: -.02em; }
::selection { background: var(--accent); color: #FFFFFF; }

/* current topic and current section: an orange square takes the number's place */
.idx.is-current::before, .toc-list a.is-current::before {
    content: ""; width: 7px; height: 7px; background: var(--accent); align-self: center; transform: translateY(-.05em);
}

/* each section of a post opens with a short orange tick */
.gh-content > h2 { position: relative; }
.gh-content > h2::after { content: ""; position: absolute; left: 0; top: -.75em; width: 24px; height: 2px; background: var(--accent); }

/* feature image framed by the product's corner brackets */
.framed { position: relative; display: block; }
.framed::before, .framed::after { content: ""; position: absolute; width: 26px; height: 26px; border: 0 solid var(--accent); pointer-events: none; }
.framed::before { left: -1px; top: -1px; border-left-width: 3px; border-top-width: 3px; }
.framed::after { right: -1px; bottom: -1px; border-right-width: 3px; border-bottom-width: 3px; }

/* list rows: the arrow turns orange on hover */
.entry-row:hover .e-go { color: var(--accent); }
