/* ============================================================
   PPZZ.ee — The Classified Bibliotheca
   Warm cyberpunk bibliotheca: golden-ratio split-screen,
   terracotta warmth + neon-cyan intrusions, scholarly motifs.
   ============================================================ */

/* ----------------------------------------------------------
   0. Google Fonts Import
   ---------------------------------------------------------- */
/* Fonts loaded via <link> in HTML:
   Caveat 400/700, Libre Baskerville 400/700/italic,
   Lora 400/italic, Share Tech Mono 400
*/

/* ----------------------------------------------------------
   1. Custom Properties
   ---------------------------------------------------------- */
:root {
    /* Colour palette */
    --espresso:    #1a0e08;   /* Deep Foundation — Burnt Umber Ink */
    --vellum:      #f2e8d9;   /* Primary Background — Aged Vellum */
    --clay:        #c9623f;   /* Left Panel Background — Terracotta Clay */
    --sienna:      #8b3a1f;   /* Secondary Warm — Burnt Sienna */
    --umber:       #2c1810;   /* Text Primary — Dark Espresso */
    --ember:       #e8923a;   /* Warm Accent — Amber Ember */
    --neon:        #00d9c8;   /* Cool Intrusion — Neon Cyan */
    --electric:    #4f46e5;   /* Cool Secondary — Electric Indigo */
    --parchment:   #d4c4aa;   /* Neutral Warm — Parchment Mid */

    /* Typography stacks */
    --font-display:    "Caveat", "Comic Sans MS", cursive;
    --font-heading:    "Libre Baskerville", Georgia, "Times New Roman", serif;
    --font-body:       "Lora", Georgia, "Times New Roman", serif;
    --font-mono:       "Share Tech Mono", "Courier New", monospace;

    /* Spacing */
    --spine-width:        3px;
    --spine-hover-width:  24px;
    --left-panel-pct:     38fr;
    --right-panel-pct:    62fr;
    --page-pad:           clamp(1.5rem, 3vw, 3rem);
    --content-max:        66ch;
    --margin-col-width:   160px;
}

/* ----------------------------------------------------------
   2. Reset and Base
   ---------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    background: var(--espresso);
    color: var(--umber);
    font-family: var(--font-body);
    line-height: 1.75;
    overflow: hidden;      /* Both panels manage their own scroll */
    height: 100vh;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: transparent; }

/* ----------------------------------------------------------
   3. Codex Wrapper — 38/62 golden-ratio split
   ---------------------------------------------------------- */
#codex-wrapper {
    display: grid;
    grid-template-columns: 38fr 62fr;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ----------------------------------------------------------
   4. Left Panel — The Cover Folio (fixed, never scrolls)
   ---------------------------------------------------------- */
#cover-folio {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background: var(--clay);
    display: flex;
    flex-direction: column;
}

/* Atmospheric base texture on cover */
#cover-folio::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(26, 14, 8, 0.6) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 10%, rgba(139, 58, 31, 0.3) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* ----------------------------------------------------------
   5. Spine
   ---------------------------------------------------------- */
#codex-spine {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: var(--spine-width);
    z-index: 20;
    transition: width 300ms ease;
    overflow: hidden;
}

#codex-spine:hover {
    width: var(--spine-hover-width);
}

.spine-line {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg,
        var(--ember) 0%,
        var(--neon)  50%,
        var(--ember) 100%);
    animation: spine-pulse 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes spine-pulse {
    0%, 100% { opacity: 0.7; box-shadow: 0 0 4px var(--ember); }
    50%       { opacity: 1.0; box-shadow: 0 0 10px var(--neon), 0 0 20px rgba(0, 217, 200, 0.3); }
}

/* Micro-navigation in spine (visible on hover) */
#spine-nav {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: calc(var(--spine-hover-width) - 3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    opacity: 0;
    transition: opacity 200ms ease;
    z-index: 2;
}

#codex-spine:hover #spine-nav {
    opacity: 1;
}

.spine-chapter-mark {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--neon);
    writing-mode: vertical-rl;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 200ms ease;
}

.spine-chapter-mark:hover {
    color: var(--ember);
}

/* ----------------------------------------------------------
   6. Cover Photo (Ken Burns, always showing)
   ---------------------------------------------------------- */
#cover-photo-frame {
    position: absolute;
    inset: 0;
    z-index: 0;
}

#cover-photo {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.photo-subject {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(139,58,31,0.55) 0%, rgba(201,98,63,0.3) 50%, rgba(26,14,8,0.7) 100%),
        /* Aged paper / daguerreotype fill via CSS gradient art */
        repeating-linear-gradient(
            30deg,
            rgba(201,98,63,0.08) 0px,
            rgba(232,146,58,0.06) 40px,
            rgba(139,58,31,0.1) 80px,
            rgba(44,24,16,0.15) 120px
        );
    background-color: #3d1e0f;
    animation: ken-burns 20s ease-in-out infinite alternate;
}

@keyframes ken-burns {
    from { transform: scale(1);    transform-origin: 60% 40%; }
    to   { transform: scale(1.04); transform-origin: 40% 60%; }
}

/* Scanline CRT overlay */
.scanline-overlay {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent           0px,
        transparent           1px,
        rgba(0, 0, 0, 0.08)  1px,
        rgba(0, 0, 0, 0.08)  2px
    );
    pointer-events: none;
    z-index: 2;
}

/* Corner vignette */
.vignette-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(26, 14, 8, 0.75) 100%
    );
    pointer-events: none;
    z-index: 3;
}

/* Glitch displacement layer */
.photo-glitch-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
}

.artifact-photo:hover .photo-glitch-layer {
    animation: glitch-displace 800ms steps(1) forwards;
}

@keyframes glitch-displace {
    0%   { opacity: 0; }
    10%  {
        opacity: 1;
        clip-path: polygon(0 20%, 100% 20%, 100% 21%, 0 21%);
        transform: translateX(6px);
        background: rgba(0, 217, 200, 0.15);
    }
    20%  {
        clip-path: polygon(0 45%, 100% 45%, 100% 47%, 0 47%);
        transform: translateX(-4px);
        background: rgba(232, 146, 58, 0.12);
    }
    40%  {
        clip-path: polygon(0 70%, 100% 70%, 100% 72%, 0 72%);
        transform: translateX(8px);
        background: rgba(0, 217, 200, 0.1);
    }
    60%  {
        clip-path: polygon(0 30%, 100% 30%, 100% 32%, 0 32%);
        transform: translateX(-3px);
    }
    80%  { opacity: 0.4; }
    100% { opacity: 0; }
}

/* Photo caption */
.photo-caption {
    position: absolute;
    bottom: 1.25rem;
    left: 1rem;
    right: 1.5rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.caption-text {
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--parchment);
    line-height: 1.3;
    opacity: 0.9;
}

/* ----------------------------------------------------------
   7. Cover Content (text overlay on left panel)
   ---------------------------------------------------------- */
#cover-content {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 2rem 2rem 2rem 1.75rem;
    padding-right: calc(var(--spine-width) + 1rem);
}

.cover-status {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--neon);
    letter-spacing: 0.05em;
    line-height: 1.4;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    word-break: break-all;
}

.cover-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(72px, 10vw, 100px);
    color: var(--vellum);
    line-height: 0.9;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    text-shadow: 3px 3px 0 rgba(26,14,8,0.5);
}

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

.cover-subtitle {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 14px;
    color: var(--parchment);
    opacity: 0.8;
    line-height: 1.5;
    margin-bottom: auto;
}

/* Cover navigation tabs */
#cover-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1.5rem;
}

.nav-tab {
    display: inline-block;
    position: relative;
    padding: 0.35rem 0.6rem;
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--vellum);
    border-radius: 2px;
    transition: background 300ms ease, color 200ms ease;
    overflow: hidden;
}

.nav-tab::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 0.6rem;
    width: 0;
    height: 1px;
    background: var(--ember);
    transition: width 300ms ease;
}

.nav-tab:hover {
    background: rgba(232, 146, 58, 0.15);
    color: var(--ember);
}

.nav-tab:hover::after {
    width: calc(100% - 1.2rem);
}

.cover-coordinates {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--neon);
    opacity: 0.7;
    letter-spacing: 0.04em;
}

/* ----------------------------------------------------------
   8. Right Panel — The Text Folio (independent scroll)
   ---------------------------------------------------------- */
#text-folio {
    height: 100vh;
    overflow-y: auto;
    background: var(--vellum);
    scroll-behavior: smooth;
}

/* Custom scrollbar */
#text-folio::-webkit-scrollbar { width: 6px; }
#text-folio::-webkit-scrollbar-track { background: var(--parchment); }
#text-folio::-webkit-scrollbar-thumb {
    background: var(--sienna);
    border-radius: 3px;
}

/* ----------------------------------------------------------
   9. Folio Chapter sections
   ---------------------------------------------------------- */
.folio-chapter {
    padding: var(--page-pad) var(--page-pad) calc(var(--page-pad) * 1.5);
    border-bottom: 1px solid rgba(212, 196, 170, 0.4);
}

.chapter-inner {
    max-width: 900px;
    margin: 0 auto;
}

/* Chapter header */
.chapter-header {
    margin-bottom: 2.5rem;
}

.chapter-number-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--sienna);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.chapter-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(24px, 3vw, 40px);
    color: var(--sienna);
    line-height: 1.15;
    margin-bottom: 0.5rem;
}

.chapter-data-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--neon);
    opacity: 0.85;
    margin-bottom: 0.75rem;
}

.chapter-ornament {
    font-family: var(--font-heading);
    color: var(--sienna);
    font-size: 14px;
    letter-spacing: 0.3em;
    opacity: 0.7;
}

/* ----------------------------------------------------------
   10. Folio Spread — 3-column micro-grid with annotation column
   ---------------------------------------------------------- */
.folio-spread {
    display: grid;
    grid-template-columns: 1fr var(--margin-col-width);
    gap: 2.5rem;
    align-items: start;
}

.folio-body {
    min-width: 0;
}

/* Annotation / Marginalia column */
.folio-margin {
    min-width: 0;
    padding-top: 2rem;
}

.marginalia-note {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 1rem;
    border-left: 1px dashed rgba(212, 196, 170, 0.6);
    transform: rotate(var(--rotate, 0deg));
    transform-origin: left center;
}

.marginalia-note span {
    font-family: var(--font-display);
    font-size: 13px;
    color: rgba(139, 58, 31, 0.7);
    line-height: 1.5;
    display: block;
}

/* ----------------------------------------------------------
   11. Typography — Body
   ---------------------------------------------------------- */
.folio-body p {
    color: var(--umber);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.75;
    margin-bottom: 1.4em;
}

/* Drop cap paragraphs */
.drop-cap-para {
    position: relative;
}

.drop-cap {
    float: left;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 4.5em;
    line-height: 0.72;
    padding: 0.06em 0.1em 0 0;
    color: var(--sienna);
    background: rgba(139, 58, 31, 0.08);
    margin-right: 0.05em;
    margin-top: 0.04em;
}

/* Footnote superscripts */
.footnote-ref {
    font-family: var(--font-heading);
    font-size: 11px;
    color: var(--sienna);
    cursor: pointer;
    transition: color 200ms ease;
    vertical-align: super;
    line-height: 0;
}

/* Footnote blocks */
.footnote-block {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(212, 196, 170, 0.5);
}

.footnote {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 13.5px;
    color: rgba(44, 24, 16, 0.7);
    line-height: 1.6;
    margin-bottom: 0.6em;
    transition: background 300ms ease;
    border-radius: 2px;
    padding: 2px 4px;
}

.footnote.fn-highlight {
    background: rgba(0, 217, 200, 0.1);
}

/* ----------------------------------------------------------
   12. Woodcut Dividers
   ---------------------------------------------------------- */
.woodcut-divider {
    margin: 1.8rem auto;
    max-width: 420px;
    text-align: center;
}

.woodcut-divider.large {
    max-width: 600px;
    margin: 2.5rem auto;
}

.woodcut-divider svg {
    width: 100%;
    height: auto;
}

/* ----------------------------------------------------------
   13. Glitch Text (Share Tech Mono + neon, used sparingly)
   ---------------------------------------------------------- */
.glitch-text {
    font-family: var(--font-mono);
    color: var(--neon);
    font-size: 10px;
    letter-spacing: 0.05em;
}

/* ----------------------------------------------------------
   14. Holographic Bookmarks
   ---------------------------------------------------------- */
.holographic-bookmark {
    position: absolute;
    right: 0;
    top: 15%;
    width: 4px;
    height: 40px;
    background: linear-gradient(180deg, var(--neon), var(--electric));
    animation: bookmark-glow 4s ease-in-out infinite;
    z-index: 10;
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.artifact-photo:hover .holographic-bookmark {
    transform: scaleY(2);
    box-shadow: 0 0 12px var(--neon);
}

@keyframes bookmark-glow {
    0%, 100% { background: linear-gradient(180deg, var(--neon), var(--electric)); opacity: 0.8; }
    50%       { background: linear-gradient(180deg, var(--electric), var(--neon)); opacity: 1; }
}

/* ----------------------------------------------------------
   15. Artifact Photo (small inline)
   ---------------------------------------------------------- */
.artifact-entry {
    display: flex;
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: flex-start;
}

.artifact-photo-small {
    position: relative;
    width: 160px;
    flex-shrink: 0;
    aspect-ratio: 3/4;
    overflow: hidden;
    border: 1px solid rgba(212, 196, 170, 0.4);
}

.artifact-image-fill {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(201,98,63,0.4) 0%, rgba(139,58,31,0.6) 100%),
        repeating-linear-gradient(
            45deg,
            rgba(201,98,63,0.07) 0px,
            rgba(232,146,58,0.05) 25px,
            rgba(139,58,31,0.08) 50px
        );
    background-color: #4a2015;
    background-size: 100% 100%, auto;
}

.artifact-details {
    flex: 1;
    min-width: 0;
}

.artifact-ref {
    margin-bottom: 0.6rem;
}

.artifact-description {
    font-size: 15.5px;
    margin-bottom: 0.8em;
}

.artifact-caption-handwritten {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--sienna);
    font-style: italic;
    opacity: 0.85;
}

/* ----------------------------------------------------------
   16. Scholar Profiles Grid
   ---------------------------------------------------------- */
.scholar-profiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.scholar-card {
    position: relative;
    background: rgba(244, 236, 224, 0.6);
    border: 1px solid rgba(212, 196, 170, 0.4);
    border-radius: 2px;
    overflow: hidden;
    transition: box-shadow 300ms ease;
}

.scholar-card:hover {
    box-shadow: 0 4px 20px rgba(139, 58, 31, 0.15);
}

.scholar-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.scholar-image-fill {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(160deg, rgba(201,98,63,0.35) 0%, rgba(26,14,8,0.65) 100%),
        repeating-linear-gradient(
            60deg,
            rgba(201,98,63,0.06) 0px,
            rgba(232,146,58,0.04) 30px,
            rgba(139,58,31,0.07) 60px
        );
    background-color: #3a1a0a;
    background-size: 100% 100%, auto;
}

.scholar-info {
    padding: 0.85rem;
}

.scholar-ref {
    font-size: 9px;
    margin-bottom: 0.4rem;
}

.scholar-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--sienna);
    margin-bottom: 0.3rem;
}

.scholar-field {
    font-family: var(--font-body);
    font-size: 12.5px;
    color: var(--umber);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.scholar-annotation {
    font-family: var(--font-display);
    font-size: 12px;
    color: rgba(139, 58, 31, 0.75);
    line-height: 1.5;
    margin: 0;
}

/* ----------------------------------------------------------
   17. Chapter Accordion
   ---------------------------------------------------------- */
.chapter-accordion {
    margin: 2rem 0;
}

.accordion-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--sienna);
    text-align: left;
    transition: color 200ms ease;
}

.accordion-trigger:hover {
    color: var(--umber);
}

.accordion-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(212, 196, 170, 0.5);
    transition: background 300ms ease;
}

.accordion-trigger:hover .accordion-divider-line {
    background: var(--ember);
}

.accordion-title {
    white-space: nowrap;
    font-size: 14px;
}

.accordion-arrow {
    font-size: 14px;
    transition: transform 300ms ease;
    color: var(--sienna);
}

.accordion-trigger.is-open .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 400ms ease, padding 300ms ease;
    padding: 0 0 0 1rem;
    border-left: 2px solid rgba(232, 146, 58, 0.4);
}

.accordion-body.is-open {
    max-height: 600px;
    padding: 1rem 0 1rem 1rem;
}

.accordion-body p {
    margin-bottom: 1em;
}

.accordion-body p:last-child {
    margin-bottom: 0;
}

/* ----------------------------------------------------------
   18. Full-bleed atmospheric spreads
   ---------------------------------------------------------- */
.full-bleed-spread {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 380px;
    overflow: hidden;
}

.spread-photo-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.spread-photo {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.spread-photo-inner {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(44,24,16,0.3) 0%,
            rgba(201,98,63,0.25) 40%,
            rgba(26,14,8,0.85) 100%),
        repeating-linear-gradient(
            15deg,
            rgba(201,98,63,0.09) 0px,
            rgba(139,58,31,0.07) 60px,
            rgba(232,146,58,0.06) 120px,
            rgba(44,24,16,0.1) 180px
        );
    background-color: #2a1208;
    background-size: 100% 100%, auto;
    animation: ken-burns 25s ease-in-out infinite alternate;
}

.spread-caption-block {
    position: absolute;
    bottom: 2.5rem;
    left: var(--page-pad);
    z-index: 10;
}

.spread-caption-right {
    left: auto;
    right: var(--page-pad);
    text-align: right;
}

.spread-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(32px, 4vw, 56px);
    color: var(--vellum);
    line-height: 1.1;
    margin-bottom: 0.6rem;
    text-shadow: 2px 2px 8px rgba(26,14,8,0.8);
}

.spread-ref {
    font-size: 11px;
    opacity: 0.85;
}

/* ----------------------------------------------------------
   19. Field Notes
   ---------------------------------------------------------- */
.field-notes-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0 2rem;
}

.field-note-entry {
    padding: 1rem 1.25rem;
    background: rgba(244, 236, 224, 0.5);
    border-left: 3px solid rgba(232, 146, 58, 0.4);
    border-radius: 0 2px 2px 0;
}

.field-note-date {
    font-size: 10px;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.field-note-text {
    font-size: 16px;
    margin-bottom: 0.5em;
}

.field-note-author {
    font-family: var(--font-display);
    font-size: 14px;
    color: rgba(139, 58, 31, 0.75);
    font-style: italic;
    margin: 0;
}

/* ----------------------------------------------------------
   20. Colophon / Footer
   ---------------------------------------------------------- */
#colophon {
    background: var(--espresso);
    padding: calc(var(--page-pad) * 1.5) var(--page-pad);
}

.colophon-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.colophon-ornament {
    font-family: var(--font-heading);
    color: var(--sienna);
    font-size: 16px;
    letter-spacing: 0.4em;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.colophon-title {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--parchment);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.colophon-meta {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 13px;
    color: rgba(212, 196, 170, 0.6);
    line-height: 1.7;
    margin-bottom: 0.6em;
}

.colophon-sys {
    margin-top: 1.5rem;
    font-size: 10px;
    opacity: 0.7;
}

/* ----------------------------------------------------------
   21. Reveal Animations (IntersectionObserver — single-unit fade)
   ---------------------------------------------------------- */
.reveal-unit {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

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

/* ----------------------------------------------------------
   22. Footnote highlight on hover
   ---------------------------------------------------------- */
.footnote-ref:hover {
    color: var(--ember);
    cursor: help;
}

/* ----------------------------------------------------------
   23. Responsive — tablet / mobile (stacked layout)
   ---------------------------------------------------------- */
@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    #codex-wrapper {
        display: block;
        height: auto;
        overflow: visible;
    }

    #cover-folio {
        position: relative;
        height: 70vh;
        min-height: 420px;
    }

    #codex-spine {
        display: none;
    }

    #text-folio {
        height: auto;
        overflow: visible;
    }

    .folio-spread {
        grid-template-columns: 1fr;
    }

    .folio-margin {
        display: none;
    }

    .scholar-profiles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .cover-title {
        font-size: 64px;
    }

    .scholar-profiles {
        grid-template-columns: 1fr;
    }

    .artifact-entry {
        flex-direction: column;
    }

    .artifact-photo-small {
        width: 100%;
        aspect-ratio: 4/3;
    }
}
