/* mystical.day - Neomorphic Seance Parlor */

/* Custom Properties */
:root {
    --deep-void: #060e18;
    --abyssal-navy: #0d1b2a;
    --midnight-slate: #1b2838;
    --ink-black: #060e18;
    --lunar-highlight: #263f5e;
    --tallow-gold: #c9a84c;
    --foxfire-lavender: #8b7ec8;
    --candleflame-amber: #d4956a;
    --moon-dust: #c8d0db;
    --twilight-silver: #7a8ba3;
    --section-mid: #162640;
    --shadow-dark: #0f2038;
    --shadow-light: #132744;
}

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

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

body {
    background-color: var(--deep-void);
    color: var(--moon-dust);
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* Navigation Thread */
.nav-thread {
    position: fixed;
    right: 20px;
    top: 0;
    width: 30px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

.nav-thread-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.1s linear;
    animation: thread-pulse 5s ease-in-out infinite;
}

.nav-node {
    animation: glow-pulse 3s ease-in-out infinite;
}

/* Sections - Shared */
.section {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(24px, 1fr) minmax(320px, 720px) minmax(24px, 1fr);
    align-items: center;
    overflow: hidden;
}

.section-content {
    grid-column: 2;
    position: relative;
    z-index: 2;
    text-align: center;
}

.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Section 1: Void Before Dawn */
.section-void {
    background: var(--deep-void);
}

.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.star-mote {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--tallow-gold);
    clip-path: polygon(50% 0%, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0% 50%, 39% 35%);
    opacity: 0;
    animation: star-appear 0.4s ease-out forwards, twinkle var(--twinkle-duration, 5s) ease-in-out var(--twinkle-delay, 0s) infinite;
}

.site-title {
    font-family: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
    font-weight: 600;
    font-size: clamp(3.5rem, 8vw, 6rem);
    color: var(--tallow-gold);
    letter-spacing: 0.04em;
    line-height: 1.1;
    opacity: 0;
    animation: fade-in 2s ease-out 4.5s forwards;
}

.site-subtitle {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    letter-spacing: 0.3em;
    color: var(--twilight-silver);
    margin-top: 1.5rem;
    opacity: 0;
    animation: fade-in 2s ease-out 5.5s forwards;
}

.scroll-indicator {
    margin-top: 3rem;
    opacity: 0;
    animation: fade-in 1.5s ease-out 6.5s forwards;
}

.chevron-breathe {
    animation: breathe-chevron 3s ease-in-out infinite;
}

/* Wave Dividers */
.wave-divider {
    position: relative;
    height: 80px;
    z-index: 3;
    margin-top: -40px;
    margin-bottom: -40px;
    pointer-events: none;
}

.wave-divider svg {
    width: 100%;
    height: 100%;
}

.wave-path {
    animation: curve-drift 12s ease-in-out infinite alternate;
}

/* Section 2: Drawing of Cards */
.section-cards {
    background: linear-gradient(180deg, var(--deep-void) 0%, var(--abyssal-navy) 40%, var(--midnight-slate) 100%);
}

.oracle-cards {
    display: flex;
    gap: clamp(1rem, 3vw, 2rem);
    justify-content: center;
    flex-wrap: wrap;
    align-items: stretch;
}

.oracle-card {
    position: relative;
    background: linear-gradient(145deg, var(--shadow-light), var(--shadow-dark));
    box-shadow: 8px 8px 20px rgba(4, 10, 20, 0.7),
                -8px -8px 20px rgba(30, 60, 110, 0.15);
    border-radius: 24px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    max-width: 280px;
    width: 100%;
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(60px);
    transition: box-shadow 0.6s cubic-bezier(0.23, 1, 0.32, 1), transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    animation: card-breathe 4s ease-in-out infinite;
    animation-play-state: paused;
}

.oracle-card.visible {
    opacity: 1;
    transform: translateY(0);
    animation-play-state: running;
}

.oracle-card:hover {
    box-shadow: 10px 10px 25px rgba(4, 10, 20, 0.8),
                -10px -10px 25px rgba(30, 60, 110, 0.2);
}

.card-aura {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.oracle-card.visible .card-aura {
    opacity: 1;
}

.aura-line {
    width: 100%;
    height: 100%;
}

.aura-line path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.5s ease-out;
}

.oracle-card.visible .aura-line path {
    stroke-dashoffset: 0;
}

.card-label {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    letter-spacing: 0.25em;
    color: var(--tallow-gold);
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    display: block;
}

.card-illustration {
    margin-bottom: 1.2rem;
    line-height: 0;
}

.card-illustration svg {
    opacity: 0.85;
}

.card-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: var(--moon-dust);
    line-height: 1.7;
}

.fate-lines {
    width: 100%;
    height: 50px;
    margin-top: 2rem;
    opacity: 0.5;
}

/* Section 3: The Meridian */
.section-meridian {
    background: var(--section-mid);
}

.oracle-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 50%, rgba(201, 168, 76, 0.08), transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.moon-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moon-svg {
    animation: moon-glow 6s ease-in-out infinite;
}

.orbit-words {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.orbit-word {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--tallow-gold);
    letter-spacing: 0.15em;
    white-space: nowrap;
    animation: orbit 30s linear infinite;
    animation-delay: var(--orbit-delay, 0s);
    transform-origin: 150px 150px;
}

/* Section 4: The Descent */
.section-descent {
    background: linear-gradient(180deg, var(--section-mid) 0%, var(--abyssal-navy) 50%, var(--midnight-slate) 100%);
}

.descent-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 60%, rgba(212, 149, 106, 0.06), transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.descent-curves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.descent-curve-svg {
    width: 100%;
    height: 100%;
}

.draw-curve {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease-out;
}

.section-descent.in-view .draw-curve {
    stroke-dashoffset: 0;
}

.descent-cards {
    display: flex;
    gap: clamp(1.5rem, 4vw, 3rem);
    justify-content: center;
    flex-wrap: wrap;
}

.oracle-card-large {
    max-width: 340px;
    flex: 1 1 280px;
    padding: clamp(2rem, 4vw, 3.5rem);
    box-shadow: 12px 12px 30px rgba(4, 10, 20, 0.8),
                -12px -12px 30px rgba(30, 60, 110, 0.18);
}

/* Section 5: The Revelation */
.section-revelation {
    background: var(--deep-void);
}

.star-field-final .star-mote {
    animation: star-appear 0.3s ease-out forwards, twinkle-fast var(--twinkle-duration, 3s) ease-in-out var(--twinkle-delay, 0s) infinite;
}

.site-title-final {
    animation: fade-in 2s ease-out 0.5s forwards;
    text-shadow: 0 0 40px rgba(201, 168, 76, 0.3);
    font-size: clamp(4rem, 10vw, 7rem);
}

.moon-phases {
    margin-top: 2.5rem;
    opacity: 0;
    animation: fade-in 1.5s ease-out 1.5s forwards;
}

.moon-phase-strip {
    max-width: 100%;
    height: auto;
    animation: moon-cycle 60s linear infinite;
}

.final-curve {
    width: 100%;
    height: 150px;
    margin-top: 3rem;
    opacity: 0;
    animation: fade-in 2s ease-out 2s forwards;
}

.final-curve-path {
    animation: glow-pulse-curve 4s ease-in-out infinite;
}

.final-curve-path-lavender {
    animation: glow-pulse-curve 4s ease-in-out infinite 2s;
}

/* Keyframe Animations */
@keyframes star-appear {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: var(--star-opacity, 0.8);
        transform: scale(1);
    }
}

@keyframes twinkle {
    0%, 100% { opacity: var(--star-opacity, 0.8); }
    50% { opacity: calc(var(--star-opacity, 0.8) * 0.3); }
}

@keyframes twinkle-fast {
    0%, 100% { opacity: var(--star-opacity, 0.9); }
    50% { opacity: calc(var(--star-opacity, 0.9) * 0.4); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes breathe-chevron {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
}

@keyframes card-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.008); }
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes glow-pulse-curve {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@keyframes thread-pulse {
    0%, 100% { stroke-width: 1.5; }
    50% { stroke-width: 2; }
}

@keyframes moon-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.2)); }
    50% { filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.4)); }
}

@keyframes orbit {
    from { transform: rotate(0deg) translateX(140px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(140px) rotate(-360deg); }
}

@keyframes curve-drift {
    0% { d: path('M0,60 C240,20 480,100 720,60 C960,20 1200,100 1440,60'); }
    100% { d: path('M0,60 C240,40 480,80 720,60 C960,40 1200,80 1440,60'); }
}

@keyframes moon-cycle {
    from { transform: translateX(0); }
    to { transform: translateX(-20px); }
}

/* Responsive */
@media (max-width: 768px) {
    .section {
        grid-template-columns: 16px 1fr 16px;
    }

    .oracle-cards {
        flex-direction: column;
        align-items: center;
    }

    .oracle-card {
        max-width: 100%;
    }

    .descent-cards {
        flex-direction: column;
        align-items: center;
    }

    .oracle-card-large {
        max-width: 100%;
    }

    .nav-thread {
        right: 8px;
    }

    .moon-container {
        width: 240px;
        height: 240px;
    }

    .orbit-word {
        transform-origin: 120px 120px;
    }

    @keyframes orbit {
        from { transform: rotate(0deg) translateX(110px) rotate(0deg); }
        to { transform: rotate(360deg) translateX(110px) rotate(-360deg); }
    }
}

@media (max-width: 480px) {
    .moon-container {
        width: 200px;
        height: 200px;
    }

    .orbit-word {
        font-size: 0.85rem;
        transform-origin: 100px 100px;
    }

    @keyframes orbit {
        from { transform: rotate(0deg) translateX(90px) rotate(0deg); }
        to { transform: rotate(360deg) translateX(90px) rotate(-360deg); }
    }
}
