/* ============================================================================
   prototype.report  --  avant-garde editorial folio, leather + aurora
   ============================================================================ */

:root {
    /* Palette -- exact hex values from DESIGN.md */
    --binding-black:    #0a0a0f;
    --parchment-cream:  #f0ece4;
    --manuscript-ivory: #f0ece4;
    --ink-umber:        #1a1018;
    --graphite:         #3d3d3d;
    --worn-linen:       #c8c0b4;
    --aurora-violet:    #7b2ff7;
    --aurora-emerald:   #2de2b0;
    --tanned-hide:      #8b6344;
    --saddle-brown:     #5c3a1e;
    --burnished-sienna: #a07850;
    --dusty-spine:      #6b6560;
    --foxing-gold:      #c4a35a;
    --grain-dark:       #7a5838;
    --aurora-blue:      #0d1b4a;

    /* Type stack -- DESIGN.md fonts (Google Fonts) */
    --font-display: "Caveat", "Brush Script MT", cursive;
    --font-body:    "Libre Baskerville", Georgia, "Times New Roman", serif;
    --font-mono:    "IBM Plex Mono", "Space Mono", "Inter", ui-monospace, monospace;

    /* Spread sizing */
    --spread-pad-x: clamp(2rem, 5vw, 5rem);
    --spread-pad-y: clamp(2rem, 4vw, 4rem);

    /* Easing curves */
    --ease-out-cubic:  cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-in-out:     cubic-bezier(0.65, 0, 0.35, 1);
    --ease-overshoot:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--binding-black);
}

body {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--worn-linen);
    background: var(--binding-black);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--aurora-violet);
    color: var(--manuscript-ivory);
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ============================================================================
   Aurora -- atmospheric lighting, persistent across spreads
   ============================================================================ */

.aurora-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    mix-blend-mode: screen;
}

.aurora {
    position: absolute;
    width: 80vw;
    height: 80vw;
    border-radius: 50%;
    filter: blur(40vw);
    opacity: 0;
    transition: opacity 1.4s var(--ease-out-cubic);
    will-change: transform, opacity;
}

.aurora-violet {
    background: radial-gradient(circle at center, var(--aurora-violet) 0%, transparent 65%);
    top: -20vw;
    left: -10vw;
    animation: aurora-drift-a 18s ease-in-out infinite,
               aurora-pulse-a 12s ease-in-out infinite;
}

.aurora-emerald {
    background: radial-gradient(circle at center, var(--aurora-emerald) 0%, transparent 65%);
    bottom: -25vw;
    right: -15vw;
    animation: aurora-drift-b 22s ease-in-out infinite,
               aurora-pulse-b 12s ease-in-out infinite;
}

.aurora-blue {
    background: radial-gradient(circle at center, var(--aurora-blue) 0%, transparent 60%);
    top: 30vh;
    left: 35vw;
    width: 60vw;
    height: 60vw;
    filter: blur(35vw);
    animation: aurora-drift-c 26s ease-in-out infinite,
               aurora-pulse-c 14s ease-in-out infinite;
}

.aurora-stage.is-lit .aurora-violet  { opacity: 0.18; }
.aurora-stage.is-lit .aurora-emerald { opacity: 0.14; }
.aurora-stage.is-lit .aurora-blue    { opacity: 0.10; }

/* deeper atmosphere on the dark colophon */
.aurora-stage.in-colophon .aurora-violet  { opacity: 0.32; }
.aurora-stage.in-colophon .aurora-emerald { opacity: 0.26; }
.aurora-stage.in-colophon .aurora-blue    { opacity: 0.22; }

/* fainter on light spreads (II, IV) */
.aurora-stage.in-light .aurora-violet  { opacity: 0.10; }
.aurora-stage.in-light .aurora-emerald { opacity: 0.07; }
.aurora-stage.in-light .aurora-blue    { opacity: 0.05; }

@keyframes aurora-pulse-a {
    0%, 100% { opacity: var(--p, 0.18); }
    50%      { opacity: 0.06; }
}
@keyframes aurora-pulse-b {
    0%, 100% { opacity: var(--p, 0.14); }
    50%      { opacity: 0.05; }
}
@keyframes aurora-pulse-c {
    0%, 100% { opacity: var(--p, 0.10); }
    50%      { opacity: 0.04; }
}

@keyframes aurora-drift-a {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(8vw, 6vh, 0); }
}
@keyframes aurora-drift-b {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(-10vw, -4vh, 0); }
}
@keyframes aurora-drift-c {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(-5vw, 8vh, 0); }
}

/* ============================================================================
   Folio spine (persistent header)
   ============================================================================ */

.folio-spine {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.4rem clamp(1.5rem, 3vw, 3rem);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--worn-linen);
    pointer-events: none;
    mix-blend-mode: difference;
}

.folio-spine .spine-id,
.folio-spine .spine-meta {
    color: var(--worn-linen);
    opacity: 0.7;
}

.spine-nav {
    display: flex;
    gap: 0.5rem;
    pointer-events: auto;
}

.spine-nav a {
    display: inline-block;
    width: 1.6rem;
    height: 1.6rem;
    line-height: 1.6rem;
    text-align: center;
    color: var(--worn-linen);
    text-decoration: none;
    font-size: 0.7rem;
    border: 1px solid transparent;
    transition: color 250ms var(--ease-out-cubic),
                border-color 250ms var(--ease-out-cubic);
    opacity: 0.55;
}

.spine-nav a:hover {
    color: var(--aurora-violet);
    border-color: var(--aurora-violet);
    opacity: 1;
}

.spine-nav a.is-active {
    color: var(--foxing-gold);
    border-color: var(--foxing-gold);
    opacity: 1;
}

/* ============================================================================
   Folio + spread shell
   ============================================================================ */

.folio {
    position: relative;
    z-index: 1;
}

.spread {
    position: relative;
    min-height: 100vh;
    padding: var(--spread-pad-y) var(--spread-pad-x);
    display: grid;
    overflow: hidden;
    isolation: isolate;
}

.spread-folio {
    position: absolute;
    top: 1.5rem;
    left: var(--spread-pad-x);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--aurora-violet);
    z-index: 5;
}

.spread-folio-light {
    color: var(--aurora-emerald);
}

/* Reveal scaffolding -- driven by IntersectionObserver */
.reveal-target {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms var(--ease-out-cubic),
                transform 600ms var(--ease-out-cubic);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-target.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-target.is-leaving {
    opacity: 0.4;
    transform: translateY(-20px);
    transition: opacity 400ms var(--ease-out-cubic),
                transform 400ms var(--ease-out-cubic);
}

/* ============================================================================
   Leather texture system (used by cover + evidence panels)
   ============================================================================ */

.leather-texture,
.leather-grain,
.leather-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.leather-texture {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(160, 120, 80, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(60, 36, 16, 0.6) 0%, transparent 60%),
        radial-gradient(ellipse at 10% 90%, rgba(92, 58, 30, 0.5) 0%, transparent 50%),
        linear-gradient(135deg, var(--tanned-hide) 0%, var(--saddle-brown) 100%);
    z-index: 0;
}

.leather-grain {
    background:
        repeating-linear-gradient(
            175deg,
            var(--tanned-hide) 0px,
            var(--tanned-hide) 1px,
            var(--grain-dark) 1px,
            var(--grain-dark) 2px
        ),
        repeating-linear-gradient(
            5deg,
            transparent 0px,
            transparent 3px,
            rgba(0, 0, 0, 0.04) 3px,
            rgba(0, 0, 0, 0.04) 4px
        );
    mix-blend-mode: multiply;
    opacity: 0.35;
    z-index: 1;
}

.leather-noise {
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' seed='5'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.45 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
    background-size: 240px 240px;
    mix-blend-mode: overlay;
    opacity: 0.18;
    z-index: 2;
}

/* deeper-stained variants for evidence panels */
.panel[data-tone="hide"] .leather-texture {
    background:
        radial-gradient(ellipse at 35% 25%, rgba(180, 132, 86, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 75%, rgba(74, 46, 20, 0.55) 0%, transparent 60%),
        linear-gradient(140deg, var(--tanned-hide) 0%, #6e4f34 100%);
}
.panel[data-tone="saddle"] .leather-texture {
    background:
        radial-gradient(ellipse at 25% 30%, rgba(120, 78, 40, 0.65) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(40, 22, 10, 0.7) 0%, transparent 60%),
        linear-gradient(150deg, var(--saddle-brown) 0%, #2e1b0c 100%);
}
.panel[data-tone="sienna"] .leather-texture {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(196, 148, 100, 0.65) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(108, 76, 44, 0.55) 0%, transparent 60%),
        linear-gradient(125deg, var(--burnished-sienna) 0%, #6b4828 100%);
}
.panel[data-tone="dark"] .leather-texture {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(80, 50, 28, 0.6) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 75%, rgba(20, 12, 6, 0.85) 0%, transparent 60%),
        linear-gradient(160deg, #3a2410 0%, #150c06 100%);
}

/* ============================================================================
   SPREAD I -- THE COVER
   ============================================================================ */

.spread-cover {
    background: var(--binding-black);
    grid-template-columns: 40% 60%;
    align-items: stretch;
    color: var(--manuscript-ivory);
    padding: 0;
}

.cover-leather {
    position: relative;
    grid-column: 1;
    height: 100vh;
    transform: translateX(-100%);
    opacity: 0;
    will-change: transform, opacity;
    overflow: hidden;
}

.spread-cover.is-revealed .cover-leather {
    animation: cover-leather-in 800ms var(--ease-out-cubic) 300ms forwards;
}

@keyframes cover-leather-in {
    0%   { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0);     opacity: 1; }
}

.cover-stitching {
    position: absolute;
    top: 1.6rem;
    bottom: 1.6rem;
    right: 1.2rem;
    width: 1px;
    background: repeating-linear-gradient(
        to bottom,
        var(--foxing-gold) 0px,
        var(--foxing-gold) 6px,
        transparent 6px,
        transparent 12px
    );
    opacity: 0.55;
    z-index: 5;
}

.cover-emboss {
    position: absolute;
    bottom: 3rem;
    left: 2.4rem;
    right: 2.4rem;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: rgba(240, 236, 228, 0.18);
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.4),
        0 -1px 0 rgba(255, 230, 190, 0.06);
}

.emboss-line {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.emboss-numeral {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 5rem);
    letter-spacing: 0;
    line-height: 1;
    color: rgba(196, 163, 90, 0.35);
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.55),
        0 2px 6px rgba(196, 163, 90, 0.12);
}

.emboss-thin {
    font-size: 0.62rem;
    letter-spacing: 0.4em;
    opacity: 0.7;
}

.cover-divider {
    position: absolute;
    top: 0;
    left: 40%;
    height: 100vh;
    width: 2px;
    z-index: 4;
    transform: translateX(-1px);
}

.divider-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.spread-cover.is-revealed .divider-line {
    animation: divider-draw 500ms var(--ease-out-cubic) 400ms forwards;
}

@keyframes divider-draw {
    to { stroke-dashoffset: 0; }
}

.cover-typography {
    grid-column: 2;
    position: relative;
    height: 100vh;
    padding: clamp(3rem, 5vw, 5rem) clamp(2rem, 4vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    z-index: 3;
}

.cover-meta {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--aurora-violet);
    margin-bottom: 1.4rem;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 600ms var(--ease-out-cubic) 200ms,
                transform 600ms var(--ease-out-cubic) 200ms;
}

.spread-cover.is-revealed .cover-meta {
    opacity: 1;
    transform: translateY(0);
}

.cover-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 9vw, 7.6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--manuscript-ivory);
    margin-bottom: 2rem;
    margin-left: -0.3em;
    transform: translateX(8%);
    white-space: nowrap;
    overflow: visible;
}

.cover-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 240ms var(--ease-out-cubic),
                transform 240ms var(--ease-out-cubic);
    transition-delay: calc(var(--char-i, 0) * 40ms + 600ms);
}

.spread-cover.is-revealed .cover-title .char {
    opacity: 1;
    transform: translateY(0);
}

.cover-title .dot {
    color: var(--aurora-violet);
}

.cover-subtitle {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.7;
    color: var(--worn-linen);
    margin-bottom: 3rem;
    max-width: 38ch;
    opacity: 0;
    transition: opacity 800ms var(--ease-out-cubic) 1400ms;
}

.spread-cover.is-revealed .cover-subtitle {
    opacity: 1;
}

.cover-footer {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dusty-spine);
    opacity: 0;
    transition: opacity 800ms var(--ease-out-cubic) 1700ms;
}

.spread-cover.is-revealed .cover-footer {
    opacity: 1;
}

.cover-rule {
    flex: 1;
    height: 1px;
    background: var(--foxing-gold);
    opacity: 0.5;
    max-width: 220px;
}

.scroll-cue {
    position: absolute;
    bottom: 2rem;
    right: clamp(2rem, 4vw, 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    z-index: 6;
    opacity: 0;
    transition: opacity 600ms var(--ease-out-cubic) 2200ms;
}

.spread-cover.is-revealed .scroll-cue {
    opacity: 1;
}

.cue-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--aurora-violet);
}

.cue-arrow {
    width: 14px;
    height: 28px;
    animation: cue-bounce 2.4s ease-in-out infinite;
}

@keyframes cue-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}

/* ============================================================================
   Stamps -- shared
   ============================================================================ */

.stamp {
    position: absolute;
    width: clamp(110px, 11vw, 160px);
    aspect-ratio: 1 / 1;
    pointer-events: none;
    transform: rotate(0deg) scale(0.4);
    opacity: 0;
    transition: transform 500ms var(--ease-overshoot),
                opacity 500ms var(--ease-out-cubic);
    z-index: 9;
}

.stamp svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.stamp.is-revealed {
    transform: rotate(var(--stamp-rotation, 0deg)) scale(1);
    opacity: var(--stamp-opacity, 0.78);
}

.stamp-arc,
.stamp-center {
    font-family: var(--font-mono);
    fill: var(--foxing-gold);
    font-weight: 500;
    text-transform: uppercase;
}

.stamp-center {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 0.1em;
}

.stamp-tiny {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.24em;
    fill: var(--foxing-gold);
}

.stamp-cover {
    top: 14vh;
    left: 32%;
    --stamp-opacity: 0.7;
}

.stamp-thesis {
    top: 8vh;
    right: clamp(2rem, 5vw, 6rem);
    --stamp-opacity: 0.62;
}

.stamp-annot {
    bottom: 8vh;
    left: clamp(3rem, 6vw, 8rem);
    --stamp-opacity: 0.65;
}

.stamp-colophon {
    top: 12vh;
    right: clamp(3rem, 6vw, 8rem);
    --stamp-opacity: 0.78;
}

/* ============================================================================
   SPREAD II -- THE THESIS (light, editorial-flow)
   ============================================================================ */

.spread-thesis {
    background: var(--parchment-cream);
    color: var(--graphite);
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    padding-top: 5rem;
}

.spread-thesis::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 12% 18%, rgba(196, 163, 90, 0.10) 0%, transparent 45%),
        radial-gradient(ellipse at 90% 90%, rgba(123, 47, 247, 0.05) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.spread-thesis::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' seed='9'/><feColorMatrix values='0 0 0 0 0.05  0 0 0 0 0.04  0 0 0 0 0.03  0 0 0 0.4 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
    background-size: 220px 220px;
    opacity: 0.06;
    pointer-events: none;
    mix-blend-mode: multiply;
    z-index: 0;
}

.thesis-body {
    position: relative;
    grid-row: 1;
    grid-column: 1;
    max-width: 320px;
    margin-top: clamp(8vh, 14vh, 16vh);
    margin-left: clamp(2rem, 6vw, 8rem);
    z-index: 3;
}

.thesis-eyebrow {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--aurora-violet);
    margin-bottom: 1.4rem;
}

.thesis-h {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 5.6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ink-umber);
    margin-bottom: 2rem;
}

.thesis-body p {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: var(--graphite);
    margin-bottom: 1.4rem;
}

.thesis-body em {
    font-style: italic;
    color: var(--aurora-violet);
    font-weight: 700;
}

.thesis-sign {
    margin-top: 2rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dusty-spine);
}

.thesis-annotation {
    position: absolute;
    top: 22vh;
    right: clamp(1rem, 2vw, 3rem);
    width: 70vw;
    max-width: 1100px;
    transform: rotate(-3deg);
    transform-origin: top right;
    z-index: 2;
    pointer-events: none;
    color: var(--aurora-violet);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.0;
    letter-spacing: -0.02em;
    text-align: right;
}

.thesis-annotation .annot-line {
    display: block;
    font-size: clamp(3rem, 8vw, 7rem);
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 500ms var(--ease-out-cubic),
                transform 500ms var(--ease-out-cubic);
}

.thesis-annotation .annot-l1 { transition-delay: 200ms; }
.thesis-annotation .annot-l2 { transition-delay: 320ms; color: var(--ink-umber); }
.thesis-annotation .annot-l3 { transition-delay: 440ms; }

.spread-thesis.is-revealed .thesis-annotation .annot-line {
    opacity: 1;
    transform: translateX(0);
}

.thesis-annotation em {
    color: var(--aurora-violet);
    font-style: normal;
    position: relative;
    padding: 0 0.1em;
}

.annot-underline {
    position: absolute;
    left: 8%;
    right: 0;
    bottom: 18%;
    width: 60%;
    height: 30px;
    pointer-events: none;
}

.annot-underline-path {
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    transition: stroke-dashoffset 800ms var(--ease-out-cubic) 600ms;
}

.spread-thesis.is-revealed .annot-underline-path {
    stroke-dashoffset: 0;
}

.margin-note {
    position: absolute;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--dusty-spine);
    max-width: 220px;
    z-index: 3;
}

.margin-note-ii {
    bottom: 14vh;
    left: clamp(2rem, 6vw, 8rem);
    transform: rotate(-1deg);
    opacity: 0;
    transition: opacity 600ms var(--ease-out-cubic) 800ms;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.spread-thesis.is-revealed .margin-note-ii {
    opacity: 1;
}

.margin-arrow {
    color: var(--aurora-violet);
    font-size: 1.2rem;
    line-height: 1;
}

/* ============================================================================
   SPREAD III -- THE EVIDENCE (broken grid panels)
   ============================================================================ */

.spread-evidence {
    background: var(--binding-black);
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 2rem;
    padding-top: 5rem;
    color: var(--manuscript-ivory);
}

.evidence-h {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--manuscript-ivory);
    max-width: 16ch;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    grid-row: 1;
}

.evidence-grid {
    grid-row: 2;
    position: relative;
    width: 100%;
    height: clamp(340px, 56vh, 640px);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 1fr);
}

.panel {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 350ms var(--ease-in-out),
                box-shadow 350ms var(--ease-in-out),
                filter 350ms var(--ease-in-out);
    transform: rotate(var(--panel-rotation, 0deg)) translateY(40px);
    opacity: 0;
    will-change: transform, box-shadow, filter;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.spread-evidence.is-revealed .panel {
    opacity: 1;
    transform: rotate(var(--panel-rotation, 0deg)) translateY(0);
    transition: transform 700ms var(--ease-out-cubic) var(--reveal-delay, 0ms),
                opacity   700ms var(--ease-out-cubic) var(--reveal-delay, 0ms),
                box-shadow 350ms var(--ease-in-out),
                filter     350ms var(--ease-in-out);
}

.panel:hover {
    transform: rotate(var(--panel-rotation, 0deg)) translateY(-6px);
    box-shadow: 0 24px 40px rgba(123, 47, 247, 0.18),
                0 6px 14px rgba(0, 0, 0, 0.5);
    filter: brightness(1.08);
    z-index: 8 !important;
    transition-duration: 250ms;
}

/* aspect-ratio + grid placement for each panel */
.panel-1 { /* 3:2 */
    grid-column: 1 / span 6;
    grid-row: 1 / span 5;
    z-index: 3;
}
.panel-2 { /* 1:1 */
    grid-column: 7 / span 4;
    grid-row: 1 / span 4;
    z-index: 4;
    margin-top: 1.5rem;
    margin-left: -2rem;
}
.panel-3 { /* 2:3 */
    grid-column: 4 / span 4;
    grid-row: 4 / span 5;
    z-index: 5;
    margin-top: 1rem;
}
.panel-4 { /* 16:9 */
    grid-column: 8 / span 5;
    grid-row: 4 / span 4;
    z-index: 2;
    margin-top: 2rem;
}

.panel-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-family: var(--font-mono);
    color: var(--manuscript-ivory);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.panel-num {
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--foxing-gold);
}

.panel-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0;
    color: var(--manuscript-ivory);
    max-width: 12rem;
    line-height: 1.15;
}

.panel-edge {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    right: 1.2rem;
    bottom: 1.2rem;
    border: 1px solid rgba(196, 163, 90, 0.18);
    pointer-events: none;
    z-index: 3;
}

.evidence-caption {
    grid-row: 3;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--worn-linen);
    max-width: 540px;
    margin-top: 1.5rem;
    margin-left: auto;
    text-align: right;
}

/* ============================================================================
   SPREAD IV -- THE ANNOTATION (ruled paper)
   ============================================================================ */

.spread-annotation {
    background: var(--parchment-cream);
    color: var(--graphite);
    grid-template-columns: 120px 1fr 200px;
    column-gap: clamp(1.5rem, 3vw, 3rem);
    padding-top: 5rem;
    padding-bottom: 4rem;
    align-items: start;
}

.spread-annotation::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 14% 22%, rgba(196, 163, 90, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse at 86% 80%, rgba(123, 47, 247, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.spread-annotation::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' seed='3'/><feColorMatrix values='0 0 0 0 0.06  0 0 0 0 0.05  0 0 0 0 0.04  0 0 0 0.4 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
    background-size: 220px 220px;
    opacity: 0.05;
    pointer-events: none;
    mix-blend-mode: multiply;
    z-index: 0;
}

.ruled-margin {
    position: relative;
    z-index: 2;
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 3.2rem;
}

.ruled-margin .margin-line {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--dusty-spine);
    line-height: 2rem;
    text-align: right;
    padding-right: 0.6rem;
    border-right: 1px solid rgba(123, 47, 247, 0.45);
}

.ruled-page {
    position: relative;
    max-width: 640px;
    margin: 2rem auto 0;
    padding: 2rem 0 4rem;
    z-index: 2;
}

.ruled-lines {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 31px,
            rgba(61, 61, 61, 0.18) 31px,
            rgba(61, 61, 61, 0.18) 32px
        );
    pointer-events: none;
    z-index: 0;
}

.ruled-h {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.4vw, 3.6rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink-umber);
    margin-bottom: 2rem;
}

.ruled-line-text {
    position: relative;
    z-index: 1;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 2rem;
    color: var(--graphite);
    margin-bottom: 2rem;
    max-width: 60ch;
}

.ruled-line-text em {
    font-style: italic;
    color: var(--aurora-violet);
    font-weight: 700;
}

.ruled-mark {
    position: relative;
    color: var(--aurora-violet);
    font-weight: 700;
    padding: 0 0.15em;
}

.circled {
    position: absolute;
    top: 8.5rem;
    right: -2rem;
    width: 200px;
    height: 60px;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 500ms var(--ease-out-cubic) 700ms;
}

.spread-annotation.is-revealed .circled { opacity: 1; }

.circled-ellipse {
    stroke-dasharray: 6 7;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 700ms var(--ease-out-cubic) 900ms;
}

.spread-annotation.is-revealed .circled-ellipse {
    stroke-dashoffset: 0;
}

.hand-arrow {
    position: absolute;
    bottom: 6rem;
    right: 2rem;
    width: 120px;
    height: 80px;
    z-index: 3;
    pointer-events: none;
}

.arrow-path {
    transition: stroke-dashoffset 700ms var(--ease-out-cubic) 1100ms;
}

.spread-annotation.is-revealed .arrow-path {
    stroke-dashoffset: 0;
}

.hand-circle-note {
    position: absolute;
    bottom: 4.5rem;
    right: 0;
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--aurora-violet);
    transform: rotate(-6deg);
    z-index: 4;
    opacity: 0;
    transition: opacity 500ms var(--ease-out-cubic) 1300ms;
}

.spread-annotation.is-revealed .hand-circle-note {
    opacity: 1;
}

.margin-note-iv {
    margin-top: 6rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(107, 101, 96, 0.4);
    opacity: 0;
    transition: opacity 600ms var(--ease-out-cubic) 800ms;
    position: relative;
}

.spread-annotation.is-revealed .margin-note-iv { opacity: 1; }

.margin-note-iv .margin-meta {
    font-family: var(--font-mono);
    font-style: normal;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--aurora-violet);
}

/* ============================================================================
   SPREAD V -- THE COLOPHON
   ============================================================================ */

.spread-colophon {
    background: var(--binding-black);
    color: var(--worn-linen);
    grid-template-columns: 1fr;
    padding: 5rem var(--spread-pad-x) 4rem;
    align-items: center;
}

.spread-colophon::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(123, 47, 247, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(45, 226, 176, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 100%, rgba(13, 27, 74, 0.55) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: colophon-aurora 20s ease-in-out infinite;
}

@keyframes colophon-aurora {
    0%, 100% {
        background-position: 0% 0%, 0% 0%, 0% 0%;
    }
    33% {
        background-position: 8% 6%, -6% 4%, 4% -3%;
    }
    66% {
        background-position: -4% 8%, 6% -4%, -3% 5%;
    }
}

.colophon-grid {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem 4rem;
    align-items: start;
}

.colophon-header {
    grid-column: 1 / -1;
    border-bottom: 1px solid rgba(196, 163, 90, 0.4);
    padding-bottom: 2rem;
    margin-bottom: 1rem;
}

.colophon-h {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--manuscript-ivory);
    margin-bottom: 1.4rem;
}

.colophon-lede {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    color: var(--worn-linen);
    max-width: 56ch;
    font-style: italic;
}

.colophon-credits {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.credit-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 1.2rem;
    align-items: baseline;
    padding-bottom: 0.9rem;
    border-bottom: 1px dashed rgba(107, 101, 96, 0.45);
}

.credit-row dt {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--aurora-emerald);
}

.credit-row dd {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--manuscript-ivory);
}

.colophon-footer {
    grid-column: 1 / -1;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(196, 163, 90, 0.3);
    display: flex;
    align-items: center;
    gap: 1.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--dusty-spine);
}

.colophon-mark {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--foxing-gold);
    letter-spacing: 0;
    text-transform: none;
}

.colophon-rule {
    flex: 1;
    height: 1px;
    background: var(--foxing-gold);
    opacity: 0.4;
}

.colophon-end {
    color: var(--aurora-violet);
}

/* ============================================================================
   Folio progress bar (right edge)
   ============================================================================ */

.folio-progress {
    position: fixed;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 1px;
    height: 32vh;
    background: rgba(200, 192, 180, 0.18);
    z-index: 40;
    pointer-events: none;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: -1px;
    width: 3px;
    height: var(--progress, 0%);
    background: linear-gradient(to bottom, var(--aurora-violet), var(--aurora-emerald));
    transition: height 200ms linear;
    box-shadow: 0 0 8px rgba(123, 47, 247, 0.55);
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (max-width: 900px) {
    .spread-cover {
        grid-template-columns: 1fr;
    }
    .cover-leather {
        grid-column: 1;
        height: 38vh;
    }
    .spread-cover.is-revealed .cover-leather {
        animation: cover-leather-in-mobile 800ms var(--ease-out-cubic) 300ms forwards;
    }
    @keyframes cover-leather-in-mobile {
        0%   { transform: translateY(-100%); opacity: 0; }
        100% { transform: translateY(0);     opacity: 1; }
    }
    .cover-leather { transform: translateY(-100%); }
    .cover-divider { display: none; }
    .cover-typography {
        grid-column: 1;
        height: auto;
        min-height: 62vh;
        padding: 3rem 1.6rem 4rem;
    }
    .cover-title { white-space: normal; transform: translateX(0); margin-left: 0; }

    .stamp-cover { left: auto; right: 5%; top: 30vh; }

    .thesis-body { margin-left: 1.5rem; max-width: 100%; padding-right: 1.5rem; }
    .thesis-annotation {
        right: 0;
        width: 100%;
        text-align: left;
        padding-left: 1.5rem;
        top: auto;
        bottom: 14vh;
        transform: rotate(-3deg);
    }
    .annot-underline { left: 1.5rem; right: auto; width: 70%; }

    .evidence-grid {
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 24vh);
        gap: 1rem;
    }
    .panel-1, .panel-2, .panel-3, .panel-4 {
        grid-column: 1 / -1;
        grid-row: auto;
        margin: 0;
    }

    .spread-annotation {
        grid-template-columns: 1fr;
    }
    .ruled-margin { display: none; }
    .margin-note-iv { margin-top: 2rem; }

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

    .stamp-thesis { right: 1rem; top: 4vh; }
    .stamp-annot  { left: 1rem; bottom: 4vh; }
    .stamp-colophon { right: 1rem; top: 4vh; }
}

@media (max-width: 540px) {
    .folio-spine { padding: 1rem; font-size: 0.62rem; }
    .spine-meta { display: none; }
    .cover-title { font-size: clamp(2.4rem, 14vw, 4rem); }
}

/* ============================================================================
   Reduced motion -- respectful but minimal (no accessibility per rules)
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .aurora-violet, .aurora-emerald, .aurora-blue { animation-duration: 0s, 0s; }
    .cue-arrow { animation: none; }
}
