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

:root {
    --bg-primary: #2d3a2e;
    --bg-secondary: #1e2820;
    --surface: rgba(186, 211, 175, 0.12);
    --text-primary: #f4eed6;
    --text-secondary: #b8c9a8;
    --accent-warm: #e8b84a;
    --accent-earth: #c4724a;
    --highlight: #7bc67e;
    --bokeh-amber: #f0c860;
    --bokeh-fern: #8fd48a;
    --glitch-magenta: #d44a7a;
    --border-glass: rgba(244, 238, 214, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* === Typography === */
.hero-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.section-header {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    line-height: 1.2;
    color: var(--accent-warm);
    margin-bottom: 0.5rem;
}

.body-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.small-text {
    font-size: clamp(0.9rem, 1.4vw, 1.05rem);
}

.caveat-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    line-height: 1.4;
    color: var(--accent-warm);
}

/* === Glass Panel (Frutiger Aero) === */
.glass-panel {
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    background: var(--surface);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 24px;
}

@supports not (backdrop-filter: blur(20px)) {
    .glass-panel {
        background: rgba(45, 58, 46, 0.92);
    }
}

/* === Section Base === */
.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 4rem 2rem;
}

/* === Bokeh Background === */
.bokeh-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: bokeh-float var(--bokeh-duration, 15s) ease-in-out infinite alternate;
    animation-delay: var(--bokeh-delay, 0s);
}

@keyframes bokeh-float {
    0% { transform: translateY(0); }
    100% { transform: translateY(var(--bokeh-drift, -15px)); }
}

/* === Section Dividers === */
.section-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 2;
}

.divider-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-out;
}

.divider-path.drawn {
    stroke-dashoffset: 0;
}

/* === Hero Section === */
#hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding-bottom: 6rem;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-title {
    width: 55%;
    position: relative;
    z-index: 2;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    animation: settle 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes settle {
    0% {
        transform: translateY(-30px) rotate(8deg);
        opacity: 0;
    }
    100% {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
}

@keyframes glitch-settle {
    0% { transform: translateX(-3px); }
    33% { transform: translateX(4px); }
    66% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

.hero-fern {
    width: 45%;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
}

.fern-svg {
    width: 300px;
    height: 600px;
    margin-right: -60px;
}

.fern-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2s ease-out;
}

.fern-path.drawn {
    stroke-dashoffset: 0;
}

.hero-tagline {
    position: absolute;
    bottom: 100px;
    right: 40px;
    z-index: 3;
    padding: 12px 32px;
    border-radius: 50px;
}

/* === Root Systems === */
#roots {
    background: var(--bg-secondary);
}

.roots-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    max-width: 1400px;
    margin: 0 auto;
    min-height: 80vh;
    align-content: center;
}

.root-card {
    padding: 2.5rem;
    transform: rotate(var(--rotate, 0deg));
    transition: transform 0.3s ease;
}

.root-card-1 {
    grid-column: 1 / 6;
    grid-row: 1 / 2;
    z-index: 2;
}

.root-card-2 {
    grid-column: 4 / 10;
    grid-row: 1 / 3;
    z-index: 3;
    margin-top: 60px;
}

.root-card-3 {
    grid-column: 7 / 12;
    grid-row: 2 / 3;
    z-index: 2;
    margin-top: -40px;
}

.vine-svg-roots {
    position: absolute;
    top: 0;
    left: 10%;
    width: 60%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.vine-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.5s ease-out;
}

.vine-path.drawn {
    stroke-dashoffset: 0;
}

/* === Canopy === */
#canopy {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.canopy-layout {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 80vh;
    align-items: center;
}

.canopy-text {
    flex: 0 0 58%;
}

.canopy-quotes {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 0;
}

.quote-card {
    padding: 1.5rem 2rem;
    border-radius: 50px;
}

.floating-card {
    animation: float-quote 8s ease-in-out infinite alternate;
    animation-delay: var(--float-delay, 0s);
}

@keyframes float-quote {
    0% { transform: translateY(0); }
    100% { transform: translateY(var(--float-offset, 15px)); }
}

/* === Undergrowth === */
#undergrowth {
    background: var(--bg-primary);
}

.undergrowth-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 70vh;
    align-content: center;
}

.undergrowth-card {
    grid-column: var(--ug-col);
    grid-row: var(--ug-row);
    padding: 1.8rem;
    transform: rotate(var(--rotate, 0deg));
    transition: transform 0.3s ease, backdrop-filter 0.3s ease;
}

/* === Glitch Hover === */
.glitch-hover {
    cursor: default;
    transition: transform 0.3s ease;
}

.glitch-hover:hover {
    animation: glitch-clip 120ms steps(1) 1, smooth-scale 300ms 120ms ease forwards;
}

@keyframes glitch-clip {
    0% {
        clip-path: inset(0 0 66% 0);
        transform: rotate(var(--rotate, 0deg)) translateX(-3px);
        text-shadow: -2px 0 var(--glitch-magenta), 2px 0 var(--highlight);
    }
    33% {
        clip-path: inset(33% 0 33% 0);
        transform: rotate(var(--rotate, 0deg)) translateX(4px);
        text-shadow: 2px 0 var(--glitch-magenta), -2px 0 var(--highlight);
    }
    66% {
        clip-path: inset(66% 0 0 0);
        transform: rotate(var(--rotate, 0deg)) translateX(-2px);
        text-shadow: -1px 0 var(--glitch-magenta), 1px 0 var(--highlight);
    }
    100% {
        clip-path: inset(0);
        transform: rotate(var(--rotate, 0deg)) translateX(0);
        text-shadow: none;
    }
}

@keyframes smooth-scale {
    to {
        transform: rotate(var(--rotate, 0deg)) scale(1.03);
    }
}

.glitch-hover:not(:hover) {
    transform: rotate(var(--rotate, 0deg)) scale(1);
}

/* === Harvest === */
#harvest {
    background: linear-gradient(180deg, var(--bg-primary) 0%, #1a211b 60%, #151a13 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.harvest-center {
    position: relative;
    z-index: 1;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.harvest-ring {
    position: absolute;
    inset: 0;
}

.ring-icons {
    width: 100%;
    height: 100%;
}

.rotating-ring {
    transform-origin: 250px 250px;
    animation: ring-rotate 60s linear infinite;
}

@keyframes ring-rotate {
    to { transform: rotate(360deg); }
}

.harvest-circle {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem;
    z-index: 2;
}

.harvest-circle::before {
    border-radius: 50%;
}

.harvest-message {
    margin: 1rem 0;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
}

.harvest-closing {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--accent-warm);
    font-size: 1rem;
    margin-bottom: 0;
}

/* === Kinetic Header Animation === */
.kinetic-header .char {
    display: inline-block;
    opacity: 0;
}

.kinetic-header.animate .char {
    animation: header-glitch 120ms steps(1) 1, settle 0.6s 120ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* === Pull-Quote Fade In === */
.quote-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.quote-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.quote-card.visible.floating-card {
    animation: float-quote 8s ease-in-out infinite alternate;
    animation-delay: var(--float-delay, 0s);
}

/* === Mobile === */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
    }

    .hero-title {
        width: 100%;
        text-align: center;
    }

    .hero-fern {
        width: 100%;
        justify-content: center;
        max-height: 300px;
    }

    .fern-svg {
        margin-right: 0;
    }

    .hero-tagline {
        position: relative;
        bottom: auto;
        right: auto;
        margin: 2rem auto 0;
        text-align: center;
    }

    .roots-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .root-card {
        transform: none;
        margin-top: 0;
    }

    .root-card:nth-child(odd) { padding-left: 1rem; }
    .root-card:nth-child(even) { padding-right: 1rem; }

    .canopy-layout {
        flex-direction: column;
    }

    .canopy-text { flex: none; }

    .undergrowth-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .undergrowth-card {
        transform: none;
    }

    .undergrowth-card:nth-child(odd) { padding-left: 0.5rem; }
    .undergrowth-card:nth-child(even) { padding-right: 0.5rem; }

    .harvest-center {
        width: 300px;
        height: 300px;
    }

    .harvest-circle {
        width: 240px;
        height: 240px;
        padding: 2rem;
    }

    .vine-svg-roots { display: none; }
}
