:root {
    --frost-obsidian: #1a1f2e;
    --dusk-slate: #2d3748;
    --ice-sheet: #e8edf5;
    --fairy-lantern: #a7c4e0;
    --dawn-blush: #e8c4b8;
    --silver-vein: #b8c6db;
    --smoke: #4a5568;
    --mist: #cbd5e0;
    --fairy-dust: #d4e5f7;
    --deep-dark: #151b28;
    --twilight-mid: #1e2a3a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--frost-obsidian);
    overflow-x: hidden;
    font-family: 'Nunito', sans-serif;
    color: var(--mist);
}

/* Timeline */
.timeline {
    position: fixed;
    left: 8vw;
    top: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    pointer-events: none;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(184, 198, 219, 0.3);
    transform: translateX(-50%);
}

.timeline-node {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--silver-vein);
    background: radial-gradient(circle, var(--ice-sheet) 0%, transparent 70%);
    cursor: pointer;
    pointer-events: all;
    animation: pulse 4s ease-in-out infinite;
}

.timeline-node:nth-child(2) { animation-delay: 0s; }
.timeline-node:nth-child(3) { animation-delay: 0.8s; }
.timeline-node:nth-child(4) { animation-delay: 1.6s; }
.timeline-node:nth-child(5) { animation-delay: 2.4s; }
.timeline-node:nth-child(6) { animation-delay: 3.2s; }

.timeline-node.active {
    background: radial-gradient(circle, var(--fairy-lantern) 0%, transparent 70%);
    box-shadow: 0 0 10px rgba(167, 196, 224, 0.5);
}

.timeline-node.dawn-active {
    background: radial-gradient(circle, var(--dawn-blush) 0%, transparent 70%);
    box-shadow: 0 0 10px rgba(232, 196, 184, 0.5);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.timeline-label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(-8deg);
    font-family: 'Indie Flower', cursive;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    color: #8fa3bf;
    opacity: 0.7;
    white-space: nowrap;
}

/* Particles */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--fairy-dust);
    box-shadow: 0 0 6px 1px var(--fairy-dust);
    pointer-events: none;
    will-change: transform, opacity;
}

.particle.dawn {
    background: var(--dawn-blush);
    box-shadow: 0 0 6px 1px var(--dawn-blush);
}

/* Sections */
.section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
}

.section-content {
    margin-left: 15vw;
    max-width: 720px;
    padding: clamp(2rem, 5vw, 6rem);
    position: relative;
    z-index: 10;
}

/* Section 1: Dusk */
.section-dusk {
    background: linear-gradient(180deg, #2d3748 0%, #1a1f2e 100%);
}

.hero-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--ice-sheet);
    letter-spacing: 0.01em;
    line-height: 1.15;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.1, 0.25, 1), transform 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.hero-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    font-family: 'Indie Flower', cursive;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--silver-vein);
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) 0.4s, transform 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) 0.4s;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.skyline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    overflow: hidden;
}

.skyline-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.skyline-bg {
    filter: blur(3px);
}

.skyline-mid {
    filter: blur(1px);
}

.skyline-dusk {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.5s cubic-bezier(0.25, 0.1, 0.25, 1) 0.3s, transform 1.5s cubic-bezier(0.25, 0.1, 0.25, 1) 0.3s;
}

.skyline-dusk.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Moss glow */
.moss {
    filter: drop-shadow(0 0 8px rgba(167, 196, 224, 0.6));
    animation: mossGlow 3s ease-in-out infinite alternate;
}

@keyframes mossGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Section 2: Frost */
.section-frost {
    background: linear-gradient(180deg, #1a1f2e 0%, #151b28 100%);
}

.frost-container {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.frost-crystal {
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.6s;
}

.frost-crystal.visible {
    opacity: 1;
}

.frost-crystal line,
.frost-crystal path,
.frost-crystal circle {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.frost-crystal.visible line,
.frost-crystal.visible path,
.frost-crystal.visible circle {
    stroke-dashoffset: 0;
}

.frost-text {
    max-width: 500px;
}

.frost-text .section-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--ice-sheet);
    letter-spacing: 0.01em;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.frost-text p {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.015em;
    color: var(--mist);
    margin-bottom: 1.5rem;
}

.frost-text .char {
    opacity: 0;
    transition: opacity 0.1s;
}

.frost-text .char.revealed {
    opacity: 1;
}

/* Section 3: Quiet */
.section-quiet {
    background: #151b28;
    justify-content: center;
}

.skyline-quiet {
    height: 70%;
}

.quiet-content {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-left: 15vw;
}

.quiet-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--fairy-lantern);
    text-shadow: 0 0 20px rgba(167, 196, 224, 0.3);
    letter-spacing: 0.01em;
    line-height: 1.15;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.quiet-title.visible {
    opacity: 1;
}

/* Section 4: Wing-Light */
.section-wing {
    background: linear-gradient(180deg, #151b28 0%, #1e2a3a 100%);
    overflow: hidden;
}

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

.wing {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    mix-blend-mode: screen;
    background: linear-gradient(135deg, #a7c4e0 0%, #d4e5f7 40%, #e8c4b8 70%, #a7c4e0 100%);
}

.wing-1 {
    width: 400px;
    height: 200px;
    top: 20%;
    left: 10%;
    clip-path: ellipse(50% 35% at 50% 50%);
    animation: wingRotate 60s linear infinite;
}

.wing-2 {
    width: 350px;
    height: 180px;
    top: 40%;
    right: 15%;
    clip-path: ellipse(45% 40% at 50% 50%);
    animation: wingRotate 60s linear infinite reverse;
}

.wing-3 {
    width: 300px;
    height: 160px;
    bottom: 30%;
    left: 30%;
    clip-path: ellipse(50% 30% at 50% 50%);
    animation: wingRotate 60s linear infinite;
    animation-delay: -20s;
}

@keyframes wingRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.wing-text .section-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--ice-sheet);
    letter-spacing: 0.01em;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.wing-text p {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.015em;
    color: var(--mist);
    margin-bottom: 1.5rem;
}

.fairy-word {
    font-family: 'Caveat', cursive;
    font-size: 1.2em;
    color: var(--fairy-lantern);
}

.skyline-wing-partial {
    height: 20%;
}

/* Section 5: Dawn */
.section-dawn {
    background: linear-gradient(180deg, #1e2a3a 0%, #e8edf5 100%);
    justify-content: center;
}

.skyline-dawn {
    height: 60%;
    opacity: 0.4;
}

.dawn-content {
    text-align: center;
    margin-left: 15vw;
}

.dawn-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--mist);
    letter-spacing: 0.01em;
    line-height: 1.15;
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.25, 0.1, 0.25, 1), color 2s;
}

.dawn-title.visible {
    opacity: 1;
    color: var(--smoke);
}

/* Mobile */
@media (max-width: 768px) {
    .timeline {
        left: 5vw;
    }

    .section-content {
        margin-left: 12vw;
        padding: clamp(1.5rem, 4vw, 3rem);
    }

    .quiet-content,
    .dawn-content {
        margin-left: 12vw;
    }

    .frost-crystal {
        display: none;
    }

    .frost-container {
        flex-direction: column;
    }

    .wing {
        width: 200px;
        height: 100px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .timeline-node {
        animation: none;
    }

    .wing {
        animation: none;
    }

    .moss {
        animation: none;
    }

    .frost-crystal line,
    .frost-crystal path,
    .frost-crystal circle {
        stroke-dashoffset: 0;
        transition: none;
    }

    .hero-title,
    .hero-subtitle,
    .skyline-dusk,
    .quiet-title,
    .dawn-title {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
