/* ============================================================
   ledger-terminal — aivelihood
   Ink-dark, mono-led. One loss-red accent, no decoration.
   ============================================================ */

:root {
    --bg: #0E0E0D;
    --bg-2: #161614;
    --bg-3: #1C1C19;
    --fg: #EDEAE3;
    --fg-86: rgba(237, 234, 227, 0.86);
    --fg-60: rgba(237, 234, 227, 0.60);
    --fg-45: rgba(237, 234, 227, 0.52);
    --rule: rgba(237, 234, 227, 0.13);
    --rule-strong: rgba(237, 234, 227, 0.30);
    --loss: #C43C2A;
    --loss-fill: #B4341F;
    --loss-text: #E4644D;

    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

    --page: 1140px;
    --pad: clamp(20px, 5vw, 56px);
    --measure: 72ch;
    --head: 64px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--head) + 24px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 15.5px;
    line-height: 1.8;
    font-variant-ligatures: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--loss); color: var(--fg); }

:focus-visible {
    outline: 1px solid var(--loss-text);
    outline-offset: 3px;
}

.sr {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--fg); color: var(--bg);
    padding: 10px 16px; font-size: 12px;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- utilities ---------- */

.wrap {
    width: 100%;
    max-width: var(--page);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.mono-label {
    margin: 0;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-60);
}

.mono-small {
    margin: 0;
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.6;
    letter-spacing: 0.03em;
    color: var(--fg-60);
    font-variant-numeric: tabular-nums;
}

.prompt { color: var(--loss-text); margin-right: 2px; }
.sep { color: var(--fg-45); padding-inline: 2px; }
.arrow { display: inline-block; transition: transform 0.25s cubic-bezier(.2,.7,.3,1); }

.cursor {
    display: inline-block;
    width: 0.52em;
    height: 0.08em;
    background: var(--loss);
    vertical-align: baseline;
    margin-left: 0.06em;
    margin-bottom: 0.12em;
    animation: blink 1.1s steps(1, end) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* ---------- header ---------- */

.site-head {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--head);
    background: rgba(14, 14, 13, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
}

.head-inner {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
    height: var(--head);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--fg);
}
.wordmark-cursor {
    display: inline-block;
    width: 7px;
    height: 13px;
    background: var(--loss);
    animation: blink 1.1s steps(1, end) infinite;
}
.wordmark:hover .wordmark-cursor { background: var(--fg); }

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 26px);
    margin-left: auto;
}
.site-nav ul {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 26px);
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav ul a,
.nav-link {
    position: relative;
    display: inline-block;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: var(--fg-60);
    padding-block: 4px;
    transition: color 0.16s ease;
}
.site-nav ul a::before {
    content: "./";
    color: var(--fg-45);
    margin-right: 1px;
}
.site-nav ul a:hover,
.nav-link:hover { color: var(--fg); }
.site-nav ul .nav-current > a { color: var(--fg); }
.site-nav ul .nav-current > a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--loss);
}

.nav-cta {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bg);
    background: var(--fg);
    padding: 7px 13px;
    transition: background 0.16s ease, color 0.16s ease;
}
.nav-cta:hover { background: var(--loss); color: var(--fg); }

.clock {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    color: var(--fg-45);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 10px;
    margin-right: -10px;
    cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    display: block;
    width: 18px; height: 1px;
    background: var(--fg);
    content: "";
    position: relative;
    transition: transform 0.22s ease, opacity 0.2s ease;
}
.nav-toggle-bars::before { position: absolute; top: -5px; }
.nav-toggle-bars::after { position: absolute; top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

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

.masthead {
    padding-top: clamp(44px, 8vw, 96px);
    padding-bottom: clamp(36px, 5vw, 64px);
}

.mast-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fg-45);
    margin-bottom: clamp(18px, 2.6vw, 28px);
    text-transform: none;
    letter-spacing: 0.04em;
    font-size: 11.5px;
}

.mast-title {
    margin: 0;
    font-family: var(--mono);
    font-weight: 400;
    font-size: clamp(2.05rem, 5.6vw, 4.35rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
    color: var(--fg);
    text-wrap: balance;
}

.mast-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: clamp(26px, 5vw, 72px);
    align-items: start;
    margin-top: clamp(28px, 4.4vw, 48px);
    padding-top: clamp(20px, 2.6vw, 28px);
    border-top: 1px solid var(--rule);
}

.mast-lead {
    margin: 0;
    max-width: 52ch;
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--fg-60);
    text-wrap: pretty;
}

.mast-facts { margin: 0; display: grid; }
.fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-top: 1px dotted var(--rule);
}
.fact:first-child { border-top: 1px solid var(--rule-strong); }
.fact dt { color: var(--fg-45); text-transform: none; letter-spacing: 0.04em; font-size: 11px; }
.fact-value {
    margin: 0;
    font-size: 12px;
    color: var(--fg-86);
    font-variant-numeric: tabular-nums;
}

.masthead--tag .mast-title--tag { font-size: clamp(1.7rem, 4.4vw, 3rem); }
.mast-count { margin-top: 20px; }

/* ---------- the log ---------- */

.log-block { padding-bottom: clamp(40px, 6vw, 80px); }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule-strong);
}
.section-head-note { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }

.log,
.ledger {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* latest entry */

.log-head { border-bottom: 1px solid var(--rule); }

.head-link {
    display: block;
    padding: clamp(24px, 3.4vw, 38px) 0 clamp(26px, 3.8vw, 42px);
}
.head-kicker {
    color: var(--fg-45);
    margin-bottom: 16px;
    text-transform: none;
    letter-spacing: 0.04em;
    font-size: 11.5px;
}
.head-title {
    margin: 0;
    max-width: 26ch;
    font-family: var(--mono);
    font-weight: 500;
    font-size: clamp(1.35rem, 3.1vw, 2.15rem);
    line-height: 1.24;
    letter-spacing: -0.025em;
    color: var(--fg);
    transition: color 0.16s ease;
}
.head-excerpt {
    margin: 14px 0 0;
    max-width: 66ch;
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--fg-60);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.head-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 22px;
    color: var(--fg-86);
    text-transform: lowercase;
    letter-spacing: 0.04em;
    font-size: 11.5px;
}
.head-link:hover .head-title { color: var(--loss-text); }
.head-link:hover .head-more { color: var(--loss-text); }
.head-link:hover .head-more .arrow { transform: translateX(4px); }

/* log rows with dotted leaders */

.log-row,
.ledger-row { border-bottom: 1px solid var(--rule); }

.row-link {
    display: grid;
    grid-template-columns: 6.6rem minmax(0, auto) minmax(2rem, 1fr) auto;
    align-items: baseline;
    gap: 12px;
    padding: 13px 8px 13px 6px;
    border-left: 1px solid transparent;
    transition: background 0.16s ease, border-color 0.16s ease;
}
.row-link:hover {
    background: var(--bg-2);
    border-left-color: var(--loss);
}

.row-date { font-size: 11px; color: var(--fg-45); }
.row-title {
    font-size: clamp(0.92rem, 1.5vw, 1.02rem);
    line-height: 1.45;
    letter-spacing: -0.005em;
    color: var(--fg-86);
    text-wrap: pretty;
}
.row-leader {
    align-self: end;
    height: 0.62em;
    border-bottom: 1px dotted rgba(237, 234, 227, 0.22);
    transition: border-color 0.16s ease;
}
.row-read { font-size: 10.5px; color: var(--fg-45); white-space: nowrap; }
.row-link:hover .row-title { color: var(--fg); }
.row-link:hover .row-leader { border-bottom-color: rgba(228, 100, 77, 0.6); }
.row-link:hover .row-date { color: var(--fg-60); }

.pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
}
.pager-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--fg-60);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    transition: color 0.16s ease;
}
.pager-link:hover { color: var(--fg); }
.pager-link:hover .arrow { transform: translateX(4px); }

/* ---------- about strip ---------- */

.about-strip {
    background: var(--bg-2);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding-block: clamp(40px, 5.4vw, 72px);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(22px, 4vw, 52px);
}

.about-col { border-top: 1px solid var(--rule-strong); padding-top: 14px; }
.about-text {
    margin: 12px 0 0;
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--fg-60);
    max-width: 38ch;
}

/* ---------- subscribe ---------- */

.subscribe {
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding-block: clamp(44px, 6.4vw, 80px);
}

.sub-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: clamp(26px, 5vw, 64px);
    align-items: end;
}

.sub-title {
    margin: 14px 0 0;
    font-family: var(--mono);
    font-weight: 400;
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
    line-height: 1.3;
    letter-spacing: -0.02em;
    max-width: 32ch;
    color: var(--fg);
    text-wrap: balance;
}

.sub-note-copy {
    margin: 14px 0 0;
    max-width: 50ch;
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--fg-60);
}

.sub-form {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--rule-strong);
    transition: border-color 0.18s ease;
}
.sub-form:focus-within { border-color: var(--loss-text); }

.sub-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    padding: 12px 2px;
    color: var(--fg);
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.02em;
}
.sub-input::placeholder { color: var(--fg-45); }
.sub-input:focus { outline: none; }

.sub-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--loss-fill);
    color: var(--fg);
    border: 0;
    padding: 11px 18px;
    margin-left: 12px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s ease;
}
.sub-btn:hover { background: #9E2E1E; }
.sub-btn:hover .sub-btn-arrow { transform: translateX(3px); }
.sub-btn-arrow { transition: transform 0.18s ease; }

.sub-fineprint { margin-top: 10px; font-size: 10.5px; }

.sub-status { margin: 9px 0 0; font-size: 11px; color: var(--loss-text); }
.sub-status:empty { display: none; }

.sub-form.loading { opacity: 0.7; }
.sub-form.loading .sub-btn-label::after { content: "…"; }

.sub-form.success { border-color: var(--rule-strong); }
.sub-form.success .sub-input,
.sub-form.success .sub-btn { display: none; }
.sub-form.success::before {
    content: "\2192";
    color: var(--loss-text);
    margin-right: 8px;
    padding: 12px 0;
}
.sub-form.success::after {
    content: "sent — check your inbox to confirm.";
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    padding: 12px 0;
    color: var(--fg);
}

.sub-form.error { border-color: var(--loss-text); }
.sub-form.error .sub-input::placeholder { color: var(--loss-text); }

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

.progress {
    position: fixed;
    top: var(--head);
    left: 0; right: 0;
    height: 1px;
    z-index: 39;
    pointer-events: none;
}
.progress-bar {
    display: block;
    height: 1px;
    width: 100%;
    background: var(--loss);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.08s linear;
}

.entry-head { padding-top: clamp(36px, 6vw, 80px); }
.entry-head-inner { max-width: 940px; }

.entry-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    color: var(--fg-45);
    margin-bottom: clamp(16px, 2.4vw, 26px);
    text-transform: none;
    letter-spacing: 0.04em;
    font-size: 11.5px;
}
.entry-kicker-tag { color: var(--loss-text); }
.entry-kicker-tag:hover { text-decoration: underline; text-underline-offset: 3px; }

.entry-title {
    margin: 0;
    font-family: var(--mono);
    font-weight: 500;
    font-size: clamp(1.75rem, 4.4vw, 3.1rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
    color: var(--fg);
    max-width: 24ch;
    text-wrap: balance;
}
.entry-title--page { max-width: 28ch; }

.entry-standfirst {
    margin: clamp(18px, 2.6vw, 26px) 0 0;
    max-width: 62ch;
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    line-height: 1.8;
    color: var(--fg-60);
    text-wrap: pretty;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px clamp(18px, 3.6vw, 44px);
    margin-top: clamp(22px, 3vw, 32px);
    padding-top: 12px;
    border-top: 1px solid var(--rule);
}
.entry-meta-item { display: flex; flex-direction: column; gap: 2px; }
.entry-meta-item--end { margin-left: auto; text-align: right; }
.entry-meta-label {
    font-size: 9.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fg-45);
}
.entry-meta-value {
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: var(--fg-86);
    font-variant-numeric: tabular-nums;
}
a.entry-meta-value:hover { color: var(--loss-text); }

.entry-media { margin-top: clamp(28px, 4vw, 48px); }
.entry-media img { width: 100%; }
.entry-media figcaption { margin-top: 8px; }

.entry-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: clamp(28px, 5vw, 76px);
    align-items: start;
    padding-top: clamp(28px, 4vw, 48px);
    padding-bottom: clamp(40px, 6vw, 76px);
    border-top: 1px solid var(--rule);
    margin-top: clamp(28px, 4vw, 48px);
}

.entry-body--page { grid-template-columns: minmax(0, 1fr); }
.entry-body--page .content { max-width: var(--measure); }

.entry-aside {
    position: sticky;
    top: calc(var(--head) + 24px);
    display: grid;
    gap: 20px;
}

.aside-block { display: grid; gap: 2px; }
.aside-value {
    margin: 8px 0 0;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--fg-86);
    font-variant-numeric: tabular-nums;
}
.aside-value .mono-small { display: block; margin-top: 2px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag-chip {
    display: inline-block;
    padding: 3px 7px;
    border: 1px solid var(--rule);
    color: var(--fg-60);
    letter-spacing: 0.04em;
    font-size: 10.5px;
    transition: border-color 0.16s ease, color 0.16s ease;
}
.tag-chip:hover { border-color: var(--loss-text); color: var(--fg); }

.toc {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    counter-reset: toc;
    display: grid;
    gap: 6px;
}
.toc li { counter-increment: toc; }
.toc a {
    display: grid;
    grid-template-columns: 1.5rem 1fr;
    gap: 4px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--fg-60);
    transition: color 0.16s ease;
}
.toc a::before {
    content: counter(toc, decimal-leading-zero);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    color: var(--fg-45);
    padding-top: 1px;
    font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--fg); }
.toc a:hover::before { color: var(--loss-text); }
.toc a.is-active { color: var(--fg); }
.toc a.is-active::before { color: var(--loss-text); }

.entry-end {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: clamp(36px, 5vw, 56px);
    padding-top: 14px;
    border-top: 1px solid var(--rule-strong);
}
.entry-end-label { text-transform: lowercase; letter-spacing: 0.06em; font-size: 11px; color: var(--fg-60); }
.entry-end-permalink { margin-left: auto; }

.entry-foot {
    border-top: 1px solid var(--rule-strong);
    padding-top: 18px;
    padding-bottom: clamp(36px, 5.4vw, 64px);
}

.entry-next {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(18px, 4vw, 48px);
    margin-top: 18px;
}

.next-link {
    display: block;
    padding: 16px 0;
    border-top: 1px solid var(--rule);
    transition: border-color 0.16s ease;
}
.next-link:hover { border-color: var(--loss-text); }
.next-link--right { text-align: right; }
.next-dir { display: block; text-transform: lowercase; letter-spacing: 0.06em; font-size: 10.5px; }
.next-link:hover .next-dir { color: var(--loss-text); }
.next-link:hover .arrow { transform: translateX(4px); }
.next-title {
    display: block;
    margin-top: 6px;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--fg);
}
.next-date { display: block; margin-top: 7px; font-size: 10px; }

/* ---------- content ---------- */

.content {
    max-width: var(--measure);
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--fg-86);
    overflow-wrap: break-word;
}

.content > * + * { margin-top: 1.35em; }
.content p { margin: 0 0 1.4em; }
.content p:last-child { margin-bottom: 0; }

.content h2,
.content h3 {
    font-family: var(--mono);
    color: var(--fg);
    text-wrap: balance;
}
.content h2 {
    position: relative;
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.02em;
    margin: 2.4em 0 0.7em;
    padding-top: 0.9em;
    padding-left: 1.9em;
    border-top: 1px solid var(--rule);
}
.content h2::before {
    content: "##";
    position: absolute;
    left: 0;
    top: 0.95em;
    color: var(--loss-text);
    font-size: 0.8em;
    letter-spacing: 0.02em;
}
.content h3 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.45;
    margin: 1.9em 0 0.5em;
    color: var(--fg);
}
.content h4 {
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 2em 0 0.7em;
    color: var(--fg-60);
}

.content a {
    color: var(--fg);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    text-decoration-color: var(--rule-strong);
    transition: color 0.16s ease, text-decoration-color 0.16s ease;
}
.content a:hover { color: var(--loss-text); text-decoration-color: var(--loss-text); }

.content strong { font-weight: 600; color: var(--fg); }
.content em { font-style: italic; }

.content ul,
.content ol { margin: 0 0 1.4em; padding-left: 1.2em; }
.content li { margin-bottom: 0.45em; }
.content li::marker { color: var(--fg-45); }
.content ul li::marker { content: "— "; }
.content li > ul,
.content li > ol { margin-top: 0.45em; }

.content blockquote {
    margin: 1.9em 0;
    padding: 2px 0 2px 20px;
    border-left: 1px solid var(--loss);
    color: var(--fg);
    font-style: italic;
}
.content blockquote p { margin: 0 0 0.7em; }
.content blockquote cite { font-size: 11px; font-style: normal; color: var(--fg-45); }

.content hr {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 2.4em 0;
}

.content code {
    font-family: var(--mono);
    font-size: 0.86em;
    background: var(--bg-3);
    border: 1px solid var(--rule);
    padding: 1px 5px;
    color: var(--fg);
}

.content pre {
    background: #080807;
    border: 1px solid var(--rule);
    padding: 16px 18px;
    overflow-x: auto;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--fg-86);
    tab-size: 2;
}
.content pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.content figure { margin: 1.9em 0; }
.content figure img { width: 100%; }
.content figcaption {
    margin-top: 8px;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: var(--fg-45);
}

.content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    margin: 1.9em 0;
}
.content th,
.content td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); }
.content th {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 10px;
    color: var(--fg-45);
    border-bottom-color: var(--rule-strong);
}
.content td { font-variant-numeric: tabular-nums; color: var(--fg-60); }

.content sup {
    font-size: 0.7em;
    line-height: 0;
    vertical-align: super;
}
.content sup a { text-decoration: none; color: var(--loss-text); }

.content .footnotes {
    margin-top: 2.6em;
    padding-top: 14px;
    border-top: 1px solid var(--rule-strong);
    font-size: 0.8rem;
    color: var(--fg-60);
}
.content .footnotes ol { padding-left: 1.3em; }
.content .footnotes li { margin-bottom: 0.5em; }
.content .footnotes p { margin: 0; }

/* Ghost cards */

.content .kg-card { margin: 1.9em 0; }
.content .kg-image-card img { width: 100%; }

.content .kg-width-wide,
.content .kg-width-full { max-width: none; }
@media (min-width: 901px) {
    .content .kg-width-wide,
    .content .kg-width-full { margin-right: calc(-200px - clamp(28px, 5vw, 76px)); }
}
@media (max-width: 900px) {
    .content .kg-width-wide,
    .content .kg-width-full { margin-inline: 0; }
}

.content .kg-bookmark-card { border: 1px solid var(--rule); }
.content .kg-bookmark-container { display: flex; text-decoration: none; }
.content .kg-bookmark-content { padding: 14px 18px; flex: 1; }
.content .kg-bookmark-title { font-weight: 500; font-size: 0.9rem; color: var(--fg); }
.content .kg-bookmark-description { font-size: 0.8rem; color: var(--fg-60); margin-top: 4px; }
.content .kg-bookmark-metadata {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px;
    font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--fg-45);
}
.content .kg-bookmark-icon { width: 16px; height: 16px; }
.content .kg-bookmark-thumbnail img { width: 130px; height: 100%; object-fit: cover; }

.content .kg-callout-card {
    border: 1px solid var(--rule);
    border-left: 1px solid var(--loss);
    background: var(--bg-2);
    padding: 16px 20px;
}
.content .kg-callout-text { font-size: 0.88rem; }

.content .kg-gallery-container { display: flex; flex-direction: column; gap: 6px; }
.content .kg-gallery-row { display: flex; gap: 6px; }
.content .kg-embed-card iframe { width: 100%; }
.content .kg-video-card video { width: 100%; }
.content .kg-toggle-card { border: 1px solid var(--rule); padding: 4px 16px; }

/* ---------- error ---------- */

.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding-block: clamp(56px, 11vw, 130px);
}
.error-title {
    margin: 16px 0 0;
    font-family: var(--mono);
    font-weight: 500;
    font-size: clamp(1.5rem, 3.6vw, 2.4rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
}
.error-text { margin: 16px 0 0; max-width: 52ch; color: var(--fg-60); font-size: 0.9rem; }
.error-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 28px;
    color: var(--fg);
    letter-spacing: 0.04em;
    font-size: 11.5px;
}
.error-link:hover { color: var(--loss-text); }
.error-link:hover .arrow { transform: translateX(-4px); }

/* ---------- footer ---------- */

.site-foot {
    padding-top: clamp(36px, 5.4vw, 60px);
    padding-bottom: 28px;
}

.foot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.7fr) minmax(0, 1fr);
    gap: clamp(22px, 4vw, 52px);
}

.foot-statement {
    margin: 12px 0 0;
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    line-height: 1.6;
    max-width: 34ch;
    color: var(--fg-86);
}

.foot-link,
.foot-index li a {
    display: block;
    margin-top: 8px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--fg-60);
    transition: color 0.16s ease;
}
.foot-index ul { list-style: none; margin: 0; padding: 0; }
.foot-index li a::before { content: "./"; color: var(--fg-45); }
.foot-link:hover,
.foot-index li a:hover { color: var(--loss-text); }

.foot-note { margin: 12px 0 0; font-size: 0.82rem; line-height: 1.8; color: var(--fg-45); }
.foot-note code { color: var(--fg-60); }

.foot-rule { height: 1px; background: var(--rule); margin: clamp(28px, 4.4vw, 44px) 0 16px; }

.foot-base {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.foot-base a { text-decoration: underline; text-underline-offset: 3px; }
.foot-base a:hover { color: var(--loss-text); }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
    .clock { display: none; }
}

@media (max-width: 900px) {
    .mast-body { grid-template-columns: 1fr; gap: 26px; }
    .about-grid { grid-template-columns: 1fr; gap: 26px; }
    .sub-inner { grid-template-columns: 1fr; align-items: start; gap: 26px; }
    .entry-body { grid-template-columns: 1fr; gap: 34px; }
    .entry-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .foot-grid { grid-template-columns: 1fr 1fr; }
    .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    body { font-size: 15px; }

    .nav-toggle { display: block; margin-left: auto; }

    .site-nav {
        position: fixed;
        inset: var(--head) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-left: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--rule);
        padding: 6px var(--pad) 20px;
        transform: translateY(-6px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease, transform 0.22s ease;
    }
    .site-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
    .site-nav ul li { border-bottom: 1px solid var(--rule); }
    .site-nav ul a { padding-block: 12px; font-size: 12.5px; }
    .site-nav ul .nav-current > a::after { display: none; }
    .nav-cta { margin-top: 12px; text-align: center; }

    .row-link {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title title"
            "date  read";
        row-gap: 4px;
        padding: 12px 6px;
    }
    .row-title { grid-area: title; }
    .row-date { grid-area: date; }
    .row-read { grid-area: read; text-align: right; }
    .row-leader { display: none; }

    .entry-next { grid-template-columns: 1fr; gap: 0; }
    .next-link--right { text-align: left; }

    .sub-form { flex-wrap: wrap; }
    .sub-btn { margin: 10px 0 0; width: 100%; justify-content: center; }

    .foot-grid { grid-template-columns: 1fr; }
    .entry-aside { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .cursor, .wordmark-cursor { animation: none; opacity: 1; }
}

@media print {
    .site-head, .site-foot, .subscribe, .entry-aside, .entry-foot, .entry-subscribe, .progress { display: none; }
    body { background: #fff; color: #000; }
}
