/* =============================================================
   Completengine — A Concurrent Event Engine, Catalogued
   The Aquarium Almanac — couture-mcbling on forest green
   ============================================================= */

:root {
    --c-wall:      #1F3A2C;
    --c-wall-deep: #13241B;
    --c-wall-lift: #2C5340;
    --c-vellum:    #F2E8D0;
    --c-vellum-deep:#E4D6B3;
    --c-ink:       #1B1208;
    --c-ink-faded: #5C4A33;
    --c-brass:     #C9A14A;
    --c-brass-hi:  #E6C476;
    --c-coral:     #E26D4F;
    --c-lagoon:    #3F8FA8;

    --col-width: 640px;
    --page-width: 1080px;
    --baseline: 24px;

    --font-display: 'Mulish', system-ui, -apple-system, sans-serif;
    --font-body:    'Mulish', system-ui, -apple-system, sans-serif;
    --font-italic:  'Cormorant Garamond', Georgia, serif;
    --font-mono:    'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--c-ink);
    background: var(--c-wall);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01";
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}

/* ============================================================
   The Wall — the dark green ground
   ============================================================ */
.wall {
    min-height: 100vh;
    width: 100%;
    background-color: var(--c-wall);
    background-image:
        radial-gradient(ellipse at 50% 0%, transparent 40%, rgba(19,36,27,0.55) 90%),
        radial-gradient(ellipse at 50% 100%, transparent 40%, rgba(19,36,27,0.65) 95%),
        repeating-linear-gradient(0deg,
            rgba(255,255,255,0.012) 0,
            rgba(255,255,255,0.012) 1px,
            transparent 1px,
            transparent 3px);
    position: relative;
    overflow-x: hidden;
}

.wall::before {
    /* outer vignette / gallery shadow */
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%,
        transparent 35%,
        rgba(19,36,27,0.35) 75%,
        rgba(19,36,27,0.7) 100%);
    z-index: 1;
}

/* ============================================================
   Chapter Index — sticky Roman numeral row
   ============================================================ */
.chapter-index {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    padding: 18px 0 14px;
    text-align: center;
    transition: backdrop-filter 220ms ease, background-color 220ms ease;
    backdrop-filter: blur(0);
    background-color: transparent;
}

.chapter-index.scrolled {
    background-color: rgba(31, 58, 44, 0.88);
    backdrop-filter: blur(6px);
    box-shadow: 0 1px 0 rgba(201, 161, 74, 0.18);
}

.chapter-row {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-display);
    color: var(--c-vellum);
}

.chapter-row .dot {
    color: var(--c-brass);
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
}

.chapter-row .fish-glyph {
    color: var(--c-brass);
    font-size: 12px;
    opacity: 0.6;
    transform: translateY(-1px);
}

.chapter-link {
    color: var(--c-vellum);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.08em;
    padding: 4px 8px;
    position: relative;
    display: inline-block;
    font-variant-numeric: tabular-nums;
    transition: color 200ms ease;
}

.chapter-link .numeral {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 18px;
    letter-spacing: 0.04em;
}

.chapter-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--c-brass);
    transform: translateX(-50%);
    transition: width 200ms cubic-bezier(.2,.8,.2,1);
}

.chapter-link.active::after {
    width: 80%;
}

.chapter-link:hover {
    color: var(--c-brass-hi);
}

.chapter-caption {
    display: none;
    margin-top: 6px;
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--c-vellum);
    font-size: 13px;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

/* ============================================================
   Codex — the centered scroll
   ============================================================ */
.codex {
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 24px 32px 96px;
    position: relative;
    z-index: 2;
}

/* ============================================================
   Plates — paper-aged rectangles on the green wall
   ============================================================ */
.plate {
    width: 100%;
    max-width: var(--col-width);
    margin: 56px auto;
    position: relative;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 700ms ease, transform 700ms ease;
}

.plate.in-view {
    opacity: 1;
    transform: translateY(0);
}

.paper {
    position: relative;
    background-color: var(--c-vellum);
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(92,74,51,0.18), transparent 45%),
        radial-gradient(ellipse at 100% 0%, rgba(92,74,51,0.18), transparent 45%),
        radial-gradient(ellipse at 0% 100%, rgba(92,74,51,0.18), transparent 45%),
        radial-gradient(ellipse at 100% 100%, rgba(92,74,51,0.18), transparent 45%),
        repeating-linear-gradient(0deg,
            rgba(92,74,51,0.05) 0,
            rgba(92,74,51,0.05) 1px,
            transparent 1px,
            transparent 64px),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='256' height='256'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.32  0 0 0 0 0.18  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-blend-mode: multiply, multiply, multiply, multiply, normal, multiply;
    box-shadow:
        0 1px 0 var(--c-vellum-deep),
        0 18px 50px -10px rgba(0,0,0,0.55),
        0 4px 12px -2px rgba(0,0,0,0.35);
    border-radius: 2px;
    overflow: hidden;
}

.paper-inner {
    position: relative;
    z-index: 2;
    padding: 56px 56px 40px;
    text-align: center;
}

/* The animated SVG plate-border */
.plate-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.plate-border rect {
    stroke-dasharray: 4000;
    stroke-dashoffset: 4000;
    transition: stroke-dashoffset 1.6s cubic-bezier(.2,.8,.2,1);
}

.plate.in-view .plate-border rect {
    stroke-dashoffset: 0;
}

/* ============================================================
   Frontispiece (Plate I) — full viewport opening
   ============================================================ */
.plate-frontispiece {
    margin-top: 24px;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
}

.plate-frontispiece .paper {
    width: 100%;
}

.plate-frontispiece .paper-inner {
    padding: 64px 56px 48px;
}

.plate-frontispiece .plate-border {
    height: 100%;
}

.cartouche-wrap {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto 14px;
}

.cartouche {
    width: 100%;
    height: auto;
    display: block;
}

.cartouche-oval {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: oval-trace 1.6s cubic-bezier(.2,.8,.2,1) 0.4s forwards;
}

.cartouche-oval-inner {
    opacity: 0;
    animation: oval-fade 0.6s ease 1.6s forwards;
}

@keyframes oval-trace {
    to { stroke-dashoffset: 0; }
}

@keyframes oval-fade {
    to { opacity: 1; }
}

/* The fish flock inside the cartouche — staggered entry, infinite loops */
.fish-flock .fish {
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
}

.fish-flock .fish-1 {
    animation:
        fish-fade-in 0.4s ease 2.4s forwards,
        fish-loop-1 18s ease-in-out 2.4s infinite;
}
.fish-flock .fish-2 {
    animation:
        fish-fade-in 0.4s ease 2.6s forwards,
        fish-loop-2 19s ease-in-out 2.6s infinite;
}
.fish-flock .fish-3 {
    animation:
        fish-fade-in 0.4s ease 2.8s forwards,
        fish-loop-3 20s ease-in-out 2.8s infinite;
}
.fish-flock .fish-4 {
    animation:
        fish-fade-in 0.4s ease 3.0s forwards,
        fish-loop-4 21s ease-in-out 3.0s infinite;
}
.fish-flock .fish-5 {
    animation:
        fish-fade-in 0.4s ease 3.2s forwards,
        fish-loop-5 18.5s ease-in-out 3.2s infinite;
}
.fish-flock .fish-6 {
    animation:
        fish-fade-in 0.4s ease 3.4s forwards,
        fish-loop-6 19.5s ease-in-out 3.4s infinite;
}
.fish-flock .fish-7 {
    animation:
        fish-fade-in 0.4s ease 3.6s forwards,
        fish-loop-7 22s ease-in-out 3.6s infinite;
}

@keyframes fish-fade-in {
    to { opacity: 1; }
}

/* Hand-keyed figure-eight loops, each fish slightly different */
@keyframes fish-loop-1 {
    0%   { transform: translate(120px, 140px) rotate(0deg); opacity: 1; }
    25%  { transform: translate(330px, 100px) rotate(-8deg); }
    50%  { transform: translate(420px, 230px) rotate(180deg); }
    75%  { transform: translate(180px, 250px) rotate(172deg); }
    100% { transform: translate(120px, 140px) rotate(360deg); opacity: 1; }
}
@keyframes fish-loop-2 {
    0%   { transform: translate(380px, 230px) rotate(180deg); opacity: 1; }
    25%  { transform: translate(160px, 200px) rotate(190deg); }
    50%  { transform: translate(110px, 110px) rotate(0deg); }
    75%  { transform: translate(360px, 90px) rotate(-10deg); }
    100% { transform: translate(380px, 230px) rotate(180deg); opacity: 1; }
}
@keyframes fish-loop-3 {
    0%   { transform: translate(220px, 80px) rotate(8deg); opacity: 1; }
    25%  { transform: translate(420px, 170px) rotate(-2deg); }
    50%  { transform: translate(290px, 280px) rotate(190deg); }
    75%  { transform: translate(120px, 200px) rotate(178deg); }
    100% { transform: translate(220px, 80px) rotate(8deg); opacity: 1; }
}
@keyframes fish-loop-4 {
    0%   { transform: translate(310px, 270px) rotate(184deg); opacity: 1; }
    25%  { transform: translate(140px, 180px) rotate(170deg); }
    50%  { transform: translate(220px, 90px) rotate(-4deg); }
    75%  { transform: translate(400px, 200px) rotate(2deg); }
    100% { transform: translate(310px, 270px) rotate(184deg); opacity: 1; }
}
@keyframes fish-loop-5 {
    0%   { transform: translate(150px, 250px) rotate(174deg); opacity: 1; }
    25%  { transform: translate(330px, 280px) rotate(190deg); }
    50%  { transform: translate(420px, 130px) rotate(-6deg); }
    75%  { transform: translate(200px, 110px) rotate(8deg); }
    100% { transform: translate(150px, 250px) rotate(174deg); opacity: 1; }
}
@keyframes fish-loop-6 {
    0%   { transform: translate(380px, 100px) rotate(-4deg); opacity: 1; }
    25%  { transform: translate(180px, 130px) rotate(8deg); }
    50%  { transform: translate(120px, 240px) rotate(186deg); }
    75%  { transform: translate(340px, 270px) rotate(178deg); }
    100% { transform: translate(380px, 100px) rotate(-4deg); opacity: 1; }
}
@keyframes fish-loop-7 {
    /* the clownfish — drifts through the wordmark zone */
    0%   { transform: translate(100px, 180px) rotate(2deg); opacity: 1; }
    25%  { transform: translate(280px, 150px) rotate(-4deg); }
    50%  { transform: translate(440px, 220px) rotate(184deg); }
    75%  { transform: translate(260px, 260px) rotate(176deg); }
    100% { transform: translate(100px, 180px) rotate(2deg); opacity: 1; }
}

/* Sparkles around the wordmark */
.sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--c-brass-hi);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 4px 1px rgba(230, 196, 118, 0.7);
}

.sparkle::before, .sparkle::after {
    content: '';
    position: absolute;
    background: var(--c-brass-hi);
    box-shadow: 0 0 2px rgba(230,196,118,0.8);
}

.sparkle::before {
    left: 50%;
    top: -3px;
    width: 1px;
    height: 10px;
    transform: translateX(-50%);
}

.sparkle::after {
    top: 50%;
    left: -3px;
    width: 10px;
    height: 1px;
    transform: translateY(-50%);
}

.sparkle.twinkle {
    animation: sparkle-twinkle 1.2s ease forwards;
}

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

.sparkle-1 { top: 12%; left: 28%; }
.sparkle-2 { top: 8%;  left: 70%; }
.sparkle-3 { top: 22%; left: 50%; }

/* ============================================================
   Wordmark, hairline rule, tagline
   ============================================================ */
.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 52px;
    line-height: 1;
    letter-spacing: -0.005em;
    color: var(--c-ink);
    margin: 18px 0 14px;
    opacity: 0;
    animation: wordmark-fade 0.5s ease 2.0s forwards;
}

@keyframes wordmark-fade {
    to { opacity: 1; }
}

.hairline-rule {
    border: 0;
    width: 80px;
    height: 1px;
    background: var(--c-brass);
    margin: 12px auto;
    opacity: 0;
    animation: rule-fade 0.5s ease 2.2s forwards;
}

@keyframes rule-fade {
    to { opacity: 1; }
}

.tagline {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 19px;
    letter-spacing: 0.04em;
    color: var(--c-ink-faded);
    margin: 8px 0 12px;
    opacity: 0;
    animation: tagline-fade 0.5s ease 2.3s forwards;
}

.frontispiece-meta {
    color: var(--c-ink-faded);
    margin: 0 0 28px;
    font-size: 14px;
    opacity: 0;
    animation: tagline-fade 0.5s ease 2.5s forwards;
}

@keyframes tagline-fade {
    to { opacity: 1; }
}

/* ============================================================
   Buttons — ovaloid pills with double-rule brass border
   ============================================================ */
.cta-row {
    margin: 28px 0 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    animation: tagline-fade 0.5s ease 2.7s forwards;
}

.btn {
    display: inline-block;
    height: 44px;
    padding: 0 28px;
    line-height: 42px;
    background: var(--c-vellum);
    color: var(--c-ink);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    font-variant: small-caps;
    text-decoration: none;
    border-radius: 44px;
    position: relative;
    cursor: pointer;
    transition: color 220ms ease, background-color 220ms ease;
    box-shadow:
        inset 0 0 0 1px var(--c-brass),
        inset 0 0 0 4px var(--c-vellum),
        inset 0 0 0 5px var(--c-brass-hi),
        inset 0 1px 0 rgba(255,255,255,0.55);
}

.btn::before {
    /* gloss seam */
    content: '';
    position: absolute;
    top: 1px;
    left: 12px;
    right: 12px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--c-brass-hi) 50%,
        transparent 100%);
    opacity: 0.7;
    pointer-events: none;
    border-radius: 2px;
}

.btn-label {
    position: relative;
    z-index: 2;
}

.btn:hover {
    color: var(--c-coral);
    background: var(--c-vellum);
    box-shadow:
        inset 0 0 0 1px var(--c-coral),
        inset 0 0 0 4px var(--c-vellum),
        inset 0 0 0 5px var(--c-brass-hi),
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 0 0 1px rgba(226,109,79,0.12);
}

.btn-secondary {
    color: var(--c-ink-faded);
}

.btn-secondary:hover {
    color: var(--c-lagoon);
    box-shadow:
        inset 0 0 0 1px var(--c-lagoon),
        inset 0 0 0 4px var(--c-vellum),
        inset 0 0 0 5px var(--c-brass-hi),
        inset 0 1px 0 rgba(255,255,255,0.6);
}

/* ============================================================
   Plate titles, ribbons, captions
   ============================================================ */
.ribbon-wrap {
    width: 220px;
    margin: 0 auto 12px;
}

.ribbon {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 0 rgba(92,74,51,0.18));
}

.plate-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 36px;
    line-height: 1.1;
    letter-spacing: -0.005em;
    color: var(--c-ink);
    margin: 12px 0 6px;
}

.plate-subtitle {
    margin: 0 0 12px;
    color: var(--c-ink-faded);
    font-size: 16px;
}

.plate-subtitle em {
    font-family: var(--font-italic);
    font-style: italic;
    letter-spacing: 0.04em;
}

.plate-caption {
    margin: 28px 0 0;
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--c-ink-faded);
    font-variant: small-caps;
}

.plate-caption::before, .plate-caption::after {
    content: ' \2767  ';
    color: var(--c-brass);
    font-style: normal;
    margin: 0 6px;
    opacity: 0.7;
}

.guilloche-rule {
    width: 220px;
    height: 8px;
    margin: 14px auto 18px;
    display: block;
    opacity: 0.85;
}

/* ============================================================
   Body type — calm Mulish on vellum
   ============================================================ */
.plate p, .plate li, .plate blockquote {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--c-ink);
    text-align: left;
}

.plate p {
    margin: 0 0 18px;
    padding: 0 24px;
}

.plate p.lede {
    font-size: 18px;
    color: var(--c-ink);
    text-align: center;
    padding: 0 12px;
    margin-top: 18px;
}

.plate p em, .plate li em {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--c-ink-faded);
}

.pull-quote {
    margin: 24px 24px;
    padding: 16px 28px;
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 19px;
    line-height: 1.4;
    color: var(--c-ink-faded);
    text-align: center;
    border-top: 1px solid var(--c-brass);
    border-bottom: 1px solid var(--c-brass);
    position: relative;
}

.pull-quote::before, .pull-quote::after {
    color: var(--c-brass);
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 24px;
    position: absolute;
}

.pull-quote::before {
    content: '\2767';
    top: 4px;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    background: var(--c-vellum);
    padding: 0 6px;
}

.pull-quote::after {
    content: '\2767';
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) translateY(50%);
    background: var(--c-vellum);
    padding: 0 6px;
}

/* ============================================================
   Catalogue (numbered list) — Plate III
   ============================================================ */
.catalogue {
    list-style: none;
    margin: 24px 0;
    padding: 0;
}

.catalogue li {
    background: var(--c-vellum);
    border: 1px solid transparent;
    border-image: linear-gradient(90deg, transparent, var(--c-brass), transparent) 1;
    margin: 12px 16px;
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 12px;
    align-items: center;
    box-shadow: 0 1px 0 var(--c-vellum-deep);
    position: relative;
}

.catalogue li::before {
    /* paper strip edge */
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--c-brass);
    opacity: 0.5;
}

.cat-num {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--c-brass);
    font-size: 16px;
    text-align: center;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
}

.cat-body {
    color: var(--c-ink);
    font-size: 15px;
    text-align: left;
}

.cat-body strong {
    color: var(--c-ink);
    font-weight: 700;
}

/* ============================================================
   Specimen Plate — the anatomical fish (Plate IV)
   ============================================================ */
.specimen-wrap {
    margin: 12px auto 18px;
    width: 100%;
    max-width: 580px;
    background: var(--c-vellum);
    padding: 12px;
    border: 1px solid var(--c-vellum-deep);
}

.specimen {
    width: 100%;
    height: auto;
    display: block;
}

.leader-lines path.leader {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1);
}

.plate-specimen.in-view .leader-lines path:nth-child(1) {
    stroke-dashoffset: 0;
    transition-delay: 0.1s;
}
.plate-specimen.in-view .leader-lines path:nth-child(2) {
    stroke-dashoffset: 0;
    transition-delay: 0.34s;
}
.plate-specimen.in-view .leader-lines path:nth-child(3) {
    stroke-dashoffset: 0;
    transition-delay: 0.58s;
}
.plate-specimen.in-view .leader-lines path:nth-child(4) {
    stroke-dashoffset: 0;
    transition-delay: 0.82s;
}
.plate-specimen.in-view .leader-lines path:nth-child(5) {
    stroke-dashoffset: 0;
    transition-delay: 1.06s;
}

.leader-labels text {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.plate-specimen.in-view .leader-labels text:nth-child(1) { opacity: 1; transition-delay: 1.0s; }
.plate-specimen.in-view .leader-labels text:nth-child(2) { opacity: 1; transition-delay: 1.24s; }
.plate-specimen.in-view .leader-labels text:nth-child(3) { opacity: 1; transition-delay: 1.48s; }
.plate-specimen.in-view .leader-labels text:nth-child(4) { opacity: 1; transition-delay: 1.72s; }
.plate-specimen.in-view .leader-labels text:nth-child(5) { opacity: 1; transition-delay: 1.96s; }

/* ============================================================
   Code block — Plate V, vellum + JetBrains Mono + brass corner brackets
   ============================================================ */
.codeblock-wrap {
    position: relative;
    margin: 22px 16px;
    padding: 24px 22px;
    background: var(--c-vellum);
    border: 1px solid var(--c-vellum-deep);
    box-shadow: inset 0 0 0 1px rgba(201,161,74,0.18);
}

.bracket {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--c-brass);
}

.bracket-tl { top: -2px; left: -2px;  border-right: 0; border-bottom: 0; }
.bracket-tr { top: -2px; right: -2px; border-left: 0;  border-bottom: 0; }
.bracket-bl { bottom: -2px; left: -2px;  border-right: 0; border-top: 0; }
.bracket-br { bottom: -2px; right: -2px; border-left: 0;  border-top: 0; }

.codeblock {
    margin: 0;
    padding: 0;
    background: transparent;
    color: var(--c-ink);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    font-feature-settings: "liga" 0;
    text-align: left;
    white-space: pre;
    overflow-x: auto;
}

/* ============================================================
   Divider fish (between plates)
   ============================================================ */
.divider-fish {
    width: 36px;
    margin: 12px auto;
    text-align: center;
    color: var(--c-brass);
    opacity: 0.85;
    transition: transform 600ms cubic-bezier(.2,.8,.2,1);
}

.divider-fish.dart {
    transform: translateX(12px);
}

.divider-fish svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   Colophon
   ============================================================ */
.colophon {
    width: 100%;
    max-width: var(--col-width);
    margin: 56px auto 24px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 700ms ease, transform 700ms ease;
}

.colophon.in-view {
    opacity: 1;
    transform: translateY(0);
}

.colophon-paper .paper-inner {
    padding: 36px 40px;
}

.crossed-fish {
    width: 80px;
    margin: 0 auto 12px;
    color: var(--c-brass);
}

.crossed-fish svg {
    width: 100%;
    height: auto;
    display: block;
}

.colophon-title {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 18px;
    letter-spacing: 0.08em;
    color: var(--c-ink-faded);
    margin: 0 0 12px;
    font-variant: small-caps;
}

.colophon-line {
    margin: 4px 0;
    font-size: 14px;
    color: var(--c-ink);
    text-align: center;
    padding: 0;
}

.colophon-line em {
    font-family: var(--font-italic);
    font-style: italic;
}

.colophon-meta {
    margin: 14px 0 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-ink-faded);
    text-align: center;
    padding: 0;
    letter-spacing: 0.04em;
}

.colophon-hash code {
    background: transparent;
    color: var(--c-brass);
    font-family: var(--font-mono);
    font-size: 11px;
}

.colophon-domain {
    margin: 8px 0 0;
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.16em;
    color: var(--c-ink-faded);
    text-align: center;
    padding: 0;
    font-variant: small-caps;
}

.colophon .plate-border rect {
    stroke-dasharray: 1750;
    stroke-dashoffset: 1750;
    transition: stroke-dashoffset 1.6s cubic-bezier(.2,.8,.2,1);
}

.colophon.in-view .plate-border rect {
    stroke-dashoffset: 0;
}

/* ============================================================
   Loading fish (idle, slow swim across the bottom)
   ============================================================ */
.loading-fish {
    position: fixed;
    bottom: 24px;
    left: -80px;
    width: 60px;
    color: var(--c-brass);
    opacity: 0.55;
    z-index: 5;
    pointer-events: none;
    animation: loading-swim 26s linear infinite;
}

.loading-fish svg {
    width: 100%;
    height: auto;
    display: block;
}

@keyframes loading-swim {
    0%   { transform: translateX(0) translateY(0); }
    25%  { transform: translateX(40vw) translateY(-6px); }
    50%  { transform: translateX(80vw) translateY(0); }
    75%  { transform: translateX(110vw) translateY(-4px); }
    100% { transform: translateX(120vw) translateY(0); }
}

/* ============================================================
   Selection style (subtle on vellum)
   ============================================================ */
::selection {
    background: rgba(201,161,74,0.35);
    color: var(--c-ink);
}

/* ============================================================
   Responsive — narrower breakpoints
   ============================================================ */
@media (max-width: 760px) {
    .codex { padding: 16px 12px 64px; }
    .plate { margin: 32px auto; }
    .paper-inner { padding: 36px 24px 28px; }
    .wordmark { font-size: 38px; }
    .plate-title { font-size: 28px; }
    .plate p, .plate li, .plate blockquote { font-size: 15px; }
    .plate p { padding: 0 8px; }
    .pull-quote { margin: 20px 8px; padding: 14px 20px; font-size: 17px; }
    .codeblock { font-size: 11.5px; }
    .codeblock-wrap { margin: 22px 4px; padding: 18px 14px; }
    .catalogue li { grid-template-columns: 70px 1fr; padding: 12px 14px; margin: 12px 4px; }
    .specimen-wrap { padding: 8px; }
}

@media (max-width: 480px) {
    .chapter-row { display: none; }
    .chapter-caption { display: block; }
    .wordmark { font-size: 32px; }
    .plate-title { font-size: 24px; }
    .ribbon-wrap { width: 180px; }
    .cta-row { gap: 10px; }
    .btn { padding: 0 18px; font-size: 12px; height: 42px; line-height: 40px; }
}

/* ============================================================
   Reduced-motion fallback
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .plate, .colophon { opacity: 1 !important; transform: none !important; transition: opacity 120ms ease !important; }
    .plate-border rect { stroke-dashoffset: 0 !important; transition: opacity 120ms ease !important; }
    .cartouche-oval { stroke-dashoffset: 0 !important; animation: none; }
    .cartouche-oval-inner { opacity: 1 !important; animation: none; }
    .fish-flock .fish { opacity: 1 !important; animation: none !important; }
    .wordmark, .tagline, .frontispiece-meta, .hairline-rule, .cta-row { opacity: 1 !important; animation: none !important; }
    .leader-lines path.leader { stroke-dashoffset: 0 !important; transition: opacity 120ms ease !important; }
    .leader-labels text { opacity: 1 !important; transition: opacity 120ms ease !important; }
    .loading-fish { animation: none; left: 50vw; }
}
