/* ============================================
   haroo.day - Burgundy-Cream Nocturne
   A dusk-saturated twilight narrative
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #1A0A0E;
    color: #C8B8A0;
    font-family: "Roboto Slab", "Rockwell", "Courier New", serif;
    font-weight: 300;
    line-height: 1.78;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Noise Filter (generated, not raster) --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Scroll Progress Indicator --- */
#scroll-progress {
    position: fixed;
    top: 0;
    right: 12px;
    width: 2px;
    height: 100vh;
    z-index: 500;
    background: rgba(138, 112, 96, 0.15);
}

#scroll-progress-fill {
    width: 100%;
    height: 0%;
    background: #C8B8A0;
    transition: opacity 0.6s ease;
}

/* --- Perspective Stage --- */
#perspective-stage {
    position: relative;
    perspective: 1200px;
    perspective-origin: 50% 50%;
    transform-style: preserve-3d;
}

/* --- Background Plane (z: 0) --- */
#bg-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    transform: translateZ(-200px) scale(1.35);
    transform-style: preserve-3d;
}

#bg-gradient {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
        #1A0A0E 0%,
        #4A1528 40%,
        #6B1D3A 70%,
        #E8DCC8 98%
    );
    transition: none;
}

/* --- Mid-ground Plane (z: 1) --- */
#mid-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    transform: translateZ(-100px) scale(1.15);
    transform-style: preserve-3d;
    pointer-events: none;
    will-change: transform;
}

/* --- Nature Silhouettes --- */
.silhouette {
    position: absolute;
    opacity: 0.65;
}

.branch-1 {
    top: 5vh;
    left: -5vw;
    width: 25vw;
    max-width: 350px;
}

.branch-2 {
    top: 20vh;
    right: -3vw;
    width: 30vw;
    max-width: 450px;
}

.leaf-ginkgo {
    top: 35vh;
    left: 20vw;
    width: 4vw;
    max-width: 60px;
    min-width: 30px;
}

.leaf-maple {
    top: 55vh;
    right: 25vw;
    width: 5vw;
    max-width: 70px;
    min-width: 35px;
}

.leaf-willow {
    top: 45vh;
    left: 60vw;
    width: 2vw;
    max-width: 25px;
    min-width: 15px;
}

.horizon-line {
    top: 72vh;
    left: 0;
    width: 100vw;
}

.grass-cluster-1 {
    bottom: 2vh;
    left: 5vw;
    width: 10vw;
    max-width: 120px;
    min-width: 60px;
}

.grass-cluster-2 {
    bottom: 0;
    left: 45vw;
    width: 8vw;
    max-width: 100px;
    min-width: 50px;
}

.grass-cluster-3 {
    bottom: 1vh;
    right: 8vw;
    width: 12vw;
    max-width: 140px;
    min-width: 70px;
}

/* Grass sway animation - 0.05Hz, almost imperceptible */
.grass-cluster-1,
.grass-cluster-2,
.grass-cluster-3 {
    animation: grass-sway 20s ease-in-out infinite;
    transform-origin: bottom center;
}

.grass-cluster-2 {
    animation-delay: -7s;
}

.grass-cluster-3 {
    animation-delay: -13s;
}

@keyframes grass-sway {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(0.5deg); }
    75% { transform: rotate(-0.5deg); }
}

/* --- Light Pools --- */
.light-pool {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(232, 220, 200, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.light-pool-1 {
    top: 15vh;
    left: 10vw;
    width: 40vw;
    height: 40vw;
}

.light-pool-2 {
    top: 50vh;
    right: 5vw;
    width: 35vw;
    height: 35vw;
}

.light-pool-3 {
    top: 75vh;
    left: 30vw;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(ellipse, rgba(232, 220, 200, 0.05) 0%, transparent 70%);
}

/* --- Foreground Plane (z: 2) --- */
#fg-plane {
    position: relative;
    z-index: 10;
    transform: translateZ(0);
}

/* --- Content Sections --- */
.content-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 8vw;
}

#section-title {
    min-height: 100vh;
    align-items: center;
    text-align: center;
}

#section-first-light {
    min-height: 100vh;
}

#section-hours {
    min-height: 300vh;
    justify-content: space-around;
    padding-top: 10vh;
    padding-bottom: 10vh;
}

#section-clearing {
    min-height: 200vh;
}

#section-return {
    min-height: 200vh;
    justify-content: space-around;
}

#section-silence {
    min-height: 100vh;
}

/* --- Section Inner Alignment --- */
.section-inner {
    max-width: 55vw;
    padding: 4vh 0;
}

.section-inner.align-left {
    margin-right: auto;
    margin-left: 0;
    padding-left: 7vw;
}

.section-inner.align-right {
    margin-left: auto;
    margin-right: 0;
    padding-right: 7vw;
    text-align: right;
}

.section-inner.align-center {
    margin: 0 auto;
    text-align: center;
}

.section-inner.align-center-left {
    margin-right: auto;
    margin-left: 8vw;
}

/* --- Typography --- */

/* Title - Korean */
.title-korean {
    font-family: "Roboto Slab", "Rockwell", "Courier New", serif;
    font-weight: 700;
    font-size: clamp(6rem, 15vw, 14rem);
    color: #F5EDE0;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.2em;
}

/* Title - Romanized */
.title-romanized {
    font-family: "Source Sans 3", "Helvetica Neue", sans-serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    color: #8A7060;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    margin-bottom: 1.5em;
}

/* Title line */
.title-line {
    width: 0;
    height: 1px;
    background: #8A4A5E;
    margin: 0 auto;
    transition: width 1.8s ease-out;
}

.title-line.revealed {
    width: 40vw;
}

/* Section headings */
.section-heading {
    font-family: "Roboto Slab", "Rockwell", "Courier New", serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    color: #E8DCC8;
    letter-spacing: -0.02em;
    margin-bottom: 1em;
}

/* Body text */
.body-text {
    font-family: "Roboto Slab", "Rockwell", "Courier New", serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.78;
    color: #C8B8A0;
    max-width: 38em;
    margin-bottom: 1.5em;
}

.body-text em {
    font-style: italic;
    color: #E8DCC8;
}

/* Hour labels */
.hour-label {
    font-family: "Bitter", "Roboto Slab", serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #8A7060;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 1em;
}

/* Hour blocks */
.hour-block {
    margin-bottom: 2em;
}

/* Sparse text - return to dark */
.sparse-text {
    font-family: "Roboto Slab", "Rockwell", "Courier New", serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: #C8B8A0;
    line-height: 1.6;
}

/* Final word */
.final-word {
    font-family: "Roboto Slab", "Rockwell", "Courier New", serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    color: #8A4A5E;
    letter-spacing: -0.02em;
    opacity: 0.6;
}

/* --- Fade Reveal System --- */
.fade-reveal {
    opacity: 0;
    transition: opacity 1200ms ease-out;
}

.fade-reveal.visible {
    opacity: 1;
}

/* Title has a longer fade */
#section-title .title-korean.fade-reveal {
    transition: opacity 2000ms ease-out;
}

/* --- Clearing block --- */
.clearing-block .body-text {
    margin-bottom: 2em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    .section-inner {
        max-width: 90vw;
    }

    .section-inner.align-left {
        padding-left: 2vw;
    }

    .section-inner.align-right {
        padding-right: 2vw;
        text-align: left;
    }

    .section-inner.align-center-left {
        margin-left: 2vw;
    }

    .content-section {
        padding: 0 5vw;
    }

    .branch-1 {
        width: 40vw;
    }

    .branch-2 {
        width: 45vw;
    }

    .title-line.revealed {
        width: 60vw;
    }
}
