/* =========================================
   diplomacy.quest - Styles
   Japanese-minimal + Art-deco display
   ========================================= */

:root {
    /* Palette: Complementary Depth */
    --deep-indigo: #0D1B2A;
    --charcoal-slate: #1B2838;
    --warm-midnight: #2A1F1A;
    --diplomatic-gold: #C9A84C;
    --pale-amber: #E8D5B5;
    --warm-stone: #B8A99A;
    --shadow-bronze: #7A6E60;
    --candle-core: #F5DEB3;
    --tarnished-gold: #8B7D3C;

    /* Spacing modular scale (48px base) */
    --space-1: 48px;
    --space-2: 96px;
    --space-3: 144px;
    --space-4: 192px;
    --space-5: 240px;

    /* Typography */
    --font-display: 'Poiret One', cursive;
    --font-secondary: 'Josefin Sans', sans-serif;
    --font-body: 'Cormorant Garamond', serif;

    /* Animation */
    --ripple-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--deep-indigo);
    color: var(--warm-stone);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   Corridor (Main container)
   ========================================= */
.corridor {
    position: relative;
    width: 100%;
}

/* =========================================
   Chamber (Shared)
   ========================================= */
.chamber {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-left: 12%;
    padding-right: 8%;
}

.chamber__content {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Ripple reveal: elements start hidden */
.chamber .ripple-reveal {
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 600ms var(--ripple-ease), transform 600ms var(--ripple-ease);
}

.chamber .ripple-reveal.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Receding chamber */
.chamber.receding {
    transition: opacity 1.2s ease;
}

.chamber.receding > * {
    opacity: 0.3;
    transition: opacity 1.2s ease;
}

/* =========================================
   Threshold Dividers
   ========================================= */
.threshold {
    height: var(--space-1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    padding: 0;
}

.threshold__svg {
    width: 100%;
    height: 2px;
    display: block;
}

.threshold-line svg {
    width: 100%;
    height: 2px;
    display: block;
}

.threshold-line__svg {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.2s var(--ripple-ease);
}

.threshold-line__svg.drawn {
    stroke-dashoffset: 0;
}

/* =========================================
   Lens Flares (Shared)
   ========================================= */
.flare {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    will-change: opacity, transform;
}

/* =========================================
   Chamber 1: Vestibule
   ========================================= */
.chamber--vestibule {
    background-color: var(--deep-indigo);
    flex-direction: column;
    min-height: 100vh;
}

.chamber--vestibule .chamber__content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.vestibule__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(64px, 10vw, 120px);
    letter-spacing: 0.08em;
    color: var(--diplomatic-gold);
    line-height: 1.1;
}

.vestibule__line {
    width: 100%;
    max-width: 100vw;
}

.flare--vestibule-1 {
    width: 400px;
    height: 400px;
    top: 20%;
    right: 10%;
    background: radial-gradient(circle, rgba(245, 222, 179, 0.15) 0%, rgba(201, 168, 76, 0.08) 30%, transparent 60%);
    animation: flareBreath 7s ease-in-out infinite;
}

.flare--vestibule-2 {
    width: 250px;
    height: 250px;
    bottom: 25%;
    left: 15%;
    background: radial-gradient(circle, rgba(245, 222, 179, 0.1) 0%, rgba(201, 168, 76, 0.05) 25%, transparent 55%);
    animation: flareBreath 8s ease-in-out infinite 2s;
}

/* =========================================
   Chamber 2: Reception Hall
   ========================================= */
.chamber--reception {
    background-color: var(--deep-indigo);
    min-height: 200vh;
}

.reception__layout {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
}

.reception__text {
    flex: 1;
    min-width: 0;
}

.reception__heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(48px, 7vw, 96px);
    letter-spacing: 0.08em;
    color: var(--diplomatic-gold);
    line-height: 1.15;
    margin-bottom: var(--space-1);
}

.reception__subheading {
    font-family: var(--font-secondary);
    font-weight: 300;
    font-size: clamp(20px, 3vw, 36px);
    letter-spacing: 0.04em;
    color: var(--pale-amber);
    line-height: 1.5;
}

.reception__flares {
    flex: 1;
    min-width: 0;
    position: relative;
    height: 500px;
}

.flare--reception-primary {
    width: 350px;
    height: 350px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(245, 222, 179, 0.25) 0%, rgba(201, 168, 76, 0.15) 20%, rgba(201, 168, 76, 0.05) 40%, transparent 60%);
    animation: flareBreath 6s ease-in-out infinite;
}

.flare--reception-secondary {
    width: 200px;
    height: 200px;
    top: 20%;
    left: 20%;
    background: radial-gradient(circle, rgba(245, 222, 179, 0.15) 0%, rgba(201, 168, 76, 0.08) 25%, transparent 55%);
    animation: flareBreath 8s ease-in-out infinite 1.5s;
}

.flare--reception-tertiary {
    width: 150px;
    height: 150px;
    bottom: 15%;
    right: 10%;
    background: radial-gradient(circle, rgba(232, 213, 181, 0.12) 0%, rgba(201, 168, 76, 0.06) 30%, transparent 55%);
    animation: flareBreath 7s ease-in-out infinite 3s;
}

/* Anamorphic streaks */
.anamorphic-streak {
    position: absolute;
    height: 1px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.chamber--reception.in-view .anamorphic-streak {
    opacity: 1;
}

.anamorphic-streak--1 {
    width: 400px;
    top: 48%;
    left: 30%;
    background: linear-gradient(90deg, transparent 0%, rgba(201, 168, 76, 0.3) 30%, rgba(201, 168, 76, 0.3) 70%, transparent 100%);
}

.anamorphic-streak--2 {
    width: 250px;
    top: 22%;
    left: 15%;
    background: linear-gradient(90deg, transparent 0%, rgba(201, 168, 76, 0.2) 40%, rgba(201, 168, 76, 0.2) 60%, transparent 100%);
    height: 2px;
}

.anamorphic-streak--3 {
    width: 600px;
    bottom: 18%;
    right: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(232, 213, 181, 0.15) 20%, rgba(201, 168, 76, 0.2) 50%, rgba(232, 213, 181, 0.15) 80%, transparent 100%);
}

/* Hexagonal Bokeh */
.bokeh {
    position: absolute;
    pointer-events: none;
    will-change: transform;
}

.bokeh--1 {
    top: 30%;
    left: 60%;
    animation: bokehFloat1 15s ease-in-out infinite;
}

.bokeh--2 {
    top: 55%;
    left: 75%;
    animation: bokehFloat2 18s ease-in-out infinite 2s;
}

.bokeh--3 {
    top: 15%;
    left: 45%;
    animation: bokehFloat3 14s ease-in-out infinite 4s;
}

.bokeh--4 {
    bottom: 20%;
    left: 55%;
    animation: bokehFloat1 20s ease-in-out infinite 6s;
}

.bokeh--5 {
    top: 40%;
    right: 15%;
    animation: bokehFloat2 16s ease-in-out infinite 3s;
}

/* Flame Wisps */
.flame-wisp {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.flame-wisp--1 {
    bottom: 20%;
    right: 25%;
    animation: flameWisp 10s ease-in-out infinite;
}

.flame-wisp--2 {
    top: 30%;
    right: 40%;
    animation: flameWisp 12s ease-in-out infinite 3s;
}

/* =========================================
   Chamber 3: Inner Chamber
   ========================================= */
.chamber--inner {
    background-color: var(--warm-midnight);
    min-height: 200vh;
    align-items: flex-start;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
}

.inner__layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: 800px;
}

.inner__block {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inner__block--left {
    align-self: flex-start;
    padding-right: 20%;
}

.inner__block--right {
    align-self: flex-end;
    padding-left: 20%;
    text-align: right;
}

.inner__block--right .fan-ornament {
    align-self: flex-end;
}

.fan-ornament {
    display: block;
    flex-shrink: 0;
}

.inner__text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.75;
    color: var(--warm-stone);
}

.flare--inner-1 {
    width: 300px;
    height: 300px;
    top: 15%;
    right: 5%;
    background: radial-gradient(circle, rgba(245, 222, 179, 0.1) 0%, rgba(201, 168, 76, 0.05) 30%, transparent 55%);
    animation: flareBreath 9s ease-in-out infinite 1s;
}

.flare--inner-2 {
    width: 200px;
    height: 200px;
    bottom: 20%;
    left: 5%;
    background: radial-gradient(circle, rgba(232, 213, 181, 0.08) 0%, rgba(201, 168, 76, 0.04) 25%, transparent 50%);
    animation: flareBreath 7s ease-in-out infinite 4s;
}

/* =========================================
   Chamber 4: Contemplation Room
   ========================================= */
.chamber--contemplation {
    background-color: var(--deep-indigo);
    min-height: 200vh;
}

.contemplation__layers {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.contemplation__layer {
    position: absolute;
    inset: 0;
    will-change: transform;
}

.contemplation__layer--1 {
    background: linear-gradient(135deg, rgba(13, 27, 42, 0.9) 0%, rgba(27, 40, 56, 0.6) 50%, rgba(13, 27, 42, 0.9) 100%);
    transform: translateY(0);
}

.contemplation__layer--2 {
    background: radial-gradient(ellipse at 30% 40%, rgba(201, 168, 76, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 60%, rgba(42, 31, 26, 0.5) 0%, transparent 40%);
    transform: translateY(0);
}

.contemplation__layer--3 {
    background: radial-gradient(ellipse at 60% 30%, rgba(232, 213, 181, 0.06) 0%, transparent 40%),
                radial-gradient(ellipse at 20% 70%, rgba(201, 168, 76, 0.04) 0%, transparent 35%);
    transform: translateY(0);
}

.contemplation__content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.contemplation__haiku {
    font-family: var(--font-body);
    font-weight: 600;
    font-style: italic;
    font-size: clamp(20px, 3vw, 32px);
    color: var(--pale-amber);
    line-height: 2.2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.haiku-line {
    display: block;
}

.flare--contemplation-1 {
    width: 500px;
    height: 500px;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(245, 222, 179, 0.12) 0%, rgba(201, 168, 76, 0.06) 25%, transparent 50%);
    animation: flareBreath 8s ease-in-out infinite;
}

.flare--contemplation-2 {
    width: 250px;
    height: 250px;
    top: 15%;
    left: 20%;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 50%);
    animation: flareBreath 10s ease-in-out infinite 2s;
}

.flare--contemplation-3 {
    width: 180px;
    height: 180px;
    bottom: 25%;
    right: 15%;
    background: radial-gradient(circle, rgba(232, 213, 181, 0.06) 0%, transparent 45%);
    animation: flareBreath 7s ease-in-out infinite 4s;
}

/* =========================================
   Chamber 5: Closing Threshold
   ========================================= */
.chamber--closing {
    background-color: var(--deep-indigo);
    min-height: 100vh;
    flex-direction: column;
}

.chamber--closing .chamber__content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.closing__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(32px, 5vw, 56px);
    letter-spacing: 0.08em;
    color: var(--diplomatic-gold);
    line-height: 1.2;
}

.closing__line {
    width: 100%;
}

.flare--closing-1 {
    width: 300px;
    height: 300px;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(245, 222, 179, 0.08) 0%, rgba(201, 168, 76, 0.04) 30%, transparent 55%);
    animation: flareBreath 9s ease-in-out infinite 1s;
}

/* =========================================
   Ripple Click Effect
   ========================================= */
.ripple-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(201, 168, 76, 0.3);
    pointer-events: none;
    animation: rippleExpand 1s var(--ripple-ease) forwards;
}

/* =========================================
   Keyframe Animations
   ========================================= */

/* Flare breathing */
@keyframes flareBreath {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Bokeh floating */
@keyframes bokehFloat1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(15px, -10px); }
    50% { transform: translate(5px, -20px); }
    75% { transform: translate(-10px, -8px); }
}

@keyframes bokehFloat2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-10px, 15px); }
    50% { transform: translate(-20px, 5px); }
    75% { transform: translate(-5px, -12px); }
}

@keyframes bokehFloat3 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(20px, 10px); }
    66% { transform: translate(-15px, 25px); }
}

/* Flame wisp drift */
@keyframes flameWisp {
    0%, 100% {
        transform: translateY(0) scaleX(1);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-20px) scaleX(1.05);
        opacity: 0.25;
    }
}

/* Ripple expand */
@keyframes rippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
    .chamber {
        padding-left: 6%;
        padding-right: 6%;
    }

    .reception__layout {
        flex-direction: column;
        gap: var(--space-1);
    }

    .reception__flares {
        height: 300px;
        width: 100%;
    }

    .inner__block--left {
        padding-right: 5%;
    }

    .inner__block--right {
        padding-left: 5%;
    }

    .vestibule__title {
        font-size: clamp(40px, 12vw, 72px);
    }

    .reception__heading {
        font-size: clamp(32px, 8vw, 56px);
    }
}

@media (max-width: 480px) {
    .inner__block--right {
        text-align: left;
        padding-left: 0;
    }

    .inner__block--right .fan-ornament {
        align-self: flex-start;
    }
}
