/* JETSKI blog: modern reading layout for the post list and articles.
   The pixel-font header, tabs and footer come from site.css. */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/inter-latin-wght-italic.woff2') format('woff2');
}

html {
    scroll-behavior: smooth;
}

.blog-main {
    --ink: #f5f1fc;
    --ink-body: rgba(245, 241, 252, 0.84);
    --ink-muted: rgba(245, 241, 252, 0.6);
    --ink-faint: rgba(245, 241, 252, 0.42);
    --line: rgba(255, 255, 255, 0.1);
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
        'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
    --font-mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    --header-offset: 110px;

    flex: 1;
    width: 100%;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--ink-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.blog-main a:focus-visible,
.blog-main button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Entrance: content rises out of a blur once site.js reveals the page; --d staggers it */
.reveal {
    opacity: 0;
    animation: blogRise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: var(--d, 0.15s);
    animation-play-state: paused;
}

body.revealed .reveal {
    animation-play-state: running;
}

@keyframes blogRise {
    from { opacity: 0; transform: translateY(18px); filter: blur(10px); }
    to { opacity: 1; transform: none; filter: none; }
}

/* ---------- Post list ---------- */
.blog-index {
    max-width: 1200px;
    margin: 0 auto;
    padding: 88px 32px 112px;
}

.blog-hero {
    margin-bottom: 48px;
}

.blog-title {
    margin: 0;
    font-size: clamp(2.5rem, 1.6rem + 3vw, 3.5rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.blog-lede {
    max-width: 560px;
    margin: 18px 0 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink-muted);
}

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: 0 0 36px;
}

.blog-filter {
    /* Padding for a finger-sized target; the negative margin keeps the spacing as it was */
    padding: 10px 8px;
    margin: -10px -8px;
    font-size: 1.0625rem;
    color: var(--ink-faint);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-filter:hover,
.blog-filter[aria-current="true"] {
    color: var(--ink);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 56px 24px;
}

.post-card {
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.post-card[hidden] {
    display: none;
}

.card-cover {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #0d0717;
}

/* Generated cover: soft blobs of the category colour and two brand colours (variables set per post) */
.card-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background:
        radial-gradient(70% 70% at var(--x1) var(--y1), color-mix(in srgb, var(--c1) 78%, transparent) 0%, transparent 70%),
        radial-gradient(65% 65% at var(--x2) var(--y2), color-mix(in srgb, var(--c2) 88%, transparent) 0%, transparent 72%),
        radial-gradient(80% 80% at var(--x3) var(--y3), color-mix(in srgb, var(--c3) 72%, transparent) 0%, transparent 76%),
        linear-gradient(var(--a, 160deg), #1b0c30, #07030d);
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Film grain so the gradients don't band */
.card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.14;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.post-card:hover .card-art {
    transform: scale(1.04);
}

.card-draft,
.article-draft {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    background: rgba(255, 68, 68, 0.85);
}

.card-draft {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
}

.card-title {
    margin: 18px 0 10px;
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-wrap: pretty;
}

.post-card:hover .card-title {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-faint);
}

/* Newest post: spans the whole row with a wide cover and its summary */
.post-card--featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
}

.post-card--featured .card-cover {
    aspect-ratio: 16 / 10;
}

.post-card--featured .card-meta {
    margin-bottom: 18px;
}

.post-card--featured .card-title {
    margin: 0;
    font-size: clamp(1.625rem, 1.1rem + 1.4vw, 2.375rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.card-summary {
    margin: 18px 0 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink-muted);
    text-wrap: pretty;
}

.card-more {
    display: inline-block;
    margin-top: 26px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
}

.card-more span {
    display: inline-block;
    transition: transform 0.25s ease;
}

.post-card--featured:hover .card-more span {
    transform: translateX(4px);
}

.card-cat,
.article-cat {
    padding: 12px 0;
    margin: -12px 0;
    color: var(--ink);
}

.card-cat::before,
.article-cat::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    vertical-align: 1px;
    background: var(--cat);
    box-shadow: 0 0 8px var(--cat);
}

.blog-empty {
    padding: 96px 0;
    text-align: center;
    border-top: 1px solid var(--line);
}

.blog-empty-title {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.25rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.blog-empty p {
    margin: 0 0 28px;
    font-size: 1.0625rem;
    color: var(--ink-muted);
}

.blog-back {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    background: var(--surface);
    transition: background 0.2s ease;
}

.blog-back:hover {
    background: var(--surface-hover);
}

.draft-note {
    margin: 0 0 36px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #ffb4b4;
    background: rgba(255, 68, 68, 0.08);
    border: 1px solid rgba(255, 68, 68, 0.25);
}

.draft-note code {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

/* ---------- Article ---------- */
.article {
    padding: 104px 32px 120px;
}

.article-hero {
    max-width: 920px;
    margin: 0 auto;
    text-align: center;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink);
}

.article-cat {
    text-decoration: none;
    color: var(--ink-muted);
    transition: color 0.2s ease;
}

.article-cat:hover {
    color: var(--ink);
}

.article-author {
    color: var(--ink-muted);
}

.article-title {
    margin: 28px 0 0;
    font-size: clamp(2.25rem, 1.4rem + 3.2vw, 4rem);
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -0.03em;
    color: var(--ink);
    text-wrap: balance;
}

.article-dek {
    max-width: 620px;
    margin: 26px auto 0;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--ink-muted);
    text-wrap: pretty;
}

.article-note {
    max-width: 680px;
    margin: 40px auto 0;
}

.article-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    max-width: 680px;
    margin: 72px auto 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.article-read {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-faint);
}

.share {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: 500 0.875rem/1 var(--font-sans);
    color: var(--ink);
    text-decoration: none;
    background: var(--surface);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.share-btn:hover {
    background: var(--surface-hover);
}

.share-btn svg {
    width: 15px;
    height: 15px;
}

.share-btn.copied {
    border-color: rgba(0, 255, 170, 0.55);
}

.article-cover {
    max-width: 1040px;
    margin: 48px auto 0;
}

.article-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* ASCII art in place of the cover (ascii-visual.js decodes it in once); no frame, just the characters */
.article-ascii {
    max-width: 1040px;
    margin: 56px auto 0;
    container-type: inline-size;
    text-align: center;
}

.ascii-art {
    display: inline-block;
    margin: 0;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: clamp(5px, 1.05vw, 15px);
    font-size: min(15px, 100cqw / 46); /* 75 columns always fit the width */
    line-height: 1.22;
    color: var(--ink);
    text-align: left;
    white-space: pre;
}

/* Body column in the middle, "on this page" list pinned in the left gutter */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 680px) minmax(0, 1fr);
    column-gap: 48px;
    max-width: 1376px;
    margin: 56px auto 0;
}

.article-toc {
    grid-column: 1;
    justify-self: start;
}

.article-toc nav {
    position: sticky;
    top: var(--header-offset);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 210px;
}

.article-toc a {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--ink-faint);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-toc a:hover,
.article-toc a.active {
    color: var(--ink);
}

.article-body {
    grid-column: 2;
    min-width: 0;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink-body);
    overflow-wrap: break-word;
}

.article-body > :first-child {
    margin-top: 0;
}

.article-body > :last-child {
    margin-bottom: 0;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body dl,
.article-body pre,
.article-body figure,
.article-body .table-wrap {
    margin: 0 0 1.5em;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    font-weight: 500;
    color: var(--ink);
    scroll-margin-top: var(--header-offset);
    text-wrap: balance;
}

.article-body h2 {
    margin: 4rem 0 1rem;
    font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.article-body h3 {
    margin: 2.5rem 0 0.75rem;
    font-size: 1.3125rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.article-body h4 {
    margin: 2rem 0 0.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
}

.article-body a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.35);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.article-body a:hover {
    color: #ffb8e8;
    text-decoration-color: var(--pink);
}

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

.article-body ul,
.article-body ol {
    padding-left: 1.3em;
}

.article-body li {
    margin: 0.45em 0;
    padding-left: 0.2em;
}

.article-body li::marker {
    color: var(--ink-faint);
}

/* Pull quote card */
.article-body blockquote {
    margin: 2.5rem 0;
    padding: 28px 32px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    box-shadow: 0 24px 60px -32px rgba(153, 69, 255, 0.45);
    font-size: 1.1875rem;
    font-style: italic;
    line-height: 1.55;
    color: var(--ink);
}

.article-body blockquote > :last-child {
    margin-bottom: 0;
}

/* "— name" line closing a quote */
.article-body blockquote .quote-by {
    margin-top: 1.2em;
    font-size: 0.875rem;
    font-style: normal;
    line-height: 1.5;
    color: var(--ink-muted);
}

.article-body code {
    padding: 0.15em 0.4em;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.86em;
    font-style: normal;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.08);
}

.article-body pre {
    padding: 18px 20px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #0c0816;
    font-size: 0.875rem;
    line-height: 1.65;
}

.article-body pre code {
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: #e9e2f7;
    background: none;
}

.article-body .table-wrap {
    overflow-x: auto;
}

/* Thin dark scrollbars for wide code and tables (the default grey bar clashes on Windows) */
.article-body pre,
.article-body .table-wrap {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.article-body pre::-webkit-scrollbar,
.article-body .table-wrap::-webkit-scrollbar {
    height: 8px;
}

.article-body pre::-webkit-scrollbar-thumb,
.article-body .table-wrap::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.article-body th,
.article-body td {
    padding: 12px 16px 12px 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.article-body th {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-muted);
}

.article-body hr {
    height: 1px;
    margin: 3rem 0;
    border: 0;
    background: var(--line);
}

.article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
}

/* Figures run wider than the text column, clear of the "on this page" list. A figure holds an
   image, or an HTML diagram (.fig, below) included from blog/figures/ */
.article-body .post-figure {
    --fig: min(920px, calc(100vw - 48px));
    width: var(--fig);
    margin: 2.75rem 0 2.75rem calc((100% - var(--fig)) / 2);
}

.article-body .post-figure img {
    width: 100%;
    border-radius: 16px;
}

.article-body .post-figure figcaption {
    max-width: 680px;
    margin: 12px auto 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--ink-faint);
    text-align: center;
    text-wrap: pretty;
}

@media (min-width: 1200px) {
    .article-body .post-figure {
        --fig: clamp(680px, calc(100vw - 520px), 920px);
    }
}

@media (max-width: 720px) {
    .article-body .post-figure {
        --fig: 100%;
    }
}

/* HTML diagrams: the page's font and text sizes at any width, in black and white (white marks
   what the unlock changed, grey what was there before), except the SM map, where re-enabled
   SMs are blue. Each one rearranges itself when its box gets narrow. */
.article-body .fig {
    --fig-grey: rgba(245, 241, 252, 0.42);
    --fig-dim: rgba(245, 241, 252, 0.2);
    --fig-off: rgba(255, 255, 255, 0.12);
    container-type: inline-size;
    padding: 28px 32px 32px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--ink-muted);
}

.article-body .fig,
.article-body .fig *,
.article-body .fig *::before,
.article-body .fig *::after {
    box-sizing: border-box;
}

.article-body .fig :where(p, ul, ol, li) {
    margin: 0;
    padding: 0;
    list-style: none;
}

.article-body .fig b {
    font-weight: 600;
    color: var(--ink);
}

/* Short labels in narrow boxes: wrap into even lines instead of leaving one word behind */
.fig-steps :is(b, .step-text, em),
.fig-timeline :is(b, .what) {
    text-wrap: balance;
}

.article-body .fig-title {
    margin-bottom: 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
}

/* Bar chart: label beside the bar, above it when narrow */
.article-body .fig-bars li {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    align-items: center;
    gap: 6px 16px;
}

.article-body .fig-bars li + li {
    margin-top: 14px;
}

.fig-bars .is-key .bar-label {
    color: var(--ink);
}

.fig-bars .bar-track {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* --v is the bar's value out of 128; 4.5rem is kept for the number after the bar */
.fig-bars .bar {
    flex: none;
    width: calc((100% - 4.5rem) * var(--v) / 128);
    height: 14px;
    border-radius: 4px;
    background: var(--fig-grey);
}

.fig-bars .is-ref .bar {
    background: var(--fig-dim);
}

/* Solid up to --from, lighter up to --v */
.fig-bars .is-key .bar {
    background: linear-gradient(90deg, var(--ink) calc(var(--from) / var(--v) * 100%), var(--fig-grey) 0);
}

.fig-bars .is-ghost .bar {
    border: 1px dashed var(--fig-grey);
    background: none;
}

.fig-bars .bar-track b {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

@container (max-width: 460px) {
    .article-body .fig-bars li {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Numbered steps in a row, one under the other when narrow */
.article-body .fig-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
}

.article-body .fig-steps li {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.fig-steps li:not(:last-child)::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: -21px;
    width: 20px;
    line-height: 1;
    text-align: center;
    color: var(--ink-faint);
    transform: translateY(-50%);
}

.fig-steps .step-n {
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

.fig-steps b {
    line-height: 1.35;
}

.fig-steps .step-text {
    font-size: 0.8125rem;
    line-height: 1.4;
}

.article-body .fig-steps .is-key {
    border-color: rgba(245, 241, 252, 0.6);
    background: rgba(255, 255, 255, 0.06);
}

.fig-steps em {
    margin-top: auto;
    padding-top: 10px;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 500;
    color: var(--ink);
}

@container (max-width: 599px) {
    .article-body .fig-steps {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .article-body .fig-steps li {
        display: grid;
        grid-template-columns: 1.25rem minmax(0, 1fr);
        column-gap: 10px;
        padding: 12px 14px;
    }

    .fig-steps .step-n {
        grid-row: 1 / span 3;
        margin: 0;
        font-size: 0.8125rem;
        line-height: 1.35;
    }

    .fig-steps li:not(:last-child)::after {
        content: "↓";
        top: calc(100% + 1px);
        right: auto;
        left: 0;
        width: 100%;
        height: 14px;
        line-height: 14px;
        transform: none;
    }

    .fig-steps em {
        padding-top: 6px;
    }
}

/* Timeline: dates in a row joined by a line, one under the other when narrow */
.article-body .fig-timeline {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    text-align: center;
}

.article-body .fig-timeline li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 6px;
}

/* The dot, placed under the date */
.fig-timeline li::before {
    content: "";
    position: relative;
    z-index: 1;
    order: 1;
    width: 9px;
    height: 9px;
    margin: 10px 0 14px;
    border-radius: 50%;
    background: #8e8b92;
}

/* The line to the next dot */
.fig-timeline li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 34px;
    left: 50%;
    width: 100%;
    height: 1px;
    background: var(--fig-dim);
}

.fig-timeline .when {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
}

.article-body .fig-timeline b {
    order: 2;
    font-weight: 500;
    line-height: 1.35;
}

.fig-timeline .what {
    order: 3;
    margin-top: 2px;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.fig-timeline .is-key::before {
    background: var(--ink);
    box-shadow: 0 0 0 4px rgba(245, 241, 252, 0.16);
}

.fig-timeline .is-key .when {
    color: var(--ink);
}

@container (max-width: 599px) {
    .article-body .fig-timeline {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 18px;
        text-align: left;
    }

    .article-body .fig-timeline li {
        display: grid;
        grid-template-columns: 9px minmax(0, 1fr);
        column-gap: 16px;
        align-items: start;
        padding: 0;
    }

    .fig-timeline li::before {
        grid-column: 1;
        grid-row: 1;
        margin: 6px 0 0;
    }

    .fig-timeline .when,
    .fig-timeline b,
    .fig-timeline .what {
        grid-column: 2;
    }

    /* From under this dot down to the next one (18px gap + 6px) */
    .fig-timeline li:not(:last-child)::after {
        top: 15px;
        bottom: -24px;
        left: 4px;
        width: 1px;
        height: auto;
    }
}

/* SM map: two chips side by side, stacked when narrow */
.article-body .fig-map {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 40px;
}

.article-body .fig-map .fig-title {
    margin-bottom: 2px;
}

.article-body .fig-sub {
    margin-bottom: 16px;
    font-size: 0.8125rem;
}

.fig-map .map-die {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.fig-map .gpc {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    padding: 7px 8px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.fig-map .gpc span {
    grid-column: 1 / -1;
    margin-bottom: 4px;
    font-size: 0.6875rem;
    line-height: 1.2;
    white-space: nowrap;
}

.fig-map .gpc.is-off {
    border-color: rgba(255, 255, 255, 0.05);
}

.fig-map .gpc.is-off span {
    color: var(--ink-faint);
}

.fig-map i {
    display: block;
    aspect-ratio: 1;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px var(--fig-off);
}

.fig-map i.s {
    background: var(--ink);
    box-shadow: none;
}

.fig-map i.n {
    background: #5ee0ff;
    box-shadow: none;
}

.article-body .fig-legend {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 0.8125rem;
}

.article-body .fig-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fig-legend i {
    flex: none;
    width: 12px;
    height: 12px;
}

@container (max-width: 599px) {
    .article-body .fig-map {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    .article-body .fig {
        padding: 22px 18px 24px;
    }
}

.article-body .footnote {
    margin-top: 3rem;
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.article-body .footnote hr {
    margin: 0 0 1.5rem;
}

/* End-of-post facts, the width of the text column */
.article-end {
    max-width: 680px;
    margin: 104px auto 0;
}

.article-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 64px;
    padding: 28px 32px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background: var(--surface);
}

.info-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.8125rem;
    color: var(--ink-faint);
}

.info-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
}

.more-posts {
    max-width: 1376px;
    margin: 0 auto;
    padding: 0 32px 120px;
}

.more-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

.more-head h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.more-head a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
}

.more-head a:hover {
    text-decoration: underline;
}

/* ---------- Smaller screens ---------- */
/* Tools page: a card per file in blog/tools/, its visual on top of the text */
.tool-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.tool {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    /* Solid underneath, so the network background doesn't show through the text */
    background: linear-gradient(var(--surface), var(--surface)), #000;
    transition: border-color 0.2s ease;
}

.tool:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.tool-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px 24px 24px;
}

/* Same height with or without a status tag, so names line up across cards */
.tool-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    min-height: 24px;
    margin: 0 0 8px;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.tool-badge {
    padding: 3px 9px;
    line-height: 18px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.1);
}

.tool-badge.is-draft {
    color: #fff;
    background: rgba(255, 68, 68, 0.85);
}

.tool-name {
    margin: 0 0 10px;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.tool-body {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ink-body);
    text-wrap: pretty;
}

.tool-body p {
    margin: 0 0 0.75em;
}

.tool-body > :last-child {
    margin-bottom: 0;
}

.tool-body a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.35);
    text-underline-offset: 3px;
}

.tool-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.tool-platforms li {
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--ink-muted);
}

/* Buttons sit at the bottom, so cards side by side line them up */
.tool-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font: 500 0.875rem/1 var(--font-sans);
    color: var(--ink);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tool-link:hover {
    background: var(--surface-hover);
}

.tool-link.is-primary {
    border-color: var(--ink);
    color: #000;
    background: var(--ink);
}

.tool-link.is-primary:hover {
    background: #fff;
}

/* The visual panel: a dark stage for each tool's logo or picture.
   A fixed height keeps the text of cards side by side on the same line. */
.tool-visual {
    --tv-off: rgba(255, 255, 255, 0.12);
    display: grid;
    place-items: center;
    height: 232px;
    padding: 24px;
    border-bottom: 1px solid var(--line);
    background: radial-gradient(90% 80% at 50% 0%, rgba(255, 255, 255, 0.07), transparent 70%), #050505;
    font-size: 0.75rem;
    color: var(--ink-muted);
}

/* Tools without a visual: their icon, or the first letter of the name */
.tool-icon {
    width: 88px;
    height: 88px;
    border-radius: 20px;
    object-fit: cover;
}

.tool-monogram {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.tool-visual p,
.tool-visual ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tool-visual i,
.tool-visual em {
    display: block;
    font-style: normal;
}

/* CLOUDSKI: a white cloud with a soft glow */
.tv-cloud {
    width: min(62%, 190px);
    height: auto;
    filter: drop-shadow(0 16px 36px rgba(255, 255, 255, 0.12));
}

/* Logos: OCSKI's wide wordmark, NVPARADISE's chip above its name */
.tv-logo {
    width: min(88%, 280px);
    height: auto;
}

.tv-logo.is-stacked {
    width: min(70%, 230px);
}

@media (max-width: 1100px) {
    .tool-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .tool-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1199px) {
    .article-layout {
        grid-template-columns: minmax(0, 680px);
        justify-content: center;
    }

    .article-toc {
        display: none;
    }

    .article-body {
        grid-column: 1;
    }
}

@media (max-width: 960px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .blog-main {
        --header-offset: 24px;
    }

    .blog-index {
        padding: 48px 18px 80px;
    }

    .blog-hero {
        margin-bottom: 32px;
    }

    .card-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .card-cover {
        aspect-ratio: 16 / 10;
    }

    .post-card--featured {
        display: block;
    }

    .post-card--featured .card-body {
        margin-top: 18px;
    }

    .post-card--featured .card-meta {
        margin-bottom: 10px;
    }

    .card-summary {
        margin-top: 12px;
        font-size: 1rem;
    }

    .card-more {
        margin-top: 16px;
    }

    .article {
        padding: 56px 18px 88px;
    }

    .article-dek {
        font-size: 1.0625rem;
    }

    .article-bar {
        margin-top: 48px;
    }

    .article-ascii {
        margin-top: 40px;
    }

    .article-layout {
        margin-top: 40px;
    }

    .article-body {
        font-size: 1rem;
        line-height: 1.7;
    }

    .article-body h2 {
        margin-top: 3rem;
    }

    .article-body blockquote {
        padding: 22px 20px;
        font-size: 1.0625rem;
    }

    .article-end {
        margin-top: 72px;
    }

    .article-info {
        gap: 18px 40px;
        padding: 22px 20px;
    }

    .more-posts {
        padding: 0 18px 88px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .card-art {
        transition: none;
    }
}
