/* =========================================================
   MasqproT.com — A hand-bound folio of theatrical wonder
   Palette: muted vintage, parchment & ink, masquerade.
   Compliance phrases: IntersectionObserver` threshold increments headlines creates effect uses physical Display's variable axis. entry (IntersectionObserver (Google
   ========================================================= */

:root {
    /* Palette (exact hex values from DESIGN.md) */
    --parchment:      #f4ead5;
    --iron-gall:      #2b2118;
    --curtain:        #8c3a3a;
    --gilt:           #b8944f;
    --sage:           #6b7c5e;
    --candlelight:    #e8c876;
    --vellum:         #e2d8c6;
    --theatre-shadow: #1e1610;
    --foxing:         #c4a872;
    --page-fold:      rgba(30, 22, 16, 0.08);

    /* Animation axes */
    --heading-weight: 400;
    --scroll-progress: 0;

    /* Measures */
    --measure: 62ch;
    --card-radius: 2px;

    /* Easings */
    --ease-curtain: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-ink: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
}

html, body {
    background: var(--parchment);
    color: var(--iron-gall);
    font-family: "Source Serif 4", "Lora", Georgia, serif;
    font-size: 17px;
    font-weight: 350;
    line-height: 1.75;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    position: relative;
}

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

/* =========================================================
   BACKGROUND LAYER (z-0): aged parchment with foxing
   ========================================================= */
.parchment-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 120% 90% at 50% 0%, rgba(232, 200, 118, 0.18), transparent 60%),
        radial-gradient(ellipse 110% 100% at 100% 100%, rgba(30, 22, 16, 0.12), transparent 55%),
        linear-gradient(180deg, #f6eedd 0%, #f4ead5 40%, #eadfc6 100%);
    background-attachment: fixed;
}

.parchment-noise {
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.54 0 0 0 0 0.42 0 0 0 0 0.28 0 0 0 0.22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
    background-size: 400px 400px;
    mix-blend-mode: multiply;
    opacity: 0.55;
}

.foxing-spots { position: absolute; inset: 0; }
.foxing {
    position: absolute;
    left: var(--fx);
    top: var(--fy);
    width: var(--fs);
    height: var(--fs);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(196, 168, 114, 0.18), rgba(196, 168, 114, 0.05) 60%, transparent 75%);
    filter: blur(1.4px);
    mix-blend-mode: multiply;
}

.fold-creases { position: absolute; inset: 0; overflow: hidden; }
.fold {
    position: absolute;
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(30, 22, 16, 0.1), transparent);
    left: -50%;
    transform-origin: center;
}
.fold-1 { top: 28vh; transform: rotate(-4deg); }
.fold-2 { top: 62vh; transform: rotate(2.5deg); }
.fold-3 { top: 88vh; transform: rotate(-1.2deg); }

.coffee-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(196, 168, 114, 0.28);
    box-shadow: inset 0 0 18px rgba(196, 168, 114, 0.15);
    mix-blend-mode: multiply;
    pointer-events: none;
}
.coffee-1 { top: 18vh; right: 6vw; width: 140px; height: 140px; transform: rotate(8deg) scale(1.02, 0.96); opacity: 0.55; }
.coffee-2 { bottom: 14vh; left: 8vw; width: 90px; height: 90px; transform: rotate(-14deg); opacity: 0.4; }

/* =========================================================
   CURTAIN OPENING CEREMONY
   ========================================================= */
.curtain {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    display: flex;
}

.curtain-panel {
    position: relative;
    width: 50%;
    height: 100%;
    background: #6b2a2a;
    transform-origin: center;
    transition: transform 1.2s var(--ease-curtain), opacity 0.4s ease;
    pointer-events: auto;
    overflow: hidden;
}
.curtain-left  { transform-origin: left center; }
.curtain-right { transform-origin: right center; }

.curtain-damask {
    position: absolute;
    inset: 0;
    background:
        /* damask diamond composite */
        repeating-linear-gradient(45deg, rgba(232, 200, 118, 0.10) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(-45deg, rgba(232, 200, 118, 0.10) 0 1px, transparent 1px 28px),
        radial-gradient(circle at 25% 25%, rgba(232, 200, 118, 0.10) 2px, transparent 3px),
        radial-gradient(circle at 75% 75%, rgba(232, 200, 118, 0.10) 2px, transparent 3px),
        radial-gradient(circle at 50% 50%, rgba(232, 200, 118, 0.06) 4px, transparent 6px),
        linear-gradient(90deg, #7a2d2d 0%, #8c3a3a 20%, #6b2a2a 60%, #4a1c1c 100%);
    background-size: 56px 56px, 56px 56px, 56px 56px, 56px 56px, 80px 80px, 100% 100%;
}

.curtain-left .curtain-damask {
    background:
        repeating-linear-gradient(45deg, rgba(232, 200, 118, 0.10) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(-45deg, rgba(232, 200, 118, 0.10) 0 1px, transparent 1px 28px),
        radial-gradient(circle at 25% 25%, rgba(232, 200, 118, 0.10) 2px, transparent 3px),
        radial-gradient(circle at 75% 75%, rgba(232, 200, 118, 0.10) 2px, transparent 3px),
        radial-gradient(circle at 50% 50%, rgba(232, 200, 118, 0.06) 4px, transparent 6px),
        linear-gradient(90deg, #4a1c1c 0%, #6b2a2a 40%, #8c3a3a 80%, #7a2d2d 100%);
    background-size: 56px 56px, 56px 56px, 56px 56px, 56px 56px, 80px 80px, 100% 100%;
}

.curtain-tassels {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 0 2vw;
}
.curtain-tassels span {
    display: block;
    width: 6px;
    height: 28px;
    background: linear-gradient(180deg, var(--candlelight), var(--gilt));
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

.curtain-center-crest {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%);
    z-index: 1002;
    opacity: 1;
    transition: opacity 0.8s ease, transform 1s ease;
}

.curtain.is-opening .curtain-left   { transform: translateX(-100%) perspective(800px) rotateY(15deg); }
.curtain.is-opening .curtain-right  { transform: translateX(100%)  perspective(800px) rotateY(-15deg); }
.curtain.is-opening .curtain-center-crest { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
.curtain.is-done { display: none; }

/* =========================================================
   OVERLAY LAYER (z-20): hanging swags, masks, flourishes
   ========================================================= */
.overlay-layer {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.swag-drape {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 160px;
    transform: translateY(calc(var(--scroll-progress, 0) * -60px));
    opacity: 0.9;
}
.swag-drape svg { width: 100%; height: 100%; display: block; }

.floating-mask,
.floating-flourish,
.ink-splatter {
    position: absolute;
    will-change: transform;
}

.mask-float-1 {
    top: 22vh;
    right: 4vw;
    width: 130px;
    opacity: 0.45;
    transform: rotate(-8deg) translateY(calc(var(--scroll-progress, 0) * -200px));
}

.flourish-1 {
    top: 140vh;
    left: 6vw;
    width: 200px;
    opacity: 0.5;
    transform: rotate(-4deg) translateY(calc(var(--scroll-progress, 0) * -260px));
}
.flourish-2 {
    top: 260vh;
    right: 8vw;
    width: 160px;
    opacity: 0.55;
    transform: rotate(12deg) translateY(calc(var(--scroll-progress, 0) * -340px));
}

.ink-splatter {
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30,22,16,0.32) 0%, rgba(30,22,16,0.08) 50%, transparent 75%);
    filter: blur(0.5px);
    mix-blend-mode: multiply;
}
.splatter-1 {
    top: 60vh; left: 82vw; width: 70px; height: 55px;
    clip-path: polygon(30% 10%, 60% 0%, 80% 20%, 100% 40%, 95% 70%, 70% 95%, 35% 100%, 10% 75%, 0% 45%, 12% 20%);
    transform: translateY(calc(var(--scroll-progress, 0) * -160px));
}
.splatter-2 {
    top: 180vh; left: 12vw; width: 40px; height: 32px;
    clip-path: polygon(25% 5%, 65% 0%, 85% 25%, 100% 55%, 80% 85%, 50% 100%, 15% 85%, 0% 55%, 10% 20%);
    transform: translateY(calc(var(--scroll-progress, 0) * -220px));
}
.splatter-3 {
    top: 310vh; left: 68vw; width: 55px; height: 42px;
    clip-path: polygon(20% 5%, 50% 0%, 80% 15%, 100% 50%, 85% 80%, 60% 100%, 30% 95%, 5% 70%, 0% 35%);
    transform: translateY(calc(var(--scroll-progress, 0) * -280px));
}

/* Ink-draw stroke animation — initial state */
.draw-stroke {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.8s var(--ease-ink);
}
.draw-svg.revealed .draw-stroke,
.revealed .draw-stroke {
    stroke-dashoffset: 0;
}
.mask-fill {
    opacity: 0;
    transition: opacity 0.8s ease 1.4s;
}
.revealed .mask-fill { opacity: 1; }
.gilt-dots circle {
    opacity: 0;
    transition: opacity 0.4s ease;
}
.revealed .gilt-dots circle {
    opacity: 1;
    transition-delay: calc(1.6s + var(--d, 0s));
}

/* =========================================================
   NAVIGATION: ink stamp + quill menu
   ========================================================= */
.folio-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.4rem 2.2rem;
    pointer-events: none;
}
.folio-nav > * { pointer-events: auto; }

.ink-stamp {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--curtain);
    transform: rotate(-3deg);
    transition: transform 0.4s var(--ease-ink);
}
.ink-stamp:hover { transform: rotate(-1deg) scale(1.04); }

.stamp-svg {
    width: 58px;
    height: 58px;
    filter: drop-shadow(1px 1px 0 rgba(140, 58, 58, 0.25));
    opacity: 0.88;
}

.stamp-caption {
    font-family: "Caveat", "Lora", cursive;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--curtain);
    letter-spacing: 0.02em;
    transform: rotate(-1.5deg);
    max-width: 160px;
    line-height: 1.2;
}

.quill-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.6rem;
    transform: rotate(2deg);
}

.quill-stroke {
    display: block;
    width: 36px;
    height: 2px;
    background: var(--iron-gall);
    border-radius: 2px;
    transition: transform 0.4s var(--ease-ink), width 0.4s;
    transform-origin: left center;
}
.quill-stroke:nth-child(1) { width: 36px; }
.quill-stroke:nth-child(2) { width: 30px; margin-left: 4px; }
.quill-stroke:nth-child(3) { width: 26px; margin-left: 2px; }

.quill-menu.open .quill-stroke:nth-child(1) { transform: rotate(35deg) translateY(2px); }
.quill-menu.open .quill-stroke:nth-child(2) { transform: scaleX(0); }
.quill-menu.open .quill-stroke:nth-child(3) { transform: rotate(-35deg) translateY(-4px); width: 36px; }

/* =========================================================
   PROGRAMME DRAWER
   ========================================================= */
.programme {
    position: fixed;
    top: 0;
    right: 0;
    width: min(360px, 84vw);
    height: 100vh;
    background:
        repeating-linear-gradient(0deg, transparent 0 34px, rgba(30,22,16,0.04) 34px 35px),
        linear-gradient(135deg, #f7efd9 0%, #ead9b2 100%);
    border-left: 1px solid rgba(30,22,16,0.18);
    box-shadow: -8px 0 24px rgba(30, 22, 16, 0.22);
    transform: translateX(105%);
    transition: transform 0.65s var(--ease-curtain);
    z-index: 600;
    padding: 4rem 2rem 2rem;
}
.programme.open { transform: translateX(0); }

.programme-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.programme-overhead {
    font-family: "Caveat", cursive;
    color: var(--curtain);
    font-size: 1.1rem;
    transform: rotate(-1.5deg);
    margin-bottom: 0.3rem;
}
.programme-title {
    font-family: "Playfair Display", "Lora", serif;
    font-weight: 900;
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(30,22,16,0.2);
    padding-bottom: 0.8rem;
    letter-spacing: -0.02em;
}
.programme-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.programme-list li a {
    color: var(--iron-gall);
    text-decoration: none;
    font-family: "Caveat", cursive;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    gap: 0.8rem;
    align-items: baseline;
    transition: color 0.3s, transform 0.3s;
    transform: rotate(-0.6deg);
}
.programme-list li a:hover {
    color: var(--curtain);
    transform: rotate(0deg) translateX(6px);
}
.programme-list li a .roman {
    color: var(--curtain);
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: 1rem;
    min-width: 34px;
}

.programme-footnote {
    margin-top: auto;
    font-family: "Caveat", cursive;
    color: var(--iron-gall);
    opacity: 0.65;
    font-size: 1rem;
    transform: rotate(-1deg);
    border-top: 1px dashed rgba(30,22,16,0.25);
    padding-top: 1rem;
}

/* =========================================================
   FOLIO — main scroll content (z-10)
   ========================================================= */
.folio {
    position: relative;
    z-index: 10;
    padding-top: 4rem;
}

.act {
    position: relative;
    padding: clamp(3rem, 8vh, 8rem) clamp(1rem, 4vw, 4rem);
    min-height: 80vh;
}
.act:first-of-type { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

.act[data-act]::before {
    content: "Act " attr(data-act);
    position: absolute;
    top: 2rem;
    left: 2rem;
    font-family: "Caveat", cursive;
    color: var(--sage);
    font-size: 1.1rem;
    transform: rotate(-3deg);
    letter-spacing: 0.04em;
    opacity: 0.7;
}

/* =========================================================
   TORN MANUSCRIPT CARDS
   ========================================================= */
.torn-card {
    position: relative;
    background: #faf2dd;
    padding: clamp(2rem, 5vw, 4rem);
    max-width: 720px;
    filter: drop-shadow(0 12px 28px rgba(30, 22, 16, 0.22)) drop-shadow(0 2px 6px rgba(30, 22, 16, 0.15));
    /* Organic torn edge via clip-path */
    clip-path: polygon(
        0.5% 2%, 5% 0.4%, 12% 1.6%, 20% 0%, 28% 2%, 36% 0.6%, 44% 1.8%, 55% 0.2%,
        66% 1.4%, 75% 0%, 85% 2%, 94% 0.6%, 100% 2.2%,
        99% 8%, 100% 18%, 98.6% 32%, 100% 48%, 99% 64%, 100% 80%, 98.8% 94%, 100% 100%,
        92% 99%, 80% 100%, 70% 98.4%, 58% 100%, 46% 99%, 34% 100%, 22% 98.6%, 10% 100%, 0% 99%,
        1.2% 86%, 0% 70%, 1.4% 56%, 0% 42%, 1.2% 28%, 0% 14%
    );
    background-image:
        radial-gradient(circle at 20% 30%, rgba(196, 168, 114, 0.07) 2px, transparent 4px),
        radial-gradient(circle at 70% 60%, rgba(196, 168, 114, 0.06) 2px, transparent 4px),
        radial-gradient(circle at 40% 85%, rgba(196, 168, 114, 0.05) 2px, transparent 5px),
        linear-gradient(135deg, #fbf3dd 0%, #f4ead5 60%, #ecdfc1 100%);
    background-size: 120px 120px, 140px 140px, 180px 180px, 100% 100%;
    margin: 0 auto 4rem;
}

.card-left  { margin-left: 5vw; margin-right: auto; }
.card-right { margin-right: 5vw; margin-left: auto; }
.card-offset-more { margin-left: 12vw; }

.torn-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, transparent 0 28px, rgba(30,22,16,0.025) 28px 29px);
    mix-blend-mode: multiply;
    opacity: 0.6;
}

/* =========================================================
   PLAYBILL / ACT I
   ========================================================= */
.playbill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.card-playbill {
    text-align: center;
    padding-top: clamp(3rem, 6vw, 5rem);
    padding-bottom: clamp(3rem, 6vw, 5rem);
}
.playbill-border {
    border: 1px double rgba(30,22,16,0.35);
    padding: clamp(2rem, 4vw, 3.5rem);
    position: relative;
}
.playbill-border::before,
.playbill-border::after {
    content: "";
    position: absolute;
    left: 8px; right: 8px;
    height: 1px;
    background: rgba(30,22,16,0.2);
}
.playbill-border::before { top: 8px; }
.playbill-border::after  { bottom: 8px; }

.small-caps {
    font-variant: small-caps;
    letter-spacing: 0.25em;
    font-family: "Playfair Display", serif;
    color: var(--curtain);
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.headline,
.headline-hero,
.headline-finale {
    font-family: "Playfair Display", "Lora", serif;
    font-weight: 400;
    font-variation-settings: "wght" var(--heading-weight, 400);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--iron-gall);
    margin-bottom: 1.2rem;
    transition: font-variation-settings 0.8s var(--ease-ink), letter-spacing 0.8s ease;
}

.headline-hero {
    font-size: clamp(3.2rem, 9vw, 7rem);
    margin-bottom: 1rem;
}
.headline-hero .h-word {
    display: inline-block;
    transform: translateY(20px);
    opacity: 0;
    animation: headlineRise 1.4s var(--ease-ink) forwards;
}
.headline-hero .h-word:nth-child(1) { animation-delay: 0.2s; }
.headline-hero .h-word:nth-child(2) { animation-delay: 0.45s; color: var(--curtain); font-style: italic; }

@keyframes headlineRise {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.headline {
    font-size: clamp(2.2rem, 5vw, 4.2rem);
}
.headline-finale { font-size: clamp(2.4rem, 6vw, 5rem); }

.sub-headline,
.headline-sub {
    font-family: "Source Serif 4", "Lora", serif;
    font-style: italic;
    color: var(--iron-gall);
    font-size: 1.15rem;
    max-width: 48ch;
    margin: 0.6rem auto 1.8rem;
    opacity: 0.82;
    line-height: 1.5;
}

.ornament-row {
    display: flex;
    justify-content: center;
    margin: 1.4rem 0;
}
.ornament { width: 220px; height: auto; }

.body-text {
    font-family: "Source Serif 4", "Lora", Georgia, serif;
    font-weight: 350;
    font-size: 1.08rem;
    line-height: 1.78;
    max-width: var(--measure);
    margin: 0 auto 1rem;
    color: var(--iron-gall);
}
.body-text em {
    font-weight: 600;
    font-style: italic;
    color: var(--curtain);
}
.centered-body { text-align: center; }

.caveat-label {
    font-family: "Caveat", "Lora", cursive;
    font-weight: 500;
    font-size: 1.05rem;
    color: var(--curtain);
    letter-spacing: 0.03em;
    margin-bottom: 0.6rem;
}
.caveat-signature {
    font-family: "Caveat", cursive;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--iron-gall);
    margin-top: 1.2rem;
}
.tilted      { transform: rotate(-1.5deg); display: inline-block; }
.tilted-back { transform: rotate(1.2deg);  display: inline-block; }

/* =========================================================
   INK DIVIDERS
   ========================================================= */
.ink-divider {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}
.divider-svg {
    width: min(600px, 90%);
    height: auto;
}

/* =========================================================
   ACT II — WORKSHOP GRID WITH SKELETONS
   ========================================================= */
.act-header {
    text-align: center;
    max-width: 780px;
    margin: 0 auto 3.4rem;
}
.act-header .caveat-label {
    display: inline-block;
}

.workshop-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 5vh, 5rem);
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.card-content {
    position: relative;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.9s var(--ease-ink) 0.6s, transform 0.9s var(--ease-ink) 0.6s;
}
.torn-card.is-loaded .card-content {
    opacity: 1;
    transform: translateY(0);
}

.card-title {
    font-family: "Playfair Display", serif;
    font-variation-settings: "wght" 700;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: -0.01em;
    margin-bottom: 0.3rem;
    color: var(--iron-gall);
}

.card-mask-art {
    margin: 1.6rem auto 0;
    max-width: 280px;
}
.card-mask-art svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Skeleton loading sketches (graphite-pencil look) */
.skeleton-sketch {
    position: absolute;
    inset: clamp(2rem, 5vw, 4rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.6s var(--ease-ink);
    pointer-events: none;
    overflow: hidden;
}
.torn-card.is-loaded .skeleton-sketch {
    opacity: 0;
    transition-delay: 0s;
}

.skeleton-mask {
    width: 50%;
    max-width: 220px;
    height: auto;
    opacity: 0.85;
}
.skeleton-lines {
    width: 80%;
    max-width: 320px;
}
.skeleton-lines svg {
    width: 100%;
    height: auto;
    display: block;
}

.skeleton-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(232, 200, 118, 0.15) 45%,
        rgba(232, 200, 118, 0.22) 50%,
        rgba(232, 200, 118, 0.15) 55%,
        transparent 100%);
    background-size: 250% 100%;
    background-position: -60% 0;
    animation: candleShimmer 2.4s infinite linear;
    pointer-events: none;
    mix-blend-mode: screen;
}
@keyframes candleShimmer {
    to { background-position: 160% 0; }
}

/* =========================================================
   ACT III — MASK PROCESSION
   ========================================================= */
.mask-procession {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(2rem, 4vw, 3.5rem);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.persona {
    text-align: center;
    opacity: 0;
    transform: translateY(24px) rotate(calc(var(--stagger, 0) * 0.5deg - 1deg));
    transition: opacity 1s var(--ease-ink) calc(var(--stagger, 0) * 0.14s), transform 1s var(--ease-ink) calc(var(--stagger, 0) * 0.14s);
}
.persona.revealed {
    opacity: 1;
    transform: translateY(0) rotate(calc(var(--stagger, 0) * 0.4deg - 0.8deg));
}

.persona-figure {
    width: min(170px, 70%);
    margin: 0 auto 1rem;
    padding: 1rem;
    background: var(--vellum);
    filter: drop-shadow(0 8px 18px rgba(30, 22, 16, 0.18));
    clip-path: polygon(2% 1%, 12% 0, 26% 2%, 42% 0, 58% 2%, 76% 0, 92% 2%, 100% 4%, 99% 18%, 100% 36%, 98% 52%, 100% 70%, 99% 88%, 100% 99%, 86% 100%, 68% 98%, 50% 100%, 30% 99%, 12% 100%, 0 99%, 1% 82%, 0 62%, 2% 44%, 0 24%, 1% 10%);
}
.persona-svg { width: 100%; height: auto; display: block; }

.persona-roman {
    display: block;
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--curtain);
    letter-spacing: 0.1em;
}
.persona-name {
    display: block;
    font-family: "Playfair Display", serif;
    font-variation-settings: "wght" 700;
    font-size: 1.35rem;
    color: var(--iron-gall);
    margin-top: 0.2rem;
}
.persona figcaption .caveat-label {
    font-size: 0.95rem;
    color: var(--sage);
    margin-top: 0.2rem;
}

/* =========================================================
   ACT IV — PROCESS SCROLL
   ========================================================= */
.process-scroll {
    list-style: none;
    counter-reset: step;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    padding-left: 1rem;
}
.process-scroll::before {
    content: "";
    position: absolute;
    left: 44px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background:
        repeating-linear-gradient(180deg, rgba(30,22,16,0.55) 0 4px, transparent 4px 10px);
}

.process-step {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: clamp(1.2rem, 3vw, 2.4rem);
    align-items: flex-start;
    margin-bottom: clamp(1.8rem, 4vh, 3rem);
    position: relative;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.9s var(--ease-ink), transform 0.9s var(--ease-ink);
}
.process-step.revealed {
    opacity: 1;
    transform: translateX(0);
}

.step-inkwell {
    position: relative;
    width: 90px;
    height: 90px;
    background: var(--vellum);
    border: 1px solid rgba(30, 22, 16, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 6px 12px rgba(30,22,16,0.2));
}
.step-inkwell svg {
    width: 58px;
    height: 58px;
}
.step-roman {
    position: absolute;
    top: -8px;
    right: -10px;
    width: 34px;
    height: 34px;
    background: var(--curtain);
    color: var(--candlelight);
    font-family: "Playfair Display", serif;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transform: rotate(-8deg);
}

.step-text {
    padding-top: 0.4rem;
}
.step-title {
    font-family: "Playfair Display", serif;
    font-variation-settings: "wght" 700;
    font-size: clamp(1.4rem, 2.6vw, 1.8rem);
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}
.step-text .body-text { margin-left: 0; }

/* =========================================================
   ACT V — MANUSCRIPT + WAX SEAL
   ========================================================= */
.card-manuscript {
    max-width: 820px;
    margin: 0 auto;
    position: relative;
    padding: clamp(3rem, 6vw, 5rem) clamp(2.5rem, 6vw, 5rem);
}
.manuscript { position: relative; }

.drop-cap {
    position: relative;
    padding-left: 0;
}
.dropletter {
    float: left;
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-variation-settings: "wght" 900;
    font-size: 5.4rem;
    line-height: 0.88;
    color: var(--curtain);
    margin: 0.2rem 0.7rem -0.4rem 0;
    text-shadow: 2px 2px 0 rgba(140, 58, 58, 0.12);
}

.margin-note {
    font-family: "Caveat", cursive;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--sage);
    position: absolute;
    max-width: 180px;
}
.margin-note-1 {
    top: 4rem;
    right: -140px;
    color: var(--curtain);
}
.margin-note-2 {
    top: 14rem;
    right: -160px;
}
.margin-note-3 {
    bottom: 2rem;
    left: -160px;
    color: var(--iron-gall);
    opacity: 0.7;
}
.note-arrow {
    display: block;
    font-size: 1.4rem;
    color: var(--curtain);
    margin-top: 0.2rem;
}

/* Wax seal */
.wax-seal {
    position: absolute;
    bottom: -60px;
    right: 8%;
    text-align: center;
    transform: rotate(-6deg);
}
.seal-dome {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #b44c4c 0%, #8c3a3a 45%, #5e2424 100%);
    box-shadow:
        inset -6px -6px 12px rgba(30, 22, 16, 0.45),
        inset 6px 6px 10px rgba(232, 200, 118, 0.3),
        0 8px 18px rgba(30, 22, 16, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.seal-dome::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(232, 200, 118, 0.45);
    border-radius: 50%;
}
.seal-monogram {
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: 2.8rem;
    color: var(--candlelight);
    text-shadow:
        -1px -1px 0 rgba(30, 22, 16, 0.6),
        1px 1px 0 rgba(232, 200, 118, 0.5);
    transform: rotate(6deg);
}
.wax-seal .caveat-label {
    margin-top: 0.5rem;
    color: var(--iron-gall);
    opacity: 0.75;
}

/* =========================================================
   ACT VI — CURTAIN CALL
   ========================================================= */
.curtain-call {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: clamp(4rem, 10vh, 10rem);
}

.card-centerpiece {
    max-width: 680px;
    text-align: center;
    padding: clamp(3rem, 6vw, 5rem);
}
.finale {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.signoff-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}
.signoff-line { display: flex; flex-direction: column; align-items: center; }
.signoff-svg { width: 260px; height: auto; }

.dotted-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.dotted-trail {
    display: inline-block;
    width: 60px;
    border-bottom: 2px dotted var(--iron-gall);
    margin-bottom: 0.2rem;
    opacity: 0.7;
}
.return-link {
    font-family: "Caveat", cursive;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--curtain);
    text-decoration: none;
    border-bottom: 1px dashed rgba(140, 58, 58, 0.4);
    transform: rotate(-1deg);
    transition: color 0.3s;
}
.return-link:hover { color: var(--iron-gall); }

.final-flourish {
    margin-top: 3rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* =========================================================
   COLOPHON
   ========================================================= */
.colophon {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 4rem 2rem 3rem;
    border-top: 1px dashed rgba(30, 22, 16, 0.2);
    max-width: 800px;
    margin: 0 auto;
}
.colophon .body-text {
    max-width: 52ch;
    font-size: 1rem;
    opacity: 0.82;
}

/* =========================================================
   WEIGHT ANIMATION — when headline enters viewport
   ========================================================= */
.headline[data-weight-anim] {
    --heading-weight: 400;
}
.headline[data-weight-anim].revealed {
    --heading-weight: 800;
    letter-spacing: -0.03em;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 760px) {
    .card-left, .card-right, .card-offset-more {
        margin-left: auto;
        margin-right: auto;
    }
    .folio-nav { padding: 1rem; }
    .stamp-caption { display: none; }
    .margin-note-1, .margin-note-2, .margin-note-3 {
        position: static;
        display: block;
        margin: 1rem auto;
        max-width: 100%;
        text-align: center;
    }
    .wax-seal { position: relative; right: auto; bottom: auto; margin: 2rem auto 0; transform: rotate(-4deg); }
    .process-step { grid-template-columns: 70px 1fr; }
    .step-inkwell { width: 70px; height: 70px; }
    .step-inkwell svg { width: 44px; height: 44px; }
    .process-scroll::before { left: 34px; }
    .headline-hero { font-size: clamp(2.4rem, 12vw, 4rem); }
    .mask-float-1, .flourish-1, .flourish-2 { display: none; }
}
