/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: #080d1a;
    color: #b8d4ff;
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
}

/* Deep Field sections */
.scene:nth-child(even) {
    background: rgba(15, 27, 61, 0.3); /* #0f1b3d */
}

/* Filament accent color: #4a7dff */
a, a:visited {
    color: #4a7dff;
}

/* === PARTICLE CANVAS === */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* === FILAMENT SVG === */
#filament-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

#filament-main {
    animation: filament-pulse 8s ease-in-out infinite;
}

@keyframes filament-pulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.55; }
}

/* === SCENES === */
.scene {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
}

#scene-void {
    height: 100vh;
    min-height: 100vh;
}

#scene-first-node {
    min-height: 80vh;
    padding-top: 8rem;
    padding-bottom: 8rem;
}

#scene-branch {
    min-height: 60vh;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

#scene-constellation {
    min-height: 100vh;
    padding-top: 8rem;
    padding-bottom: 8rem;
}

#scene-closing {
    min-height: 80vh;
    padding-top: 8rem;
    padding-bottom: 10rem;
}

/* === CONTENT COLUMN === */
.scene-content {
    width: clamp(320px, 60vw, 720px);
    max-width: 90vw;
    position: relative;
}

/* === TYPOGRAPHY === */
.hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 7rem);
    color: #eef4ff;
    letter-spacing: 0.02em;
    text-align: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

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

.title-dot {
    color: #ffb347;
}

h2.decode-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: #eef4ff;
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

h2.decode-text.revealed {
    opacity: 1;
}

.body-text {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: #b8d4ff;
    line-height: 1.85;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.body-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.amber-highlight {
    color: #ffb347;
}

/* === BRANCH TEXT === */
.branch-content h2 {
    margin-bottom: 0.3rem;
}

.branch-content h2:last-child {
    margin-bottom: 1.5rem;
}

/* === CLOSING === */
.closing-title {
    font-size: clamp(2rem, 5vw, 3.5rem) !important;
    margin-bottom: 2rem !important;
}

/* === NODE CIRCLES === */
.node-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #6ba3ff;
    box-shadow: 0 0 12px 2px rgba(74, 125, 255, 0.4);
    margin-bottom: 2rem;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.node-circle.active {
    opacity: 1;
    transform: scale(1);
}

.node-circle.pulse {
    animation: node-pulse 0.4s ease-out;
}

@keyframes node-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* === TRAJECTORY SVGs === */
.trajectory-svg {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.trajectory-svg.visible {
    opacity: 1;
}

.trajectory-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease;
}

.trajectory-svg.visible .trajectory-path {
    stroke-dashoffset: 0;
}

/* === CONSTELLATION === */
.constellation-svg {
    width: clamp(280px, 50vw, 500px);
    height: auto;
    margin-bottom: 3rem;
    opacity: 0;
    transition: opacity 1s ease;
}

.constellation-svg.visible {
    opacity: 1;
}

.constellation-svg .trajectory-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
}

.constellation-svg.visible .trajectory-path {
    stroke-dashoffset: 0;
}

.constellation-svg.visible .trajectory-path:nth-child(1) { transition: stroke-dashoffset 1.5s ease 0s; }
.constellation-svg.visible .trajectory-path:nth-child(2) { transition: stroke-dashoffset 1.5s ease 0.3s; }
.constellation-svg.visible .trajectory-path:nth-child(3) { transition: stroke-dashoffset 1.5s ease 0.6s; }
.constellation-svg.visible .trajectory-path:nth-child(4) { transition: stroke-dashoffset 1.5s ease 0.9s; }
.constellation-svg.visible .trajectory-path:nth-child(5) { transition: stroke-dashoffset 1.5s ease 1.2s; }
.constellation-svg.visible .trajectory-path:nth-child(6) { transition: stroke-dashoffset 1.5s ease 1.5s; }

/* === CAVEAT ANNOTATIONS === */
.caveat-annotation {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: #6ba3ff;
    opacity: 0;
    position: absolute;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.caveat-annotation.visible {
    opacity: 0.7;
}

.annotation-1 {
    right: 8%;
    top: 35%;
}

.annotation-constellation {
    position: absolute;
}
.a-1 { top: 25%; right: 15%; }
.a-2 { top: 45%; left: 8%; }
.a-3 { bottom: 30%; left: 50%; transform: translateX(-50%); }
.a-4 { top: 20%; left: 15%; }

/* === MARGIN GLYPHS === */
.margin-glyph {
    position: fixed;
    width: 32px;
    height: auto;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

.margin-glyph.visible {
    opacity: 1;
}

.glyph-infinity {
    top: 50%;
    left: 2%;
}

.glyph-spiral {
    top: 70%;
    right: 3%;
}

/* === SPIRAL GLYPH === */
.spiral-glyph {
    width: 48px;
    height: 48px;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 1s ease;
}

.spiral-glyph.visible {
    opacity: 1;
}

/* === AMBER GLOW === */
.amber-highlight {
    text-shadow: 0 0 16px rgba(255, 179, 71, 0.3);
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .trajectory-svg {
        width: 80%;
    }
    .annotation-1 {
        right: 4%;
        top: 15%;
    }
    .annotation-constellation {
        display: none;
    }
}
