/* =============================================================
   mujun.art -- light-academia x punk defiance
   palette: #1B4332 #2D6A4F #52B788 #F5F0E8 #2B2118 #8B1A1A #C4A35A #000000
   fonts: Playfair Display, Stint Ultra Expanded, Lora, Courier Prime
   ============================================================= */

:root {
    --canopy:    #1B4332;
    --revolt:    #2D6A4F;
    --lichen:    #52B788;
    --parchment: #F5F0E8;
    --ink:       #2B2118;
    --stamp-red: #8B1A1A;
    --gilt:      #C4A35A;
    --black:     #000000;

    --col-left:    38vw;
    --col-gutter:  24vw;
    --col-right:   38vw;

    --font-display: "Playfair Display", "Lora", Georgia, serif;
    --font-stencil: "Stint Ultra Expanded", "Inter", "Arial Black", sans-serif;
    --font-body:    "Lora", Georgia, "Times New Roman", serif;
    --font-mono:    "Courier Prime", "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--parchment);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.72;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    /* aged paper tint; subtle vignette */
    background-image:
        radial-gradient(circle at 20% 10%, rgba(196, 163, 90, 0.06), transparent 50%),
        radial-gradient(circle at 80% 90%, rgba(43, 33, 24, 0.06), transparent 60%);
}

/* =============================================================
   Ambient leaf scatter -- background drift
   ============================================================= */
.leaf-scatter {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.leaf-scatter .floating-leaf {
    position: absolute;
    width: 36px;
    height: 36px;
    opacity: 0.12;
    color: var(--revolt);
}
.folio-dark + .folio-dark .leaf-scatter .floating-leaf,
.folio-dark .leaf-scatter .floating-leaf { color: var(--lichen); }

/* =============================================================
   Cursor leaf trail
   ============================================================= */
.cursor-trail {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}
.cursor-trail .trail-leaf {
    position: absolute;
    width: 18px;
    height: 18px;
    color: var(--revolt);
    opacity: 0.55;
    transform-origin: center;
    transition: opacity 0.6s linear, transform 0.6s ease-out;
    will-change: transform, opacity;
}

/* =============================================================
   Vine spine -- continuous SVG running down center gutter
   ============================================================= */
.vine-spine {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    color: var(--ink);
    transition: color 600ms ease;
}
.vine-spine.on-dark { color: var(--parchment); }
.vine-spine.on-dark .vine-leaves { fill: var(--lichen); }

.vine-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vine-stem,
.vine-tendrils path,
.vine-leaves path { transition: opacity 300ms ease; }

/* leaves fade in progressively */
.vine-leaves path {
    opacity: 0;
    transform-origin: center;
    transform: scale(0);
    transition: opacity 600ms ease, transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.vine-leaves path.unfurled {
    opacity: 0.85;
    transform: scale(1);
}

.vine-tendrils path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.vine-tendrils path.extended { stroke-dashoffset: 0; }

/* =============================================================
   Margin annotations
   ============================================================= */
.margin-annotations {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 5vw;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
    color: var(--ink);
    transition: color 600ms ease;
}
.margin-left  { left: 0; }
.margin-right { right: 0; }

.margin-annotations.on-dark { color: var(--parchment); }

.margin-stream {
    display: flex;
    flex-direction: column;
    gap: 3.2rem;
    padding: 3rem 0;
    transform: translateY(0);
    will-change: transform;
}
.margin-left  .margin-stream { writing-mode: vertical-lr; align-items: flex-start; padding-left: 1vw; }
.margin-right .margin-stream { writing-mode: vertical-rl; align-items: flex-end;   padding-right: 1vw; }

.annot {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    opacity: 0.65;
    white-space: nowrap;
    text-transform: none;
}
.annot.accent {
    color: var(--stamp-red);
    font-weight: 700;
    letter-spacing: 0.18em;
    opacity: 0.9;
    text-transform: uppercase;
}
.margin-annotations.on-dark .annot.accent { color: var(--lichen); }

/* =============================================================
   Manuscript -- folios
   ============================================================= */
.manuscript {
    position: relative;
    z-index: 1;
}

.folio {
    position: relative;
    min-height: 100vh;
    width: 100vw;
    padding: 6vh 6vw 6vh 6vw;
    display: grid;
    grid-template-columns: var(--col-left) var(--col-gutter) var(--col-right);
    grid-template-rows: 1fr;
    gap: 2vw;
    overflow: hidden;
    isolation: isolate;
}

/* light folio -- parchment background, ink type */
.folio-light {
    background: var(--parchment);
    color: var(--ink);
}

/* dark folio -- canopy background, parchment type */
.folio-dark {
    background: var(--canopy);
    color: var(--parchment);
}
.folio-dark .footnote,
.folio-dark .folio-meta,
.folio-dark .annot { color: var(--parchment); }

.folio-recto > .verso { grid-column: 1; align-self: center; }
.folio-recto > .recto { grid-column: 3; align-self: center; }
.folio-verso > .recto { grid-column: 1; align-self: center; }
.folio-verso > .verso { grid-column: 3; align-self: center; }

.folio .verso, .folio .recto {
    position: relative;
    z-index: 2;
    max-height: 88vh;
    overflow: visible;
}

/* a subtle paper-grain corner mark on light folios */
.folio-light::before {
    content: "";
    position: absolute;
    top: 4vh; left: 4vw;
    width: 28px; height: 28px;
    border-left: 1px solid rgba(43,33,24,0.4);
    border-top: 1px solid rgba(43,33,24,0.4);
}
.folio-light::after {
    content: "";
    position: absolute;
    bottom: 4vh; right: 4vw;
    width: 28px; height: 28px;
    border-right: 1px solid rgba(43,33,24,0.4);
    border-bottom: 1px solid rgba(43,33,24,0.4);
}
.folio-dark::before {
    content: "";
    position: absolute;
    top: 4vh; left: 4vw;
    width: 28px; height: 28px;
    border-left: 1px solid rgba(196,163,90,0.5);
    border-top: 1px solid rgba(196,163,90,0.5);
}
.folio-dark::after {
    content: "";
    position: absolute;
    bottom: 4vh; right: 4vw;
    width: 28px; height: 28px;
    border-right: 1px solid rgba(196,163,90,0.5);
    border-bottom: 1px solid rgba(196,163,90,0.5);
}

/* =============================================================
   Typography -- common
   ============================================================= */
.folio-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.72;
    margin-bottom: 2.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: rotate(-1deg);
    transform-origin: left center;
}
.folio-divider {
    flex: 0 0 36px;
    height: 1px;
    background: currentColor;
    opacity: 0.5;
}

.kicker {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 14px;
    margin-bottom: 1.2rem;
    color: var(--gilt);
    letter-spacing: 0.04em;
}
.folio-dark .kicker { color: var(--gilt); }

.lede {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(20px, 1.8vw, 26px);
    line-height: 1.32;
    letter-spacing: -0.01em;
    max-width: 36ch;
    margin-bottom: 2rem;
}

.folio-body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    max-width: 42ch;
    margin-bottom: 1.4rem;
}
.folio-body em {
    font-style: italic;
    color: var(--revolt);
}
.folio-dark .folio-body em { color: var(--lichen); }

.footnote {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid currentColor;
    border-color: rgba(43,33,24,0.25);
    font-family: var(--font-body);
    font-style: italic;
    font-size: 13px;
    line-height: 1.55;
    max-width: 38ch;
    opacity: 0.86;
    display: flex;
    gap: 0.6rem;
}
.folio-dark .footnote { border-color: rgba(245,240,232,0.25); }

.footnote-mark {
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1;
    color: var(--stamp-red);
}
.folio-dark .footnote-mark { color: var(--lichen); }

/* =============================================================
   Folio I -- Hero
   ============================================================= */
.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -0.025em;
    font-size: clamp(54px, 7.4vw, 132px);
    margin-bottom: 2.4rem;
    position: relative;
}
.hero-line { display: block; position: relative; }
.line-a {
    transform: translateX(-2vw) rotate(-1.5deg);
    color: var(--ink);
}
.line-b {
    text-align: right;
    transform: translateX(0.5vw) rotate(0.8deg);
    font-style: italic;
    color: var(--revolt);
    position: relative;
}
.line-b em {
    font-style: italic;
    font-weight: 700;
}
.line-c {
    transform: translateX(4vw) rotate(-0.5deg);
    font-weight: 700;
    color: var(--ink);
}

.stamp-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-7deg);
    font-family: var(--font-stencil);
    font-size: clamp(16px, 1.6vw, 24px);
    font-weight: 400;
    letter-spacing: 0.18em;
    color: var(--stamp-red);
    background: transparent;
    padding: 6px 18px;
    border: 2px solid var(--stamp-red);
    mix-blend-mode: multiply;
    white-space: nowrap;
    pointer-events: none;
    text-transform: uppercase;
    opacity: 0.85;
}

.hero-illustration {
    position: relative;
    width: 100%;
    height: 70vh;
    max-height: 720px;
    color: var(--ink);
}
.hero-illustration svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ill-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    fill: currentColor;
    opacity: 0.7;
}

.stamp {
    position: absolute;
    top: 8%;
    right: -2%;
    transform: rotate(8deg);
    font-family: var(--font-stencil);
    color: var(--stamp-red);
    border: 3px double var(--stamp-red);
    padding: 0.4rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: clamp(14px, 1.3vw, 20px);
    background: rgba(245,240,232,0.0);
    mix-blend-mode: multiply;
    line-height: 1;
}
.stamp-sub {
    display: block;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.6em;
    letter-spacing: 0.08em;
    text-transform: none;
    margin-top: 0.2rem;
    opacity: 0.85;
}

/* scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--ink);
    opacity: 0.7;
}
.scroll-hint-text {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.scroll-hint-line {
    width: 60px;
    height: 1px;
    background: currentColor;
    position: relative;
}
.scroll-hint-line::after {
    content: "";
    position: absolute;
    right: -2px;
    top: -3px;
    width: 7px;
    height: 7px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(-45deg);
}

/* =============================================================
   Folio II -- Manifesto
   ============================================================= */
.folio-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(40px, 5.4vw, 86px);
    line-height: 1.06;
    letter-spacing: -0.02em;
    margin-bottom: 2.6rem;
    transform: rotate(-1deg);
    transform-origin: left top;
}
.folio-title em {
    color: var(--lichen);
    font-style: italic;
    display: block;
    transform: translateX(2vw);
}

.manifesto-illustration {
    width: 100%;
    height: 56vh;
    max-height: 560px;
    color: var(--parchment);
}
.manifesto-illustration svg { width: 100%; height: 100%; display: block; }

.pull-quote {
    position: relative;
    margin-bottom: 2.4rem;
    padding: 1.6rem 0 1.6rem 2.4rem;
    border-left: 2px solid var(--gilt);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.3;
    color: var(--parchment);
    max-width: 32ch;
    transform: rotate(-0.6deg);
}
.pull-quote em { color: var(--lichen); font-style: italic; }
.quote-mark {
    position: absolute;
    font-family: var(--font-display);
    font-size: 4em;
    line-height: 0.8;
    color: var(--gilt);
    opacity: 0.7;
}
.quote-mark:not(.closing) { top: -12px; left: -8px; }
.quote-mark.closing { bottom: -28px; right: 2rem; }
.pull-quote cite {
    display: block;
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 400;
    font-style: normal;
    color: var(--gilt);
    opacity: 0.85;
}

.numbered-list {
    margin-top: 2rem;
    display: grid;
    gap: 0.9rem;
}
.numbered-item {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    border-bottom: 1px dotted rgba(245,240,232,0.25);
    padding-bottom: 0.6rem;
}
.numbered-item .num {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.2em;
    color: var(--gilt);
    min-width: 1.6em;
}
.numbered-item p {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.45;
    color: var(--parchment);
    max-width: 38ch;
}

/* =============================================================
   Folio III -- Specimen
   ============================================================= */
.study-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(32px, 4vw, 60px);
    line-height: 1.1;
    letter-spacing: -0.018em;
    margin-bottom: 2rem;
    position: relative;
    transform: rotate(-0.8deg);
}
.study-title em {
    color: var(--revolt);
    font-style: italic;
    display: block;
}
.folio-dark .study-title em { color: var(--lichen); }

.stint-overlay {
    position: absolute;
    bottom: -8px;
    right: 0;
    transform: rotate(-3deg);
    font-family: var(--font-stencil);
    font-size: clamp(14px, 1.2vw, 20px);
    font-weight: 400;
    letter-spacing: 0.18em;
    color: var(--stamp-red);
    background: var(--parchment);
    padding: 4px 14px;
    border: 1.5px solid var(--stamp-red);
    text-transform: uppercase;
    line-height: 1;
    mix-blend-mode: multiply;
}
.folio-dark .stint-overlay { background: var(--canopy); }

.specimen-list {
    margin-top: 2rem;
    display: grid;
    gap: 0.7rem;
}
.specimen-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px dotted rgba(43,33,24,0.3);
    align-items: baseline;
}
.specimen-row dt {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}
.specimen-row dd {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.75;
}

.specimen-card {
    position: relative;
    border: 1px solid var(--gilt);
    padding: 1.6rem 1.2rem 1rem 1.2rem;
    background: rgba(245,240,232,0.4);
    box-shadow: 4px 4px 0 var(--gilt);
    transform: rotate(0.6deg);
    color: var(--ink);
}
.specimen-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.8;
}
.cat-no { color: var(--stamp-red); font-weight: 700; }
.cat-status { color: var(--revolt); }

.specimen-svg {
    width: 100%;
    height: 60vh;
    max-height: 640px;
    display: block;
    color: var(--ink);
}

.specimen-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--gilt);
}
.cat-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.7;
}
.cat-tag.accent {
    color: var(--stamp-red);
    border: 1px solid var(--stamp-red);
    padding: 2px 8px;
    transform: rotate(-2deg);
    font-weight: 700;
}

/* =============================================================
   Folio IV -- Conflict
   ============================================================= */
.conflict-typography {
    margin-bottom: 1.8rem;
}
.conflict-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(34px, 4.6vw, 78px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    display: grid;
    gap: 0.4rem;
}
.word-elegant {
    font-style: italic;
    color: var(--parchment);
    transform: translateX(-1vw) rotate(-1deg);
}
.word-versus {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.4em;
    color: var(--gilt);
    margin: 0.2rem 0;
    transform: translateX(2vw);
}
.word-stencil {
    font-family: var(--font-stencil);
    font-weight: 400;
    font-size: 0.78em;
    letter-spacing: 0.18em;
    color: var(--lichen);
    text-transform: uppercase;
    transform: translateX(0.5vw) rotate(0.6deg);
}

.conflict-sub {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 14px;
    color: var(--gilt);
    opacity: 0.85;
    margin-top: 0.6rem;
    max-width: 30ch;
}

.ill-collision {
    width: 100%;
    height: 44vh;
    max-height: 460px;
    display: block;
    color: var(--parchment);
}
.stencil-burst { color: var(--lichen); }

.dual-column {
    display: grid;
    grid-template-columns: 1fr 24px 1fr;
    gap: 1.4rem;
    margin-bottom: 2rem;
}
.col-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-style: italic;
    font-size: 22px;
    margin-bottom: 0.8rem;
    color: var(--gilt);
    letter-spacing: -0.01em;
}
.col-body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 1rem;
    color: var(--parchment);
}
.col-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}
.col-list li {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.85;
    color: var(--parchment);
}
.col-list .hex { color: var(--lichen); font-weight: 700; }

.col-divider {
    display: flex;
    justify-content: center;
}
.divider-vine {
    width: 20px;
    height: 100%;
    color: var(--gilt);
}
.divider-vine svg { width: 100%; height: 100%; display: block; }

.col-right .col-title { color: var(--lichen); }

.closer {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 22px;
    color: var(--parchment);
    margin-top: 1.4rem;
    text-align: right;
    transform: rotate(-0.6deg);
}
.closer em { color: var(--lichen); }

/* =============================================================
   Folio V -- Vine architecture
   ============================================================= */
.vine-stats {
    margin-top: 2.6rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
    border-top: 1px solid var(--gilt);
    border-bottom: 1px solid var(--gilt);
    padding: 1.2rem 0;
}
.stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.stat-num {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(36px, 3.4vw, 56px);
    line-height: 1;
    color: var(--revolt);
    letter-spacing: -0.02em;
}
.stat-pct {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.5em;
    color: var(--gilt);
    margin-left: 0.1em;
}
.stat-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0.7;
    margin-top: 0.4rem;
}

.ill-roots {
    width: 100%;
    height: 70vh;
    max-height: 720px;
    color: var(--ink);
    display: block;
}
.root-pulse {
    animation: rootPulse 4s ease-in-out infinite;
}
@keyframes rootPulse {
    0%, 100% { stroke: var(--ink); }
    50%      { stroke: var(--revolt); }
}

/* =============================================================
   Folio VI -- Colophon
   ============================================================= */
.colophon-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(46px, 6vw, 96px);
    line-height: 1.04;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}
.colophon-title em {
    font-style: italic;
    color: var(--gilt);
    display: block;
    transform: translateX(2vw) rotate(-0.6deg);
}

.colophon-block {
    margin-top: 2rem;
    padding: 1.4rem 0;
    border-top: 2px solid var(--gilt);
    border-bottom: 2px solid var(--gilt);
    display: grid;
    gap: 0.7rem;
}
.colophon-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: baseline;
    border-bottom: 1px dotted rgba(245,240,232,0.25);
    padding-bottom: 0.5rem;
}
.colophon-row:last-child { border-bottom: none; }
.colophon-key {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gilt);
}
.colophon-val {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 16px;
    color: var(--parchment);
}

.rebut-btn {
    margin-top: 2.4rem;
    background: transparent;
    border: 2px solid var(--lichen);
    color: var(--lichen);
    padding: 0.9rem 1.4rem;
    font-family: var(--font-stencil);
    font-size: 13px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    transition: background 200ms ease, color 200ms ease, transform 200ms ease;
    transform: rotate(-1deg);
}
.rebut-stamp {
    display: block;
    margin-top: 0.3rem;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: none;
    color: var(--gilt);
    transform: rotate(0.5deg);
}
.rebut-btn:hover {
    background: var(--lichen);
    color: var(--canopy);
    transform: rotate(0deg);
}
.rebut-btn:hover .rebut-stamp { color: var(--canopy); }
.rebut-btn.fired {
    border-color: var(--stamp-red);
    color: var(--stamp-red);
    animation: stampImpact 700ms ease forwards;
}
@keyframes stampImpact {
    0%   { transform: rotate(-1deg) scale(1); }
    20%  { transform: rotate(-2deg) scale(0.92); }
    35%  { transform: rotate(-2deg) scale(1.04); }
    100% { transform: rotate(-1.5deg) scale(1); }
}

.ill-colophon {
    width: 100%;
    height: 80vh;
    max-height: 760px;
    color: var(--parchment);
    display: block;
}

/* =============================================================
   Footer
   ============================================================= */
.archive-footer {
    background: var(--canopy);
    color: var(--parchment);
    padding: 3rem 6vw;
    border-top: 4px double var(--gilt);
}
.footer-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    justify-content: space-between;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.footer-mark { font-weight: 700; }
.footer-mark.accent { color: var(--gilt); }
.footer-divider {
    flex: 1;
    height: 1px;
    background: var(--gilt);
    opacity: 0.5;
    min-width: 40px;
}
.footer-text {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0.04em;
    color: var(--gilt);
}

/* =============================================================
   Folio progress (right edge leaf indicator)
   ============================================================= */
.folio-progress {
    position: fixed;
    right: 2vw;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    pointer-events: none;
}
.progress-leaf {
    width: 14px;
    height: 14px;
    background:
        radial-gradient(circle at 30% 30%, transparent 50%, currentColor 51%) no-repeat,
        linear-gradient(45deg, transparent 50%, currentColor 50%) no-repeat;
    /* simpler -- just a leaf-shaped element via clip-path */
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2 Q 16 8 14 14 Q 10 18 6 14 Q 4 8 10 2 Z' fill='black'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M10 2 Q 16 8 14 14 Q 10 18 6 14 Q 4 8 10 2 Z' fill='black'/></svg>") center/contain no-repeat;
    background: var(--ink);
    opacity: 0.25;
    transition: background 400ms ease, opacity 400ms ease, transform 400ms ease;
}
.progress-leaf.active {
    background: var(--lichen);
    opacity: 1;
    transform: scale(1.25) rotate(-6deg);
}
.progress-leaf.passed {
    background: var(--revolt);
    opacity: 0.85;
}
body.on-dark-section .progress-leaf:not(.active):not(.passed) {
    background: var(--parchment);
    opacity: 0.4;
}

/* =============================================================
   Reveal animations -- per-folio entrance
   ============================================================= */
.folio .verso > *,
.folio .recto > * {
    opacity: 0;
    transform: translateY(18px) rotate(0.6deg);
    transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.folio.in-view .verso > *,
.folio.in-view .recto > * {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}
/* stagger */
.folio.in-view .verso > *:nth-child(1),
.folio.in-view .recto > *:nth-child(1) { transition-delay: 60ms; }
.folio.in-view .verso > *:nth-child(2),
.folio.in-view .recto > *:nth-child(2) { transition-delay: 160ms; }
.folio.in-view .verso > *:nth-child(3),
.folio.in-view .recto > *:nth-child(3) { transition-delay: 260ms; }
.folio.in-view .verso > *:nth-child(4),
.folio.in-view .recto > *:nth-child(4) { transition-delay: 360ms; }
.folio.in-view .verso > *:nth-child(5),
.folio.in-view .recto > *:nth-child(5) { transition-delay: 460ms; }
.folio.in-view .verso > *:nth-child(n+6),
.folio.in-view .recto > *:nth-child(n+6) { transition-delay: 560ms; }

/* on first load, hero is already in view */
#folio-1 .verso > *, #folio-1 .recto > * {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

/* fern unfurl -- main illustration in each folio */
.folio.in-view .ill-fern,
.folio.in-view .specimen-svg,
.folio.in-view .ill-collision,
.folio.in-view .ill-roots,
.folio.in-view .ill-colophon,
.folio.in-view .manifesto-illustration svg {
    animation: fernUnfurl 1800ms cubic-bezier(0.32, 1.06, 0.41, 1.01) both;
}
@keyframes fernUnfurl {
    0%   { transform: rotate(-12deg) scale(0.62); transform-origin: bottom center; opacity: 0; filter: blur(2px); }
    40%  { opacity: 1; }
    100% { transform: rotate(0) scale(1); transform-origin: bottom center; opacity: 1; filter: blur(0); }
}

/* =============================================================
   Responsive -- collapse the tripartite grid
   ============================================================= */
@media (max-width: 980px) {
    :root {
        --col-left:    100%;
        --col-gutter:  0;
        --col-right:   100%;
    }
    .folio {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 4vh;
        padding: 8vh 8vw;
        min-height: auto;
    }
    .folio-recto > .verso, .folio-recto > .recto,
    .folio-verso > .recto, .folio-verso > .verso {
        grid-column: 1;
    }
    .vine-spine { display: none; }
    .margin-annotations { display: none; }
    .folio-progress { display: none; }
    .hero-title { font-size: clamp(40px, 9vw, 80px); }
    .stamp { right: 2%; top: 4%; }
    .specimen-card { transform: rotate(0); }
    .vine-stats { grid-template-columns: 1fr; gap: 0.8rem; }
    .dual-column { grid-template-columns: 1fr; }
    .col-divider { display: none; }
}

@media (max-width: 560px) {
    body { font-size: 16px; }
    .folio { padding: 6vh 6vw; }
    .stamp-overlay { font-size: 12px; padding: 4px 10px; }
    .footer-inner { gap: 0.6rem; }
    .footer-divider { display: none; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .folio .verso > *, .folio .recto > * { opacity: 1; transform: none; }
}
