/* ═══════════════════════════════════════════════════════════════
   SYSTEM / SIGNAL — generativeart.io identity
   Ink & bone, one signal color. Type as architecture.
   Dark = SIGNAL (lab).  Light = PRINT (plotter).
   ═══════════════════════════════════════════════════════════════ */

/* ── Self-hosted type — no CDN, no FOUT. font-display: block +
   same-origin preload means the metrics never swap mid-paint. ── */
@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: block;
    src: url(fonts/archivo-normal-100-900.woff2) format('woff2');
}
@font-face {
    font-family: 'Archivo';
    font-style: italic;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: block;
    src: url(fonts/archivo-italic-100-900.woff2) format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url(fonts/ibmplexmono-normal-400.woff2) format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: block;
    src: url(fonts/ibmplexmono-normal-500.woff2) format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 600;
    font-display: block;
    src: url(fonts/ibmplexmono-normal-600.woff2) format('woff2');
}

:root {
    --bg: #0e0d0b;
    --bg-2: #14120f;
    --fg: #f2efe6;
    --fg-dim: #b9b4a6;
    --muted: #6f6a5e;
    --signal: #ff4a1c;
    --hairline: rgba(242, 239, 230, 0.14);
    --hairline-strong: rgba(242, 239, 230, 0.28);
    --nav-h: 56px;
    --gutter: clamp(20px, 4vw, 64px);
    --display: 'Archivo', 'Helvetica Neue', sans-serif;
    --mono: 'IBM Plex Mono', 'SFMono-Regular', monospace;
}

html.light {
    --bg: #f2efe6;
    --bg-2: #eae6d9;
    --fg: #0e0d0b;
    --fg-dim: #45423a;
    --muted: #8a8577;
    --signal: #e83c10;
    --hairline: rgba(14, 13, 11, 0.16);
    --hairline-strong: rgba(14, 13, 11, 0.32);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--display);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── Startup handshake ── */
.is-starting { overflow: hidden; }
.startup {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--bg);
    color: var(--fg);
    transition: clip-path 0.8s cubic-bezier(0.76, 0, 0.24, 1);
    clip-path: inset(0 0 0 0);
}
.startup-exit { clip-path: inset(0 0 100% 0); }
.startup-sequence { width: min(88vw, 1120px); }
.startup-kicker {
    color: var(--muted);
    letter-spacing: 0.2em;
    margin-bottom: 18px;
    opacity: 0;
    transform: translateY(6px);
}
.startup-word {
    font-family: var(--display);
    font-size: clamp(32px, 6.2vw, 96px);
    font-weight: 850;
    font-stretch: 118%;
    line-height: 0.9;
    letter-spacing: -0.04em;
    white-space: nowrap;
}
.startup-glyph {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.24em);
}
.startup-glyph-dot { color: var(--signal); }
.startup-status {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 26px;
    padding-top: 12px;
    border-top: 1px solid var(--hairline);
    color: var(--muted);
    opacity: 0;
}
.startup-command { color: var(--fg); }
.startup-dot { color: var(--signal); }
.startup-register {
    position: absolute;
    font: 15px/1 var(--mono);
    color: var(--muted);
}
.startup-register-tl { top: var(--gutter); left: var(--gutter); }
.startup-register-br { right: var(--gutter); bottom: var(--gutter); }
.startup-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--signal);
    transform: scaleX(0);
    transform-origin: left;
}
.startup-run .startup-kicker { animation: startup-in 0.35s 0.08s ease forwards; }
.startup-run .startup-glyph {
    animation: startup-glyph 0.32s calc(0.18s + var(--glyph-index) * 48ms) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.startup-run .startup-status { animation: startup-in 0.3s 1.2s ease forwards; }
.startup-run .startup-command { animation: startup-flash 0.42s 1.55s step-end 2; }
.startup-run .startup-progress { animation: startup-progress 1.92s 0.12s cubic-bezier(0.65, 0, 0.35, 1) forwards; }
@keyframes startup-in { to { opacity: 1; transform: none; } }
@keyframes startup-glyph { to { opacity: 1; transform: none; } }
@keyframes startup-flash { 50% { opacity: 0.22; } }
@keyframes startup-progress { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .startup { display: none; } }

::selection { background: var(--signal); color: var(--bg); }

a { color: inherit; }
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 3px;
}

.mono {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.04em;
}

.signal { color: var(--signal); }

.skip-link {
    position: fixed;
    top: -48px;
    left: var(--gutter);
    z-index: 100;
    background: var(--signal);
    color: var(--bg);
    font-family: var(--mono);
    font-size: 12px;
    padding: 8px 16px;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus { top: 8px; }

/* ── The organism (fixed, behind everything) ── */
#organism {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    cursor: crosshair;
}

main { position: relative; z-index: 1; pointer-events: none; }
main a, main button, main .specimen-stage { pointer-events: auto; }

/* ── Nav ── */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 0 var(--gutter);
    border-bottom: 1px solid var(--hairline);
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.wordmark {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-decoration: none;
}
.wordmark-tld { color: var(--signal); }

.nav-links {
    display: flex;
    gap: 24px;
    margin-left: auto;
}
.nav-links a {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-decoration: none;
    color: var(--fg-dim);
    transition: color 0.15s;
}
.nav-links a:hover { color: var(--signal); }
.nav-archive { color: var(--muted) !important; }
.nav-archive:hover { color: var(--signal) !important; }

.theme-toggle {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    background: none;
    border: 1px solid var(--hairline-strong);
    color: var(--fg);
    padding: 0;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.theme-toggle:hover { border-color: var(--signal); color: var(--signal); }
.theme-toggle:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.theme-icon { width: 16px; height: 16px; }
.theme-icon-moon { display: none; }
html.light .theme-icon-sun { display: none; }
html.light .theme-icon-moon { display: block; }

/* ── HUD readout ── */
.hud {
    position: fixed;
    left: var(--gutter);
    bottom: 24px;
    z-index: 40;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    line-height: 1.9;
    color: var(--fg-dim);
    user-select: none;
    pointer-events: none;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--hairline);
    padding: 10px 14px;
}
.hud-row { display: flex; gap: 12px; }
.hud-k { width: 46px; color: var(--muted); }
.hud-v { min-width: 110px; }
.hud-signal { color: var(--signal); }
.hud-state.flick { animation: flick 0.35s steps(2) 1; }
@keyframes flick {
    0% { color: var(--signal); }
    100% { color: var(--fg-dim); }
}

/* ── Marginalia (right edge, vertical) ── */
.marginalia {
    position: fixed;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    z-index: 40;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.28em;
    color: var(--muted);
    user-select: none;
    pointer-events: none;
}

/* ── Hero ── */
.hero {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 var(--gutter) 12vh;
    position: relative;
}

.hero-topline {
    color: var(--fg-dim);
    letter-spacing: 0.22em;
    margin-bottom: 20px;
}

.hero-title {
    font-family: var(--display);
    font-weight: 850;
    font-stretch: 118%;
    font-size: clamp(64px, 15.5vw, 230px);
    line-height: 0.88;
    letter-spacing: -0.025em;
    text-transform: uppercase;
    text-shadow: 0 2px 40px color-mix(in srgb, var(--bg) 55%, transparent);
}
.hero-title .line { display: block; }

.hero-sub {
    margin-top: 28px;
    color: var(--fg-dim);
    line-height: 2;
    max-width: 480px;
    text-shadow: 0 0 10px var(--bg), 0 0 22px var(--bg), 0 0 34px var(--bg);
}
.hero-topline { text-shadow: 0 0 10px var(--bg), 0 0 22px var(--bg); }
.hero-hint { color: var(--signal); }

.scroll-cue {
    position: absolute;
    right: calc(var(--gutter) + 20px);
    bottom: 12vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--muted);
}
.scroll-cue .mono {
    writing-mode: vertical-rl;
    font-size: 10px;
    letter-spacing: 0.24em;
}
.cue-rule {
    width: 1px;
    height: 64px;
    background: var(--fg-dim);
    animation: cue 2.2s ease-in-out infinite;
    transform-origin: top;
}
@keyframes cue {
    0%, 100% { transform: scaleY(0.3); opacity: 0.4; }
    50% { transform: scaleY(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .cue-rule { animation: none; }
}

/* ── Chapters ── */
.chapter {
    position: relative;
    padding: 18vh var(--gutter) 10vh;
    max-width: 1500px;
    border-top: 1px solid var(--hairline);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
}

/* corner registration ticks — TDR technical-drawing flavor */
.chapter::before, .chapter::after,
.specimen::before, .specimen::after {
    content: '+';
    position: absolute;
    top: -0.62em;
    font-family: var(--mono);
    font-size: 15px;
    color: var(--muted);
    background: var(--bg);
    line-height: 1;
    padding: 2px;
}
.chapter::before, .specimen::before { left: calc(var(--gutter) - 10px); }
.chapter::after, .specimen::after { right: calc(var(--gutter) - 10px); }

.chapter-label {
    color: var(--signal);
    letter-spacing: 0.18em;
    margin-bottom: 28px;
}

.chapter-title {
    font-weight: 830;
    font-stretch: 115%;
    font-size: clamp(36px, 6.5vw, 96px);
    line-height: 0.95;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin-bottom: 48px;
}

.chapter-standfirst {
    color: var(--fg-dim);
    line-height: 2;
    max-width: 520px;
}

.chapter-specimens { padding-bottom: 4vh; }

/* ── Idea section ── */
.idea-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 96px);
    align-items: start;
}

.idea-copy p {
    font-size: clamp(16px, 1.35vw, 19px);
    line-height: 1.75;
    color: var(--fg-dim);
    margin-bottom: 1.4em;
    max-width: 58ch;
}
.idea-copy strong { color: var(--fg); font-weight: 700; }
.idea-copy em { color: var(--fg); }
.seed-echo { color: var(--signal); font-size: 0.92em; }

.matrix-panel {
    border: 1px solid var(--hairline);
    padding: 24px;
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.matrix-title {
    color: var(--fg-dim);
    letter-spacing: 0.16em;
    margin-bottom: 18px;
}
.matrix {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
}
.matrix-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.05em;
    color: var(--muted);
    transition: background 0.4s, box-shadow 0.4s;
}
.matrix-cell.mc-head { color: var(--fg-dim); font-weight: 600; }
.matrix-cell.mc-prob { background: var(--fg); }
.matrix-cell.mc-from { box-shadow: inset 2px 0 0 var(--signal); }
.matrix-cell.mc-hot {
    background: var(--signal) !important;
    box-shadow: 0 0 18px color-mix(in srgb, var(--signal) 55%, transparent);
}
.matrix-legend {
    margin-top: 16px;
    color: var(--muted);
    line-height: 1.8;
    font-size: 10px;
}

/* ── The blinking full stop — hero only, even on/off pulse, matches z13labs.com ── */
@keyframes stop-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.hero-title .signal {
    animation: stop-blink 1.2s step-end infinite;
}
@media (prefers-reduced-motion: reduce) {
    .hero-title .signal { animation: none; }
}

/* ── Scroll reveals — panels rise in; numerals parallax in JS ── */
.rv {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.rv-in {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .rv { opacity: 1; transform: none; transition: none; }
}

/* ── Specimens ── */
.specimen {
    position: relative;
    padding: 10vh var(--gutter) 8vh;
    max-width: 1500px;
    border-top: 1px solid var(--hairline);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
}

.ghost-numeral {
    position: absolute;
    top: 9vh;
    right: var(--gutter);
    font-weight: 900;
    font-stretch: 125%;
    font-size: clamp(100px, 16vw, 300px);
    line-height: 0.8;
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: transparent;
    -webkit-text-stroke: 1px var(--hairline);
    user-select: none;
    pointer-events: none;
    z-index: 0;
}

.specimen-head { position: relative; z-index: 1; margin-bottom: 36px; }

.specimen-index {
    color: var(--signal);
    letter-spacing: 0.18em;
    margin-bottom: 14px;
}

.specimen-title {
    font-weight: 850;
    font-stretch: 118%;
    font-size: clamp(40px, 7.5vw, 110px);
    line-height: 0.92;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.specimen-desc {
    margin-top: 16px;
    font-size: clamp(16px, 1.5vw, 21px);
    color: var(--fg-dim);
    font-style: italic;
    font-family: var(--display);
    max-width: 46ch;
}

.specimen-stage {
    position: relative;
    z-index: 1;
    border: 1px solid var(--hairline-strong);
}

.specimen-canvas {
    display: block;
    width: 100%;
    height: min(72vh, 780px);
    cursor: crosshair;
    background: var(--bg-2);
    touch-action: pan-y;
    user-select: none;
}
.specimen-canvas:focus-visible { outline: 2px solid var(--signal); outline-offset: -3px; }

.specimen-controls {
    position: absolute;
    right: 0;
    bottom: -1px;
    transform: translateY(100%);
    display: flex;
    align-items: stretch;
    gap: 0;
}
.specimen-seed {
    padding: 8px 16px;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--muted);
    border: 1px solid var(--hairline);
    border-top: none;
    border-right: none;
}
.btn-reseed {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    background: none;
    border: 1px solid var(--hairline);
    border-top: none;
    color: var(--fg);
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-reseed:hover { background: var(--signal); border-color: var(--signal); color: var(--bg); }

.specimen-meta {
    margin-top: 52px;
    color: var(--muted);
    letter-spacing: 0.12em;
    font-size: 10px;
}

/* ── Field notes ── */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--hairline);
    border: 1px solid var(--hairline);
}

.note {
    background: var(--bg);
    padding: clamp(28px, 3.5vw, 56px);
}
.note-index { color: var(--signal); letter-spacing: 0.18em; margin-bottom: 18px; }
.note-title {
    font-weight: 800;
    font-stretch: 112%;
    font-size: clamp(20px, 2.2vw, 30px);
    letter-spacing: -0.01em;
    margin-bottom: 18px;
}
.note p {
    color: var(--fg-dim);
    line-height: 1.75;
    font-size: 15px;
}
.note strong, .note em { color: var(--fg); }

.note-links {
    list-style: none;
    margin-top: 18px;
    line-height: 2.4;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
}
.note-links a {
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid var(--hairline-strong);
    transition: all 0.15s;
}
.note-links a:hover { color: var(--signal); border-color: var(--signal); }

.archive-note {
    margin-top: 64px;
    color: var(--muted);
    letter-spacing: 0.1em;
    font-size: 11px;
}
.archive-note a { color: var(--fg-dim); text-decoration: none; border-bottom: 1px solid var(--hairline-strong); }
.archive-note a:hover { color: var(--signal); border-color: var(--signal); }

/* ── Coda ── */
.coda {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 28px;
    padding: 0 var(--gutter);
    border-top: 1px solid var(--hairline);
}

.coda-title {
    font-weight: 850;
    font-stretch: 118%;
    font-size: clamp(40px, 8vw, 130px);
    line-height: 0.92;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    text-shadow: 0 2px 40px color-mix(in srgb, var(--bg) 55%, transparent);
}

.coda-sub { color: var(--fg-dim); line-height: 2; }

.btn-world {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.2em;
    background: var(--signal);
    border: 1px solid var(--signal);
    color: #0e0d0b;
    padding: 16px 40px;
    cursor: pointer;
    transition: all 0.15s;
}
html.light .btn-world { color: #f2efe6; }
.btn-world:hover {
    background: transparent;
    color: var(--signal);
}

.colophon {
    margin-top: 10vh;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--muted);
    scroll-margin-top: calc(var(--nav-h) + 24px);
}
.colophon a {
    color: var(--fg-dim);
    text-decoration: none;
    border-bottom: 1px solid var(--hairline-strong);
    transition: all 0.15s;
}
.colophon a:hover { color: var(--signal); border-color: var(--signal); }

/* ── Cellular automaton footer — one rule byte, made visible ── */
.ca-footer {
    position: relative;
    z-index: 1;
    padding: clamp(28px, 4vw, 52px) var(--gutter) clamp(32px, 5vw, 64px);
    border-top: 1px solid var(--hairline);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
}
.ca-footer::before, .ca-footer::after {
    content: '+';
    position: absolute;
    top: -0.62em;
    padding: 2px;
    background: var(--bg);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1;
}
.ca-footer::before { left: calc(var(--gutter) - 10px); }
.ca-footer::after { right: calc(var(--gutter) - 10px); }
.ca-footer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 14px;
}
.ca-caption {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.14em;
    line-height: 1.7;
}
.ca-rules {
    display: flex;
    flex: 0 0 auto;
    border: 1px solid var(--hairline-strong);
}
.ca-rule {
    min-width: 60px;
    min-height: 34px;
    padding: 7px 10px;
    border: 0;
    border-right: 1px solid var(--hairline-strong);
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 9px;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}
.ca-rule:last-child { border-right: 0; }
.ca-rule:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); }
.ca-rule[aria-pressed="true"] {
    color: var(--signal);
    background: color-mix(in srgb, var(--signal) 8%, transparent);
    box-shadow: inset 0 -2px 0 var(--signal);
}
.ca-rule:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
#ca-strip {
    display: block;
    width: 100%;
    height: clamp(120px, 16vh, 180px);
    background: var(--bg-2);
    border-left: 2px solid var(--signal);
}

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .startup-sequence { width: calc(100vw - 40px); }
    .startup-word { font-size: clamp(24px, 7vw, 52px); }
    .startup-status { font-size: 9px; }
    :root { --nav-h: 50px; }

    .site-nav { gap: 12px; }
    .wordmark { font-size: 11px; white-space: nowrap; }
    .nav-links { gap: 12px; }
    .nav-links a { font-size: 9px; }
    .nav-links a[href="#notes"] { display: none; }
    .nav-archive { display: none; }
    .theme-toggle { width: 30px; height: 30px; flex-basis: 30px; }

    .hud { bottom: 14px; font-size: 9px; }
    .hud-v { min-width: 80px; }
    .marginalia { display: none; }

    .hero { padding-bottom: 16vh; }
    .hero-title { font-size: clamp(52px, 18vw, 110px); }
    .hero-sub { font-size: 11px; }
    .scroll-cue { display: none; }

    .chapter, .specimen { padding-left: 20px; padding-right: 20px; }
    .chapter::before, .specimen::before { left: 10px; }
    .chapter::after, .specimen::after { right: 10px; }

    .idea-grid { grid-template-columns: 1fr; }
    .matrix-panel { position: static; }

    .specimen-canvas { height: 62vh; }
    .ghost-numeral { top: 6vh; font-size: clamp(80px, 24vw, 140px); }

    .notes-grid { grid-template-columns: 1fr; }

    .coda { min-height: 82vh; }
    .colophon { max-width: 30ch; line-height: 2.2; }

    .ca-footer { padding-left: 20px; padding-right: 20px; }
    .ca-footer::before { left: 10px; }
    .ca-footer::after { right: 10px; }
    .ca-footer-head { align-items: flex-start; flex-direction: column; gap: 12px; }
    .ca-rules { width: 100%; }
    .ca-rule { flex: 1 1 25%; min-width: 0; }
    #ca-strip { height: 140px; }
}

@media (max-width: 360px) {
    .site-nav { gap: 8px; padding-left: 12px; padding-right: 12px; }
    .wordmark { font-size: 10px; }
    .nav-links { gap: 8px; }
    .nav-links a[href="#idea"] { display: none; }
    .theme-toggle { width: 28px; height: 28px; flex-basis: 28px; }
}

/* Ultra-wide: keep measure sane */
@media (min-width: 1800px) {
    .chapter, .specimen { margin: 0 auto; }
}
