/* =================================================================
   jungchi.boo  --  surrealist political theater
   Palette: #0d0d1a #2a2a3d #4a3066 #c9a84c #8b2233 #c2b8a3 #e8e4f0 #2d8f8f
   Fonts:   Playfair Display (display), Source Serif 4 (body),
            Space Grotesk (UI / annotations)
   ================================================================= */

:root {
    --c-midnight: #0d0d1a;
    --c-fog-grey: #2a2a3d;
    --c-violet:   #4a3066;
    --c-gold:     #c9a84c;
    --c-vote-red: #8b2233;
    --c-ash-fog:  #c2b8a3;
    --c-ghost:    #e8e4f0;
    --c-teal:     #2d8f8f;

    --grad-descent: linear-gradient(180deg, #0d0d1a 0%, #2a2a3d 40%, #4a3066 100%);
    --grad-gold:    linear-gradient(90deg, #c9a84c 0%, transparent 70%);
    --grad-fog:     radial-gradient(ellipse at 50% 0%, rgba(74, 48, 102, 0.4) 0%, transparent 70%);

    --f-display: "Playfair Display", "Inter", Georgia, serif;
    --f-body:    "Source Serif 4", "Inter", Georgia, serif;
    --f-ui:      "Space Grotesk", "Inter", "Helvetica Neue", sans-serif;

    --golden: 1.618;
}

/* ---------- reset / base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--c-midnight);
    color: var(--c-ash-fog);
    font-family: var(--f-body);
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    background: var(--grad-descent);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.75;
    overflow-x: hidden;
    cursor: crosshair;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 400ms ease-out;
}

a:hover {
    color: var(--c-teal);
}

p {
    max-width: 38em;
}

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

/* ---------- shared section frame ---------- */

.section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: clamp(4rem, 10vh, 8rem) clamp(1.5rem, 6vw, 6rem);
    overflow: hidden;
    isolation: isolate;
}

.section + .section {
    border-top: 1px solid rgba(201, 168, 76, 0.08);
}

.section__header {
    position: relative;
    max-width: 56rem;
    margin: 0 auto 3rem;
    text-align: center;
    z-index: 4;
}

.section__floor {
    display: inline-block;
    font-family: var(--f-ui);
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--c-gold);
    padding: 0.4rem 1rem;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 999px;
    margin-bottom: 1.6rem;
}

.section__title {
    position: relative;
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(3rem, 7vw, 8rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-ghost);
    line-height: 0.95;
    margin: 0 0 1.5rem;
    mix-blend-mode: difference;
    transition: text-shadow 600ms ease-out, transform 600ms ease-out;
    text-shadow:
        0 -8px 24px rgba(13, 13, 26, 0.6),
        12px 6px 28px rgba(74, 48, 102, 0.45);
}

.section__title::after {
    content: attr(data-shadow-text);
    position: absolute;
    inset: 0;
    color: rgba(139, 34, 51, 0.18);
    transform: translate(8px, -10px) skewX(-3deg);
    filter: blur(2px);
    pointer-events: none;
    z-index: -1;
}

.section__title:hover {
    text-shadow:
        0 8px 24px rgba(13, 13, 26, 0.6),
        -12px -6px 28px rgba(45, 143, 143, 0.4);
}

.section__lede {
    font-family: var(--f-body);
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.75;
    color: var(--c-ash-fog);
    margin: 0 auto;
    max-width: 38em;
}

/* ---------- chamber navigation (side rail) ---------- */

.chamber-nav {
    position: fixed;
    top: 50%;
    right: 1.4rem;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    pointer-events: auto;
}

.chamber-nav .nav-mark,
.chamber-nav .nav-meta {
    font-family: var(--f-ui);
    font-size: 0.62rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(201, 168, 76, 0.55);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.chamber-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-left: 1px dashed rgba(201, 168, 76, 0.3);
    padding-left: 0.9rem;
}

.chamber-nav li {
    position: relative;
}

.chamber-nav a {
    font-family: var(--f-ui);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(226, 220, 240, 0.55);
    padding: 0.3rem 0;
    display: inline-block;
    position: relative;
}

.chamber-nav a::before {
    content: attr(data-floor);
    margin-right: 0.7rem;
    color: var(--c-gold);
    font-feature-settings: "tnum" 1;
}

.chamber-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--c-teal);
    transition: width 300ms ease-out;
}

.chamber-nav a:hover::after,
.chamber-nav a.is-active::after {
    width: 100%;
}

.chamber-nav a.is-active {
    color: var(--c-ghost);
}

@media (max-width: 720px) {
    .chamber-nav {
        display: none;
    }
}

/* ---------- fog layers (pseudo-overlays) ---------- */

.fog-layer {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 1;
}

.fog-layer--top {
    top: 0;
    height: 60vh;
    background: var(--grad-fog);
    opacity: 0.7;
    transform: translateZ(0);
}

.fog-layer--bottom {
    bottom: 0;
    height: 50vh;
    background: radial-gradient(ellipse at 50% 100%, rgba(74, 48, 102, 0.38) 0%, transparent 70%);
    opacity: 0.6;
}

/* ---------- marble parallax columns ---------- */

.marble-columns {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.marble-column {
    position: absolute;
    top: -10%;
    width: 60px;
    height: 120vh;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(232, 228, 240, 0.08) 0px,
            rgba(232, 228, 240, 0.02) 4px,
            transparent 7px,
            rgba(201, 168, 76, 0.04) 11px,
            transparent 13px
        ),
        radial-gradient(ellipse at 30% 20%, rgba(232, 228, 240, 0.18), transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(42, 42, 61, 0.55), transparent 50%),
        linear-gradient(180deg, #2a2a3d, #1a1a2e);
    border-left: 1px solid rgba(201, 168, 76, 0.18);
    border-right: 1px solid rgba(201, 168, 76, 0.18);
    will-change: transform;
}

.marble-column--left { left: 0.6%; }
.marble-column--right { right: 0.6%; }

@media (max-width: 720px) {
    .marble-columns { display: none; }
}

/* ---------- floating ballots (generated by JS) ---------- */

.ballots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    will-change: transform;
}

.ballot {
    position: absolute;
    width: 40px;
    height: 60px;
    background: var(--c-fog-grey);
    border: 1px solid var(--c-gold);
    box-shadow: 0 -6px 18px rgba(13, 13, 26, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-display);
    font-size: 1.1rem;
    color: var(--c-vote-red);
    will-change: transform;
    animation: ballot-drift 22s ease-in-out infinite;
}

.ballot--alt {
    animation-name: ballot-drift-alt;
    animation-duration: 28s;
}

.ballot::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px dashed rgba(201, 168, 76, 0.3);
    pointer-events: none;
}

@keyframes ballot-drift {
    0%   { transform: translate3d(0, 0, 0) rotate(-4deg); }
    25%  { transform: translate3d(40px, -60px, 0) rotate(8deg); }
    50%  { transform: translate3d(-30px, -100px, 0) rotate(-6deg); }
    75%  { transform: translate3d(20px, -40px, 0) rotate(10deg); }
    100% { transform: translate3d(0, 0, 0) rotate(-4deg); }
}

@keyframes ballot-drift-alt {
    0%   { transform: translate3d(0, 0, 0) rotate(6deg); }
    33%  { transform: translate3d(-50px, 70px, 0) rotate(-12deg); }
    66%  { transform: translate3d(60px, 30px, 0) rotate(4deg); }
    100% { transform: translate3d(0, 0, 0) rotate(6deg); }
}

/* =================================================================
   SECTION 1 -- THE ANTECHAMBER
   ================================================================= */

.section--antechamber {
    background: radial-gradient(ellipse at 50% 80%, rgba(74, 48, 102, 0.3), transparent 60%), var(--c-midnight);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Marble corridor with vanishing point */

.corridor {
    position: absolute;
    inset: 0;
    perspective: 900px;
    z-index: 2;
}

.corridor__floor,
.corridor__ceiling,
.corridor__wall {
    position: absolute;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(232, 228, 240, 0.04) 0%,
            rgba(232, 228, 240, 0.04) 49%,
            rgba(201, 168, 76, 0.06) 50%,
            transparent 100%
        ),
        linear-gradient(180deg, rgba(42, 42, 61, 0.9), rgba(13, 13, 26, 1));
}

.corridor__floor {
    left: -10%;
    right: -10%;
    bottom: -10%;
    height: 60%;
    transform: rotateX(70deg) translateZ(-150px);
    transform-origin: 50% 100%;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(232, 228, 240, 0.06) 0%,
            rgba(232, 228, 240, 0.06) 49.5%,
            rgba(201, 168, 76, 0.08) 50%,
            rgba(13, 13, 26, 0.9) 100%
        ),
        linear-gradient(0deg, rgba(74, 48, 102, 0.25), rgba(13, 13, 26, 1));
    opacity: 0.85;
}

.corridor__ceiling {
    left: -10%;
    right: -10%;
    top: -10%;
    height: 50%;
    transform: rotateX(-70deg) translateZ(-150px);
    transform-origin: 50% 0%;
    opacity: 0.55;
}

.corridor__wall {
    top: 0;
    bottom: 0;
    width: 30%;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(232, 228, 240, 0.05) 0%,
            rgba(232, 228, 240, 0.05) 49.5%,
            rgba(201, 168, 76, 0.06) 50%,
            transparent 100%
        ),
        linear-gradient(180deg, rgba(42, 42, 61, 0.95), rgba(13, 13, 26, 1));
}

.corridor__wall--left {
    left: 0;
    transform: rotateY(60deg) translateZ(-100px);
    transform-origin: 0 50%;
}

.corridor__wall--right {
    right: 0;
    transform: rotateY(-60deg) translateZ(-100px);
    transform-origin: 100% 50%;
}

.corridor__vanish {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(201, 168, 76, 0.18), rgba(74, 48, 102, 0.15) 30%, transparent 70%);
    filter: blur(20px);
    transition: transform 1200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Overture (hero title block) */

.overture {
    position: relative;
    z-index: 6;
    text-align: center;
    max-width: 80vw;
}

.overture__line {
    position: relative;
    margin: 0 auto 3rem;
    width: 0;
    height: 1px;
    background: var(--c-gold);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.6);
    animation: line-draw 1800ms ease-in-out 600ms forwards;
}

@keyframes line-draw {
    0%   { width: 0; }
    100% { width: 80vw; }
}

.overture__title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(3rem, 9vw, 9rem);
    letter-spacing: 0.5em;
    text-transform: lowercase;
    color: var(--c-ghost);
    margin: 0 0 1.4rem;
    mix-blend-mode: difference;
    opacity: 0;
    animation: title-settle 1200ms cubic-bezier(0.16, 0.84, 0.32, 1) 1500ms forwards;
    text-shadow:
        0 -10px 40px rgba(74, 48, 102, 0.6),
        14px 8px 30px rgba(13, 13, 26, 0.7);
    position: relative;
}

.overture__title::after {
    content: attr(data-shadow-text);
    position: absolute;
    inset: 0;
    color: rgba(201, 168, 76, 0.18);
    transform: translate(-12px, 14px) skewY(-2deg);
    filter: blur(3px);
    z-index: -1;
}

@keyframes title-settle {
    0%   { opacity: 0; letter-spacing: 0.5em; }
    60%  { opacity: 1; }
    100% { opacity: 1; letter-spacing: 0.08em; }
}

.overture__subtitle {
    font-family: var(--f-display);
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--c-gold);
    letter-spacing: 0.3em;
    margin: 0 0 1.2rem;
    opacity: 0;
    animation: fade-in 1000ms ease-out 2400ms forwards;
}

.overture__caption {
    font-family: var(--f-ui);
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(194, 184, 163, 0.7);
    margin: 0 auto;
    max-width: 38em;
    opacity: 0;
    animation: fade-in 1000ms ease-out 2800ms forwards;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.discover-hint {
    position: absolute;
    bottom: 2.8rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    z-index: 6;
    opacity: 0;
    animation: fade-in 1000ms ease-out 3400ms forwards;
}

.discover-hint__line {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, transparent, var(--c-gold));
    animation: pulse-down 2400ms ease-in-out infinite;
}

@keyframes pulse-down {
    0%, 100% { transform: scaleY(0.6); opacity: 0.4; }
    50%      { transform: scaleY(1); opacity: 1; }
}

.discover-hint__text {
    font-family: var(--f-ui);
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(201, 168, 76, 0.7);
}

/* =================================================================
   SECTION 2 -- THE DEBATE HALL
   ================================================================= */

.section--debate {
    background:
        linear-gradient(180deg, var(--c-midnight) 0%, var(--c-fog-grey) 60%, var(--c-violet) 100%);
    padding-top: clamp(6rem, 12vh, 10rem);
    padding-bottom: clamp(8rem, 14vh, 12rem);
}

.debate__divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--grad-gold);
    background: linear-gradient(180deg, transparent, rgba(201, 168, 76, 0.4) 20%, rgba(201, 168, 76, 0.4) 80%, transparent);
    transform: translateX(-50%) skewX(0.6deg);
    z-index: 2;
    pointer-events: none;
}

.debate__stage {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 70vh;
    z-index: 4;
}

.debate__half {
    position: relative;
    padding: 3rem 2rem;
    min-height: 60vh;
}

.debate__half--left {
    transform: translateX(-0.4%);
}

.debate__half--right {
    transform: translateX(0.4%);
}

/* Mirror chambers */
.chamber-mirror {
    position: relative;
    height: 100%;
    min-height: 50vh;
    perspective: 700px;
}

.chamber-mirror__row {
    position: absolute;
    left: 10%;
    right: 10%;
    height: 24px;
    border-top: 1px solid rgba(201, 168, 76, 0.3);
    border-bottom: 1px solid rgba(201, 168, 76, 0.12);
}

.chamber-mirror__row--front { bottom: 18%; transform: rotateX(60deg) translateZ(20px); }
.chamber-mirror__row--mid   { bottom: 36%; transform: rotateX(60deg) translateZ(0); opacity: 0.7; }
.chamber-mirror__row--back  { bottom: 54%; transform: rotateX(60deg) translateZ(-20px); opacity: 0.4; }

.chamber-mirror__chair {
    position: absolute;
    width: 26px;
    height: 36px;
    background:
        linear-gradient(180deg, rgba(201, 168, 76, 0.3), rgba(201, 168, 76, 0.05));
    border: 1px solid rgba(201, 168, 76, 0.4);
    border-bottom: none;
}

.chamber-mirror--left .chamber-mirror__chair--1 { left: 22%; bottom: 22%; }
.chamber-mirror--left .chamber-mirror__chair--2 { left: 48%; bottom: 22%; }
.chamber-mirror--left .chamber-mirror__chair--3 { left: 72%; bottom: 22%; }

.chamber-mirror--right .chamber-mirror__chair--1 { left: 22%; bottom: 22%; transform: scaleX(-1); }
.chamber-mirror--right .chamber-mirror__chair--3 { left: 72%; bottom: 22%; transform: scaleX(-1); }

/* Backwards-running clocks */
.chamber-clock {
    position: absolute;
    top: 12%;
    left: 50%;
    width: 90px;
    height: 90px;
    border: 1.5px solid rgba(201, 168, 76, 0.55);
    border-radius: 50%;
    transform: translateX(-50%);
    background:
        radial-gradient(circle at 50% 50%, rgba(13, 13, 26, 0.95), rgba(42, 42, 61, 0.85));
}

.chamber-clock::before,
.chamber-clock::after {
    content: "";
    position: absolute;
    background: rgba(201, 168, 76, 0.55);
}

.chamber-clock::before {
    top: 4%;
    left: 50%;
    width: 1px;
    height: 8px;
    transform: translateX(-50%);
}

.chamber-clock::after {
    left: 4%;
    top: 50%;
    width: 8px;
    height: 1px;
    transform: translateY(-50%);
}

.chamber-clock__hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    background: var(--c-gold);
    transform-origin: 50% 100%;
}

.chamber-clock__hand--hour {
    width: 2px;
    height: 24px;
    margin-left: -1px;
    animation: clock-hand-back 60s linear infinite;
}

.chamber-clock__hand--minute {
    width: 1px;
    height: 32px;
    margin-left: -0.5px;
    background: var(--c-vote-red);
    animation: clock-hand-back 12s linear infinite;
}

.chamber-clock--reversed .chamber-clock__hand {
    animation-direction: normal;
}

.chamber-clock__pivot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
    background: var(--c-gold);
    border-radius: 50%;
}

@keyframes clock-hand-back {
    from { transform: rotate(360deg); }
    to   { transform: rotate(0deg); }
}

/* Speech bubbles */

.speech-bubble {
    position: absolute;
    background: rgba(13, 13, 26, 0.85);
    border: 1px solid rgba(201, 168, 76, 0.4);
    padding: 1.4rem 1.6rem;
    max-width: 24rem;
    backdrop-filter: blur(4px);
    box-shadow: 0 -10px 30px rgba(13, 13, 26, 0.55), 8px 0 24px rgba(74, 48, 102, 0.25);
    transition: box-shadow 600ms ease-out, transform 400ms ease-out;
    z-index: 5;
}

.speech-bubble:hover {
    box-shadow: 0 10px 30px rgba(13, 13, 26, 0.55), -8px 0 24px rgba(45, 143, 143, 0.4);
    transform: translateY(-4px);
}

.speech-bubble__tag {
    display: block;
    font-family: var(--f-ui);
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--c-gold);
    margin-bottom: 0.6rem;
}

.speech-bubble p {
    font-family: var(--f-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--c-ash-fog);
    margin: 0;
}

.speech-bubble--left {
    top: 18%;
    left: 6%;
    transform: rotate(-1deg);
}

.speech-bubble--right {
    top: 28%;
    right: 6%;
    transform: rotate(1.5deg);
}

.speech-bubble--center {
    top: 62%;
    left: 50%;
    max-width: 18rem;
    transform: translateX(-50%) rotate(-0.5deg);
    background: rgba(74, 48, 102, 0.45);
    border-color: rgba(45, 143, 143, 0.5);
}

.speech-bubble--center .speech-bubble__tag {
    color: var(--c-teal);
}

.speech-bubble--center p {
    text-align: center;
    font-style: italic;
    color: var(--c-ghost);
}

/* Melting podium */

.podium-stage {
    position: relative;
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    z-index: 4;
}

.podium {
    width: clamp(160px, 22vw, 260px);
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(13, 13, 26, 0.7));
}

@media (max-width: 720px) {
    .speech-bubble--left { top: 8%; left: 4%; max-width: 80vw; }
    .speech-bubble--right { top: 38%; right: 4%; max-width: 80vw; }
    .speech-bubble--center { top: 70%; max-width: 80vw; }
    .debate__stage { grid-template-columns: 1fr; }
    .debate__divider { display: none; }
}

/* =================================================================
   SECTION 3 -- THE VOTING FLOOR
   ================================================================= */

.section--voting {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(74, 48, 102, 0.45), transparent 70%),
        linear-gradient(180deg, var(--c-violet) 0%, #2d1f4a 50%, var(--c-fog-grey) 100%);
    padding-top: clamp(6rem, 12vh, 10rem);
    padding-bottom: clamp(8rem, 14vh, 12rem);
    cursor: default;
}

.section--voting * {
    cursor: crosshair;
}

.voting-floor {
    position: relative;
    margin: 4rem auto 0;
    max-width: 1200px;
    height: 85vh;
    min-height: 700px;
    z-index: 4;
}

.voting-floor__threads {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    animation: thread-shimmer 8s ease-in-out infinite alternate;
}

@keyframes thread-shimmer {
    from { opacity: 0.6; }
    to   { opacity: 1; }
}

.ballot-card {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: clamp(220px, 22vw, 280px);
    padding: 1.6rem 1.4rem;
    background: rgba(13, 13, 26, 0.88);
    border: 1px solid rgba(201, 168, 76, 0.45);
    transform: rotate(var(--rot));
    transform-origin: center;
    box-shadow:
        0 -8px 24px rgba(13, 13, 26, 0.6),
        14px 18px 36px rgba(74, 48, 102, 0.4);
    transition:
        transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 600ms ease-out,
        border-color 400ms ease-out;
    z-index: 4;
    will-change: transform;
}

.ballot-card::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px dashed rgba(201, 168, 76, 0.18);
    pointer-events: none;
}

.ballot-card__seal {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 50px;
    height: 50px;
    border: 1.5px solid var(--c-vote-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--c-vote-red);
    background: rgba(13, 13, 26, 0.92);
    transform: rotate(-12deg);
    box-shadow: 0 0 18px rgba(139, 34, 51, 0.45);
}

.ballot-card h3 {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    color: var(--c-ghost);
    margin: 0 0 0.8rem;
}

.ballot-card p {
    font-family: var(--f-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--c-ash-fog);
    margin: 0 0 1rem;
    max-width: 100%;
}

.ballot-card__meta {
    display: block;
    font-family: var(--f-ui);
    font-size: 0.65rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--c-gold);
    border-top: 1px solid rgba(201, 168, 76, 0.18);
    padding-top: 0.8rem;
}

.ballot-card:hover {
    transform: rotate(0deg) translateY(-6px) scale(1.04);
    border-color: var(--c-teal);
    box-shadow:
        0 18px 40px rgba(13, 13, 26, 0.7),
        -14px -6px 36px rgba(45, 143, 143, 0.35);
    z-index: 8;
}

.ballot-card.is-repelled {
    transform: rotate(var(--rot)) translate(var(--push-x, 0), var(--push-y, 0));
}

@media (max-width: 720px) {
    .voting-floor {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    .ballot-card {
        position: relative;
        left: auto !important;
        top: auto !important;
        width: 100%;
        transform: rotate(var(--rot));
    }
}

/* =================================================================
   SECTION 4 -- THE ARCHIVE
   ================================================================= */

.section--archive {
    background:
        linear-gradient(180deg, var(--c-fog-grey) 0%, #1a1a2e 50%, var(--c-midnight) 100%);
    padding-top: clamp(6rem, 12vh, 10rem);
    padding-bottom: clamp(8rem, 14vh, 12rem);
}

.archive-spine {
    position: relative;
    max-width: 960px;
    margin: 4rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding: 2rem 0;
    z-index: 4;
}

.archive-spine__line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 20px;
    height: 100%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 1;
}

.cabinet {
    position: relative;
    width: 46%;
    z-index: 2;
}

.cabinet--left  { align-self: flex-start; transform: translateX(2%); }
.cabinet--right { align-self: flex-end;   transform: translateX(-2%); }

.cabinet__drawer {
    position: relative;
    background:
        linear-gradient(180deg, rgba(42, 42, 61, 0.96), rgba(13, 13, 26, 0.92));
    border: 1px solid rgba(201, 168, 76, 0.4);
    padding: 1.6rem 1.8rem;
    box-shadow:
        0 -10px 30px rgba(13, 13, 26, 0.6),
        14px 18px 36px rgba(74, 48, 102, 0.35);
    transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 700ms;
    transform: translateX(0);
}

.cabinet--left .cabinet__drawer  { transform: translateX(0); }
.cabinet--right .cabinet__drawer { transform: translateX(0); }

.cabinet--left.is-open .cabinet__drawer  { transform: translateX(18px); }
.cabinet--right.is-open .cabinet__drawer { transform: translateX(-18px); }

.cabinet__drawer:hover {
    box-shadow:
        0 18px 40px rgba(13, 13, 26, 0.8),
        -14px -6px 36px rgba(45, 143, 143, 0.3);
}

.cabinet__pull {
    position: absolute;
    top: 50%;
    width: 22px;
    height: 8px;
    background: var(--c-gold);
    transform: translateY(-50%);
    box-shadow: 0 0 14px rgba(201, 168, 76, 0.45);
}

.cabinet--left  .cabinet__pull { right: -1px; }
.cabinet--right .cabinet__pull { left: -1px; }

.cabinet__contents {
    position: relative;
}

.cabinet__date {
    display: block;
    font-family: var(--f-ui);
    font-size: 0.65rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--c-gold);
    margin-bottom: 0.6rem;
}

.cabinet__contents h3 {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    color: var(--c-ghost);
    margin: 0 0 0.8rem;
}

.cabinet__contents p {
    font-family: var(--f-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--c-ash-fog);
    margin: 0;
    max-width: 100%;
}

@media (max-width: 720px) {
    .cabinet { width: 100%; }
    .cabinet--left, .cabinet--right { transform: none; align-self: stretch; }
}

/* Broken seal stage */

.seal-stage {
    position: relative;
    margin: 5rem auto 0;
    width: 240px;
    height: 240px;
    z-index: 4;
}

.broken-seal {
    position: relative;
    width: 200px;
    height: 200px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: transform 700ms cubic-bezier(0.5, 1.6, 0.5, 1);
}

.broken-seal svg {
    width: 100%;
    height: 100%;
    animation: seal-rotate 120s linear infinite;
    filter: drop-shadow(0 0 14px rgba(139, 34, 51, 0.4));
}

.broken-seal__label {
    position: absolute;
    bottom: -2rem;
    font-family: var(--f-ui);
    font-size: 0.65rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(201, 168, 76, 0.55);
}

.broken-seal.is-stamped {
    animation: seal-stamp 600ms cubic-bezier(0.5, 1.7, 0.4, 1);
}

@keyframes seal-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes seal-stamp {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.15); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.seal-stage__stains {
    position: absolute;
    inset: -200% -200%;
    pointer-events: none;
}

.seal-stain {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 34, 51, 0.18), transparent 70%);
    transform: translate(-50%, -50%);
    animation: stain-fade 8s ease-out forwards;
    pointer-events: none;
}

@keyframes stain-fade {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
    20%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

/* =================================================================
   SECTION 5 -- THE EXIT THAT ISN'T
   ================================================================= */

.section--exit {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(74, 48, 102, 0.4), transparent 60%),
        linear-gradient(180deg, var(--c-midnight) 0%, var(--c-violet) 100%);
    padding-top: clamp(6rem, 12vh, 10rem);
    padding-bottom: clamp(6rem, 12vh, 8rem);
    text-align: center;
}

.exit-door {
    position: relative;
    margin: 0 auto 3rem;
    width: 200px;
    height: 320px;
    perspective: 800px;
    z-index: 4;
}

.exit-door__frame {
    position: relative;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(201, 168, 76, 0.55);
    background: linear-gradient(180deg, rgba(42, 42, 61, 0.9), rgba(13, 13, 26, 0.95));
    box-shadow:
        inset 0 0 40px rgba(74, 48, 102, 0.45),
        0 0 30px rgba(201, 168, 76, 0.18);
}

.exit-door__panel {
    position: absolute;
    inset: 8%;
    border: 1px solid rgba(201, 168, 76, 0.4);
    background: linear-gradient(135deg, rgba(13, 13, 26, 0.7), rgba(74, 48, 102, 0.45));
    transform-origin: left center;
    transition: transform 1500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.exit-door:hover .exit-door__panel {
    transform: rotateY(-32deg);
}

.exit-door__handle {
    position: absolute;
    right: 12%;
    top: 50%;
    width: 6px;
    height: 18px;
    background: var(--c-gold);
    box-shadow: 0 0 10px rgba(201, 168, 76, 0.6);
    transform: translateY(-50%);
}

.exit-door__sign {
    position: absolute;
    top: -2.4rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--f-ui);
    font-size: 0.78rem;
    letter-spacing: 0.4em;
    color: var(--c-gold);
    border: 1px solid rgba(201, 168, 76, 0.5);
    padding: 0.3rem 1rem;
    background: rgba(13, 13, 26, 0.9);
}

.exit-door__shadow {
    position: absolute;
    bottom: -30px;
    left: 50%;
    width: 60%;
    height: 16px;
    background: radial-gradient(ellipse, rgba(13, 13, 26, 0.85), transparent 70%);
    transform: translateX(-50%) translateY(-100%);
    /* shadow falls UPWARD */
}

.false-exit {
    position: relative;
    z-index: 4;
    max-width: 56rem;
    margin: 0 auto;
}

.section__title--mirror {
    transform: scaleX(-1);
    color: var(--c-gold);
    mix-blend-mode: normal;
    text-shadow:
        0 -8px 24px rgba(201, 168, 76, 0.3),
        12px 6px 28px rgba(139, 34, 51, 0.35);
}

.false-exit__lede {
    font-family: var(--f-display);
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--c-ash-fog);
    letter-spacing: 0.32em;
    margin: 0 auto 3rem;
}

.false-exit__inscriptions {
    list-style: none;
    margin: 0 auto 4rem;
    padding: 0;
    max-width: 44rem;
    text-align: left;
}

.false-exit__inscriptions li {
    font-family: var(--f-body);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--c-ash-fog);
    border-left: 1px solid rgba(201, 168, 76, 0.35);
    padding: 1rem 1.4rem;
    margin: 0 0 1rem;
    background: linear-gradient(90deg, rgba(74, 48, 102, 0.18), transparent 70%);
    transition: border-color 400ms, background 400ms;
}

.false-exit__inscriptions li:hover {
    border-left-color: var(--c-teal);
    background: linear-gradient(90deg, rgba(45, 143, 143, 0.18), transparent 70%);
}

.false-exit__inscriptions span {
    font-family: var(--f-ui);
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--c-gold);
    margin-right: 0.6rem;
}

/* Footer */

.chamber-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(201, 168, 76, 0.2);
    text-align: left;
}

.chamber-footer__col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chamber-footer__label {
    font-family: var(--f-ui);
    font-size: 0.65rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--c-gold);
    margin-bottom: 0.4rem;
}

.chamber-footer__col a,
.chamber-footer__col span {
    font-family: var(--f-body);
    font-size: 0.92rem;
    color: var(--c-ash-fog);
    line-height: 1.7;
}

.chamber-footer__col a {
    border-bottom: 1px dashed transparent;
    transition: border-color 300ms, color 300ms;
}

.chamber-footer__col a:hover {
    border-bottom-color: var(--c-teal);
    color: var(--c-teal);
}

@media (max-width: 720px) {
    .chamber-footer { grid-template-columns: 1fr; gap: 1.4rem; text-align: center; }
}

/* =================================================================
   DESCENT RAIL (left progress)
   ================================================================= */

.descent-rail {
    position: fixed;
    left: 1.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 40vh;
    z-index: 100;
}

.descent-rail__bar {
    position: absolute;
    inset: 0;
    background: rgba(201, 168, 76, 0.18);
}

.descent-rail__progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, var(--c-gold), var(--c-teal));
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.55);
    transition: height 200ms ease-out;
}

@media (max-width: 720px) {
    .descent-rail { display: none; }
}

/* =================================================================
   CURSOR TRAIL (Voting Floor only)
   ================================================================= */

.cursor-trail {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
}

.cursor-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-gold);
    box-shadow: 0 0 10px rgba(201, 168, 76, 0.6);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 600ms ease-out;
    pointer-events: none;
}

.cursor-dot.is-active { opacity: 0.3; }

/* =================================================================
   IN-VIEW REVEAL
   ================================================================= */

.section__header,
.speech-bubble,
.ballot-card,
.cabinet,
.false-exit__inscriptions li,
.podium-stage,
.exit-door {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 1200ms cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 1200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#antechamber .overture { /* hero handles its own */ }

.in-view .section__header,
.in-view .speech-bubble,
.in-view .ballot-card,
.in-view .cabinet,
.in-view .false-exit__inscriptions li,
.in-view .podium-stage,
.in-view .exit-door {
    opacity: 1;
    transform: translateY(0);
}

/* small animation delays per child for stagger */
.in-view .ballot-card:nth-child(1) { transition-delay: 80ms; }
.in-view .ballot-card:nth-child(2) { transition-delay: 160ms; }
.in-view .ballot-card:nth-child(3) { transition-delay: 240ms; }
.in-view .ballot-card:nth-child(4) { transition-delay: 320ms; }
.in-view .ballot-card:nth-child(5) { transition-delay: 400ms; }
.in-view .ballot-card:nth-child(6) { transition-delay: 480ms; }

.in-view .cabinet:nth-child(1) { transition-delay: 120ms; }
.in-view .cabinet:nth-child(2) { transition-delay: 240ms; }
.in-view .cabinet:nth-child(3) { transition-delay: 360ms; }
.in-view .cabinet:nth-child(4) { transition-delay: 480ms; }
.in-view .cabinet:nth-child(5) { transition-delay: 600ms; }

.in-view .false-exit__inscriptions li:nth-child(1) { transition-delay: 100ms; }
.in-view .false-exit__inscriptions li:nth-child(2) { transition-delay: 250ms; }
.in-view .false-exit__inscriptions li:nth-child(3) { transition-delay: 400ms; }
