/* historical.quest - Surreal Dreamscape */

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

:root {
    --deep-indigo: #0F0A1A;
    --amber-glow: #C9A96E;
    --violet-mist: #7B68AE;
    --rose-fog: #B8687D;
    --pale-starlight: #E8DFD0;
    --midnight-blue: #1A1B3A;
    --ghost-silver: #A8A0B0;
    --dream-gold: #E8C87A;
}

body {
    font-family: 'Sorts Mill Goudy', serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.85;
    color: var(--pale-starlight);
    background: var(--deep-indigo);
    overflow-x: hidden;
}

/* Threshold (Hero) */
#threshold {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.dream-title {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: 0.06em;
    color: var(--pale-starlight);
    text-shadow: 0 0 40px rgba(201, 169, 110, 0.3), 0 0 80px rgba(201, 169, 110, 0.1);
    opacity: 0;
    position: relative;
    z-index: 2;
}

.dream-title.glow-phase {
    text-shadow: 0 0 40px rgba(201, 169, 110, 0.5), 0 0 80px rgba(201, 169, 110, 0.2);
    transition: text-shadow 0.8s ease;
}

.dream-title.visible {
    opacity: 1;
    transition: opacity 0.6s ease;
}

.floating-quotes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.float-quote {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-style: italic;
    color: var(--pale-starlight);
    position: absolute;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.float-quote.visible {
    animation: float-bob 10s ease-in-out infinite;
}

@keyframes float-bob {
    0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
    50% { transform: translateY(-15px) rotate(var(--rot, 0deg)); }
}

/* Memory Pool Sections */
.memory-pool-section {
    padding: 8vh 5vw;
    display: flex;
    justify-content: center;
    position: relative;
    min-height: 80vh;
}

.memory-pool {
    width: clamp(300px, 65vw, 700px);
    min-height: 350px;
    border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.memory-pool.visible {
    opacity: 1;
    transform: translateY(0);
    animation: pool-morph 20s ease-in-out infinite;
}

.pool-violet {
    background: radial-gradient(ellipse at 40% 40%, var(--violet-mist), var(--midnight-blue));
}

.pool-rose {
    background: radial-gradient(ellipse at 60% 50%, var(--rose-fog), var(--deep-indigo));
}

.pool-gold {
    background: radial-gradient(ellipse at 50% 60%, rgba(201, 169, 110, 0.4), var(--midnight-blue));
}

@keyframes pool-morph {
    0%, 100% { border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%; }
    25% { border-radius: 55% 45% 40% 60% / 45% 60% 40% 55%; }
    50% { border-radius: 45% 55% 60% 40% / 60% 45% 55% 40%; }
    75% { border-radius: 60% 40% 45% 55% / 40% 55% 45% 60%; }
}

.pool-content {
    max-width: 450px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease 0.3s;
}

.memory-pool.visible .pool-content {
    opacity: 1;
}

.pool-title {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--dream-gold);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.pool-text {
    color: var(--pale-starlight);
    font-size: 1rem;
    line-height: 1.85;
}

/* Drift Zone */
#drift-zone {
    height: 60vh;
    position: relative;
    overflow: hidden;
}

.drift-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.drift-text {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-size: clamp(1rem, 3vw, 2.5rem);
    color: var(--pale-starlight);
    position: absolute;
    top: var(--y, 50%);
    white-space: nowrap;
    animation: drift-horizontal var(--speed, 30s) linear infinite;
    will-change: transform;
}

@keyframes drift-horizontal {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* Dissolution */
#dissolution {
    height: 80vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.point-lights {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.point-light {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--amber-glow);
    box-shadow: 0 0 4px var(--amber-glow);
    opacity: 0;
    animation: point-glow 2s ease forwards;
}

@keyframes point-glow {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0.2; }
}

.remember-text {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--pale-starlight);
    opacity: 0;
    transition: opacity 1s ease;
    position: relative;
    z-index: 2;
    letter-spacing: 0.1em;
}

.remember-text.visible {
    opacity: 0.3;
}
