:root {
    --midnight-void: #0D0B1A;
    --heisei-indigo: #1A1730;
    --pressed-cream: #F0E6D8;
    --faded-rose: #D4A0A7;
    --sakura-pastel: #F2C6D0;
    --wisteria-mist: #C3B1E1;
    --matcha-pale: #B8D8BA;
    --yuzu-soft: #F5E1A4;
    --rain-glass: #8BA7C7;
}

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

body {
    background-color: var(--midnight-void);
    color: var(--pressed-cream);
    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;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Vertical Navigation */
.vertical-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.nav-bud {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    color: var(--faded-rose);
    font-size: 14px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.6s cubic-bezier(0.23, 1.0, 0.32, 1.0), transform 0.6s cubic-bezier(0.23, 1.0, 0.32, 1.0);
}

.nav-bud.active {
    opacity: 1;
    transform: scale(1.4);
    color: var(--sakura-pastel);
}

/* Scenes */
.scene {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 1;
}

.interstitial {
    position: relative;
    min-height: 50vh;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Title - Ghostly */
.hero-title {
    font-family: 'Shippori Mincho', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.08em;
    color: var(--pressed-cream);
    text-align: left;
    padding-left: 10%;
    z-index: 2;
    position: relative;
}

.ghostly span {
    display: inline-block;
    animation: ghostFade 4s ease-in-out infinite;
}

@keyframes ghostFade {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Scene Text */
.scene-text {
    position: relative;
    z-index: 2;
    max-width: 500px;
    padding: 48px;
}

.left-text {
    margin-right: auto;
    padding-left: 8%;
}

.right-text {
    margin-left: auto;
    padding-right: 8%;
    text-align: left;
}

.scene-heading {
    font-family: 'Shippori Mincho', serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 3rem);
    letter-spacing: 0.08em;
    line-height: 1.2;
    color: var(--pressed-cream);
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.23, 1.0, 0.32, 1.0), transform 1s cubic-bezier(0.23, 1.0, 0.32, 1.0);
}

.scene-heading.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scene-body {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    line-height: 1.75;
    color: var(--pressed-cream);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.23, 1.0, 0.32, 1.0) 0.3s, transform 1.2s cubic-bezier(0.23, 1.0, 0.32, 1.0) 0.3s;
}

.scene-body.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Sakura Branches */
.sakura-branch {
    position: absolute;
    z-index: 1;
}

.branch-threshold {
    bottom: 0;
    left: 40px;
}

.branch-spring-bl {
    bottom: 0;
    left: 20px;
}

.branch-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.23, 1.0, 0.32, 1.0);
}

.scene.in-view .branch-path,
.threshold.in-view .branch-path {
    stroke-dashoffset: 0;
}

/* Wisteria */
.wisteria-vine {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
}

/* Ume Branch */
.ume-branch {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 1;
}

/* Maple Leaves */
.maple-leaves {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.maple-leaf {
    position: absolute;
    font-size: 24px;
    opacity: 0.4;
    animation: leafDrift 12s ease-in-out infinite;
}

.leaf-a { top: 20%; right: 15%; animation-delay: 0s; }
.leaf-b { top: 40%; right: 30%; animation-delay: -4s; }
.leaf-c { top: 60%; right: 10%; animation-delay: -8s; }

@keyframes leafDrift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-15px, 20px) rotate(20deg); }
    50% { transform: translate(10px, 40px) rotate(-10deg); }
    75% { transform: translate(-5px, 25px) rotate(15deg); }
}

/* Spring Scene */
.spring-scene {
    background: #0F0D1E;
}

/* Summer Scene */
.summer-scene {
    background: var(--midnight-void);
}

/* Autumn Scene */
.autumn-scene {
    background: var(--midnight-void);
}

/* Winter Scene */
.winter-scene {
    background: var(--midnight-void);
}

/* Return */
.return-scene {
    flex-direction: column;
    justify-content: center;
    gap: 32px;
}

.return-annotation {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    color: var(--faded-rose);
    padding-left: 10%;
    z-index: 2;
    position: relative;
}

/* Drifting Elements */
.drifting-petal {
    width: 8px;
    height: 8px;
    border-radius: 50% 50% 50% 0;
    background: var(--sakura-pastel);
    opacity: 0.3;
    animation: driftDown 8s ease-in-out infinite;
}

.drifting-leaf {
    width: 10px;
    height: 10px;
    background: var(--yuzu-soft);
    opacity: 0.3;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation: driftDown 10s ease-in-out infinite;
}

.drifting-snow {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rain-glass);
    opacity: 0.25;
    animation: driftDown 12s ease-in-out infinite;
}

@keyframes driftDown {
    0% { transform: translate(0, -30px) rotate(0deg); opacity: 0; }
    20% { opacity: 0.3; }
    80% { opacity: 0.3; }
    100% { transform: translate(20px, 60px) rotate(45deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .vertical-nav {
        position: fixed;
        right: auto;
        left: 50%;
        top: auto;
        bottom: 16px;
        transform: translateX(-50%);
        flex-direction: row;
    }

    .scene-text {
        padding: 32px 24px;
    }

    .left-text { padding-left: 24px; }
    .right-text { padding-right: 24px; }

    .hero-title {
        padding-left: 24px;
    }
}

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

    .maple-leaf {
        animation: none;
    }

    .drifting-petal, .drifting-leaf, .drifting-snow {
        animation: none;
        opacity: 0.3;
    }

    .branch-path {
        stroke-dashoffset: 0;
        transition: none;
    }

    .scene-heading, .scene-body {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
