/* ========================================
   xanadu.quest - styles.css
   Palette:
     Deep Twilight:  #1A1B3D
     Dawn Purple:    #2D1B4E
     Dusk Magenta:   #4A1942
     Sacred Gold:    #C9A84C
     Mist Cream:     #E8E0D0
     Ice Blue:       #A8C8E8
     Void Indigo:    #0D0E1A
     Frost White:    #F0F4F8
   Fonts: Cormorant Infant 300, EB Garamond 400i, Zen Kaku Gothic New 300
======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    color: #E8E0D0;
    background: #0D0E1A;
    line-height: 1.85;
    font-size: 1.1rem;
    overflow-x: hidden;
}

h1 {
    font-family: 'Cormorant Infant', Georgia, serif;
    font-weight: 300;
    letter-spacing: 0.12em;
}

.whisper {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    font-style: normal;
}

/* ---- FADE IN ---- */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.fade-in.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ---- SKY ANIMATION ---- */

@keyframes skyShift {
    0%   { background-color: #2D1B4E; }
    33%  { background-color: #1A1B3D; }
    66%  { background-color: #4A1942; }
    100% { background-color: #2D1B4E; }
}

/* ---- STAR PULSE ---- */

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

/* ---- FLOAT ANIMATION ---- */

@keyframes float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-15px); }
}

/* ---- RIVER FLOW ---- */

@keyframes riverFlow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -40; }
}

/* ---- THE APPROACH ---- */

.approach {
    position: relative;
    height: 150vh;
    overflow: hidden;
}

.sky-bg {
    position: absolute;
    inset: 0;
    background-color: #1A1B3D;
    animation: skyShift 30s ease-in-out infinite alternate;
}

.star-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.star-field-dot {
    position: absolute;
    width: 1px;
    height: 1px;
    background: #E8E0D0;
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

.parallax-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2;
}

.mountains-back {
    height: 40%;
    background: #2D1B4E;
    opacity: 0.7;
    clip-path: polygon(0% 60%, 8% 45%, 15% 55%, 25% 30%, 35% 50%, 45% 25%, 55% 45%, 65% 20%, 75% 40%, 85% 30%, 92% 50%, 100% 35%, 100% 100%, 0% 100%);
    z-index: 2;
}

.mountains-mid {
    height: 35%;
    background: linear-gradient(180deg, #1A1B3D, #2D1B4E);
    clip-path: polygon(0% 70%, 10% 50%, 20% 65%, 30% 40%, 40% 55%, 50% 30%, 60% 50%, 70% 35%, 80% 55%, 90% 40%, 100% 55%, 100% 100%, 0% 100%);
    z-index: 3;
}

.mountains-fore {
    height: 25%;
    background: #0D0E1A;
    clip-path: polygon(0% 75%, 5% 60%, 12% 70%, 20% 55%, 30% 65%, 42% 50%, 55% 60%, 65% 45%, 78% 60%, 88% 50%, 95% 65%, 100% 55%, 100% 100%, 0% 100%);
    z-index: 4;
}

.approach-title-wrap {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    text-align: center;
}

.approach-title {
    font-size: clamp(2rem, 5vw, 4.5rem);
    color: #E8E0D0;
    letter-spacing: 0.12em;
    text-shadow: 0 0 40px rgba(201, 168, 76, 0.3);
}

/* ---- THE RIVER ---- */

.river {
    position: relative;
    min-height: 130vh;
    background: #0D0E1A;
    overflow: hidden;
    padding: 10vh 0;
}

.river-flow {
    position: absolute;
    left: 10%;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 1;
    opacity: 0.6;
}

.river-path {
    animation: riverFlow 4s linear infinite;
}

.river-diagonal {
    transform: rotate(-3deg) scale(1.1);
    position: relative;
    z-index: 2;
}

.river-inner {
    transform: rotate(3deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40vh;
    padding: 10vh 2rem;
}

.poetic-passage {
    max-width: 600px;
    text-align: center;
}

.poem-text {
    font-size: 1.1rem;
    line-height: 1.85;
    color: #E8E0D0;
}

/* ---- THE DOME ---- */

.dome-section {
    position: relative;
    min-height: 120vh;
    background: linear-gradient(180deg, #0D0E1A 0%, #1A1B3D 50%, #0D0E1A 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10vh 2rem;
    overflow: hidden;
}

.dome-container {
    position: relative;
    width: 80vw;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dome-shape {
    width: 80vw;
    max-width: 700px;
    height: 40vw;
    max-height: 350px;
    border-radius: 50% 50% 0 0;
    background: radial-gradient(ellipse at 50% 100%, #C9A84C 0%, #4A1942 50%, #1A1B3D 100%);
    box-shadow: 0 0 80px rgba(201, 168, 76, 0.2), 0 0 160px rgba(201, 168, 76, 0.1);
}

.dome-text {
    text-align: center;
    margin-top: 3rem;
    max-width: 600px;
}

.dome-poem {
    color: #C9A84C;
    font-family: 'Cormorant Infant', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    letter-spacing: 0.04em;
}

.dome-passage {
    margin-top: 8vh;
    text-align: center;
    max-width: 500px;
}

/* ---- FLOATING SHAPES ---- */

.floating-shape {
    position: absolute;
    pointer-events: none;
    animation: float 6s ease-in-out infinite alternate;
}

.shape-circle-1 {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.15);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-circle-2 {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(168, 200, 232, 0.12);
    top: 20%;
    right: 15%;
    animation-delay: 1.5s;
}

.shape-triangle-1 {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid rgba(201, 168, 76, 0.1);
    top: 5%;
    right: 30%;
    animation-delay: 3s;
}

.shape-rect-1 {
    width: 4px;
    height: 30px;
    background: rgba(168, 200, 232, 0.1);
    top: 30%;
    left: 20%;
    animation-delay: 2s;
}

.shape-circle-3 {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.1);
    bottom: 20%;
    right: 10%;
    animation-delay: 4s;
}

/* ---- CAVES OF ICE ---- */

.caves {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(180deg, #0D0E1A 0%, #1A1B3D 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8vh;
    padding: 10vh 2rem;
    overflow: hidden;
}

.crystal-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crystal-svg {
    width: 100%;
    height: 100%;
}

.crystal-line {
    opacity: 0;
    transition: opacity 1.5s ease;
}

.caves.in-view .crystal-line {
    opacity: 0.4;
}

.ice-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(240, 244, 248, 0.08);
    border: 1px solid rgba(240, 244, 248, 0.12);
    border-radius: 8px;
    padding: 2.5rem 3rem;
    max-width: 550px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.ice-card .poem-text {
    color: #A8C8E8;
}

/* ---- THE RETURN ---- */

.return-section {
    position: relative;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.return-sky {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #1A1B3D 0%, #2D1B4E 50%, #4A1942 100%);
}

.return-text {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.return-poem {
    font-family: 'Cormorant Infant', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1.3rem, 3vw, 2rem);
    color: #C9A84C;
    letter-spacing: 0.08em;
    font-style: italic;
}

.return-empty {
    height: 40vh;
}

.whisper {
    position: relative;
    z-index: 2;
    color: rgba(232, 224, 208, 0.3);
    margin-bottom: 4rem;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 768px) {
    .dome-shape {
        width: 90vw;
        height: 45vw;
    }

    .river-diagonal {
        transform: none;
    }

    .river-inner {
        transform: none;
        gap: 25vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
