/* ==========================================================================
   home4hack — pixel-arcade Ghost theme
   --------------------------------------------------------------------------
   Order: tokens, reset, primitives, layout, then components top-to-bottom in
   the order they appear on the homepage. Motion lives at the bottom, behind a
   prefers-reduced-motion guard.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
    --ink:        #0a0a0a;
    --ink-2:      #121218;
    --ink-3:      #1a1a24;
    --paper:      #f5efe2;
    --muted:      #9a9488;

    --yellow:     #ffcf33;
    --pink:       #e91e63;

    /* Two pinks earn their keep. #e91e63 is a fine graphic colour but only
       reaches 3.8:1 behind paper text and 4.3:1 as text on --ink-2, both under
       the 4.5 AA needs. So: a darker one for solid buttons the paper sits on,
       and a lighter one for pink text on a dark background. */
    --pink-btn:   #c2185b;
    --pink-text:  #f5487d;
    --cyan:       #22d3ee;
    --green:      #34d399;
    /* #4f5bf5 lands at 4.4:1 behind paper text on the CTA panel — just under
       AA. A shade down clears it without changing the character. */
    --blue:       #4650e0;
    --purple:     #a855f7;

    /* Ghost injects --ghost-accent-color from Settings → Design. It drives the
       focus ring and text selection so the owner's accent shows up somewhere
       real, without letting it repaint the pixel palette. */
    --brand:      var(--ghost-accent-color, #e91e63);

    /* Ghost 6 lets an admin pick site fonts; those land as --gh-font-*.
       If nothing is chosen the vars are unset and the theme's own faces win. */
    --font-display: var(--gh-font-heading, 'Silkscreen'), 'Courier New', monospace;
    --font-body:    var(--gh-font-body, 'Hanken Grotesk'), system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Hard offset shadows. No blur anywhere — that is the whole look. */
    --pix:    4px 4px 0 0 var(--paper);
    --pix-lg: 8px 8px 0 0 var(--paper);
    --pix-ink: 4px 4px 0 0 var(--ink);

    --border: 3px;
    --wrap: 1180px;
    --wrap-narrow: 720px;
    --gut: clamp(1.25rem, 4vw, 2.5rem);
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */

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

html {
    background: var(--ink);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-body);
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

button, input { font: inherit; color: inherit; }

::selection { background: var(--brand); color: var(--paper); }

:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 3px;
}

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--yellow);
    color: var(--ink);
    padding: 0.75rem 1.25rem;
    font-family: var(--font-mono);
    font-weight: 700;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Pixel art must never be smoothed. */
.px { image-rendering: pixelated; display: block; height: auto; }

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */

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

.site-main { display: block; }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }

.section__head {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: clamp(2rem, 5vw, 3rem);
}

/* --------------------------------------------------------------------------
   4. Type primitives
   -------------------------------------------------------------------------- */

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}
.eyebrow--cyan { color: var(--cyan); }

.eyebrow::after {
    content: '_';
    margin-left: 0.15em;
    animation: caret 1.1s steps(1) infinite;
}

.section__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.75rem, 5vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--paper);
    text-shadow: 3px 3px 0 var(--ink-3);
    margin-bottom: 0.75rem;
}
.section__title--center { text-align: center; margin-bottom: clamp(2rem, 5vw, 3rem); }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */

.btn {
    --btn-bg: transparent;
    --btn-fg: var(--paper);
    --btn-bd: var(--paper);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.15rem;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: var(--border) solid var(--btn-bd);
    box-shadow: var(--pix);
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: transform 0.08s steps(2), box-shadow 0.08s steps(2), background-color 0.12s;
}

.btn:hover,
.btn:focus-visible {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 0 var(--paper);
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--paper); }

.btn--lg { padding: 0.95rem 1.6rem; font-size: 0.9375rem; }

.btn--pink   { --btn-bg: var(--pink-btn); --btn-fg: var(--paper); --btn-bd: var(--pink-btn); }
.btn--yellow { --btn-bg: var(--yellow); --btn-fg: var(--ink);   --btn-bd: var(--yellow); }
.btn--cyan   { --btn-bg: var(--cyan);   --btn-fg: var(--ink);   --btn-bd: var(--cyan); }
.btn--dark   { --btn-bg: var(--ink);    --btn-fg: var(--paper); --btn-bd: var(--ink); }
.btn--ghost  { --btn-bg: transparent;   --btn-fg: var(--paper); --btn-bd: var(--paper); }

.btn--dark:hover,
.btn--dark:focus-visible { box-shadow: 6px 6px 0 0 var(--ink); }
.btn--dark { box-shadow: var(--pix-ink); }

.btn.is-disabled { opacity: 0.35; pointer-events: none; }

.btn__busy { display: none; }

/* --------------------------------------------------------------------------
   6. Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: var(--border) solid var(--paper);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 68px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
}
.brand__mark {
    display: block;
    border: 2px solid var(--paper);
    padding: 3px;
    line-height: 0;
}
.brand__mark .px { width: 22px; }
.brand__name {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--yellow);
}

.site-nav { display: flex; align-items: center; gap: 1.75rem; }

.site-nav__list { display: flex; align-items: center; gap: 1.25rem; }

.site-nav__link {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--paper);
    padding-block: 0.35rem;
    border-bottom: 2px solid transparent;
}
.site-nav__link:hover,
.site-nav__item.is-current .site-nav__link {
    color: var(--yellow);
    border-bottom-color: var(--yellow);
}

.site-nav__actions { display: flex; align-items: center; gap: 0.6rem; }

.nav-toggle {
    display: none;
    background: none;
    border: var(--border) solid var(--paper);
    padding: 0.5rem;
    cursor: pointer;
}
.nav-toggle__bar {
    display: block;
    width: 20px; height: 3px;
    background: var(--paper);
}
.nav-toggle__bar + .nav-toggle__bar { margin-top: 4px; }

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    padding-top: clamp(3rem, 9vw, 6rem);
    isolation: isolate;
}

.hero__grid {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(245, 239, 226, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 239, 226, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
}

.hero__scan {
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 160px;
    z-index: -1;
    background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.07), transparent);
    animation: scan 7s linear infinite;
}

.hero__inner { text-align: center; position: relative; }

.hero__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 10vw, 6rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}
.hero__line { display: block; color: var(--yellow); text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 var(--ink-2); }
.hero__line--alt { color: var(--paper); text-shadow: 4px 4px 0 var(--cyan), 8px 8px 0 var(--ink-2); }

.hero__sub {
    max-width: 46ch;
    margin: 0 auto 2rem;
    color: #cfc8ba;
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
}

.hero__note {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.hero__member {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--paper);
}

.dot {
    display: inline-block;
    width: 9px; height: 9px;
    margin-right: 0.4rem;
    vertical-align: baseline;
}
.dot--green { background: var(--green); animation: blink 2.4s steps(1) infinite; }

/* Subscribe form */

.subscribe {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    max-width: 540px;
    margin-inline: auto;
}

.subscribe__input {
    flex: 1 1 260px;
    min-width: 0;
    padding: 0.85rem 1rem;
    background: var(--ink-2);
    color: var(--paper);
    border: var(--border) solid var(--paper);
    box-shadow: var(--pix);
    font-family: var(--font-mono);
    font-size: 0.9375rem;
}
.subscribe__input::placeholder { color: #6f6a61; }
.subscribe__input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 4px 4px 0 0 var(--brand);
}

.subscribe__msg {
    flex-basis: 100%;
    display: none;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: 0.6rem 0.75rem;
    border: 2px solid currentColor;
}
.subscribe__msg--ok  { color: var(--green); }
.subscribe__msg--bad { color: var(--pink); }

.subscribe.success .subscribe__msg--ok  { display: block; }
.subscribe.error   .subscribe__msg--bad { display: block; }
.subscribe.success .subscribe__input,
.subscribe.success .btn { display: none; }

.subscribe.loading .btn__idle { display: none; }
.subscribe.loading .btn__busy { display: inline; }

/* Sparks — decorative pixels drifting behind the headline. */

.sparks { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.spark {
    position: absolute;
    width: 6px; height: 6px;
    animation: twinkle 3.4s steps(2) infinite;
}
.spark--1 { top: 12%; left: 8%;  background: var(--pink);   animation-delay: 0s; }
.spark--2 { top: 26%; left: 91%; background: var(--yellow); animation-delay: 0.6s; }
.spark--3 { top: 58%; left: 5%;  background: var(--green);  animation-delay: 1.2s; }
.spark--4 { top: 44%; left: 95%; background: var(--cyan);   animation-delay: 1.8s; }
.spark--5 { top: 72%; left: 14%; background: var(--purple); animation-delay: 2.4s; }

/* --------------------------------------------------------------------------
   8. The pixel scene
   -------------------------------------------------------------------------- */

.scene {
    position: relative;
    margin-top: clamp(2.5rem, 7vw, 4.5rem);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(0.75rem, 3vw, 3rem);
    padding-inline: var(--gut);
}

.scene__item .px { width: auto; }
.scene__item--rack   .px { height: clamp(150px, 26vw, 260px); }
.scene__item--frog   .px { height: clamp(110px, 19vw, 190px); }
.scene__item--crt    .px { height: clamp(120px, 21vw, 205px); }
.scene__item--floppy .px { height: clamp(48px, 8vw, 80px); }

.scene__item--frog   { animation: bob 3.2s ease-in-out infinite; }
.scene__item--floppy { animation: bob 2.4s ease-in-out infinite 0.4s; align-self: center; }

/* Drive lights. Each colour blinks on its own clock so the rack looks busy. */
.px-led { animation: blink 1.6s steps(1) infinite; }
.px-led--c { animation-duration: 1.1s; }
.px-led--y { animation-duration: 2.3s; animation-delay: 0.3s; }
.px-led--k { animation-duration: 1.7s; animation-delay: 0.7s; }
.px--rack .px-led:nth-of-type(3n)   { animation-delay: 0.9s; }
.px--rack .px-led:nth-of-type(3n+1) { animation-delay: 0.2s; }

/* --------------------------------------------------------------------------
   9. Dividers
   -------------------------------------------------------------------------- */

.divider { width: 100%; }

.divider--teeth {
    height: 16px;
    background:
        linear-gradient(var(--paper), var(--paper)) bottom / 100% 4px no-repeat,
        repeating-linear-gradient(90deg, var(--paper) 0 8px, transparent 8px 16px) top / 100% 12px no-repeat;
}

.divider--hazard {
    height: 18px;
    border-block: 3px solid var(--paper);
    background: repeating-linear-gradient(-45deg, var(--paper) 0 8px, var(--ink) 8px 16px);
}

/* --------------------------------------------------------------------------
   10. Marquee
   -------------------------------------------------------------------------- */

.marquee {
    overflow: hidden;
    background: var(--pink-btn);
    border-bottom: var(--border) solid var(--paper);
    padding-block: 0.85rem;
    white-space: nowrap;
}

.marquee__track {
    display: inline-flex;
    gap: 2.5rem;
    animation: marquee 26s linear infinite;
    will-change: transform;
}

.marquee__text {
    font-family: var(--font-display);
    font-size: clamp(0.8125rem, 1.6vw, 1.0625rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--paper);
    text-shadow: 2px 2px 0 rgba(10, 10, 10, 0.35);
}

/* --------------------------------------------------------------------------
   11. Cards, what-you-get, and the tally
   -------------------------------------------------------------------------- */

.card {
    background: var(--ink-2);
    border: var(--border) solid var(--paper);
    box-shadow: var(--pix-lg);
}

.ledger {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}

/* --- what you'll get --- */

.gets {
    display: grid;
    gap: clamp(0.85rem, 2vw, 1.25rem);
    margin-top: clamp(1.5rem, 4vw, 2rem);
}

.get {
    --accent: var(--yellow);
    position: relative;
    padding: 1.1rem 1.25rem 1.15rem 1.75rem;
    background: var(--ink-2);
    border: 2px solid #2c2a35;
    transition: border-color 0.12s, transform 0.1s steps(2);
}
.get--cyan { --accent: var(--cyan); }
.get--pink { --accent: var(--pink-text); }

/* The colour bar doubles as the left border, so there is one less line. */
.get::before {
    content: '';
    position: absolute;
    inset: -2px auto -2px -2px;
    width: 7px;
    background: var(--accent);
}
.get:hover { border-color: var(--accent); transform: translateX(3px); }

.get__title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.4rem;
}
.get__body { color: #b7b0a4; font-size: 0.9375rem; line-height: 1.55; }

/* --- the tally --- */

.tally { padding: clamp(1.25rem, 3vw, 1.75rem); }
.tally .eyebrow { margin-bottom: 1.25rem; }

.tally__list {
    display: grid;
    gap: 0;
    border-top: 2px solid #2c2a35;
}

.tally__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 2px solid #2c2a35;
}

.tally__value {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3vw, 1.625rem);
    line-height: 1;
    color: var(--paper);
    text-shadow: 2px 2px 0 var(--ink-3);
}

.tally__label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: right;
}

.tally__note {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: #8a847a;
}

/* --------------------------------------------------------------------------
   12. Post grid
   -------------------------------------------------------------------------- */

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: clamp(1.25rem, 3vw, 2rem);
}

.post-card {
    --accent: var(--yellow);
    position: relative;
    transition: transform 0.1s steps(2), box-shadow 0.1s steps(2);
}
.post-card:nth-child(4n+2) { --accent: var(--cyan); }
.post-card:nth-child(4n+3) { --accent: var(--pink-text); }
.post-card:nth-child(4n+4) { --accent: var(--green); }

.post-card:hover,
.post-card:focus-within {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 0 var(--paper);
}

.post-card__link { display: block; text-decoration: none; height: 100%; }

.post-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--accent);
    border-bottom: var(--border) solid var(--paper);
    display: grid;
    place-items: center;
    overflow: hidden;
}
.post-card__img { width: 100%; height: 100%; object-fit: cover; }
.post-card__fallback .px { height: 68px; width: auto; }

.post-card__flag {
    position: absolute;
    top: 0.6rem; left: 0.6rem;
    padding: 0.25rem 0.5rem;
    background: var(--ink);
    color: var(--paper);
    border: 2px solid var(--paper);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.post-card__body { padding: 1.25rem; }

.post-card__title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--paper);
    margin-bottom: 0.75rem;
}
.post-card:hover .post-card__title { color: var(--accent); }

.post-card__excerpt {
    color: #b7b0a4;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-card__meta,
.post-card__go {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.post-card__meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }

.post-card__go {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    border-bottom: 2px solid transparent;
}
.post-card:hover .post-card__go { border-bottom-color: var(--accent); }

/* --------------------------------------------------------------------------
   13. Empty state
   -------------------------------------------------------------------------- */

.empty {
    padding: clamp(2rem, 6vw, 3.5rem);
    text-align: center;
    max-width: 640px;
    margin-inline: auto;
}
.empty__art { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.empty__art .px { height: 76px; width: auto; animation: bob 3s ease-in-out infinite; }

.empty__title {
    font-family: var(--font-display);
    font-size: clamp(1.125rem, 3vw, 1.5rem);
    color: var(--yellow);
    margin-bottom: 0.9rem;
}
.empty__body { color: #b7b0a4; margin-bottom: 1.75rem; }

/* --------------------------------------------------------------------------
   14. Chips
   -------------------------------------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
/* Tags close out a post, and a full-bleed divider follows immediately after.
   Without a bottom margin the two sit flush against each other. */
.chips--post { margin-top: 3rem; margin-bottom: clamp(2.5rem, 6vw, 4rem); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    background: var(--ink-2);
    border: 2px solid var(--paper);
    box-shadow: 3px 3px 0 0 var(--paper);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform 0.08s steps(2), background-color 0.12s;
}
.chip:hover { background: var(--yellow); color: var(--ink); transform: translate(-2px, -2px); }
.chip__count { color: var(--cyan); }
.chip:hover .chip__count { color: var(--ink); }

/* --------------------------------------------------------------------------
   15. CTA panels
   -------------------------------------------------------------------------- */

.panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(1.25rem, 3vw, 2rem);
}

.panel {
    padding: clamp(1.75rem, 4vw, 2.5rem);
    border: var(--border) solid var(--paper);
    box-shadow: var(--pix-lg);
    color: var(--ink);
}
.panel--wide { max-width: 720px; margin-inline: auto; text-align: center; }
.panel--green { background: var(--green); }
.panel--blue  { background: var(--blue); color: var(--paper); }

.panel__tag {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    margin-bottom: 1.15rem;
    background: var(--ink);
    color: var(--paper);
    border: 2px solid var(--ink);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.panel__title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3.2vw, 1.875rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
}
.panel__body { margin-bottom: 1.75rem; opacity: 0.9; }

/* --------------------------------------------------------------------------
   16. Page heads, posts, prose
   -------------------------------------------------------------------------- */

.page-head { padding-block: clamp(3rem, 8vw, 5rem) clamp(2rem, 5vw, 3rem); }
.page-head__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 7vw, 4rem);
    font-weight: 700;
    line-height: 1.06;
    color: var(--yellow);
    text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 var(--ink-2);
}
.page-head__blurb { margin-top: 1.5rem; max-width: 55ch; color: #b7b0a4; }
.page-head__count {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--cyan);
}

.post__head { padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); }

.post__title {
    font-family: var(--font-display);
    font-size: clamp(1.625rem, 4.5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    text-shadow: 3px 3px 0 var(--ink-3);
}

.post__standfirst { font-size: 1.1875rem; color: #cfc8ba; margin-bottom: 1.25rem; }

.post__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--muted);
}

.post__author {
    color: var(--cyan);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.post__author:hover { color: var(--yellow); }

.post__feature { margin-block: clamp(1.5rem, 4vw, 2.5rem); }
.post__feature img { width: 100%; border: var(--border) solid var(--paper); box-shadow: var(--pix-lg); }
.post__feature figcaption {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--muted);
    text-align: center;
}

.prose { padding-block: clamp(1rem, 3vw, 2rem) clamp(2rem, 5vw, 3rem); }

/* A page has no standfirst or byline under its title, so the default top pad
   leaves a hole where a post has metadata. */
.post--page .prose { padding-top: 0; }
.prose > * + * { margin-top: 1.4em; }

.prose p { color: #ded7c9; }

.prose h2, .prose h3, .prose h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
    color: var(--yellow);
    margin-top: 2.5em;
    margin-bottom: 0.4em;
}
.prose h2 { font-size: 1.375rem; }
.prose h3 { font-size: 1.125rem; color: var(--cyan); }
.prose h4 { font-size: 1rem; color: var(--paper); }

.prose a { color: var(--pink-text); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { background: var(--pink-btn); color: var(--paper); text-decoration: none; }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li { color: #ded7c9; margin-top: 0.4em; }
.prose li::marker { color: var(--cyan); }

.prose blockquote {
    padding: 1rem 1.25rem;
    border-left: 6px solid var(--pink);
    background: var(--ink-2);
    font-style: normal;
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--ink-3);
    color: var(--cyan);
    padding: 0.15em 0.4em;
    border: 1px solid #2b2b36;
}

.prose pre {
    padding: 1.15rem;
    overflow-x: auto;
    background: var(--ink-2);
    border: var(--border) solid var(--paper);
    box-shadow: var(--pix);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; color: var(--paper); }

.prose img { border: var(--border) solid var(--paper); }

.prose hr {
    height: 4px;
    border: 0;
    background: repeating-linear-gradient(90deg, var(--paper) 0 8px, transparent 8px 16px);
}

/* --- Koenig cards -------------------------------------------------------
   Ghost injects its own cards.min.css through {{ghost_head}}, which lands
   *after* this file — so every selector here carries an extra `.prose` (and
   sometimes more) to win on specificity rather than shouting !important. */

.prose .kg-card { margin-block: clamp(1.75rem, 4vw, 2.5rem); }

/* Callout */

.prose .kg-callout-card {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 1.1rem 1.25rem;
    background: var(--ink-2);
    border: 3px solid var(--paper);
    border-radius: 0;
    box-shadow: var(--pix);
}
.prose .kg-callout-emoji { font-size: 1.1rem; line-height: 1.5; }
.prose .kg-callout-text { color: var(--paper); font-size: 0.9375rem; }

.prose .kg-callout-card-red,
.prose .kg-callout-card-pink   { border-color: var(--pink);   box-shadow: 4px 4px 0 0 var(--pink); }
.prose .kg-callout-card-yellow { border-color: var(--yellow); box-shadow: 4px 4px 0 0 var(--yellow); }
.prose .kg-callout-card-green  { border-color: var(--green);  box-shadow: 4px 4px 0 0 var(--green); }
.prose .kg-callout-card-blue   { border-color: var(--cyan);   box-shadow: 4px 4px 0 0 var(--cyan); }
.prose .kg-callout-card-purple { border-color: var(--purple); box-shadow: 4px 4px 0 0 var(--purple); }
.prose .kg-callout-card-accent { border-color: var(--brand);  box-shadow: 4px 4px 0 0 var(--brand); }

/* Button */

.prose .kg-button-card .kg-btn {
    display: inline-flex;
    align-items: center;
    height: auto;
    padding: 0.85rem 1.35rem;
    background: var(--pink-btn);
    color: var(--paper);
    border: 3px solid var(--pink-btn);
    border-radius: 0;
    box-shadow: var(--pix);
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: transform 0.08s steps(2), box-shadow 0.08s steps(2);
}
.prose .kg-button-card .kg-btn:hover {
    background: var(--pink-btn);
    color: var(--paper);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 0 var(--paper);
}
.prose .kg-button-card .kg-btn-accent { background: var(--pink-btn); border-color: var(--pink-btn); }

/* Bookmark */

.prose .kg-bookmark-card a.kg-bookmark-container {
    background: var(--ink-2);
    border: 3px solid var(--paper);
    border-radius: 0;
    box-shadow: var(--pix);
    color: var(--paper);
    text-decoration: none;
}
.prose .kg-bookmark-card a.kg-bookmark-container:hover { background: var(--ink-3); }
.prose .kg-bookmark-title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    color: var(--yellow);
}
.prose .kg-bookmark-description { color: #b7b0a4; }
.prose .kg-bookmark-metadata {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}
.prose .kg-bookmark-thumbnail { border-radius: 0; }

/* Toggle */

.prose .kg-toggle-card {
    background: var(--ink-2);
    border: 2px solid #2c2a35;
    border-radius: 0;
}
.prose .kg-toggle-heading-text {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    color: var(--paper);
}
.prose .kg-toggle-content { color: #ded7c9; }

.prose .kg-blockquote-alt { color: #ded7c9; font-style: normal; }

/* Koenig card widths. The editor emits these on wide/full-bleed cards and the
   content column is narrow, so they have to break out of it. */
.prose .kg-width-wide {
    position: relative;
    width: calc(100vw - (var(--gut) * 2));
    max-width: 1040px;
    margin-inline: auto;
    left: 50%;
    transform: translateX(-50%);
}
.prose .kg-width-full {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-inline: auto;
    left: 50%;
    transform: translateX(-50%);
}
.prose .kg-width-full img { width: 100%; border-inline: 0; }

.prose figcaption {
    margin-top: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--muted);
    text-align: center;
}

.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.prose th, .prose td { border: 2px solid #33333f; padding: 0.6rem 0.75rem; text-align: left; }
.prose th { background: var(--ink-3); font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; }

/* --------------------------------------------------------------------------
   17. Pager
   -------------------------------------------------------------------------- */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: clamp(2.5rem, 6vw, 4rem);
    flex-wrap: wrap;
}
.pager__count {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   18. Footer
   -------------------------------------------------------------------------- */

.site-footer { padding-block: clamp(2.5rem, 6vw, 4rem) 2rem; }

.site-footer__grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) 1fr 1fr;
    gap: clamp(2rem, 5vw, 3rem);
}

.brand--footer { margin-bottom: 1.1rem; }
.site-footer__blurb { color: var(--muted); max-width: 42ch; font-size: 0.9375rem; }
.site-footer__uptime {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--green);
}

.site-footer__head {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 1rem;
}
.site-footer__list { display: grid; gap: 0.5rem; }
.site-footer__list .site-nav__link { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: none; }

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    justify-content: space-between;
    margin-top: clamp(2rem, 5vw, 3rem);
    padding-top: 1.5rem;
    border-top: 2px solid #26262f;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}
.site-footer__colophon a { color: var(--pink-text); }

/* --------------------------------------------------------------------------
   19. Error page
   -------------------------------------------------------------------------- */

.error-page { text-align: center; padding-block: clamp(2rem, 6vw, 4rem); }
.error-page__art { display: flex; justify-content: center; margin-bottom: 2rem; }
.error-page__art .px { height: clamp(120px, 20vw, 190px); width: auto; }
.error-page__code {
    font-family: var(--font-display);
    font-size: clamp(3rem, 12vw, 7rem);
    line-height: 1;
    color: var(--yellow);
    text-shadow: 5px 5px 0 var(--pink), 10px 10px 0 var(--ink-2);
    margin-bottom: 1.25rem;
}
.error-page__msg { font-family: var(--font-mono); color: var(--cyan); margin-bottom: 0.75rem; }
.error-page__body { color: #b7b0a4; margin-bottom: 2rem; }
.error-page__details { margin-top: 2rem; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   20. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
    .ledger { grid-template-columns: 1fr; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
    .nav-toggle { display: block; }

    .site-nav {
        position: absolute;
        inset-inline: 0;
        top: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1rem var(--gut) 1.5rem;
        background: var(--ink);
        border-bottom: var(--border) solid var(--paper);
    }
    .site-nav.is-open { display: flex; }

    .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
    .site-nav__link { display: block; padding: 0.8rem 0; border-bottom: 2px solid #26262f; }
    .site-nav__actions { margin-top: 1.25rem; }
    .site-nav__actions .btn { flex: 1; }

    .scene { gap: 0.5rem; }
    .scene__item--floppy { display: none; }
}

@media (max-width: 560px) {
    .scene__item--crt { display: none; }
    .site-footer__grid { grid-template-columns: 1fr; }
    .btn { box-shadow: 3px 3px 0 0 var(--paper); }
}

/* --------------------------------------------------------------------------
   21. Motion
   -------------------------------------------------------------------------- */

@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(calc(-100% / 3 - 0.833rem)); }
}

@keyframes blink {
    0%, 48%   { opacity: 1; }
    50%, 100% { opacity: 0.15; }
}

@keyframes caret {
    0%, 50%   { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.6); }
    50%      { opacity: 1; transform: scale(1); }
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

@keyframes scan {
    from { transform: translateY(-160px); }
    to   { transform: translateY(120vh); }
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20%      { transform: translate(-3px, 2px); }
    40%      { transform: translate(3px, -2px); }
    60%      { transform: translate(-2px, -2px); }
    80%      { transform: translate(2px, 2px); }
}

.hero__title.is-glitching .hero__line { animation: glitch 0.28s steps(2) 1; }

/* --------------------------------------------------------------------------
   22. Print
   --------------------------------------------------------------------------
   A dark theme prints as a black rectangle and drains a cartridge, so print
   gets a plain light document: the article, nothing else. Worth having on a
   site whose posts are the kind of thing people save to PDF.
   -------------------------------------------------------------------------- */

@media print {
    :root { --paper: #000; --muted: #444; }

    html, body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
    }

    /* Everything that is furniture rather than content. */
    .site-header,
    .site-footer,
    .divider,
    .marquee,
    .scene,
    .sparks,
    .hero__grid,
    .hero__scan,
    .skip-link,
    .pager,
    .section--cta,
    .section--ledger,
    .section--topics,
    .subscribe,
    .btn,
    #ghost-portal-root {
        display: none !important;
    }

    .wrap, .wrap--narrow { max-width: none; padding: 0; }
    .section, .post__head, .prose { padding: 0; margin: 0; }

    h1, h2, h3, .post__title, .section__title, .page-head__title {
        font-family: Georgia, 'Times New Roman', serif !important;
        color: #000 !important;
        text-shadow: none !important;
        page-break-after: avoid;
    }

    .prose p, .prose li { color: #000 !important; orphans: 3; widows: 3; }

    .prose a { color: #000 !important; text-decoration: underline; }
    /* Paper cannot be clicked, so print the destination. */
    .prose a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555;
    }

    .prose pre,
    .prose code,
    .prose blockquote,
    .card,
    .panel {
        background: #f4f4f4 !important;
        color: #000 !important;
        border: 1pt solid #999 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .post__feature img, .prose img { max-width: 100% !important; border: 0 !important; }

    .post__meta { color: #444 !important; }
}

@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;
    }

    /* Those animations set opacity, so pin the end state explicitly. */
    .px-led, .dot--green, .eyebrow::after { opacity: 1; }
    .spark { opacity: 0.8; }
    .hero__scan { display: none; }
}
