/* ========================================
   lurch.dev — Frutiger Aero + Sharp Angles
   Warm-Earthy Palette, Immersive Scroll
   ======================================== */

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

:root {
    --deep-earth: #3E2723;
    --warm-clay: #A1887F;
    --sunlit-ivory: #FAF3E0;
    --moss-dew: #7D9B76;
    --amber-glow: #E6A23C;
    --frosted-glass: rgba(255, 250, 240, 0.12);
    --obsidian-edge: #1B1210;
    --mid-brown: #5D4037;
    --light-brown: #8D6E63;
    --tan: #E8D5B7;
    --forest: #4A6741;

    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --clip-angle: 80px;
    --clip-angle-lurch: 160px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: var(--mid-brown);
    background-color: var(--deep-earth);
    overflow-x: hidden;
}

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

.section__content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    width: 100%;
    padding: 64px 40px;
}

/* --- Dark Sections --- */
.section--dark {
    background: linear-gradient(180deg, var(--deep-earth) 0%, var(--mid-brown) 100%);
    color: var(--tan);
}

.section--dark::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(230, 162, 60, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* --- Light Sections --- */
.section--light {
    background-color: var(--sunlit-ivory);
    color: var(--deep-earth);
}

/* --- Clay Sections --- */
.section--clay {
    background-color: var(--warm-clay);
    color: var(--sunlit-ivory);
}

/* --- Ivory Sections --- */
.section--ivory {
    background-color: var(--sunlit-ivory);
    color: var(--deep-earth);
}

/* --- Warm Sections --- */
.section--warm {
    background: linear-gradient(180deg, var(--warm-clay) 0%, rgba(230, 162, 60, 0.15) 100%);
    color: var(--deep-earth);
}

/* --- Diagonal Clip Paths --- */
#opening {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--clip-angle)), 0 100%);
}

#first-stratum {
    clip-path: polygon(0 var(--clip-angle), 100% 0, 100% 100%, 0 calc(100% - var(--clip-angle)));
    margin-top: -80px;
    padding-top: 120px;
    padding-bottom: 80px;
}

#breath-1 {
    clip-path: polygon(0 0, 100% var(--clip-angle), 100% calc(100% - var(--clip-angle)), 0 100%);
    margin-top: -80px;
    min-height: 60vh;
}

#lurch-1 {
    clip-path: polygon(0 var(--clip-angle-lurch), 100% 0, 100% 100%, 0 calc(100% - var(--clip-angle-lurch)));
    margin-top: -160px;
}

#middle-1 {
    clip-path: polygon(0 0, 100% var(--clip-angle), 100% calc(100% - var(--clip-angle)), 0 100%);
    margin-top: -80px;
    padding-top: 120px;
}

#middle-2 {
    clip-path: polygon(0 var(--clip-angle), 100% 0, 100% 100%, 0 calc(100% - var(--clip-angle)));
    margin-top: -80px;
    padding-top: 120px;
}

#breath-2 {
    clip-path: polygon(0 0, 100% var(--clip-angle), 100% calc(100% - var(--clip-angle)), 0 100%);
    margin-top: -80px;
    min-height: 60vh;
}

#lurch-2 {
    clip-path: polygon(0 var(--clip-angle-lurch), 100% 0, 100% 100%, 0 calc(100% - var(--clip-angle-lurch)));
    margin-top: -160px;
}

#deep-stratum {
    clip-path: polygon(0 0, 100% var(--clip-angle), 100% calc(100% - var(--clip-angle)), 0 100%);
    margin-top: -80px;
    padding-top: 120px;
    padding-bottom: 120px;
}

#closing {
    clip-path: polygon(0 var(--clip-angle), 100% 0, 100% 100%, 0 100%);
    margin-top: -80px;
    padding-top: 140px;
    min-height: 80vh;
}

/* --- Opening Section --- */
.opening__content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.opening__title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    letter-spacing: -0.02em;
    color: var(--sunlit-ivory);
    text-shadow: 0 2px 12px rgba(62, 39, 35, 0.15);
    margin-bottom: 16px;
}

.opening__tagline {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

/* --- Body Text --- */
.body-text {
    margin-bottom: 24px;
    color: var(--mid-brown);
}

.body-text--emphasis {
    font-weight: 600;
    font-style: italic;
}

.body-text--light {
    color: var(--tan);
}

.section--dark .body-text {
    color: var(--tan);
}

.section--warm .body-text {
    color: var(--deep-earth);
}

/* --- Fade-in Blocks --- */
.fade-in-block {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 800ms var(--ease-out-quint), transform 800ms var(--ease-out-quint);
}

.fade-in-block.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Sharp-Angled Cards --- */
.sharp-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(12px);
    clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%);
    border-radius: 0 0 12px 12px;
    padding: 32px;
    margin-top: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}

.sharp-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--amber-glow) 0%, transparent 60%);
    opacity: 0.3;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.sharp-card--dark {
    background: linear-gradient(135deg, rgba(62, 39, 35, 0.4), rgba(62, 39, 35, 0.15));
    border-color: rgba(230, 162, 60, 0.2);
}

.sharp-card--mosaic {
    background: linear-gradient(135deg, rgba(255, 250, 240, 0.15), rgba(255, 250, 240, 0.05));
    border-color: rgba(230, 162, 60, 0.25);
    flex: 1;
    min-width: 200px;
}

.card-label {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--amber-glow);
    display: block;
    margin-bottom: 12px;
}

.card-mosaic {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

/* --- Glossy Orbs --- */
.orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.orb--1 {
    width: 96px;
    height: 96px;
    top: 20%;
    left: 15%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), rgba(230, 162, 60, 0.3) 40%, transparent 70%);
    animation: drift1 30s ease-in-out infinite alternate;
}

.orb--2 {
    width: 64px;
    height: 64px;
    top: 60%;
    right: 20%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), rgba(230, 162, 60, 0.25) 40%, transparent 70%);
    animation: drift2 25s ease-in-out infinite alternate;
}

.orb--3 {
    width: 48px;
    height: 48px;
    top: 35%;
    right: 30%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.3), rgba(230, 162, 60, 0.2) 40%, transparent 70%);
    animation: drift3 35s ease-in-out infinite alternate;
}

.orb--4 {
    width: 72px;
    height: 72px;
    top: 25%;
    right: 10%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), rgba(125, 155, 118, 0.3) 40%, transparent 70%);
    animation: drift1 28s ease-in-out infinite alternate;
}

.orb--5 {
    width: 56px;
    height: 56px;
    bottom: 20%;
    left: 8%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.3), rgba(230, 162, 60, 0.25) 40%, transparent 70%);
    animation: drift2 32s ease-in-out infinite alternate;
}

.orb--6 {
    width: 80px;
    height: 80px;
    top: 15%;
    right: 12%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.3), rgba(230, 162, 60, 0.2) 40%, transparent 70%);
    animation: drift3 26s ease-in-out infinite alternate;
}

.orb--7 {
    width: 60px;
    height: 60px;
    top: 30%;
    left: 5%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), rgba(125, 155, 118, 0.25) 40%, transparent 70%);
    animation: drift1 33s ease-in-out infinite alternate;
}

.orb--8 {
    width: 48px;
    height: 48px;
    bottom: 25%;
    right: 15%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.3), rgba(230, 162, 60, 0.2) 40%, transparent 70%);
    animation: drift2 29s ease-in-out infinite alternate;
}

.orb--closing {
    width: 48px;
    height: 48px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), rgba(230, 162, 60, 0.35) 40%, transparent 70%);
    animation: pulse-orb 8s ease-in-out infinite;
    z-index: 1;
}

@keyframes drift1 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 40px); }
}

@keyframes drift2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50px, 30px); }
}

@keyframes drift3 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, -50px); }
}

@keyframes pulse-orb {
    0%, 100% { width: 48px; height: 48px; opacity: 0.8; }
    50% { width: 120px; height: 120px; opacity: 1; }
}

/* --- Water Droplets --- */
.water-droplet {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.droplet--1 {
    width: 18px;
    height: 18px;
    top: 30%;
    right: 18%;
    background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.7), rgba(250, 243, 224, 0.3) 50%, transparent 70%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.droplet--2 {
    width: 12px;
    height: 12px;
    top: 55%;
    right: 22%;
    background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.65), rgba(250, 243, 224, 0.25) 50%, transparent 70%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.droplet--3 {
    width: 10px;
    height: 10px;
    top: 42%;
    right: 15%;
    background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.6), rgba(250, 243, 224, 0.2) 50%, transparent 70%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* --- River Stones --- */
.stone-cluster {
    position: absolute;
    bottom: 12%;
    right: 8%;
    z-index: 1;
}

.river-stone {
    position: absolute;
    border-radius: 45% 55% 50% 50% / 50% 45% 55% 50%;
    background: linear-gradient(145deg, var(--light-brown), var(--mid-brown));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.15);
}

.stone--1 {
    width: 56px;
    height: 44px;
    top: 0;
    left: 0;
}

.stone--2 {
    width: 40px;
    height: 32px;
    top: -20px;
    left: 48px;
    border-radius: 50% 45% 55% 50% / 45% 55% 45% 55%;
}

.stone--3 {
    width: 28px;
    height: 24px;
    top: 10px;
    left: 80px;
    border-radius: 55% 45% 50% 50% / 50% 50% 45% 55%;
    background: linear-gradient(145deg, var(--warm-clay), var(--light-brown));
}

/* --- Condensation Lines --- */
.condensation-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
    z-index: 1;
    transition: background 600ms var(--ease-out-quint);
}

.condensation-line.bright {
    background: rgba(255, 255, 255, 0.25);
}

.cond--1 { top: 18%; }
.cond--2 { top: 33%; }
.cond--3 { top: 51%; }
.cond--4 { top: 67%; }
.cond--5 { top: 82%; }
.cond--6 { top: 22%; }
.cond--7 { top: 48%; }
.cond--8 { top: 74%; }

/* --- Fern SVG --- */
.fern-container {
    position: absolute;
    left: -40px;
    top: 10%;
    width: 300px;
    height: 600px;
    z-index: 1;
    pointer-events: none;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.fern-svg {
    width: 100%;
    height: 100%;
}

.fern-stem,
.fern-frond {
    opacity: 0;
    transition: opacity 600ms var(--ease-out-quint);
}

.fern-group.animate .fern-stem {
    opacity: 1;
    stroke-dasharray: 600;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 2s var(--ease-out-quint), opacity 300ms;
}

.fern-group.animate .fern-frond {
    opacity: 1;
}

.fern-group .fern-stem {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

.fern-group.animate .fern-frond--1 { transition-delay: 200ms; }
.fern-group.animate .fern-frond--2 { transition-delay: 300ms; }
.fern-group.animate .fern-frond--3 { transition-delay: 400ms; }
.fern-group.animate .fern-frond--4 { transition-delay: 500ms; }
.fern-group.animate .fern-frond--5 { transition-delay: 600ms; }
.fern-group.animate .fern-frond--6 { transition-delay: 700ms; }
.fern-group.animate .fern-frond--7 { transition-delay: 800ms; }
.fern-group.animate .fern-frond--8 { transition-delay: 900ms; }
.fern-group.animate .fern-frond--9 { transition-delay: 1000ms; }
.fern-group.animate .fern-frond--10 { transition-delay: 1100ms; }
.fern-group.animate .fern-frond--11 { transition-delay: 1200ms; }
.fern-group.animate .fern-frond--12 { transition-delay: 1300ms; }

/* --- Chevrons --- */
.chevrons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    opacity: 0.15;
    z-index: 1;
}

.chevron {
    width: 40px;
    height: 40px;
    border-left: 2px solid rgba(250, 243, 224, 0.6);
    border-bottom: 2px solid rgba(250, 243, 224, 0.6);
    transform: rotate(-45deg);
}

.chevron--dark {
    border-color: rgba(62, 39, 35, 0.4);
}

/* --- Breathing Spaces --- */
.section--breath {
    min-height: 60vh;
}

.breath__content {
    text-align: center;
}

.breath__phrase {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: -0.01em;
    color: var(--sunlit-ivory);
    text-shadow: 0 2px 12px rgba(62, 39, 35, 0.15);
}

.breath__phrase--dark {
    color: var(--deep-earth);
    text-shadow: 0 2px 12px rgba(250, 243, 224, 0.15);
}

/* --- Lurch Disruption Sections --- */
.section--lurch {
    background-color: var(--obsidian-edge);
    min-height: 100vh;
}

.lurch__content {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.lurch__word {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(4rem, 12vw, 8rem);
    letter-spacing: -0.03em;
    color: var(--amber-glow);
    transform: rotate(-3deg);
    text-shadow: 0 0 60px rgba(230, 162, 60, 0.4), 0 0 120px rgba(230, 162, 60, 0.15);
}

/* --- Deep Stratum Content --- */
.deep__content {
    max-width: 900px;
}

/* --- Closing Section --- */
.section--closing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.closing__content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.closing__text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    line-height: 2;
    color: var(--tan);
    margin-bottom: 48px;
}

.closing__domain {
    margin-top: 24px;
}

.domain-glow {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--amber-glow);
    text-shadow: 0 0 20px rgba(230, 162, 60, 0.5), 0 0 40px rgba(230, 162, 60, 0.2);
    animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { text-shadow: 0 0 20px rgba(230, 162, 60, 0.5), 0 0 40px rgba(230, 162, 60, 0.2); }
    50% { text-shadow: 0 0 30px rgba(230, 162, 60, 0.7), 0 0 60px rgba(230, 162, 60, 0.35); }
}

/* --- Navigation Pill --- */
.nav-pill {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 32px;
    padding: 0 20px;
    border-radius: 16px;
    background: rgba(62, 39, 35, 0.4);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 100;
    transition: opacity 400ms var(--ease-out-quint);
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: background 400ms var(--ease-out-quint), box-shadow 400ms var(--ease-out-quint);
    cursor: pointer;
}

.nav-dot--active {
    background: var(--amber-glow);
    box-shadow: 0 0 8px rgba(230, 162, 60, 0.6);
}

/* --- Glossy Surface Overlay --- */
.section--light::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.05));
    pointer-events: none;
    z-index: 0;
}

/* --- Diagonal Separator SVGs (visual accents) --- */
.section--dark::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, rgba(230, 162, 60, 0.15) 50%, transparent 90%);
    pointer-events: none;
    z-index: 3;
}

/* --- First Stratum Content --- */
.first-stratum__content {
    position: relative;
    z-index: 3;
}

/* --- Middle Content --- */
.middle__content {
    position: relative;
    z-index: 3;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section__content {
        padding: 48px 24px;
    }

    .fern-container {
        width: 200px;
        height: 400px;
        left: -60px;
    }

    .card-mosaic {
        flex-direction: column;
    }

    .sharp-card--mosaic {
        min-width: unset;
    }

    .stone-cluster {
        display: none;
    }

    .orb--1, .orb--4, .orb--6 {
        display: none;
    }

    :root {
        --clip-angle: 50px;
        --clip-angle-lurch: 100px;
    }

    #first-stratum,
    #middle-1,
    #middle-2,
    #deep-stratum {
        margin-top: -50px;
        padding-top: 80px;
    }

    #lurch-1,
    #lurch-2 {
        margin-top: -100px;
    }

    #breath-1,
    #breath-2 {
        margin-top: -50px;
    }

    #closing {
        margin-top: -50px;
        padding-top: 100px;
    }
}

@media (max-width: 480px) {
    .opening__title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .lurch__word {
        font-size: clamp(3rem, 15vw, 5rem);
    }
}
