/* dilemma.quest - Skeuomorphic Seance Parlor */
/* Fonts: Cormorant Garamond, Source Serif 4, Libre Franklin */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0806;
    color: #c9b896;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ============================================
   CHAMBER BASE STYLES
   ============================================ */

.chamber {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chamber-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    padding: 4rem 2rem;
}

/* ============================================
   VIGNETTE OVERLAY
   ============================================ */

.vignette {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.vignette-heavy {
    box-shadow: inset 0 0 150px 50px rgba(5, 3, 2, 0.7);
}

.vignette-light {
    box-shadow: inset 0 0 100px 30px rgba(5, 3, 2, 0.4);
}

.vignette-medium {
    box-shadow: inset 0 0 130px 40px rgba(5, 3, 2, 0.6);
}

.vignette-deepest {
    box-shadow: inset 0 0 200px 80px #050302;
}

.vignette-soft {
    box-shadow: inset 0 0 120px 40px rgba(5, 3, 2, 0.5);
}

/* ============================================
   LEATHER TEXTURE (CSS-Generated)
   ============================================ */

.leather-surface {
    background:
        repeating-conic-gradient(#2a1208 0.0001%, transparent 0.0002%) 0 0 / 300px 300px,
        radial-gradient(ellipse at 30% 40%, rgba(92, 58, 30, 0.6) 0%, transparent 2px) 0 0 / 18px 18px,
        radial-gradient(ellipse at 70% 60%, rgba(42, 18, 8, 0.4) 0%, transparent 1.5px) 8px 8px / 18px 18px,
        linear-gradient(145deg, #3d2414 0%, #2a1208 40%, #1a0a04 100%);
    background-attachment: fixed;
}

.leather-light {
    background:
        repeating-conic-gradient(#5c3a1e 0.0001%, transparent 0.0002%) 0 0 / 300px 300px,
        radial-gradient(ellipse at 30% 40%, rgba(184, 160, 112, 0.3) 0%, transparent 2px) 0 0 / 18px 18px,
        radial-gradient(ellipse at 70% 60%, rgba(92, 58, 30, 0.2) 0%, transparent 1.5px) 8px 8px / 18px 18px,
        linear-gradient(145deg, #8a6914 0%, #5c3a1e 40%, #3d2414 100%);
    background-attachment: fixed;
}

.leather-surface-panel {
    background:
        repeating-conic-gradient(#2a1208 0.0001%, transparent 0.0002%) 0 0 / 200px 200px,
        radial-gradient(ellipse at 30% 40%, rgba(92, 58, 30, 0.5) 0%, transparent 2px) 0 0 / 14px 14px,
        radial-gradient(ellipse at 70% 60%, rgba(42, 18, 8, 0.3) 0%, transparent 1.5px) 6px 6px / 14px 14px,
        linear-gradient(145deg, #3d2414 0%, #2a1208 50%, #1a0a04 100%);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.embossed-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(2.4rem, 5.5vw, 4.8rem);
    letter-spacing: 0.03em;
    color: #e8d5a3;
    text-shadow:
        0 1px 0 #b8a070,
        0 2px 0 #a08860,
        0 3px 6px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(232, 213, 163, 0.15);
    text-align: center;
}

.chamber-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    letter-spacing: 0.03em;
    color: #e8d5a3;
    text-align: center;
    margin-bottom: 2rem;
}

.embossed {
    text-shadow:
        0 -1px 0 rgba(0, 0, 0, 0.6),
        0 1px 0 rgba(255, 255, 255, 0.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.chamber-number {
    display: block;
    text-align: center;
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ff5e3a;
    margin-bottom: 1rem;
}

/* ============================================
   CHAMBER I - THE VESTIBULE
   ============================================ */

.vestibule-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding: 0 2rem;
}

.vestibule-subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    color: #b8a070;
    margin-top: 1.5rem;
    letter-spacing: 0.04em;
}

.brass-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 4rem;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brass-arrow:hover {
    transform: translateY(6px);
}

.arrow-shaft {
    width: 3px;
    height: 50px;
    background: linear-gradient(to bottom, #e8d5a3, #c9a84c, #8a6914);
    border-radius: 1px;
    box-shadow: 1px 0 2px rgba(0,0,0,0.3), -1px 0 2px rgba(0,0,0,0.3);
}

.arrow-head {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid #c9a84c;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
    margin-top: -1px;
}

.arrow-label {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ff5e3a;
    margin-top: 1rem;
}

/* ============================================
   BRASS RULES (Dividers)
   ============================================ */

.brass-rule {
    position: relative;
    width: 100%;
    height: 4px;
    background: linear-gradient(to bottom,
        #f5ecd0 0px,
        #e8d5a3 1px,
        #c9a84c 2px,
        #8a6914 3px,
        rgba(0,0,0,0.5) 4px
    );
    z-index: 5;
}

/* ============================================
   WAX DRIPS
   ============================================ */

.wax-drip {
    position: absolute;
    width: 8px;
    height: 20px;
    border-radius: 4px 4px 4px 4px / 3px 3px 8px 8px;
    background: linear-gradient(to bottom, #ffb347, #ff5e3a);
    top: 0;
    z-index: 6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.wax-drip-1 { left: 15%; height: 18px; }
.wax-drip-2 { left: 50%; height: 24px; }
.wax-drip-3 { left: 78%; height: 16px; }
.wax-drip-4 { left: 30%; height: 22px; }
.wax-drip-5 { left: 65%; height: 19px; }
.wax-drip-6 { left: 20%; height: 17px; }
.wax-drip-7 { left: 48%; height: 25px; }
.wax-drip-8 { left: 82%; height: 20px; }
.wax-drip-9 { left: 35%; height: 21px; }
.wax-drip-10 { left: 70%; height: 18px; }

/* ============================================
   CHAMBER II - THE LEDGER
   ============================================ */

.chamber-ledger {
    background:
        linear-gradient(145deg, #d4c4a0 0%, #c9b896 30%, #b8a070 100%);
    min-height: 120vh;
}

.ledger-content {
    text-align: center;
}

.ledger-book {
    display: flex;
    position: relative;
    gap: 0;
    margin-top: 2rem;
    justify-content: center;
}

.ledger-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 12px;
    transform: translateX(-50%);
    background: linear-gradient(to right,
        rgba(0,0,0,0.3),
        rgba(0,0,0,0.5),
        rgba(0,0,0,0.3)
    );
    z-index: 3;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.ledger-page {
    position: relative;
    flex: 1;
    max-width: 480px;
    padding: 3rem 2.5rem;
    background: #f5ecd0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1);
    text-align: left;
}

.ledger-page-left {
    border-radius: 4px 0 0 4px;
    margin-right: 6px;
}

.ledger-page-right {
    border-radius: 0 4px 4px 0;
    margin-left: 6px;
}

.page-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 31px,
        rgba(180, 160, 120, 0.25) 31px,
        rgba(180, 160, 120, 0.25) 32px
    );
    pointer-events: none;
}

.dog-ear {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 20px 20px 0 0;
    border-color: #d4c4a0 #f5ecd0 transparent transparent;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.1));
}

.dog-ear-right {
    left: auto;
    right: 0;
    border-width: 0 0 20px 20px;
    border-color: transparent transparent #f5ecd0 #d4c4a0;
}

.page-heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: #2a1f14;
    margin-bottom: 1.2rem;
    letter-spacing: 0.02em;
}

.page-text {
    color: #2a1f14;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.page-text em {
    font-style: italic;
    color: #5c3a1e;
}

/* ============================================
   CHAMBER III - THE SCALES
   ============================================ */

.chamber-scales {
    background: linear-gradient(180deg, #1a0a04 0%, #0a0806 50%, #1a0a04 100%);
}

.scales-content {
    text-align: center;
}

.scales-container {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    margin-top: 2rem;
    perspective: 1000px;
}

.scale-panel {
    flex: 1;
    max-width: 420px;
    padding: 2.5rem 2rem;
    border-radius: 6px;
    box-shadow:
        0 4px 20px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(232,213,163,0.08);
    transition: transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scale-left {
    transform-origin: right center;
}

.scale-right {
    transform-origin: left center;
}

.scale-heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 1.6rem;
    color: #e8d5a3;
    margin-bottom: 1.2rem;
    text-shadow:
        0 1px 0 #b8a070,
        0 2px 4px rgba(0,0,0,0.3);
}

.scale-text {
    color: #c9b896;
    text-align: left;
    line-height: 1.8;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
}

.brass-divider-vertical {
    width: 6px;
    min-height: 200px;
    margin: 0 1.5rem;
    background: linear-gradient(to right,
        rgba(0,0,0,0.3),
        #8a6914,
        #c9a84c,
        #e8d5a3,
        #c9a84c,
        #8a6914,
        rgba(0,0,0,0.3)
    );
    border-radius: 3px;
    position: relative;
    box-shadow: 0 0 10px rgba(232,213,163,0.1);
    align-self: stretch;
}

.fulcrum-ornament {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #f5ecd0, #e8d5a3, #8a6914);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.scales-footnote {
    margin-top: 3rem;
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-size: 1.1rem;
    color: #b8a070;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   CHAMBER IV - THE FLAME
   ============================================ */

.chamber-flame {
    background: #0a0806;
    min-height: 130vh;
}

.flame-light-pool {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 94, 58, 0.08) 0%, rgba(255, 94, 58, 0.03) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
}

.flame-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 130vh;
    justify-content: flex-start;
    padding-top: 6rem;
}

.candle-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0 3rem;
}

.candle-body {
    width: 30px;
    height: 80px;
    background: linear-gradient(to right, #f5ecd0, #e8d5a3, #d4c4a0);
    border-radius: 2px 2px 4px 4px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.candle-wax {
    position: absolute;
    top: -3px;
    left: -4px;
    right: -4px;
    height: 10px;
    background: linear-gradient(to bottom, #f5ecd0, #e8d5a3);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.flame {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 40px;
}

.flame-outer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 40px;
    background: linear-gradient(to top, #ff5e3a, rgba(255,179,71,0.5), transparent);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flickerOuter 1.2s ease-in-out infinite alternate;
    box-shadow: 0 0 60px 30px rgba(255, 94, 58, 0.2), 0 0 120px 60px rgba(255, 94, 58, 0.08);
}

.flame-core {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 30px;
    background: linear-gradient(to top, #ff5e3a, #ffb347, #fffbe6);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flickerCore 0.8s ease-in-out infinite alternate;
}

.flame-inner {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 16px;
    background: linear-gradient(to top, #00e5c7, #fffbe6);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flickerInner 0.6s ease-in-out infinite alternate;
    opacity: 0.9;
}

.wick {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 12px;
    background: #2a1208;
    border-radius: 1px;
}

@keyframes flickerOuter {
    0% { transform: translateX(-50%) scaleX(1) scaleY(1); opacity: 0.9; }
    25% { transform: translateX(-48%) scaleX(1.04) scaleY(0.96); }
    50% { transform: translateX(-52%) scaleX(0.96) scaleY(1.04); }
    75% { transform: translateX(-49%) scaleX(1.02) scaleY(0.98); }
    100% { transform: translateX(-50%) scaleX(0.98) scaleY(1.02); opacity: 1; }
}

@keyframes flickerCore {
    0% { transform: translateX(-50%) scaleX(1) scaleY(1); }
    33% { transform: translateX(-48%) scaleX(1.06) scaleY(0.94); }
    66% { transform: translateX(-52%) scaleX(0.94) scaleY(1.06); }
    100% { transform: translateX(-50%) scaleX(1.02) scaleY(0.98); }
}

@keyframes flickerInner {
    0% { transform: translateX(-50%) scaleY(1); opacity: 0.85; }
    50% { transform: translateX(-50%) scaleY(1.1); opacity: 0.95; }
    100% { transform: translateX(-50%) scaleY(0.9); opacity: 0.8; }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 60px 30px rgba(255, 94, 58, 0.2), 0 0 120px 60px rgba(255, 94, 58, 0.08); }
    100% { box-shadow: 0 0 80px 40px rgba(255, 94, 58, 0.25), 0 0 160px 80px rgba(255, 94, 58, 0.12); }
}

.flame-text-rings {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.flame-ring {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.8;
    text-align: center;
    transition: opacity 0.6s ease, color 0.6s ease;
}

.flame-ring-1 {
    font-size: 1.3rem;
    color: #e8d5a3;
    opacity: 0.95;
}

.flame-ring-2 {
    font-size: 1.15rem;
    color: #c9b896;
    opacity: 0.8;
}

.flame-ring-3 {
    font-size: 1.05rem;
    color: #b8a070;
    opacity: 0.65;
}

.flame-ring-4 {
    font-size: 0.95rem;
    color: #8a6914;
    opacity: 0.5;
}

.flame-ring-5 {
    font-size: 0.9rem;
    color: #5c3a1e;
    opacity: 0.35;
}

/* ============================================
   CHAMBER V - THE RESOLUTION
   ============================================ */

.chamber-resolution {
    min-height: 100vh;
}

.resolution-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.letterpress-block {
    max-width: 650px;
    margin: 1rem auto;
}

.letterpress-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.3vw, 1.3rem);
    line-height: 1.9;
    color: #e8d5a3;
    text-shadow:
        0 -1px 0 rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.06);
}

.letterpress-text em {
    font-style: italic;
    color: #ff5e3a;
}

.closing-mark {
    margin-top: 3rem;
}

.mark-symbol {
    font-size: 2rem;
    color: #e8d5a3;
    opacity: 0.6;
    text-shadow: 0 0 12px rgba(232, 213, 163, 0.3);
}

/* ============================================
   SPRING ANIMATION SYSTEM
   ============================================ */

.spring-in {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease-out;
}

.spring-in.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.scale-panel.spring-in {
    transform: translateY(50px) rotateX(4deg);
    transition: transform 1.1s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease-out;
}

.scale-panel.spring-in.visible {
    transform: translateY(0) rotateX(0deg);
}

.brass-rule.spring-in {
    transform: scaleX(0);
    transform-origin: center;
    opacity: 1;
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brass-rule.spring-in.visible {
    transform: scaleX(1);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .ledger-book {
        flex-direction: column;
        align-items: center;
    }

    .ledger-spine {
        position: relative;
        left: auto;
        top: auto;
        bottom: auto;
        width: 100%;
        max-width: 480px;
        height: 6px;
        transform: none;
        background: linear-gradient(to bottom,
            rgba(0,0,0,0.2),
            rgba(0,0,0,0.4),
            rgba(0,0,0,0.2)
        );
        margin: 0 auto;
    }

    .ledger-page {
        max-width: 100%;
        margin: 0;
    }

    .ledger-page-left {
        border-radius: 4px 4px 0 0;
        margin-right: 0;
    }

    .ledger-page-right {
        border-radius: 0 0 4px 4px;
        margin-left: 0;
    }

    .scales-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .brass-divider-vertical {
        width: 80%;
        min-height: 6px;
        height: 6px;
        margin: 0;
        background: linear-gradient(to bottom,
            rgba(0,0,0,0.3),
            #8a6914,
            #c9a84c,
            #e8d5a3,
            #c9a84c,
            #8a6914,
            rgba(0,0,0,0.3)
        );
    }

    .scale-panel {
        max-width: 100%;
    }

    .flame-text-rings {
        padding: 0 1rem;
    }
}
