:root {
    --amber-glow: #E8943A;
    --deep-saffron: #C96B2D;
    --burnt-coral: #B84F4A;
    --twilight-rose: #7A3B5E;
    --deep-violet: #2E1F4D;
    --obsidian-indigo: #0D0B1A;
    --pale-starfire: #F0E4D1;
    --flare-white: #FFF5E6;
    --final-text: #1A1828;
}

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

body {
    background-color: var(--obsidian-indigo);
    color: var(--pale-starfire);
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* Star Navigation */
.star-nav {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.5s ease;
    padding: 8px;
}

.star-nav:hover {
    opacity: 1;
}

.star-stroke {
    stroke-dasharray: 100;
    animation: starDraw 20s linear infinite;
}

@keyframes starDraw {
    0% { stroke-dashoffset: 0; }
    50% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}

/* Scenes */
.scene {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

/* Golden Hour */
.scene-golden {
    background: linear-gradient(180deg, var(--amber-glow) 0%, #D47C32 50%, var(--deep-saffron) 100%);
    justify-content: center;
}

/* Civil Twilight */
.scene-civil {
    background: linear-gradient(180deg, var(--deep-saffron) 0%, var(--burnt-coral) 40%, #9B4450 100%);
}

/* Nautical Twilight */
.scene-nautical {
    background: linear-gradient(180deg, #9B4450 0%, var(--twilight-rose) 40%, #5A2D5E 80%, var(--deep-violet) 100%);
}

/* Astronomical Twilight */
.scene-astro {
    background: linear-gradient(180deg, var(--deep-violet) 0%, #1F1540 60%, var(--obsidian-indigo) 100%);
}

/* Night Zenith */
.scene-night {
    background: var(--obsidian-indigo);
    justify-content: center;
}

/* Breathing Zones */
.breathing-zone {
    height: 40vh;
    position: relative;
}

.bz-1 {
    background: linear-gradient(180deg, var(--deep-saffron) 0%, var(--burnt-coral) 100%);
}
.bz-2 {
    background: linear-gradient(180deg, #9B4450 0%, var(--twilight-rose) 100%);
}
.bz-3 {
    background: linear-gradient(180deg, #5A2D5E 0%, var(--deep-violet) 100%);
}
.bz-4 {
    background: linear-gradient(180deg, var(--deep-violet) 0%, var(--obsidian-indigo) 100%);
}

/* Horizon Line */
.horizon-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 66.7%;
    height: 0.5px;
    background: var(--pale-starfire);
    opacity: 0.2;
}

/* Hero Domain */
.hero-domain {
    font-family: 'Sawarabi Mincho', serif;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.08em;
    color: var(--obsidian-indigo);
    position: relative;
    z-index: 2;
}

.hero-char {
    display: inline-block;
    opacity: 0;
    animation: charReveal 0.8s ease forwards;
    animation-delay: calc(var(--i) * 400ms + 500ms);
}

@keyframes charReveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Lens Flares */
.lens-flare {
    position: absolute;
    height: 20px;
    background: radial-gradient(ellipse at center, var(--flare-white) 0%, transparent 70%);
    filter: blur(30px);
    mix-blend-mode: screen;
    will-change: filter;
    animation: flareBreathe 8s ease-in-out infinite alternate;
}

.flare-1 {
    width: 400px;
    top: 45%;
    left: 10%;
    opacity: 0.5;
    animation-delay: 0s;
}

.flare-2 {
    width: 300px;
    top: 50%;
    left: 30%;
    opacity: 0.4;
    animation-delay: -3s;
}

.flare-3 {
    width: 350px;
    top: 48%;
    right: 15%;
    opacity: 0.45;
    animation-delay: -5s;
}

.flare-full {
    width: 100%;
    top: 50%;
    left: 0;
    opacity: 0.08;
    height: 30px;
}

@keyframes flareBreathe {
    0% { opacity: 0.4; transform: scaleX(0.9); }
    100% { opacity: 0.7; transform: scaleX(1.1); }
}

/* Pulse Gradient */
.pulse-gradient {
    position: absolute;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-radius: 50%;
    background: radial-gradient(ellipse, var(--twilight-rose) 0%, transparent 70%);
    opacity: 0.15;
    animation: pulseGlow 6s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { opacity: 0.1; transform: scale(0.95); }
    100% { opacity: 0.2; transform: scale(1.05); }
}

/* Smoke Wisp */
.smoke-wisp {
    position: absolute;
    right: 20%;
    bottom: 30%;
    width: 40px;
    height: 120px;
    opacity: 0.08;
}

.smoke-wisp::before,
.smoke-wisp::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: var(--pale-starfire);
}

.smoke-wisp::before {
    width: 20px;
    height: 40px;
    bottom: 0;
    left: 10px;
    opacity: 0.12;
    animation: smokeDrift 8s ease-in-out infinite;
}

.smoke-wisp::after {
    width: 15px;
    height: 30px;
    bottom: 30px;
    left: 15px;
    opacity: 0.08;
    animation: smokeDrift 10s ease-in-out infinite -3s;
}

@keyframes smokeDrift {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.05; }
    50% { transform: translateY(-40px) translateX(5px); opacity: 0.12; }
}

/* Scene Text */
.scene-text {
    position: relative;
    z-index: 2;
    max-width: 42ch;
    padding: 48px;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.scene-text.visible {
    opacity: 1;
}

.text-lower {
    align-self: flex-end;
    margin-bottom: 10vh;
    padding-left: 8%;
}

.text-upper {
    align-self: flex-start;
    margin-top: 10vh;
    padding-left: 8%;
}

.text-center {
    text-align: left;
    padding-left: 15%;
}

.final-text {
    color: var(--final-text);
    font-family: 'Sawarabi Mincho', serif;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    opacity: 1;
}

/* Star Field */
.star-field {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.star-point {
    position: absolute;
    border-radius: 50%;
    background: var(--flare-white);
    will-change: transform, opacity;
}

/* Constellation Lines */
.constellation-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.const-line {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    transition: stroke-dashoffset 2s ease;
}

.scene-astro.in-view .const-line {
    stroke-dashoffset: 0;
}

/* Barlow Condensed accent */
.scene-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--pale-starfire);
    opacity: 0.3;
}

/* Responsive */
@media (max-width: 768px) {
    .scene-text {
        padding: 32px 24px;
    }

    .text-lower { padding-left: 24px; }
    .text-upper { padding-left: 24px; }
    .text-center { padding-left: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-char {
        opacity: 1;
        animation: none;
    }

    .lens-flare {
        animation: none;
    }

    .pulse-gradient {
        animation: none;
    }

    .smoke-wisp::before,
    .smoke-wisp::after {
        animation: none;
    }

    .star-stroke {
        animation: none;
        stroke-dashoffset: 0;
    }

    .star-point {
        animation: none;
        opacity: 0.6;
    }

    .scene-text {
        opacity: 1;
        transition: none;
    }
}
