/* mystical.day — ethereal-blue, street-style, z-pattern, variable-fluid */

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

:root {
    --abyss: #0B1026;
    --astral: #1B2A4A;
    --ether: #2E4A7A;
    --phosphor: #4AEADC;
    --spore: #7ACE5A;
    --mist: #E8EDF5;
    --vapor: #94A3C0;
    --signal: #FFB833;

    --gutter-l: 8vw;
    --gutter-r: 8vw;

    --scroll-weight: 300;
}

html, body {
    background: var(--abyss);
    color: var(--mist);
    font-family: "Epilogue", "Inter", system-ui, sans-serif;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    position: relative;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(74, 234, 220, 0.06) 0%, transparent 60%),
        var(--abyss);
}

/* ============== SCENE LAYOUT ============== */
.scene {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: grid;
    grid-template-columns: 8vw 1fr 2fr 1fr 8vw;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
    background: var(--abyss);
}

.scene-mycelium {
    background: linear-gradient(to bottom, var(--abyss) 0%, var(--astral) 40%, var(--astral) 60%, var(--abyss) 100%);
}

/* ============== VORONOI FIELDS ============== */
.voronoi-field {
    position: absolute;
    top: 0;
    height: 100%;
    width: 60%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.85;
}

.voronoi-right {
    right: 0;
    clip-path: polygon(20% 0, 100% 0, 100% 100%, 0% 100%);
}

.voronoi-left {
    left: 0;
    clip-path: polygon(0 0, 80% 0, 100% 100%, 0 100%);
}

.voronoi-dense {
    width: 65%;
    opacity: 0.92;
}

.voronoi-fade {
    width: 100%;
    left: 0;
    opacity: 0.4;
    clip-path: none;
}

.voronoi-field svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mycelium-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.mycelium-field svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============== RADIAL GLOW ============== */
.radial-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 234, 220, 0.22) 0%, rgba(74, 234, 220, 0.08) 40%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    filter: blur(20px);
}

/* ============== CONTENT BLOCKS ============== */
.content {
    position: relative;
    z-index: 4;
    padding: clamp(2rem, 4vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.4rem;
}

.content-tl {
    grid-column: 2 / span 2;
    grid-row: 2;
    align-self: start;
    margin-top: 12vh;
    max-width: 720px;
}

.content-r {
    grid-column: 3 / span 2;
    grid-row: 2;
    margin-top: 8vh;
    margin-bottom: 8vh;
    max-width: 640px;
    justify-self: end;
}

.content-l-narrow {
    grid-column: 2 / span 1;
    grid-row: 2;
    margin-top: 12vh;
    margin-bottom: 12vh;
    max-width: 360px;
}

.content-center {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding: clamp(2rem, 6vw, 6rem);
}

.content-r-final {
    grid-column: 3 / span 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
    margin-top: 6vh;
    max-width: 600px;
}

/* ============== TYPOGRAPHY ============== */
.scene-label {
    font-family: "Epilogue", "Inter", sans-serif;
    font-weight: 600;
    font-size: clamp(0.7rem, 1.2vw, 0.875rem);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--phosphor);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.scene-label::before {
    content: "";
    width: 36px;
    height: 1px;
    background: var(--phosphor);
}

.scene-label.centered {
    margin: 0 auto;
}

.hero-title,
.section-title {
    font-family: "Epilogue", "Inter", sans-serif;
    font-weight: 800;
    font-variation-settings: "wght" var(--scroll-weight, 300);
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.95;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    color: var(--mist);
    transition: font-variation-settings 0.1s linear;
}

.hero-title {
    text-transform: lowercase;
    letter-spacing: -0.04em;
}

.hero-title .char {
    display: inline-block;
    transform: scale(1.5);
    opacity: 0;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.7s ease-out;
}

.hero-title .char.visible {
    transform: scale(1);
    opacity: 1;
}

.hero-title .char.dot {
    color: var(--phosphor);
}

.hero-tagline {
    font-family: "Epilogue", "Inter", sans-serif;
    font-weight: 350;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: var(--mist);
    max-width: 540px;
}

.content p {
    font-family: "Epilogue", "Inter", sans-serif;
    font-weight: 350;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: var(--mist);
}

.vertical-stack {
    line-height: 0.92;
    font-size: clamp(3.5rem, 10vw, 9rem);
}

.mega-title {
    font-size: clamp(4.5rem, 16vw, 16rem);
    color: var(--mist);
    letter-spacing: -0.04em;
    line-height: 0.85;
    text-shadow: 0 0 60px rgba(74, 234, 220, 0.18);
}

.centered-tag {
    text-align: center;
    font-style: italic;
    color: var(--vapor);
    margin: 0 auto;
    max-width: 640px;
    font-family: "Instrument Serif", "Lora", serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.3;
}

/* ============== BRIDGE MARKERS ============== */
.bridge-marker {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.2rem;
    font-family: "Epilogue", "Inter", sans-serif;
    font-weight: 600;
    font-size: clamp(0.7rem, 1.1vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--vapor);
}

.bridge-marker-right {
    align-self: flex-end;
}

.marker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--phosphor);
    box-shadow: 0 0 14px var(--phosphor);
    flex-shrink: 0;
}

.marker-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, var(--phosphor), transparent);
}

.bridge-marker-right .marker-line {
    background: linear-gradient(270deg, var(--phosphor), transparent);
}

.marker-text {
    color: var(--vapor);
}

/* ============== DIAGONAL BRIDGES ============== */
.diagonal-bridge {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    opacity: 0.7;
}

.bridge-1 {
    width: 240px;
    height: 240px;
    bottom: 8%;
    right: 6%;
}

.bridge-2 {
    width: 240px;
    height: 240px;
    bottom: 8%;
    left: 6%;
}

.bridge-3 {
    width: 240px;
    height: 240px;
    bottom: 8%;
    right: 6%;
}

/* ============== LEAVES ============== */
.leaf {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

.leaf-br {
    width: clamp(180px, 18vw, 320px);
    height: auto;
    bottom: 12%;
    right: 6%;
    opacity: 0.95;
}

.leaf-cluster {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    width: clamp(280px, 32vw, 540px);
    height: auto;
    top: 12%;
    left: 4%;
    opacity: 0.9;
}

.leaf-canopy {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    width: clamp(360px, 44vw, 720px);
    height: auto;
    top: 8%;
    right: 0;
    opacity: 0.92;
}

/* Animation for leaf outlines drawing in */
.leaf-outline {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    transition: stroke-dashoffset 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.in-view .leaf-outline,
.scene.in-view .leaf-outline {
    stroke-dashoffset: 0;
}

/* ============== INVOCATIONS ============== */
.invocation {
    font-family: "Instrument Serif", "Lora", serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.3;
    color: var(--spore);
    text-align: center;
}

.invocation-1 {
    grid-column: 1 / -1;
    grid-row: 3;
    align-self: end;
    text-align: center;
    padding: 0 0 5vh;
    z-index: 4;
}

.invocation-band {
    background: var(--abyss);
    padding: 6vh 8vw;
    text-align: center;
    border-top: 1px solid rgba(46, 74, 122, 0.4);
    border-bottom: 1px solid rgba(46, 74, 122, 0.4);
}

.invocation-band .invocation {
    color: var(--spore);
    margin: 0 auto;
    max-width: 60ch;
}

/* ============== ROOTS ============== */
.roots {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 2;
    pointer-events: none;
}

.roots-dense {
    height: 120px;
}

/* ============== SCENE 5 / CLOSING ============== */
.closing-line {
    font-family: "Instrument Serif", "Lora", serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.4;
    color: var(--mist);
    text-align: right;
}

.scene-5 {
    min-height: 130vh;
}

.depth-glow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    height: 200px;
    background: radial-gradient(ellipse at center bottom, rgba(74, 234, 220, 0.45) 0%, rgba(74, 234, 220, 0.12) 30%, transparent 70%);
    z-index: 5;
    pointer-events: none;
    filter: blur(28px);
    animation: pulse-depth 4s ease-in-out infinite;
}

@keyframes pulse-depth {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

.bottom-glow {
    position: fixed;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 640px;
    height: 240px;
    background: radial-gradient(ellipse at center, rgba(74, 234, 220, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* ============== ZOOM-FOCUS ============== */
.zoom-focus-target {
    transform: scale(1.08);
    opacity: 0;
    filter: blur(2px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s ease-out,
                filter 0.6s ease-out;
}

.zoom-focus-target.in-view {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
}

/* Scene 1 hero is visible by default after page load animation */
.scene-1 .content-tl {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
}

/* ============== SIGNAL FLASH ============== */
@keyframes signal-flash {
    0% { color: var(--phosphor); }
    20% { color: var(--signal); }
    100% { color: var(--phosphor); }
}

.signal-flash {
    animation: signal-flash 0.4s ease-out;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
    .scene {
        grid-template-columns: 4vw 1fr 4vw;
        grid-template-rows: auto 1fr auto;
    }

    .content-tl,
    .content-r,
    .content-l-narrow,
    .content-r-final {
        grid-column: 2 / span 1;
        max-width: 100%;
        justify-self: stretch;
    }

    .voronoi-field {
        width: 100%;
        clip-path: none;
        opacity: 0.55;
    }

    .leaf-br,
    .leaf-cluster,
    .leaf-canopy {
        opacity: 0.55;
    }

    .leaf-cluster {
        width: 60vw;
    }

    .leaf-canopy {
        width: 80vw;
    }

    .closing-line {
        text-align: left;
    }
}
