/* ============================================================
   a6c.boo — Surreal Spectral Minimalism
   ============================================================ */

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

:root {
    --void: #0B0E14;
    --surface: #151A23;
    --primary: #4A7C6F;
    --secondary: #C9A84C;
    --tertiary: #2E4A6B;
    --text-primary: #E8E6E1;
    --text-secondary: #8A8D93;
    --highlight: #3FBF8E;
    --sage: #6B8F84;
    --deep-navy: #1A2433;
    --angle: 12deg;
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 350;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.85;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ============================================================
   BACKGROUND PLANE (z:0) — Generative Fog System
   ============================================================ */

.fog-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(165deg, #0B0E14 0%, #151A23 35%, #1A2433 65%, #0B0E14 100%);
    background-size: 400% 400%;
    animation: driftBackground 45s ease-in-out infinite;
}

@keyframes driftBackground {
    0% { background-position: 0% 0%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 50% 100%; }
    75% { background-position: 0% 50%; }
    100% { background-position: 0% 0%; }
}

.fog-gradient {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
}

.fog-gradient-1 {
    width: 80vw;
    height: 80vw;
    top: -20%;
    left: -10%;
    background: radial-gradient(ellipse at center, rgba(74, 124, 111, 0.08) 0%, transparent 70%);
    animation: fogFloat1 35s ease-in-out infinite;
}

.fog-gradient-2 {
    width: 60vw;
    height: 60vw;
    top: 30%;
    right: -15%;
    background: radial-gradient(ellipse at center, rgba(46, 74, 107, 0.06) 0%, transparent 70%);
    animation: fogFloat2 42s ease-in-out infinite;
}

.fog-gradient-3 {
    width: 50vw;
    height: 50vw;
    bottom: 10%;
    left: 20%;
    background: radial-gradient(ellipse at center, rgba(74, 124, 111, 0.05) 0%, transparent 70%);
    animation: fogFloat3 55s ease-in-out infinite;
}

.fog-gradient-4 {
    width: 70vw;
    height: 70vw;
    top: 50%;
    left: -20%;
    background: radial-gradient(ellipse at center, rgba(46, 74, 107, 0.04) 0%, transparent 70%);
    animation: fogFloat4 48s ease-in-out infinite;
}

.fog-gradient-5 {
    width: 40vw;
    height: 40vw;
    top: 10%;
    right: 10%;
    background: radial-gradient(ellipse at center, rgba(74, 124, 111, 0.03) 0%, transparent 70%);
    animation: fogFloat5 60s ease-in-out infinite;
}

@keyframes fogFloat1 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    33% { transform: translate3d(5vw, 3vh, 0); }
    66% { transform: translate3d(-3vw, -2vh, 0); }
}

@keyframes fogFloat2 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    33% { transform: translate3d(-4vw, 5vh, 0); }
    66% { transform: translate3d(6vw, -3vh, 0); }
}

@keyframes fogFloat3 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    33% { transform: translate3d(7vw, -4vh, 0); }
    66% { transform: translate3d(-5vw, 6vh, 0); }
}

@keyframes fogFloat4 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    33% { transform: translate3d(-6vw, -5vh, 0); }
    66% { transform: translate3d(4vw, 3vh, 0); }
}

@keyframes fogFloat5 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    33% { transform: translate3d(3vw, 7vh, 0); }
    66% { transform: translate3d(-7vw, -4vh, 0); }
}

/* ============================================================
   GRAIN OVERLAY
   ============================================================ */

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 900;
    opacity: 0.03;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px 128px;
    animation: grainFlicker 0.1s steps(1) infinite;
}

@keyframes grainFlicker {
    0% { background-position: 0 0; }
    25% { background-position: 1px 0; }
    50% { background-position: 0 1px; }
    75% { background-position: 1px 1px; }
    100% { background-position: 0 0; }
}

/* ============================================================
   SPECTRAL PLANE (z:2) — Floating Glyphs
   ============================================================ */

.spectral-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 800;
    overflow: hidden;
}

.floating-glyph {
    position: absolute;
    font-family: 'Della Respira', serif;
    color: var(--text-secondary);
    pointer-events: none;
    will-change: transform;
}

.glyph-1 {
    font-size: 36px;
    opacity: 0.10;
    left: 12%;
    top: 15%;
    animation: glyphDrift1 38s linear infinite;
}

.glyph-2 {
    font-size: 28px;
    opacity: 0.08;
    left: 75%;
    top: 25%;
    animation: glyphDrift2 45s linear infinite;
}

.glyph-3 {
    font-size: 42px;
    opacity: 0.12;
    left: 55%;
    top: 60%;
    animation: glyphDrift3 32s linear infinite;
}

.glyph-4 {
    font-size: 30px;
    opacity: 0.09;
    left: 25%;
    top: 80%;
    animation: glyphDrift4 50s linear infinite;
}

.glyph-5 {
    font-size: 24px;
    opacity: 0.15;
    left: 88%;
    top: 45%;
    animation: glyphDrift5 35s linear infinite;
}

.glyph-6 {
    font-size: 48px;
    opacity: 0.07;
    left: 40%;
    top: 10%;
    animation: glyphDrift6 42s linear infinite;
}

.glyph-7 {
    font-size: 32px;
    opacity: 0.11;
    left: 65%;
    top: 85%;
    animation: glyphDrift7 47s linear infinite;
}

.glyph-8 {
    font-size: 26px;
    opacity: 0.08;
    left: 8%;
    top: 50%;
    animation: glyphDrift8 40s linear infinite;
}

@keyframes glyphDrift1 {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100vh); }
}
@keyframes glyphDrift2 {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-110vh) translateX(-5vw); }
}
@keyframes glyphDrift3 {
    0% { transform: translateY(0); }
    100% { transform: translateY(-120vh); }
}
@keyframes glyphDrift4 {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-90vh) translateX(3vw); }
}
@keyframes glyphDrift5 {
    0% { transform: translateY(0); }
    100% { transform: translateY(-105vh); }
}
@keyframes glyphDrift6 {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-115vh) translateX(-4vw); }
}
@keyframes glyphDrift7 {
    0% { transform: translateY(0); }
    100% { transform: translateY(-95vh); }
}
@keyframes glyphDrift8 {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-108vh) translateX(6vw); }
}

.spectral-plane.startled .floating-glyph {
    transition: animation-duration 0.5s;
}

/* ============================================================
   RADIAL NAVIGATION
   ============================================================ */

.nav-orb {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 950;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.nav-orb-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(74, 124, 111, 0.4);
    background: transparent;
    transition: all 0.6s var(--ease-out);
}

.nav-orb:hover .nav-orb-circle,
.nav-orb.active .nav-orb-circle {
    width: 32px;
    height: 32px;
    box-shadow: 0 0 40px rgba(74, 124, 111, 0.15);
    border-color: rgba(74, 124, 111, 0.7);
}

.nav-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

.nav-orb.active .nav-menu {
    opacity: 1;
    pointer-events: auto;
}

.nav-item {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.4s var(--ease-out), color 0.3s;
    transform: translate(-50%, -50%) rotate(0deg) translate(80px) rotate(0deg);
}

.nav-orb.active .nav-item {
    opacity: 0.7;
    transform: translate(-50%, -50%) rotate(var(--angle)) translate(80px) rotate(calc(-1 * var(--angle)));
}

.nav-item:hover {
    color: var(--secondary);
    opacity: 1;
}

/* ============================================================
   HERO SECTION — Opening Sequence
   ============================================================ */

.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8vw), 0 100%);
    background: transparent;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 20;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(3.5rem, 9vw, 8rem);
    letter-spacing: 0.15em;
    color: var(--text-primary);
    display: inline-block;
}

.hero-letter {
    display: inline-block;
    opacity: 0;
    filter: blur(8px);
    animation: blurFocus 1.2s var(--ease-out) forwards;
    animation-delay: var(--delay);
    text-shadow: 0 0 60px rgba(74, 124, 111, 0.3), 0 0 120px rgba(74, 124, 111, 0.1);
}

@keyframes blurFocus {
    0% {
        opacity: 0;
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        filter: blur(0px);
    }
}

.hero-line {
    width: 0;
    height: 1px;
    background: rgba(74, 124, 111, 0.4);
    margin: 1.5rem auto;
    animation: lineExpand 1.5s var(--ease-out) 2.4s forwards;
}

@keyframes lineExpand {
    0% { width: 0; }
    100% { width: 30vw; }
}

.hero-boo {
    font-family: 'Della Respira', serif;
    font-size: clamp(2rem, 5.4vw, 4.8rem);
    color: var(--text-primary);
    opacity: 0;
    letter-spacing: 0.1em;
    animation: booAppear 0.01s linear 4.4s forwards;
}

@keyframes booAppear {
    0% { opacity: 0; }
    100% { opacity: 0.5; }
}

.scroll-prompt {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: scrollPromptShow 0.5s var(--ease-out) 5s forwards;
}

.scroll-prompt svg {
    animation: scrollBounce 2.5s ease-in-out infinite;
}

@keyframes scrollPromptShow {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* ============================================================
   VOID GAPS — SVG Path-Draw Dividers
   ============================================================ */

.void-gap {
    position: relative;
    height: 200px;
    z-index: 5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.void-label {
    position: absolute;
    font-family: 'Della Respira', serif;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
    opacity: 0.35;
    z-index: 6;
    pointer-events: none;
}

.void-svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 600px;
    height: 100%;
}

.draw-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    opacity: 0.5;
    transition: stroke-dashoffset 2.5s var(--ease-out);
}

.draw-path.animated {
    stroke-dashoffset: 0;
}

.constellation-dot {
    transition: opacity 0.8s var(--ease-out) 2s;
}

.draw-path.animated ~ .constellation-dot {
    opacity: 0.6;
}

/* ============================================================
   DIAGONAL SECTIONS — Content Plane (z:1)
   ============================================================ */

.diagonal-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

.section-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8rem 4vw;
    position: relative;
    z-index: 20;
}

/* HAUNT Section */
.section-haunt {
    clip-path: polygon(0 8vw, 100% 0, 100% calc(100% - 8vw), 0 100%);
    background: linear-gradient(170deg, var(--surface) 0%, rgba(26, 36, 51, 0.6) 50%, var(--void) 100%);
    margin-top: -5vw;
    padding: 4rem 0;
}

/* DRIFT Section */
.section-drift {
    clip-path: polygon(0 0, 100% 8vw, 100% 100%, 0 calc(100% - 8vw));
    background: linear-gradient(190deg, rgba(26, 36, 51, 0.9) 0%, var(--void) 100%);
    margin-top: -5vw;
    padding: 4rem 0;
}

/* ECHO Section */
.section-echo {
    clip-path: polygon(0 8vw, 100% 0, 100% calc(100% - 8vw), 0 100%);
    background: linear-gradient(170deg, var(--surface) 0%, rgba(74, 124, 111, 0.05) 50%, var(--void) 100%);
    margin-top: -5vw;
    padding: 4rem 0;
}

/* STILL Section */
.section-still {
    clip-path: polygon(0 0, 100% 8vw, 100% 100%, 0 calc(100% - 8vw));
    background: linear-gradient(200deg, var(--void) 0%, rgba(74, 124, 111, 0.03) 50%, var(--void) 100%);
    margin-top: -5vw;
    min-height: 80vh;
    padding: 4rem 0;
}

/* BOO Section — full viewport, no clip-path */
.section-boo {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: var(--void);
    margin-top: -5vw;
    padding: 4rem 2rem;
}

/* ============================================================
   SECTION CONTENT
   ============================================================ */

.section-grid {
    display: grid;
    grid-template-columns: 1fr minmax(0, 4fr) 1fr;
    gap: 4vw;
}

.section-content {
    grid-column: 2 / 3;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.section-content.visible {
    opacity: 1;
    transform: scale(1);
}

.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-shadow: 0 0 40px rgba(74, 124, 111, 0.2);
}

.section-body {
    font-family: 'Inter', sans-serif;
    font-weight: 350;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.85;
    color: rgba(232, 230, 225, 0.7);
    text-shadow: 0 0 20px rgba(232, 230, 225, 0.05);
    margin-bottom: 1.5rem;
}

.section-body:last-child {
    margin-bottom: 0;
}

/* ============================================================
   DRIFT SECTION — Staggered Word Statement
   ============================================================ */

.drift-statement {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2em;
}

.drift-word {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.08em;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.6s var(--ease-spring), transform 0.6s var(--ease-spring);
    transition-delay: var(--word-delay);
}

.drift-statement.visible .drift-word {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ============================================================
   ECHO SECTION — Grid + Lissajous Canvas
   ============================================================ */

.echo-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4vw;
    align-items: center;
}

.echo-text {
    grid-column: 2 / 5;
}

.echo-canvas-wrap {
    grid-column: 5 / 7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lissajous-canvas {
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 1;
    opacity: 0.6;
}

/* ============================================================
   STILL SECTION — Single Word
   ============================================================ */

.still-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.still-word {
    font-family: 'Della Respira', serif;
    font-size: clamp(4rem, 10vw, 9rem);
    color: var(--primary);
    opacity: 0.3;
    transition: opacity 0.4s var(--ease-out);
    user-select: none;
}

.still-word.scroll-stopped {
    opacity: 0.6;
}

/* ============================================================
   BOO SECTION — Final Reveal
   ============================================================ */

.boo-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.boo-svg {
    width: clamp(280px, 50vw, 600px);
    height: auto;
}

.boo-text {
    transition: stroke-dashoffset 3s var(--ease-out);
}

.boo-text.animated {
    stroke-dashoffset: 0;
}

.boo-text-fill {
    transition: opacity 1s var(--ease-out) 3s;
}

.boo-text-fill.animated {
    opacity: 1;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 4rem 2rem;
    border-top: 1px solid rgba(74, 124, 111, 0.08);
}

.footer-glyph {
    display: block;
    font-family: 'Della Respira', serif;
    font-size: 1.2rem;
    color: var(--text-secondary);
    opacity: 0.2;
    margin-bottom: 1rem;
}

.footer-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: 0.2em;
    color: rgba(232, 230, 225, 0.25);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .echo-grid {
        grid-template-columns: 1fr;
    }

    .echo-text {
        grid-column: 1;
    }

    .echo-canvas-wrap {
        grid-column: 1;
    }

    .section-grid {
        grid-template-columns: 1fr;
    }

    .section-content {
        grid-column: 1;
    }

    .section-inner {
        padding: 6rem 6vw;
    }

    .nav-orb {
        top: 1.5rem;
        right: 1.5rem;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

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

    .hero-line {
        animation: none;
        width: 30vw;
    }

    .hero-boo {
        animation: none;
        opacity: 0.5;
    }

    .scroll-prompt {
        animation: none;
        opacity: 1;
    }

    .scroll-prompt svg {
        animation: none;
    }

    .floating-glyph {
        animation: none;
    }

    .fog-gradient {
        animation: none;
    }

    .grain-overlay {
        animation: none;
    }

    .fog-background {
        animation: none;
        background-size: 100% 100%;
    }

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

    .drift-word {
        transition: none;
        opacity: 1;
        transform: none;
    }

    .section-content {
        transition: none;
        opacity: 1;
        transform: none;
    }

    .still-word {
        transition: none;
    }

    .boo-text {
        transition: none;
        stroke-dashoffset: 0;
    }

    .boo-text-fill {
        transition: none;
        opacity: 1;
    }
}
