/* 1. Tokens + reset
/* ---------------------------------------------------------- */

/* IBM Plex Mono, self-hosted. The ASCII machine keeps the system monospace
   (--art): its drawings were made on a terminal grid and are measured in JS,
   so they must not shift when the webfont arrives. */
@font-face {
    font-family: "Plex Mono";
    src: url("fonts/plex-mono-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Plex Mono";
    src: url("fonts/plex-mono-400-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Plex Mono";
    src: url("fonts/plex-mono-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #000;
    --fg: #8fffe5;                          /* phosphor green, the body voice */
    --accent: #ffd1bf;                      /* warm secondary, for anything live or selected */
    --hot: #fff;

    /* Legibility first: these are deliberately high for a dark UI. */
    --dim: rgba(143, 255, 229, .82);
    --faint: rgba(143, 255, 229, .6);
    --line: rgba(143, 255, 229, .24);
    --line-soft: rgba(143, 255, 229, .12);

    --glow: 0 0 6px rgba(143, 255, 229, .45);
    --glow-accent: 0 0 8px rgba(255, 209, 191, .5);

    --art: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
    --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;

    /* One pair of curves for the whole site: things arrive on --out and
       swap places on --in-out. */
    --out: cubic-bezier(.16, 1, .3, 1);
    --in-out: cubic-bezier(.65, 0, .35, 1);

    --gutter: 28px;
    --measure: 720px;                       /* reading column */
    --wide: 920px;                          /* figures break out to this */

    color-scheme: dark;
}

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

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font: 15px/1.65 var(--mono);
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

body { min-height: 100vh; }

h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, pre {
    margin: 0;
    font-size: inherit;
    font-weight: 400;
}

img { max-width: 100%; height: auto; display: block; }

/* Lazy images are marked .pending by a line of script until they arrive, so
   they fade up instead of popping in. */
img,
video { transition: opacity .6s ease; }
img.pending { opacity: 0; }

a { color: var(--fg); text-decoration: none; }

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

::selection { background: var(--accent); color: #000; text-shadow: none; }

:focus-visible { outline: 1px dashed var(--accent); outline-offset: 3px; }

.inner { width: min(1180px, 100%); margin: 0 auto; padding: 0 var(--gutter); }

/* A bracketed terminal link: [ like this ]. The brackets step apart on hover. */
.bkt {
    display: inline-block;
    padding: 4px 2px;
    font-size: 14px;
    color: var(--dim);
    white-space: nowrap;
    transition: color .2s ease, text-shadow .2s ease;
}

.bkt .b {
    display: inline-block;
    transition: transform .35s var(--out);
}

.bkt:hover,
.bkt:focus-visible { color: var(--accent); text-shadow: var(--glow-accent); }

.bkt:hover .b:first-child,
.bkt:focus-visible .b:first-child { transform: translateX(-3px); }

.bkt:hover .b:last-child,
.bkt:focus-visible .b:last-child { transform: translateX(3px); }


/* 2. CRT overlay
/* ---------------------------------------------------------- */

.crt {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    background:
        repeating-linear-gradient(rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, .17) 2px 3px),
        radial-gradient(120% 100% at 50% 50%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .55) 100%);
}


/* 3. Intro — the washing machine
/* ---------------------------------------------------------- */

body.has-intro { overflow: hidden; }
body.has-intro.opened { overflow: auto; }

.intro {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
    padding: 16px;
    background: var(--bg);
}

/* A breath of phosphor bloom behind the drum, so the black has some depth. */
.intro::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(46% 42% at 50% 40%, rgba(143, 255, 229, .075), rgba(143, 255, 229, 0) 72%);
}

.stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 3vw, 44px);
    flex: none;
}

.scene { position: relative; flex: none; }

.rig { position: absolute; inset: 0; }

.ascii {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    font-family: var(--art);
    white-space: pre;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(143, 255, 229, .35);
}

.drum {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
}

/* Tumbling objects are pure decoration — the whole porthole is the target.
   The drawings were made in a terminal, whose cell is about twice as tall as
   it is wide. A monospace glyph advances 0.6em, so the leading has to be
   1.2em to match; leaving it at 1em is what flattens the artwork. */
.obj {
    position: absolute;
    left: 0;
    top: 0;
    color: inherit;
    font-family: var(--art);
    font-size: calc(8px * var(--k, 1));
    line-height: calc(9.6px * var(--k, 1));
    white-space: pre;
    pointer-events: none;
    text-shadow: 0 0 4px rgba(143, 255, 229, .5);
    will-change: transform;
}

/* The single hit target: the porthole. */
.machine-hit {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 2;
    cursor: pointer;
}

/* Dead centre of the drum, always shown on the home page; it glows on hover. */
.machine-hint {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    padding: 5px 11px;
    background: var(--bg);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 2px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease, box-shadow .3s ease, text-shadow .3s ease, letter-spacing .45s var(--out);
}

body:not(.opened):not(.closing) .machine-hint { opacity: 1; }

body:not(.opened):not(.closing) .machine-hit:hover ~ .machine-hint,
body:not(.opened):not(.closing) .machine-hit:focus-visible ~ .machine-hint {
    opacity: 1;
    letter-spacing: 3.5px;
    text-shadow: var(--glow-accent);
    box-shadow: 0 0 18px rgba(255, 209, 191, .35);
}

.blurb {
    flex: none;
    width: min(660px, 100%);
    text-align: center;
}

.blurb p {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.85;
    color: var(--dim);
    text-wrap: pretty;
}

.blurb b {
    font-weight: 500;
    font-size: 15px;
    letter-spacing: .5px;
    color: var(--accent);
    text-shadow: var(--glow-accent);
}

.blurb p a {
    color: inherit;
    border-bottom: 1px solid var(--line);
    transition: color .2s ease, text-shadow .2s ease, border-color .2s ease;
}

.blurb p a:hover,
.blurb p a:focus-visible { color: var(--accent); text-shadow: var(--glow-accent); border-bottom-color: var(--accent); }

.blurb strong { font-weight: 400; color: var(--fg); }

.blurb nav {
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
}


/* Labels beside the machine, each wired to one tumbling object. */
.rail {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: none;
    z-index: 3;
    font-size: 13.5px;
    letter-spacing: 1px;
    color: var(--dim);
    white-space: nowrap;
}

.rail-left { align-items: flex-end; }
.rail-right { align-items: flex-start; }

.wires {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.wires path {
    fill: none;
    stroke: rgba(143, 255, 229, .4);
    stroke-width: 1;
}

.wires circle {
    fill: #000;
    stroke: rgba(143, 255, 229, .75);
    stroke-width: 1;
}

/* Everything clickable on the front page is the highlight colour. */
.intro .bkt { color: rgba(255, 209, 191, .8); }
.intro .bkt:hover,
.intro .bkt:focus-visible { color: var(--accent); text-shadow: var(--glow-accent); }


/* 4. Arrival
/* ------------------------------------------------------------
   Played once per page load. Every animation fills backwards only,
   so once it ends the element is back under its ordinary rules and
   the door choreography below can transition it freely. The rails
   and wires only fade: the wires are drawn from measured positions
   and a moving label would leave its wire behind.
   ------------------------------------------------------------ */

@keyframes power-on {
    from { opacity: 0; filter: brightness(2.6); }
    55%  { opacity: 1; }
}

@keyframes fade-in {
    from { opacity: 0; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
}

@keyframes breathe {
    50% { box-shadow: 0 0 16px rgba(255, 209, 191, .32); }
}

@media (prefers-reduced-motion: no-preference) {
    .scene      { animation: power-on 1.2s var(--out) .1s backwards; }
    .blurb p    { animation: rise .9s var(--out) .4s backwards; }
    .blurb nav  { animation: rise .9s var(--out) .52s backwards; }
    .rail       { animation: fade-in .8s ease .8s backwards; }
    .wires      { animation: fade-in .9s ease 1.15s backwards; }

    .machine-hint { animation: breathe 3.2s ease-in-out 1.6s infinite; }
    .machine-hit:hover ~ .machine-hint { animation: none; }

    .post-head  { animation: rise .8s var(--out) .05s backwards; }
    .post-body,
    .post-foot  { animation: rise .9s var(--out) .18s backwards; }

    .error > *  { animation: rise .8s var(--out) backwards; }
    .error > :nth-child(2) { animation-delay: .1s; }
    .error > :nth-child(3) { animation-delay: .2s; }
}


/* 5. Open / close choreography
/* ------------------------------------------------------------
   The rules below are the CLOSING state, so returning from the
   archive plays: grid fades out, machine flies back, door shuts.
   `body.opened` overrides each one with its own opening timing.
   ------------------------------------------------------------ */

.intro { transition: opacity .5s ease, visibility 0s; }
.scene { transition: transform 1.05s cubic-bezier(.4, 0, .2, 1) .1s, opacity .45s ease; }
#door  { transition: transform 1.05s cubic-bezier(.4, 0, .2, 1) .5s; }

.rail,
.blurb { transition: opacity .45s ease .35s; }

/* Wires are drawn against the machine's resting position, so they only fade
   back once the scene has finished flying home. */
.wires { transition: opacity .4s ease 1.2s; }

body.opened .intro {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .7s ease .55s, visibility 0s linear 1.25s;
}

body.opened .scene {
    transform: scale(3.2);
    opacity: 0;
    transition: transform 1.6s cubic-bezier(.6, 0, .3, 1) .45s, opacity 1.2s ease .55s;
}

body.opened #door {
    transform: perspective(1500px) rotateY(-118deg);
    transition-delay: 0s;
}

body.opened .wires,
body.opened .rail,
body.opened .blurb { opacity: 0; transition-delay: 0s; }

/* Deep links (/#posts) land on the grid with no animation at all. */
body.no-anim .intro,
body.no-anim .scene,
body.no-anim #door,
body.no-anim .archive { transition: none !important; }


/* 6. Archive — the posts grid
/* ---------------------------------------------------------- */

.archive {
    position: relative;
    z-index: 10;
    padding: 32px 0 0;
    min-height: 100vh;
}

body.has-intro .archive {
    opacity: 0;
    transition: opacity .3s ease;   /* closing: get out of the way quickly */
}

body.has-intro.opened .archive {
    opacity: 1;
    transition: opacity .9s ease .85s;
}

.feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    align-items: start;   /* a card without a feature image shouldn't stretch to match one that has */
    gap: 28px;
    padding-bottom: 56px;
}

.site-nav + .feed { padding-top: 28px; }

/* Coming through the door deals the cards out one after another. `deal` is
   set by machine.js only when the door actually plays, so a deep link or a
   Back from a post lands on a grid that is simply there. */
@keyframes deal {
    from { opacity: 0; transform: translateY(18px); }
}

@media (prefers-reduced-motion: no-preference) {
    body.deal .card {
        animation: deal .9s var(--out) backwards;
        animation-delay: calc(.95s + var(--i, 0) * 70ms);
    }
}


/* 7. Post cards
/* ---------------------------------------------------------- */

.card {
    position: relative;
    border: 1px solid var(--line);
    transition: border-color .25s ease, background-color .25s ease;
}

.card::before,
.card::after {
    position: absolute;
    color: var(--faint);
    font-size: 12px;
    line-height: 1;
    transition: color .25s ease, transform .45s var(--out);
}

.card::before { content: "+"; top: -6px; left: -4px; }
.card::after { content: "+"; bottom: -6px; right: -4px; }

.card:hover,
.card:focus-within {
    border-color: var(--accent);
    background: rgba(255, 209, 191, .04);
}

.card:hover::before,
.card:hover::after,
.card:focus-within::before,
.card:focus-within::after { color: var(--accent); }

.card:hover::before,
.card:focus-within::before { transform: translate(-3px, -3px) rotate(90deg); }

.card:hover::after,
.card:focus-within::after { transform: translate(3px, 3px) rotate(90deg); }

.card-link {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    padding: 18px 20px 22px;
}

.card-link:focus-visible { outline-offset: -1px; }

/* Feature image, pushed out to the card edges. Left in full colour — the CRT
   overlay is what makes it read as something on a console. */
.card-image {
    display: block;
    margin: -18px -20px 6px;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    /* something to look at while the picture loads */
    background: repeating-linear-gradient(-45deg, transparent 0 7px, var(--line-soft) 7px 8px);
    transition: border-color .25s ease;
}

.card:hover .card-image,
.card:focus-within .card-image { border-bottom-color: rgba(255, 209, 191, .5); }

.card-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 1.1s var(--out), opacity .6s ease;
}

.card:hover .card-image img,
.card:focus-within .card-image img { transform: scale(1.045); }

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12.5px;
    letter-spacing: 1px;
    color: var(--faint);
}

.card-meta .tag { color: var(--fg); }

.card-title {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--accent);
    text-wrap: balance;
    transition: text-shadow .25s ease;
}

/* The prompt nudges forward when the card is live. */
.card-title::before {
    content: ">";
    display: inline-block;
    margin-right: 1ch;
    font-weight: 400;
    color: var(--faint);
    transition: transform .45s var(--out), color .25s ease;
}

.card:hover .card-title,
.card:focus-within .card-title { text-shadow: var(--glow-accent); }

.card:hover .card-title::before,
.card:focus-within .card-title::before { transform: translateX(4px); color: var(--accent); }

.card-excerpt {
    flex: 1 1 auto;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--dim);
    text-wrap: pretty;
}


/* 8. Single post / page
/* ---------------------------------------------------------- */

.single { padding: 0 0 72px; }

/* Text keeps to a reading measure; pictures are allowed to run wider. */
.post-head,
.post-body,
.post-foot {
    width: min(var(--measure), 100%);
    margin-left: auto;
    margin-right: auto;
}

.post-image {
    width: min(var(--wide), 100%);
    margin-left: auto;
    margin-right: auto;
}

.post-head { padding: 48px 0 28px; }

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12.5px;
    letter-spacing: 1px;
    color: var(--faint);
}

.post-title {
    position: relative;
    margin-top: 14px;
    font-size: clamp(26px, 4.2vw, 38px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.5px;
    color: var(--hot);
    text-shadow: var(--glow);
    text-wrap: balance;
}

.post-title::before { content: "# "; font-weight: 400; color: var(--accent); text-shadow: none; }

.post-image { margin-top: 4px; }

/* Untinted inside a post: the terminal is the frame, the artwork is the point. */
.post-image img { width: 100%; }

.post-body {
    padding: 36px 0 48px;
    font-size: 15px;
    line-height: 1.9;
    color: var(--dim);
}

.post-body > * + * { margin-top: 1.5em; }

.post-body p { text-wrap: pretty; }

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    position: relative;
    margin-top: 2.6em;
    font-weight: 500;
    color: var(--hot);
    line-height: 1.35;
    text-shadow: var(--glow);
    text-wrap: balance;
}

.post-body h1 { font-size: 23px; }
.post-body h2 { font-size: 20px; }
.post-body h3 { font-size: 17px; }
.post-body h4,
.post-body h5,
.post-body h6 { font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; }

.post-body h2::before { content: "## "; font-weight: 400; color: var(--accent); text-shadow: none; }
.post-body h3::before { content: "### "; font-weight: 400; color: var(--accent); text-shadow: none; }

.post-body a {
    color: var(--accent);
    border-bottom: 1px solid rgba(255, 209, 191, .4);
    transition: border-color .2s ease, text-shadow .2s ease;
}

.post-body a:hover { text-shadow: var(--glow-accent); border-bottom-color: var(--accent); }

.post-body strong { color: var(--hot); font-weight: 500; }
.post-body em { font-style: italic; }

.post-body ul,
.post-body ol { padding-left: 1.6em; }
.post-body li + li { margin-top: .5em; }
.post-body ol li::marker { color: var(--accent); }
.post-body ul { list-style: none; padding-left: 1.2em; }
.post-body ul li::before {
    content: "- ";
    margin-left: -1.2em;
    color: var(--accent);
}

.post-body blockquote {
    padding-left: 18px;
    border-left: 2px solid var(--accent);
    color: var(--faint);
    font-style: italic;
}

.post-body code {
    padding: 1px 5px;
    border: 1px solid var(--line);
    color: var(--accent);
    font-size: .95em;
}

.post-body pre {
    padding: 16px 18px;
    border: 1px solid var(--line);
    overflow-x: auto;
    color: var(--fg);
    font-size: 13.5px;
    line-height: 1.65;
}

.post-body pre code { padding: 0; border: 0; color: inherit; }

.post-body hr { border: 0; border-top: 1px dashed var(--line); }

.post-body img,
.post-body video { width: 100%; }

.post-body figure { margin-top: 2.2em; }
.post-body figure + * { margin-top: 2.2em; }

.post-body figcaption {
    margin-top: 10px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--faint);
    text-align: center;
    text-wrap: balance;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.post-body th,
.post-body td {
    padding: 8px 10px;
    border: 1px solid var(--line);
    text-align: left;
}

.post-body th { color: var(--hot); font-weight: 500; }

.post-body iframe { width: 100%; border: 1px solid var(--line); }

.post-body iframe[src*="youtube"] { aspect-ratio: 16 / 9; height: auto; }

/* A gallery is rows of images; each image flexes by its aspect ratio (set
   inline once it loads) so a row shares one height. */
.post-body .gallery { display: flex; flex-direction: column; gap: 6px; }
.post-body .gallery-row { display: flex; gap: 6px; }
.post-body .gallery-row > * { flex: 1 1 0; width: 0; min-width: 0; object-fit: cover; }

.post-foot { padding-top: 22px; border-top: 1px solid var(--line); }

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 13.5px;
    color: var(--faint);
}

/* With room to spare, figures step outside the reading column and the
   markdown hashes hang in the margin so headings align with the text. */
@media (min-width: 1000px) {
    .post-body > figure {
        width: var(--wide);
        margin-left: calc((var(--measure) - var(--wide)) / 2);
    }

    .post-title::before,
    .post-body h2::before,
    .post-body h3::before {
        position: absolute;
        right: 100%;
        white-space: pre;
    }
}

/* Reading progress bar pinned to the top of the viewport. */
.progress {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 80;
    width: 100%;
    height: 2px;
    appearance: none;
    border: 0;
    background: transparent;
}

.progress::-webkit-progress-bar { background: transparent; }
.progress::-webkit-progress-value { background: var(--accent); box-shadow: var(--glow-accent); }
.progress::-moz-progress-bar { background: var(--accent); }


/* 9. Error page
/* ---------------------------------------------------------- */

.error {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 14px;
    min-height: 52vh;
    text-align: center;
}

.error pre {
    font-family: var(--art);
    font-size: 13px;
    line-height: 1.15;
    white-space: pre;
    color: var(--fg);
    text-shadow: var(--glow);
}

.error h1 { font-size: 20px; font-weight: 500; letter-spacing: 3px; color: var(--accent); text-shadow: var(--glow-accent); }
.error p { color: var(--faint); }


/* 10. Site chrome
/* ---------------------------------------------------------- */

/* Sticks to the top while you read. It bleeds into the gutters so nothing
   shows beside it as the page slides underneath. */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 0 calc(var(--gutter) * -1);
    padding: 18px var(--gutter) 14px;
    background: rgba(0, 0, 0, .72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.site-nav::after {
    content: "";
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: 0;
    border-bottom: 1px solid var(--line);
}

.site-nav-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }

.site-nav-links > span { color: var(--faint); }

.site-nav .home { font-size: 15px; font-weight: 500; color: var(--hot); transition: color .2s ease, text-shadow .2s ease; }
.site-nav .home:hover { color: var(--accent); text-shadow: var(--glow-accent); }

.site-foot {
    padding: 22px 0 34px;
    font-size: 13px;
    color: var(--faint);
}

.site-foot .inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.site-foot .inner::before {
    content: "";
    flex: 0 0 100%;
    margin-bottom: 12px;
    border-top: 1px solid var(--line);
}


/* 11. Page-to-page transitions
/* ------------------------------------------------------------
   Where the browser supports it, moving between the grid and a
   post cross-fades, and the card's picture travels to become the
   post's cover (the two share a view-transition-name, set inline).
   The header and the CRT glass hold still on top of it all.
   ------------------------------------------------------------ */

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

    .site-nav { view-transition-name: site-nav; }
    .crt { view-transition-name: crt; }

    .card-image,
    .post-image { view-transition-class: cover; }

    ::view-transition-old(root),
    ::view-transition-new(root) { animation-duration: .35s; }

    ::view-transition-group(*.cover) {
        animation-duration: .55s;
        animation-timing-function: var(--out);
    }

    ::view-transition-old(*.cover),
    ::view-transition-new(*.cover) {
        height: 100%;
        object-fit: cover;
    }
}


/* 12. Responsive
/* ---------------------------------------------------------- */

@media (max-width: 900px) {
    :root { --gutter: 20px; }

    /* Rails move above and below the drum; the wires still reach in. */
    .stage { flex-direction: column; gap: 26px; }
    .stage .rail { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 2px 18px; }
}

@media (max-width: 640px) {
    .intro { padding: 12px; gap: 20px; }
    .blurb p { font-size: 13.5px; line-height: 1.75; }
    .archive { padding-top: 14px; }
    .feed { grid-template-columns: 1fr; gap: 22px; }
    .post-head { padding-top: 32px; }
    .post-body { font-size: 14.5px; line-height: 1.85; }
}

@media (orientation: landscape) and (max-height: 560px) {
    .intro { flex-direction: row; gap: 18px; }
    .blurb { width: min(380px, 40%); text-align: left; }
    .blurb nav { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    img,
    video,
    .bkt .b,
    .card::before,
    .card::after,
    .card-image img,
    .card-title::before,
    .machine-hint { transition: none; }
}
