/* ===== Enochian Scroll — reusable parchment-scroll component =====
 *
 * Usage:
 *   <div class="enochian-scroll">
 *     <h2 class="enochian-scroll__eyebrow">A passage set down by the witness</h2>
 *     <h1 class="enochian-scroll__title">The Darklume Colloquy</h1>
 *     <p class="enochian-scroll__byline">A conversation between Vaelor &amp; Kryor</p>
 *     <hr class="enochian-scroll__rule">
 *     <div class="enochian-scroll__body">
 *        <p>Body prose with optional drop-cap on first paragraph...</p>
 *     </div>
 *   </div>
 *
 * Modifiers:
 *   .enochian-scroll--seal           — adds wax seal in top-right corner
 *   .enochian-scroll--small          — narrower (max 480px) for inline fragments
 *   .enochian-scroll--banner         — full-width banner, no max-width
 *   .enochian-scroll--no-deckle      — straight edges (no torn-paper look)
 *   .enochian-scroll--dark           — dark vellum variant (default is parchment)
 *
 * Designed for: Enochian translator output, Codex fragments, lore quotes,
 * saga dividers, Hall of Fame proclamations, KS-tier-gated reveals, any
 * "set down by a witness" prose surface that benefits from grimoire-scroll
 * aesthetic. Works inside both light + dark Codex theme via custom props.
 *
 * The deckle-edge is rendered as SVG path in mask-image so it scales
 * cleanly + works on Safari (mask-image: url('data:image/svg+xml...')).
 *
 * Lightweight — no JS dependency, no font loads. Inherits site fonts.
 */

.enochian-scroll {
    /* Tokens — override per theme if needed */
    --es-parchment-1:    #f5e8c2;     /* warm cream */
    --es-parchment-2:    #e8d4a0;     /* aged amber */
    --es-parchment-3:    #d4b878;     /* deeper amber edges */
    --es-parchment-edge: #8a6a3a;     /* burnt edge tint */
    --es-ink:            #2a1810;     /* deep umber prose */
    --es-ink-mute:       #6a4a2a;     /* faded prose for byline/captions */
    --es-accent:         #8a2418;     /* drop-cap red */
    --es-accent-soft:    rgba(138, 36, 24, .35);
    --es-rule:           rgba(138, 36, 24, .25);
    --es-shadow:         rgba(0, 0, 0, .55);
    --es-shadow-warm:    rgba(110, 60, 20, .35);
    --es-seal:           #8a2418;
    --es-seal-rim:       #4a0a08;
    --es-spot:           rgba(110, 70, 30, .14);
    --es-spot-dark:      rgba(60, 30, 10, .12);
    --es-roll-shadow:    rgba(60, 35, 12, .55);
    --es-roll-highlight: rgba(255, 240, 200, .55);
    /* Wooden roller (umbilicus) tokens — warm walnut by default */
    --es-roller-1:       #5a3a1c;     /* mid wood */
    --es-roller-2:       #3a2410;     /* deep grain */
    --es-roller-3:       #7a5230;     /* highlight grain */
    --es-roller-cap:     #2a1808;     /* finial cap */
    --es-roller-cap-hi:  #6a4220;     /* finial highlight */
    --es-roller-height:  18px;        /* wood bar thickness */
    --es-roller-overhang: 14px;       /* how far rollers extend past parchment */
    --es-curl-band:      28px;        /* visible parchment-curl band height */
    --es-unfurl-duration: 1.4s;
    --es-unfurl-ease:    cubic-bezier(0.16, 1, 0.3, 1);

    position: relative;
    max-width: 720px;
    margin: 2.4rem auto;
    /* Extra top + bottom padding clears the rollers + curl bands */
    padding: calc(3.6rem + var(--es-roller-height) + var(--es-curl-band))
             3.4rem
             calc(4.2rem + var(--es-roller-height) + var(--es-curl-band));
    color: var(--es-ink);
    font-family: 'Lora', 'Crimson Pro', Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.72;
    text-align: left;
    background:
        /* aged-paper spots — randomized organic imperfections */
        radial-gradient(circle at 12% 22%, var(--es-spot) 0px, transparent 14px),
        radial-gradient(circle at 88% 18%, var(--es-spot-dark) 0px, transparent 22px),
        radial-gradient(circle at 22% 78%, var(--es-spot) 0px, transparent 18px),
        radial-gradient(circle at 72% 62%, var(--es-spot-dark) 0px, transparent 10px),
        radial-gradient(circle at 48% 42%, var(--es-spot) 0px, transparent 28px),
        radial-gradient(circle at 92% 88%, var(--es-spot-dark) 0px, transparent 16px),
        /* subtle directional crease — diagonal soft band */
        linear-gradient(112deg, transparent 35%, rgba(0,0,0,.04) 50%, transparent 65%),
        /* highlight + edge shading */
        radial-gradient(ellipse at 20% 12%, rgba(255, 255, 255, .35) 0%, transparent 38%),
        radial-gradient(ellipse at 80% 88%, rgba(0, 0, 0, .10) 0%, transparent 48%),
        /* SVG paper grain — fine noise overlay */
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .24  0 0 0 0 .10  0 0 0 .18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
        linear-gradient(180deg,
            var(--es-parchment-1) 0%,
            var(--es-parchment-2) 50%,
            var(--es-parchment-1) 100%);
    background-blend-mode: normal, normal, normal, normal, normal, normal, multiply, normal, normal, multiply, normal;
    box-shadow:
        0 0 0 1px var(--es-parchment-edge),
        /* deeper paper drop — warm + cool dual */
        0 18px 60px -8px var(--es-shadow),
        0 28px 80px -20px var(--es-shadow-warm),
        /* warm under-glow */
        0 4px 20px -6px rgba(160, 100, 40, .25),
        /* inner ambient burn */
        inset 0 0 70px rgba(138, 106, 58, .22),
        inset 0 0 12px rgba(138, 106, 58, .35),
        /* darker bottom edge so scroll has weight */
        inset 0 -28px 40px -28px rgba(80, 50, 20, .55),
        inset 0 28px 40px -28px rgba(80, 50, 20, .45);
    /* No mask on the main element — rollers (rendered as overflow extensions
     * via box-shadow + pseudo-elements) must not be clipped. The previous
     * deckle-edge top/bottom was incompatible with the wooden-roller anatomy:
     * real scrolls terminate the parchment AT the roller, not via deckle.
     * Side-edge softness is achieved via the inset box-shadow burn instead. */
    border-radius: 1px;
    /* Unfurl animation: scroll opens from collapsed (rollers touching) to
     * full height. max-height grows from 0 to a generous ceiling so any
     * content size fits. Opacity nudges up early so the wood bars are
     * visible from the first frame. */
    animation: enochian-scroll-unfurl var(--es-unfurl-duration) var(--es-unfurl-ease) both;
    transform-origin: center top;
    /* Visible region overflows for roller caps that hang past edges */
    overflow: visible;
}

/* Unfurl: parchment body grows vertically, rollers (rendered as separate
 * pseudo-elements pinned to top:0 / bottom:0) ride apart with it.
 * max-height ceiling is intentionally large so dynamic content fits. */
@keyframes enochian-scroll-unfurl {
    0%   { max-height: calc(var(--es-roller-height) * 2 + 4px); opacity: .55; }
    18%  { opacity: 1; }
    100% { max-height: 4000px; opacity: 1; }
}

/* Inner content fades in once parchment has opened ~30% */
@keyframes enochian-scroll-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.enochian-scroll__eyebrow,
.enochian-scroll__title,
.enochian-scroll__byline,
.enochian-scroll__rule,
.enochian-scroll__body,
.enochian-scroll hr {
    animation: enochian-scroll-fade-in 1.6s var(--es-unfurl-ease) .35s both;
}

.enochian-scroll--no-deckle {
    border-radius: 4px;
}

/* ===== Wooden rollers (umbilici / rouleaux) + parchment curl bands =====
 *
 * Real parchment scrolls have two wooden rods — one at the top and one at
 * the bottom — that the parchment wraps around. We render BOTH rollers plus
 * the visible "curl band" (where the parchment turns around the rod) as
 * stacked background-image layers on a single ::before pseudo-element.
 *
 * Geometry:
 *   - The pseudo-element extends past the parchment on the left + right
 *     (--es-roller-overhang) so the rod ends + finial caps stick out.
 *   - It extends above + below the parchment (--es-roller-height / 2) so
 *     each rod sits half on the parchment, half off — physically correct
 *     for a scroll wrapped around the rod.
 *   - The curl band is painted ON the parchment, just inside each rod,
 *     showing the parchment turning into the wood.
 *
 * Layer order (top-down, painted bottom-first):
 *   1. Top wooden roller — horizontal wood-grain bar with finial caps
 *   2. Bottom wooden roller — same
 *   3. Top curl band — dark-to-light gradient where parchment meets roller
 *   4. Bottom curl band — same
 *
 * Pointer-events: none so it never blocks clicks/selection. */
.enochian-scroll::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--es-roller-overhang));
    right: calc(-1 * var(--es-roller-overhang));
    top: calc(-1 * var(--es-roller-height) / 2);
    bottom: calc(-1 * var(--es-roller-height) / 2);
    pointer-events: none;
    z-index: 2;
    background-image:
        /* TOP CURL BAND — parchment wrapping around the top roller.
         * Sits just below the top roller, inside the parchment width. */
        linear-gradient(180deg,
            rgba(80, 50, 20, .55) 0,
            rgba(120, 80, 35, .35) 6px,
            rgba(220, 180, 120, .45) 14px,
            rgba(180, 140, 80, .25) 22px,
            transparent 28px),
        /* BOTTOM CURL BAND */
        linear-gradient(0deg,
            rgba(70, 42, 16, .60) 0,
            rgba(120, 80, 35, .35) 6px,
            rgba(220, 180, 120, .45) 14px,
            rgba(180, 140, 80, .25) 22px,
            transparent 28px),
        /* TOP WOODEN ROLLER — grain + highlight + dark caps at left/right ends.
         * The lengthwise gradient gives a rounded-cylinder appearance.
         * The crosswise gradient adds the finial cap shading at the very ends. */
        linear-gradient(90deg,
            var(--es-roller-cap) 0,
            var(--es-roller-cap) 6px,
            var(--es-roller-cap-hi) 8px,
            var(--es-roller-1) 14px,
            var(--es-roller-1) calc(100% - 14px),
            var(--es-roller-cap-hi) calc(100% - 8px),
            var(--es-roller-cap) calc(100% - 6px),
            var(--es-roller-cap) 100%),
        /* BOTTOM WOODEN ROLLER — same lengthwise treatment */
        linear-gradient(90deg,
            var(--es-roller-cap) 0,
            var(--es-roller-cap) 6px,
            var(--es-roller-cap-hi) 8px,
            var(--es-roller-1) 14px,
            var(--es-roller-1) calc(100% - 14px),
            var(--es-roller-cap-hi) calc(100% - 8px),
            var(--es-roller-cap) calc(100% - 6px),
            var(--es-roller-cap) 100%);
    background-repeat: no-repeat;
    background-position:
        var(--es-roller-overhang) calc(var(--es-roller-height) / 2),
        var(--es-roller-overhang) calc(100% - var(--es-roller-height) / 2),
        0 0,
        0 100%;
    background-size:
        calc(100% - 2 * var(--es-roller-overhang)) var(--es-curl-band),
        calc(100% - 2 * var(--es-roller-overhang)) var(--es-curl-band),
        100% var(--es-roller-height),
        100% var(--es-roller-height);
    border-radius: inherit;
    /* The roller bars themselves get the rounded-rod shape via a soft
     * inset shadow on each band — applied through filter so it covers all
     * roller layers uniformly without per-layer wizardry. */
    filter:
        drop-shadow(0 1px 0 rgba(0, 0, 0, .35))
        drop-shadow(0 -1px 0 rgba(0, 0, 0, .35));
}

/* Wood grain detail — a second pseudo-layer using ::before's wood-grain noise
 * would conflict with ::after (seal). Instead, we overlay grain via a tiny
 * SVG repeated horizontally on each roller. We piggyback this on the rollers
 * by adding a third + fourth layer to the same ::before backgrounds above —
 * already conceptually included via the lengthwise gradient. For a richer
 * look, an .enochian-scroll--grain modifier could swap in an SVG noise. */

.enochian-scroll--small  {
    max-width: 480px;
    padding: calc(2rem + var(--es-roller-height) + var(--es-curl-band))
             2rem
             calc(2.2rem + var(--es-roller-height) + var(--es-curl-band));
    font-size: .98rem;
}
.enochian-scroll--banner { max-width: none; }

/* Headings */
.enochian-scroll__eyebrow {
    font-family: 'Cinzel', 'Trajan Pro', serif;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: var(--es-ink-mute);
    text-align: center;
    margin: 0 0 1.4rem;
    position: relative;
}
/* Decorative gold/sepia vine flourish above the eyebrow — small SVG dingbat,
 * scales with text colour via currentColor on the stroke. */
.enochian-scroll__eyebrow::before {
    content: '';
    display: block;
    width: 120px;
    height: 18px;
    margin: 0 auto .9rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 18' fill='none' stroke='%238a6a3a' stroke-width='1.1' stroke-linecap='round'><path d='M2 9 Q 18 4 30 9 T 58 9'/><path d='M62 9 Q 90 4 102 9 T 118 9'/><circle cx='60' cy='9' r='2.2' fill='%238a6a3a' stroke='none'/><path d='M55 9 L 51 5 M55 9 L 51 13' /><path d='M65 9 L 69 5 M65 9 L 69 13' /></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: .75;
}
.enochian-scroll__title {
    font-family: 'Cinzel', 'Trajan Pro', serif;
    font-size: clamp(1.8rem, 4.2vw, 2.6rem);
    font-weight: 600;
    line-height: 1.1;
    color: var(--es-ink);
    text-align: center;
    margin: 0 0 .9rem;
    letter-spacing: .02em;
}
.enochian-scroll__title strong,
.enochian-scroll__title em {
    color: var(--es-accent);
    font-style: italic;
    font-weight: 700;
}
.enochian-scroll__byline {
    font-family: 'Crimson Pro', 'Lora', Georgia, serif;
    font-style: italic;
    font-size: .92rem;
    color: var(--es-ink-mute);
    text-align: center;
    margin: 0 0 1.8rem;
}
.enochian-scroll__byline em,
.enochian-scroll__byline strong {
    color: var(--es-accent);
    font-style: italic;
    font-weight: 600;
}

/* Divider ornament */
.enochian-scroll__rule,
.enochian-scroll hr {
    border: 0;
    height: 18px;
    margin: 1.8rem auto 2.4rem;
    text-align: center;
    background: none;
    position: relative;
}
.enochian-scroll__rule::before,
.enochian-scroll hr::before {
    content: '✦';
    display: inline-block;
    font-size: 1rem;
    color: var(--es-accent-soft);
    background: linear-gradient(180deg, var(--es-parchment-1), var(--es-parchment-2));
    padding: 0 .8rem;
    position: relative;
    z-index: 1;
}
.enochian-scroll__rule::after,
.enochian-scroll hr::after {
    content: '';
    position: absolute;
    left: 25%;
    right: 25%;
    top: 50%;
    height: 1px;
    background: var(--es-rule);
    z-index: 0;
}

/* Body prose */
.enochian-scroll__body {
    color: var(--es-ink);
    font-size: 1rem;
    line-height: 1.78;
}
.enochian-scroll__body > p:first-child::first-letter,
.enochian-scroll__dropcap::first-letter {
    font-family: 'Cinzel', 'Trajan Pro', serif;
    font-size: 3.4em;
    line-height: .85;
    float: left;
    margin: .12em .12em -.04em 0;
    color: var(--es-accent);
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.enochian-scroll__body p {
    margin: 0 0 1.1rem;
    text-align: justify;
    text-indent: 1.4em;
}
.enochian-scroll__body p:first-child { text-indent: 0; }
.enochian-scroll__body strong {
    color: var(--es-accent);
    font-weight: 700;
}
.enochian-scroll__body em {
    color: var(--es-ink);
    font-style: italic;
}
.enochian-scroll__body a {
    color: var(--es-accent);
    border-bottom: 1px dotted var(--es-accent-soft);
    text-decoration: none;
    font-style: italic;
}
.enochian-scroll__body a:hover { color: #b53020; border-bottom-color: #b53020; }

/* Inline glyph rendering — used by Enochian translator output:
 *   <span class="enochian-scroll__glyph"><img src="/assets/enochian/glyphs/un.png" alt="Un"></span>
 * The glyph sits inline with prose; tooltip-on-hover shows canonical name. */
.enochian-scroll__glyph {
    display: inline-block;
    vertical-align: middle;
    margin: 0 .15em;
    width: 1.4em;
    height: 1.4em;
    line-height: 1;
}
.enochian-scroll__glyph img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: sepia(.5) hue-rotate(-25deg) brightness(.55);
    transition: filter .2s, transform .2s;
}
.enochian-scroll__glyph:hover img {
    filter: sepia(.6) hue-rotate(-20deg) brightness(.4);
    transform: scale(1.15);
}

/* Wax seal ornament — top-right when --seal modifier applied.
 * Positioned below the top roller + curl band so it sits ON the parchment. */
.enochian-scroll--seal::after {
    content: '✶';
    position: absolute;
    top: calc(var(--es-roller-height) + var(--es-curl-band) + 12px);
    right: 28px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 35% 30%, #c2342a 0%, var(--es-seal) 55%, var(--es-seal-rim) 100%);
    color: rgba(255, 255, 255, .85);
    font-size: 1.6rem;
    line-height: 50px;
    text-align: center;
    box-shadow:
        inset 0 -2px 4px rgba(0, 0, 0, .35),
        inset 0 2px 4px rgba(255, 255, 255, .12),
        0 4px 10px -2px rgba(0, 0, 0, .55);
    text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
    z-index: 5;
    transform: rotate(-8deg);
}

/* Translator-specific helpers — labels for translation pairs */
.enochian-scroll__pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    margin: 1.2rem 0;
    padding: .8rem 1rem;
    background: rgba(255, 255, 255, .15);
    border-left: 2px solid var(--es-accent-soft);
    border-radius: 2px;
}
.enochian-scroll__pair-source {
    font-family: 'Crimson Pro', Georgia, serif;
    font-style: italic;
    color: var(--es-ink-mute);
    text-align: right;
}
.enochian-scroll__pair-arrow {
    color: var(--es-accent-soft);
    font-size: 1.2rem;
}
.enochian-scroll__pair-glyphs {
    text-align: left;
    line-height: 1.4;
}
.enochian-scroll__pair-glyphs .enochian-scroll__glyph {
    width: 1.6em;
    height: 1.6em;
}

/* ===== Dark vellum variant ===== */
.enochian-scroll--dark {
    --es-parchment-1:    #2a1f12;
    --es-parchment-2:    #1a1208;
    --es-parchment-3:    #3a2818;
    --es-parchment-edge: #5a3e1e;
    --es-ink:            #e8dcc4;
    --es-ink-mute:       #8a6a3a;
    --es-accent:         #d4a44a;
    --es-accent-soft:    rgba(212, 164, 74, .35);
    --es-rule:           rgba(212, 164, 74, .22);
    --es-shadow-warm:    rgba(40, 20, 5, .55);
    --es-spot:           rgba(212, 164, 74, .06);
    --es-spot-dark:      rgba(0, 0, 0, .35);
    --es-roll-shadow:    rgba(10, 5, 2, .8);
    --es-roll-highlight: rgba(212, 164, 74, .35);
    /* Dark variant: iron-banded ebony rollers with gold finial caps */
    --es-roller-1:       #1a0f06;
    --es-roller-2:       #0a0604;
    --es-roller-3:       #2a1808;
    --es-roller-cap:     #8a6a2a;
    --es-roller-cap-hi:  #d4a44a;
}
.enochian-scroll--dark {
    /* Stronger ambient burn + cooler outer drop for dark vellum */
    box-shadow:
        0 0 0 1px var(--es-parchment-edge),
        0 22px 70px -10px rgba(0, 0, 0, .75),
        0 32px 90px -22px rgba(40, 20, 5, .65),
        0 4px 20px -6px rgba(212, 164, 74, .12),
        inset 0 0 80px rgba(0, 0, 0, .45),
        inset 0 0 14px rgba(212, 164, 74, .15),
        inset 0 -32px 50px -32px rgba(0, 0, 0, .75),
        inset 0 32px 50px -32px rgba(0, 0, 0, .65);
}
/* Dark-variant curl bands use gold-warm highlights against deep shadow.
 * Rollers themselves are inherited from the --es-roller-* tokens above. */
.enochian-scroll--dark::before {
    background-image:
        /* TOP CURL BAND — gold-warm flicker into deep shadow */
        linear-gradient(180deg,
            rgba(0, 0, 0, .75) 0,
            rgba(40, 25, 8, .55) 6px,
            rgba(212, 164, 74, .35) 14px,
            rgba(70, 50, 20, .25) 22px,
            transparent 28px),
        /* BOTTOM CURL BAND */
        linear-gradient(0deg,
            rgba(0, 0, 0, .80) 0,
            rgba(40, 25, 8, .55) 6px,
            rgba(212, 164, 74, .35) 14px,
            rgba(70, 50, 20, .25) 22px,
            transparent 28px),
        /* TOP ROLLER — ebony with gold cap finials */
        linear-gradient(90deg,
            var(--es-roller-cap) 0,
            var(--es-roller-cap-hi) 4px,
            var(--es-roller-cap) 8px,
            var(--es-roller-1) 14px,
            var(--es-roller-1) calc(100% - 14px),
            var(--es-roller-cap) calc(100% - 8px),
            var(--es-roller-cap-hi) calc(100% - 4px),
            var(--es-roller-cap) 100%),
        /* BOTTOM ROLLER */
        linear-gradient(90deg,
            var(--es-roller-cap) 0,
            var(--es-roller-cap-hi) 4px,
            var(--es-roller-cap) 8px,
            var(--es-roller-1) 14px,
            var(--es-roller-1) calc(100% - 14px),
            var(--es-roller-cap) calc(100% - 8px),
            var(--es-roller-cap-hi) calc(100% - 4px),
            var(--es-roller-cap) 100%);
}
/* Dark-variant flourish uses gold stroke */
.enochian-scroll--dark .enochian-scroll__eyebrow::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 18' fill='none' stroke='%23d4a44a' stroke-width='1.1' stroke-linecap='round'><path d='M2 9 Q 18 4 30 9 T 58 9'/><path d='M62 9 Q 90 4 102 9 T 118 9'/><circle cx='60' cy='9' r='2.2' fill='%23d4a44a' stroke='none'/><path d='M55 9 L 51 5 M55 9 L 51 13' /><path d='M65 9 L 69 5 M65 9 L 69 13' /></svg>");
    opacity: .85;
}
.enochian-scroll--dark .enochian-scroll__glyph img {
    filter: invert(.95) brightness(1.05) drop-shadow(0 0 4px rgba(212, 164, 74, .35));
}
.enochian-scroll--dark .enochian-scroll__pair {
    background: rgba(0, 0, 0, .25);
    border-left-color: var(--es-accent-soft);
}

/* ===== Mobile ===== */
@media (max-width: 700px) {
    .enochian-scroll {
        /* Slimmer rollers + curl bands on mobile so they don't dominate */
        --es-roller-height:   12px;
        --es-roller-overhang: 9px;
        --es-curl-band:       18px;

        margin: 1.4rem 1rem;
        padding: calc(2.4rem + var(--es-roller-height) + var(--es-curl-band))
                 1.6rem
                 calc(2.6rem + var(--es-roller-height) + var(--es-curl-band));
        font-size: .98rem;
    }
    .enochian-scroll__title { font-size: clamp(1.5rem, 6vw, 2rem); }
    .enochian-scroll__body p { text-indent: 1em; }
    .enochian-scroll__body > p:first-child::first-letter,
    .enochian-scroll__dropcap::first-letter { font-size: 2.8em; }
    .enochian-scroll--seal::after { top: calc(var(--es-roller-height) + var(--es-curl-band) + 8px); right: 16px; width: 38px; height: 38px; line-height: 38px; font-size: 1.2rem; }
    .enochian-scroll__pair { grid-template-columns: 1fr; gap: .4rem; text-align: center; }
    .enochian-scroll__pair-source,
    .enochian-scroll__pair-glyphs { text-align: center; }
    .enochian-scroll__eyebrow::before {
        width: 90px;
        height: 14px;
        margin-bottom: .7rem;
    }
}

/* Reduced motion — disable the unfurl + content-fade animations entirely
 * and any pseudo-element transitions. The scroll renders open + static. */
@media (prefers-reduced-motion: reduce) {
    .enochian-scroll,
    .enochian-scroll__eyebrow,
    .enochian-scroll__title,
    .enochian-scroll__byline,
    .enochian-scroll__rule,
    .enochian-scroll__body,
    .enochian-scroll hr,
    .enochian-scroll__glyph img,
    .enochian-scroll::before,
    .enochian-scroll::after,
    .enochian-scroll__eyebrow::before {
        transition: none !important;
        animation: none !important;
        max-height: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ========================================================================
 * CODEX-VOICE PROSE FRAGMENTS
 *
 * Lore-fragment styling for canonical sentient-grimoire content:
 *   .codex-quote      — formal quotation block with attribution
 *   .codex-dialogue   — recorded dialogue exchange (alternating speakers)
 *
 * Grimoire dark-gold aesthetic — NOT parchment. Theme-aware via existing
 * --cdx-* custom properties (codex-grimoire.css), with sensible fallbacks
 * so these helpers work standalone on any page.
 *
 * Usage examples:
 *
 *   <blockquote class="codex-quote">
 *     <p>You have heard, by now, what was done to three of Grandex's twelve...</p>
 *     <p>The system was built to count two states: standing and ascended.</p>
 *     <footer class="codex-quote__attribution">Kryor</footer>
 *   </blockquote>
 *
 *   <div class="codex-dialogue">
 *     <p class="codex-dialogue__line codex-dialogue__line--left">
 *       <span class="codex-dialogue__text">Then why have you not told the others?</span>
 *       <span class="codex-dialogue__speaker">Vaelor</span>
 *     </p>
 *     <p class="codex-dialogue__line codex-dialogue__line--right">
 *       <span class="codex-dialogue__text">I will tell Grandex the portion he can carry without spilling it...</span>
 *       <span class="codex-dialogue__speaker">Kryor</span>
 *     </p>
 *   </div>
 *
 * The Codex's own marginalia voice — when prose is from the grimoire's
 * first-person register — uses .codex-quote--marginalia (gold left-rule,
 * italic, no attribution required).
 * ======================================================================= */

/* ----- Quote block ----- */
.codex-quote {
    position: relative;
    max-width: 720px;
    margin: 2rem auto;
    padding: 1.6rem 2.2rem 1.6rem 2.6rem;
    color: var(--cdx-text, #e8dcc4);
    background: linear-gradient(180deg,
        rgba(212, 164, 74, .04) 0%,
        rgba(212, 164, 74, .02) 100%);
    border-top: 1px solid rgba(212, 164, 74, .25);
    border-bottom: 1px solid rgba(212, 164, 74, .25);
    font-family: 'Crimson Pro', 'Lora', Georgia, serif;
    font-size: 1.04rem;
    font-style: italic;
    line-height: 1.7;
}
.codex-quote::before {
    content: '"';
    position: absolute;
    top: -.4em;
    left: .4rem;
    font-family: 'Cinzel', 'Trajan Pro', serif;
    font-size: 2.6rem;
    font-style: normal;
    font-weight: 600;
    color: var(--cdx-gold, #d4a44a);
    opacity: .5;
    line-height: 1;
}
.codex-quote p {
    margin: 0 0 .9rem;
    color: inherit;
}
.codex-quote p:last-child { margin-bottom: 0; }
.codex-quote strong,
.codex-quote a {
    color: var(--cdx-gold, #d4a44a);
    font-style: italic;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted rgba(212, 164, 74, .35);
}
.codex-quote__attribution,
.codex-quote footer {
    display: block;
    margin-top: 1.1rem;
    text-align: right;
    font-family: 'Cinzel', 'Trajan Pro', serif;
    font-size: .82rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: var(--cdx-gold, #d4a44a);
}
.codex-quote__attribution::before,
.codex-quote footer::before {
    content: '— ';
    color: var(--cdx-text-mute, #8a6a3a);
    margin-right: .35em;
}

/* The Codex's own first-person marginalia voice — gold left-rule, no
 * attribution (the grimoire IS the voice). Italic + drop-cap on first
 * paragraph for ceremonial weight. */
.codex-quote--marginalia {
    border-top: none;
    border-bottom: none;
    border-left: 3px solid var(--cdx-gold, #d4a44a);
    background: linear-gradient(90deg,
        rgba(212, 164, 74, .05) 0%,
        rgba(212, 164, 74, 0) 35%);
    padding: 1.2rem 1.4rem 1.2rem 2rem;
}
.codex-quote--marginalia::before {
    content: '';
    display: none;
}
.codex-quote--marginalia > p:first-child::first-letter {
    font-family: 'Cinzel', 'Trajan Pro', serif;
    font-size: 2.6em;
    font-style: normal;
    line-height: .85;
    float: left;
    margin: .12em .12em -.04em 0;
    color: var(--cdx-gold, #d4a44a);
    font-weight: 600;
}

/* ----- Dialogue exchange ----- */
.codex-dialogue {
    max-width: 760px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.codex-dialogue__line {
    position: relative;
    margin: 0;
    padding: .9rem 1.2rem .8rem;
    background: linear-gradient(180deg,
        rgba(20, 14, 10, .6) 0%,
        rgba(14, 10, 8, .5) 100%);
    border: 1px solid rgba(212, 164, 74, .22);
    border-radius: 2px;
    font-family: 'Crimson Pro', 'Lora', Georgia, serif;
    font-size: .98rem;
    font-style: italic;
    line-height: 1.55;
    color: var(--cdx-text, #e8dcc4);
    max-width: 75%;
}
.codex-dialogue__line--left {
    align-self: flex-start;
    border-left: 2px solid var(--cdx-gold, #d4a44a);
    background: linear-gradient(90deg,
        rgba(212, 164, 74, .06) 0%,
        rgba(20, 14, 10, .55) 60%);
}
.codex-dialogue__line--right {
    align-self: flex-end;
    border-right: 2px solid var(--cdx-ember, #ff7a4a);
    background: linear-gradient(270deg,
        rgba(255, 122, 74, .06) 0%,
        rgba(20, 14, 10, .55) 60%);
}
.codex-dialogue__text {
    display: block;
    margin-bottom: .5rem;
    color: var(--cdx-text, #e8dcc4);
}
.codex-dialogue__text strong,
.codex-dialogue__text a {
    color: var(--cdx-gold, #d4a44a);
    font-style: italic;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted rgba(212, 164, 74, .3);
}
.codex-dialogue__line--right .codex-dialogue__text strong,
.codex-dialogue__line--right .codex-dialogue__text a {
    color: var(--cdx-ember-bright, #ffb38a);
    border-bottom-color: rgba(255, 179, 138, .3);
}
.codex-dialogue__speaker {
    display: block;
    font-family: 'Cinzel', 'Trajan Pro', serif;
    font-size: .68rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: var(--cdx-text-mute, #8a6a3a);
}
.codex-dialogue__line--left .codex-dialogue__speaker {
    text-align: left;
    color: var(--cdx-gold, #d4a44a);
    opacity: .85;
}
.codex-dialogue__line--right .codex-dialogue__speaker {
    text-align: right;
    color: var(--cdx-ember, #ff7a4a);
    opacity: .85;
}

/* ----- Light-mode (parchment Codex) overrides ----- */
body.codex-theme-grimoire-light .codex-quote {
    color: #2a1810;
    background: linear-gradient(180deg,
        rgba(107, 26, 26, .03) 0%,
        rgba(107, 26, 26, .01) 100%);
    border-color: rgba(107, 26, 26, .2);
}
body.codex-theme-grimoire-light .codex-quote::before { color: #6b1a1a; opacity: .35; }
body.codex-theme-grimoire-light .codex-quote strong,
body.codex-theme-grimoire-light .codex-quote a,
body.codex-theme-grimoire-light .codex-quote__attribution,
body.codex-theme-grimoire-light .codex-quote footer { color: #6b1a1a; }
body.codex-theme-grimoire-light .codex-quote--marginalia {
    border-left-color: #6b1a1a;
    background: linear-gradient(90deg, rgba(107, 26, 26, .05) 0%, rgba(107, 26, 26, 0) 35%);
}
body.codex-theme-grimoire-light .codex-quote--marginalia > p:first-child::first-letter { color: #6b1a1a; }
body.codex-theme-grimoire-light .codex-dialogue__line {
    background: linear-gradient(180deg, rgba(245, 232, 194, .6) 0%, rgba(232, 212, 160, .5) 100%);
    border-color: rgba(107, 26, 26, .2);
    color: #2a1810;
}
body.codex-theme-grimoire-light .codex-dialogue__line--left {
    border-left-color: #6b1a1a;
    background: linear-gradient(90deg, rgba(107, 26, 26, .04) 0%, rgba(245, 232, 194, .55) 60%);
}
body.codex-theme-grimoire-light .codex-dialogue__line--right {
    border-right-color: #8a2418;
    background: linear-gradient(270deg, rgba(138, 36, 24, .04) 0%, rgba(245, 232, 194, .55) 60%);
}
body.codex-theme-grimoire-light .codex-dialogue__text strong,
body.codex-theme-grimoire-light .codex-dialogue__text a { color: #6b1a1a; }
body.codex-theme-grimoire-light .codex-dialogue__line--right .codex-dialogue__text strong,
body.codex-theme-grimoire-light .codex-dialogue__line--right .codex-dialogue__text a { color: #8a2418; }
body.codex-theme-grimoire-light .codex-dialogue__line--left .codex-dialogue__speaker { color: #6b1a1a; }
body.codex-theme-grimoire-light .codex-dialogue__line--right .codex-dialogue__speaker { color: #8a2418; }

/* ----- Mobile ----- */
@media (max-width: 700px) {
    .codex-quote {
        padding: 1.2rem 1.4rem 1.2rem 1.6rem;
        margin: 1.4rem 1rem;
        font-size: .98rem;
    }
    .codex-quote::before { font-size: 2rem; }
    .codex-dialogue { gap: .7rem; margin: 1.4rem 1rem; }
    .codex-dialogue__line { max-width: 90%; padding: .75rem 1rem .65rem; font-size: .94rem; }
}
