/* ============================================================
   gamelicensor.info — Holographic Trading-Card Archive
   ============================================================ */

:root {
    /* Palette */
    --vault-velvet: #0B0B12;
    --drawer-felt: #1A1A24;
    --card-stock: #E8E6DC;
    --chrome-rail: #C9CCD2;
    --registrar-grey: #7A7E8A;
    --clause-ink: #1F1B16;
    --foil-stamp-red: #FF3B5C;

    /* Holofoil stops */
    --foil-magenta: #FF6FB7;
    --foil-cyan: #7CD0FF;
    --foil-emerald: #B0FF8A;
    --foil-gold: #FFE07A;
    --foil-amethyst: #C49EFF;

    /* Dynamic */
    --foil-angle: 0deg;
    --foil-x: 50%;
    --foil-y: 50%;
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --drawer-x: 0px;

    /* Type */
    --f-display: 'Bebas Neue', 'Impact', sans-serif;
    --f-clause: 'Cormorant Garamond', 'Georgia', serif;
    --f-mono: 'JetBrains Mono', 'Menlo', monospace;
    --f-accent: 'Big Shoulders Display', 'Bebas Neue', sans-serif;
}

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

html, body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: var(--vault-velvet);
    color: var(--card-stock);
    font-family: var(--f-mono);
    cursor: default;
}

body {
    position: relative;
    perspective: 1600px;
}

/* ---------- Velvet noise backdrop ---------- */
.velvet-noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.22;
    mix-blend-mode: overlay;
}
.velvet-noise svg { width: 100%; height: 100%; }

body::before {
    /* Subtle gradient lift (drawer-felt) on top of vault-velvet */
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 60%, var(--drawer-felt) 0%, transparent 65%),
        var(--vault-velvet);
    z-index: 0;
    pointer-events: none;
}

/* ---------- HUD ---------- */
.hud {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 28px;
    height: 38px;
    background: linear-gradient(180deg,
        rgba(201, 204, 210, 0.10) 0%,
        rgba(201, 204, 210, 0.04) 50%,
        rgba(11, 11, 18, 0.0) 100%);
    border-bottom: 1px solid rgba(201, 204, 210, 0.20);
    backdrop-filter: blur(2px);
    font-family: var(--f-mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--chrome-rail);
}
.hud-top { top: 0; }
.hud-bottom {
    bottom: 0;
    top: auto;
    border-top: 1px solid rgba(201, 204, 210, 0.20);
    border-bottom: none;
    background: linear-gradient(0deg,
        rgba(201, 204, 210, 0.10) 0%,
        rgba(201, 204, 210, 0.04) 50%,
        rgba(11, 11, 18, 0.0) 100%);
}

.hud-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 22px;
    height: 100%;
    border-right: 1px solid rgba(201, 204, 210, 0.10);
    min-width: 0;
}
.hud-cell:first-child { border-left: 1px solid rgba(201, 204, 210, 0.10); }
.hud-cell-status { margin-left: auto; border-right: none; flex-direction: row; gap: 8px; align-items: center; }
.hud-label {
    color: var(--registrar-grey);
    font-size: 8.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.hud-val {
    color: var(--chrome-rail);
    font-size: 11px;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.hud-brand {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 22px;
    height: 100%;
    border-left: 1px solid rgba(201, 204, 210, 0.10);
    color: var(--chrome-rail);
}
.hud-brand-mark {
    color: var(--foil-stamp-red);
    font-size: 14px;
}
.hud-brand-text {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
}

.hud-counter {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 22px;
    height: 100%;
    border-left: 1px solid rgba(201, 204, 210, 0.10);
    border-right: 1px solid rgba(201, 204, 210, 0.10);
}
.hud-counter-num {
    font-family: var(--f-accent);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 0.04em;
    color: var(--card-stock);
    line-height: 1;
    margin-top: 2px;
}

.hud-scrubber {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 26px;
    position: relative;
}
.hud-scrubber-track {
    position: relative;
    height: 2px;
    background: rgba(201, 204, 210, 0.18);
    border-radius: 0;
}
.hud-scrubber-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--chrome-rail), var(--foil-cyan));
}
.hud-scrubber-thumb {
    position: absolute;
    left: 0%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--card-stock);
    border: 1px solid var(--chrome-rail);
    box-shadow: 0 0 6px rgba(201, 204, 210, 0.5);
}
.hud-scrubber-ticks {
    position: absolute;
    left: 26px;
    right: 26px;
    bottom: 6px;
    display: flex;
    justify-content: space-between;
    color: var(--registrar-grey);
    font-size: 7.5px;
    letter-spacing: 0.18em;
    pointer-events: none;
}
.hud-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--foil-emerald);
    box-shadow: 0 0 8px var(--foil-emerald);
    animation: pulse-dot 2.4s infinite ease-in-out;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* ---------- Drawer ---------- */
.drawer {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    height: 100vh;
    will-change: transform;
    transform: translateX(var(--drawer-x));
    padding: 0;
    flex-wrap: nowrap;
    width: max-content;
}

.scene {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* ---------- Threshold ---------- */
.scene-threshold {
    flex-direction: column;
    gap: 1.5rem;
}
.threshold-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    transform-style: preserve-3d;
}

.threshold-card {
    width: clamp(280px, 28vw, 420px);
    aspect-ratio: 5 / 7;
    transform-origin: 50% 100%;
    transform: rotateX(60deg) translateY(40vh);
    opacity: 0;
    animation: cardRise 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.3s;
}
@keyframes cardRise {
    0% { transform: rotateX(60deg) translateY(40vh); opacity: 0; }
    60% { opacity: 1; }
    100% { transform: rotateX(0deg) translateY(0); opacity: 1; }
}

.threshold-numbering {
    width: clamp(280px, 32vw, 460px);
    height: 60px;
    color: var(--chrome-rail);
}
.threshold-svg { width: 100%; height: 100%; }
.threshold-text {
    font-family: var(--f-display);
    font-size: 78px;
    fill: none;
    stroke: var(--chrome-rail);
    stroke-width: 1.2;
    letter-spacing: 6px;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: pathDraw 0.8s ease-out forwards 0.6s, fillIn 0.6s ease-out forwards 1.4s;
}
@keyframes pathDraw {
    to { stroke-dashoffset: 0; }
}
@keyframes fillIn {
    to { fill: var(--chrome-rail); stroke-width: 0.4; }
}

.threshold-line {
    font-family: var(--f-clause);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.45rem);
    color: var(--chrome-rail);
    letter-spacing: 0.02em;
    line-height: 1.5;
    text-align: center;
    max-width: 60vw;
}
.threshold-line span {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    animation: letterIn 0.5s ease-out forwards;
}

@keyframes letterIn {
    to { opacity: 1; transform: translateY(0); }
}

.threshold-arrow {
    position: absolute;
    right: clamp(40px, 6vw, 80px);
    bottom: 18vh;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    color: var(--chrome-rail);
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    opacity: 0;
    animation: arrowFadeIn 0.6s ease-out forwards 3.5s, arrowPulse 3s infinite ease-in-out 4s;
}
.threshold-arrow-label { color: var(--registrar-grey); }
.threshold-arrow-svg { width: 64px; height: 24px; color: var(--chrome-rail); }
@keyframes arrowFadeIn { to { opacity: 1; } }
@keyframes arrowPulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

/* ---------- Card stream ---------- */
.card-stream {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    height: 100vh;
}

/* ---------- Card ---------- */
.card {
    flex: 0 0 auto;
    width: 38vw;
    max-width: 600px;
    min-width: 340px;
    aspect-ratio: 5 / 7;
    margin: 0 1vw;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(180deg, rgba(232, 230, 220, 1) 0%, rgba(232, 230, 220, 0.97) 100%);
    border: 1px solid var(--chrome-rail);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.55),
        0 4px 14px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18);
    color: var(--clause-ink);
    overflow: hidden;
    display: grid;
    grid-template-rows: 15% 55% 30%;
    z-index: 10;
}

/* Card stock subtle paper texture via SVG noise */
.card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, rgba(31, 27, 22, 0.018) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

/* Holofoil overlay */
.card-foil {
    position: absolute;
    inset: 4px;
    z-index: 20;
    pointer-events: none;
    background:
        conic-gradient(from var(--foil-angle) at var(--foil-x) var(--foil-y),
            var(--foil-magenta) 0deg,
            var(--foil-cyan) 72deg,
            var(--foil-emerald) 144deg,
            var(--foil-gold) 216deg,
            var(--foil-amethyst) 288deg,
            var(--foil-magenta) 360deg);
    mix-blend-mode: color-dodge;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    -webkit-mask-image: radial-gradient(ellipse at var(--foil-x) var(--foil-y), black 0%, rgba(0,0,0,0.7) 40%, rgba(0,0,0,0.2) 80%, transparent 100%);
            mask-image: radial-gradient(ellipse at var(--foil-x) var(--foil-y), black 0%, rgba(0,0,0,0.7) 40%, rgba(0,0,0,0.2) 80%, transparent 100%);
    border: 1px solid rgba(201, 204, 210, 0.3);
}
.card.is-active .card-foil { opacity: 0.55; }
.card:hover .card-foil { opacity: 0.85; }

/* Card top band */
.card-top {
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 8px;
    border-bottom: 1px solid rgba(31, 27, 22, 0.1);
    position: relative;
    z-index: 2;
}
.card-mono {
    font-family: var(--f-mono);
    font-size: 9.5px;
    letter-spacing: 0.12em;
    color: var(--registrar-grey);
    text-transform: uppercase;
}
.card-mono-num { color: var(--clause-ink); letter-spacing: 0.2em; }

/* Card title (foil-printed via offset) */
.card-title {
    position: absolute;
    top: 5%;
    left: 18px;
    right: 18px;
    height: 12%;
    font-family: var(--f-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3.2vw, 3.6rem);
    letter-spacing: 0.04em;
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--clause-ink);
    z-index: 25;
    pointer-events: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: clip;
}
.card-title-back {
    position: absolute;
    top: 1px;
    left: 1px;
    color: transparent;
    background: linear-gradient(120deg, var(--foil-magenta), var(--foil-cyan), var(--foil-emerald), var(--foil-gold), var(--foil-amethyst));
    -webkit-background-clip: text;
            background-clip: text;
    opacity: 0.95;
}
.card-title-front {
    position: relative;
    color: var(--clause-ink);
    mix-blend-mode: multiply;
}

/* Card art zone (crest area + meta) */
.card-art {
    grid-row: 2;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.card-crest {
    width: 70%;
    height: 70%;
    opacity: 0.85;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.6));
}

/* Meta cells (broken grid) */
.card-meta {
    position: absolute;
    inset: 35% 6% 32% 6%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px 10px;
    z-index: 5;
    pointer-events: none;
}
.meta-cell {
    background: rgba(232, 230, 220, 0.78);
    border: 1px solid rgba(31, 27, 22, 0.18);
    padding: 4px 6px;
    font-family: var(--f-mono);
    font-size: 8.5px;
    letter-spacing: 0.08em;
    color: var(--clause-ink);
    line-height: 1.2;
    transform: rotate(var(--m-rot, 0deg)) translate(var(--m-x, 0), var(--m-y, 0));
    opacity: 0;
    box-shadow: 1px 1px 0 rgba(31, 27, 22, 0.05);
}
.meta-cell:nth-child(1) { --m-rot: -0.6deg; --m-x: -2px; --m-y: 1px; }
.meta-cell:nth-child(2) { --m-rot: 0.4deg; --m-x: 1px; --m-y: -1px; }
.meta-cell:nth-child(3) { --m-rot: -0.3deg; --m-x: 2px; --m-y: 0; }
.meta-cell:nth-child(4) { --m-rot: 0.7deg; --m-x: -1px; --m-y: 2px; }
.meta-cell:nth-child(5) { --m-rot: -0.5deg; --m-x: 0; --m-y: -1px; }
.meta-cell:nth-child(6) { --m-rot: 0.3deg; --m-x: 1px; --m-y: 1px; }
.meta-key {
    display: block;
    color: var(--registrar-grey);
    font-size: 7.5px;
    letter-spacing: 0.15em;
}
.meta-val {
    display: block;
    margin-top: 2px;
    color: var(--clause-ink);
    font-weight: 400;
}

.card.is-active .meta-cell {
    animation: metaIn 0.4s ease-out forwards;
}
.card.is-active .meta-cell:nth-child(1) { animation-delay: 0.10s; }
.card.is-active .meta-cell:nth-child(2) { animation-delay: 0.16s; }
.card.is-active .meta-cell:nth-child(3) { animation-delay: 0.22s; }
.card.is-active .meta-cell:nth-child(4) { animation-delay: 0.28s; }
.card.is-active .meta-cell:nth-child(5) { animation-delay: 0.34s; }
.card.is-active .meta-cell:nth-child(6) { animation-delay: 0.40s; }
@keyframes metaIn {
    from { opacity: 0; transform: rotate(var(--m-rot, 0deg)) translate(var(--m-x, 0), calc(var(--m-y, 0) + 6px)); }
    to { opacity: 1; transform: rotate(var(--m-rot, 0deg)) translate(var(--m-x, 0), var(--m-y, 0)); }
}

/* Card lower (deal-flow ribbon + seal) */
.card-lower {
    grid-row: 3;
    position: relative;
    z-index: 3;
    padding: 12px 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-top: 1px solid rgba(31, 27, 22, 0.1);
    background: linear-gradient(180deg, transparent 0%, rgba(31, 27, 22, 0.04) 100%);
}

.deal-ribbon {
    width: 100%;
    height: 50%;
    overflow: visible;
}
.deal-ribbon path.ribbon-path {
    fill: none;
    stroke: var(--clause-ink);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.2s ease-out;
}
.card.is-active .deal-ribbon path.ribbon-path {
    stroke-dashoffset: 0;
}
.deal-ribbon .ribbon-node {
    fill: var(--clause-ink);
}
.deal-ribbon .ribbon-label {
    font-family: var(--f-mono);
    font-size: 6.5px;
    fill: var(--registrar-grey);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.card-seal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--f-mono);
    font-size: 8.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--registrar-grey);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(31, 27, 22, 0.15);
}
.seal-text {
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 1px 0 0 rgba(31, 27, 22, 0.06);
}
.seal-num {
    color: var(--clause-ink);
    letter-spacing: 0.2em;
}

/* AAA foil-stamp (circular badge) */
.aaa-stamp {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 64px;
    height: 64px;
    z-index: 6;
    color: var(--foil-stamp-red);
    pointer-events: none;
}
.aaa-stamp svg { width: 100%; height: 100%; }
.aaa-stamp .stamp-text {
    font-family: var(--f-display);
    font-size: 7.5px;
    letter-spacing: 0.18em;
    fill: var(--foil-stamp-red);
}
.aaa-stamp .stamp-rim {
    fill: none;
    stroke: var(--foil-stamp-red);
    stroke-width: 1;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    transition: stroke-dashoffset 1.4s ease-out;
}
.card.is-active .aaa-stamp .stamp-rim { stroke-dashoffset: 0; }
.aaa-stamp .stamp-fleur {
    fill: var(--foil-stamp-red);
    opacity: 0.85;
}

/* Card variants */
.card-aaa .card-inner {
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.65),
        0 6px 18px rgba(255, 59, 92, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Card velvet drawer indent */
.card::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 6%;
    right: 6%;
    height: 14px;
    background: radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, 0.45) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

/* ---------- Chapter marker (interstitial chrome band) ---------- */
.chapter-marker {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 60vw;
    padding: 0 4vw;
}
.chapter-band {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg,
        rgba(201, 204, 210, 0.15) 0%,
        rgba(201, 204, 210, 0.05) 50%,
        rgba(201, 204, 210, 0.15) 100%);
    border-top: 1px solid rgba(201, 204, 210, 0.4);
    border-bottom: 1px solid rgba(201, 204, 210, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4);
    color: var(--chrome-rail);
    font-family: var(--f-mono);
    letter-spacing: 0.4em;
    font-size: 13px;
    text-transform: uppercase;
}
.chapter-band-num {
    font-family: var(--f-accent);
    font-weight: 800;
    font-size: 36px;
    letter-spacing: 0.05em;
    color: var(--card-stock);
    margin: 0 18px;
}

/* ---------- Featured Holo interstitial ---------- */
.featured {
    flex: 0 0 auto;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(ellipse at 50% 50%, rgba(11, 11, 18, 0.4) 0%, var(--vault-velvet) 80%);
    overflow: hidden;
}
.featured::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 30%, var(--vault-velvet) 75%);
    pointer-events: none;
}
.featured-card {
    flex: 0 0 auto;
    width: clamp(360px, 32vw, 520px);
    aspect-ratio: 5 / 7;
    transform-style: preserve-3d;
    animation: featuredRotate 14s ease-in-out infinite;
    position: relative;
    z-index: 5;
}
@keyframes featuredRotate {
    0%, 100% { transform: rotateY(-8deg) rotateX(2deg); }
    50% { transform: rotateY(8deg) rotateX(-2deg); }
}

.featured-clauses {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22vw;
    max-width: 360px;
    overflow: hidden;
    color: var(--chrome-rail);
    font-family: var(--f-clause);
    font-style: italic;
    font-weight: 300;
    font-size: 13px;
    line-height: 1.7;
    z-index: 6;
    padding: 8vh 0;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 18%, black 82%, transparent 100%);
            mask-image: linear-gradient(180deg, transparent 0%, black 18%, black 82%, transparent 100%);
}
.featured-clauses-left { left: 6vw; }
.featured-clauses-right { right: 6vw; }
.featured-clauses h4 {
    font-family: var(--f-clause);
    font-style: normal;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--card-stock);
    margin-bottom: 14px;
    margin-top: 22px;
}
.featured-clauses h4:first-child { margin-top: 0; }
.featured-clauses p { margin-bottom: 16px; }

.featured-tag {
    position: absolute;
    top: 22vh;
    left: 50%;
    transform: translateX(-50%);
    color: var(--foil-stamp-red);
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    z-index: 7;
}
.featured-tag::before, .featured-tag::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 1px;
    background: var(--foil-stamp-red);
    vertical-align: middle;
    margin: 0 14px;
}

/* ---------- Closing ---------- */
.scene-closing {
    flex-direction: column;
    gap: 2rem;
}
.closing-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.4rem;
}
.closing-card {
    width: clamp(280px, 28vw, 420px);
    aspect-ratio: 5 / 7;
    position: relative;
    transform-style: preserve-3d;
    transform-origin: 50% 100%;
    animation: closingRotate 6s ease-in-out infinite alternate;
}
@keyframes closingRotate {
    from { transform: rotateY(-4deg); }
    to { transform: rotateY(4deg); }
}
.closing-clause {
    font-family: var(--f-clause);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: center;
    color: var(--clause-ink);
    margin-top: 16px;
    padding: 0 18px;
    position: absolute;
    bottom: 26%;
    left: 0;
    right: 0;
    z-index: 5;
}
.closing-line {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--registrar-grey);
    text-transform: uppercase;
}

/* ---------- Motes ---------- */
.motes-layer {
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
    overflow: hidden;
}
.mote {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.2) 35%, transparent 65%);
    box-shadow: 0 0 4px rgba(255,255,255,0.5);
    will-change: transform, opacity;
    opacity: 0;
}

/* ---------- Verso (card flip) overlay ---------- */
.verso-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(11, 11, 18, 0.86);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease-out;
}
.verso-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.verso-card {
    width: min(560px, 68vw);
    aspect-ratio: 5 / 7;
    background: var(--card-stock);
    color: var(--clause-ink);
    border: 1px solid var(--chrome-rail);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: rotateY(180deg) scale(0.94);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}
.verso-overlay.is-open .verso-card { transform: rotateY(0deg) scale(1); }
.verso-inner {
    padding: 26px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.verso-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(31, 27, 22, 0.15);
    padding-bottom: 10px;
}
.verso-close {
    background: transparent;
    border: 1px solid rgba(31, 27, 22, 0.3);
    padding: 6px 14px;
    color: var(--clause-ink);
    font-family: var(--f-mono);
    font-size: 9.5px;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: background 0.2s;
}
.verso-close:hover { background: rgba(31, 27, 22, 0.08); }
.verso-title {
    font-family: var(--f-display);
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 0.04em;
    margin: 22px 0 18px;
    color: var(--clause-ink);
}
.verso-clause {
    flex: 1;
    overflow: auto;
    font-family: var(--f-clause);
    font-style: italic;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.7;
    color: var(--clause-ink);
}
.verso-clause h5 {
    font-family: var(--f-clause);
    font-weight: 500;
    font-style: normal;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: 14px 0 8px;
    color: var(--registrar-grey);
}
.verso-clause p { margin-bottom: 12px; }
.verso-seal {
    border-top: 1px dashed rgba(31, 27, 22, 0.2);
    padding-top: 10px;
    margin-top: 10px;
    text-align: right;
    font-family: var(--f-mono);
    font-size: 9px;
    letter-spacing: 0.18em;
    color: var(--registrar-grey);
    text-transform: uppercase;
}

/* ---------- Misc spacing ---------- */
.spacer {
    flex: 0 0 auto;
    width: 4vw;
    height: 100vh;
}

/* ---------- Foil stamp red dot ---------- */
.live-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--foil-stamp-red);
    box-shadow: 0 0 10px var(--foil-stamp-red);
    display: inline-block;
    margin-right: 6px;
    animation: pulse-dot 1.6s infinite ease-in-out;
}
