/* =============================================
   lunge.dev - Pastoral Grainy-Textured Aesthetic
   ============================================= */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #F4EDE4;
    color: #2B3A2E;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.15vw, 1.2rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Grain Canvas Overlay --- */
#grain-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: multiply;
    opacity: 0.6;
}

/* --- Vine SVG (Left Margin) --- */
#vine-svg {
    position: fixed;
    left: 20px;
    top: 0;
    width: 60px;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
}

#vine-main {
    stroke-dasharray: 5200;
    stroke-dashoffset: 5200;
    transition: stroke-dashoffset 0.05s linear;
}

.vine-leaf, .vine-tendril {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.vine-leaf.visible, .vine-tendril.visible {
    opacity: 1;
}

/* --- Section Base --- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 2rem;
}

.section__inner {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

/* Section dividers - hand-drawn wobble lines */
.section-divider {
    display: block;
    width: 100%;
    height: 8px;
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Section reveal animation */
.section__inner {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.section__inner.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Section 1: Hero --- */
.section--hero {
    background-color: #F4EDE4;
    padding-left: 100px;
}

.section--hero .section__inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    min-height: 60vh;
}

.hero__botanical {
    position: absolute;
    left: -80px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 400px;
    pointer-events: none;
}

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

.hero__content {
    text-align: right;
    max-width: 600px;
    padding-right: 2rem;
}

.hero__title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    font-variation-settings: 'opsz' 72, 'WONK' 1;
    color: #2B3A2E;
    line-height: 1.1;
    margin-bottom: 1.2rem;
}

.hero__subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: #5C7A60;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.hero__annotation {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: #9B8E7E;
    display: inline-block;
}

/* --- Section 2: Philosophy --- */
.section--philosophy {
    background-color: #EAE3D2;
}

.philosophy__content {
    max-width: 540px;
    margin: 0 auto;
    text-align: left;
}

.philosophy__heading {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-variation-settings: 'opsz' 72, 'WONK' 1;
    color: #2B3A2E;
    margin-bottom: 2.5rem;
}

.philosophy__text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 2.2;
    margin-bottom: 2.5rem;
    color: #2B3A2E;
}

.philosophy__text:last-of-type {
    margin-bottom: 2rem;
}

.philosophy__annotation {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: #9B8E7E;
    display: block;
    margin-top: 1rem;
}

/* --- Section 3: Capabilities --- */
.section--capabilities {
    background-color: #F4EDE4;
}

.capabilities__heading {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-variation-settings: 'opsz' 72, 'WONK' 1;
    color: #2B3A2E;
    margin-bottom: 3rem;
}

.capabilities__cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.capability-card {
    background-color: #F4EDE4;
    border: 1px solid #9B8E7E;
    border-radius: 16px;
    padding: 2.5rem;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 400ms ease;
    cursor: default;
}

.capability-card:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 32px rgba(43, 58, 46, 0.08);
}

/* Cascading staircase offset */
.capability-card--1 {
    margin-left: 0;
}

.capability-card--2 {
    margin-left: 40px;
}

.capability-card--3 {
    margin-left: 80px;
}

.capability-card__title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-variation-settings: 'opsz' 72, 'WONK' 1;
    color: #3A6B45;
    margin-bottom: 1rem;
}

.capability-card__text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.85;
    color: #2B3A2E;
    margin-bottom: 1rem;
}

.capability-card__annotation {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: #9B8E7E;
}

/* --- Section 4: Process --- */
.section--process {
    background-color: #EAE3D2;
}

.process__heading {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-variation-settings: 'opsz' 72, 'WONK' 1;
    color: #2B3A2E;
    margin-bottom: 3rem;
}

.process__timeline {
    display: flex;
    gap: 2rem;
    position: relative;
}

.process__vine {
    flex-shrink: 0;
    width: 40px;
    min-height: 500px;
}

.process__steps {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    flex: 1;
}

.process__step {
    padding: 1.5rem 0;
}

.process__step-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
    font-variation-settings: 'opsz' 72, 'WONK' 1;
    color: #3A6B45;
    margin-bottom: 0.8rem;
}

.process__step-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.85;
    color: #2B3A2E;
}

/* --- Section 5: Close --- */
.section--close {
    background-color: #F4EDE4;
    position: relative;
    overflow: hidden;
}

.section--close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(58, 107, 69, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 40%, rgba(200, 149, 61, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

.close__content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.close__title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    font-variation-settings: 'opsz' 72, 'WONK' 1;
    color: #2B3A2E;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.close__tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: #5C7A60;
    margin-bottom: 1.5rem;
}

.close__annotation {
    font-family: 'Caveat', cursive;
    font-weight: 500;
    font-size: clamp(1rem, 1.4vw, 1.3rem);
    color: #C8953D;
    display: inline-block;
}

/* --- Floating Seed Particles --- */
#seed-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.seed-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #3A6B45;
    border-radius: 50%;
    opacity: 0.3;
}

/* --- Link Styles --- */
a {
    color: #3A6B45;
    text-decoration: none;
    position: relative;
    display: inline-block;
}

a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #C8953D;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 300ms ease-out;
}

a:hover::after {
    transform: scaleX(1);
}

a:hover {
    color: #C8953D;
}

/* --- Selection --- */
::selection {
    background-color: #D4E8C7;
    color: #2B3A2E;
}

/* --- Responsive (below 768px) --- */
@media (max-width: 768px) {
    .section--hero {
        padding-left: 2rem;
    }

    .section--hero .section__inner {
        justify-content: center;
    }

    .hero__botanical {
        display: none;
    }

    .hero__content {
        text-align: center;
        padding-right: 0;
    }

    #vine-svg {
        display: none;
    }

    .capability-card--1,
    .capability-card--2,
    .capability-card--3 {
        margin-left: 0;
    }

    .process__timeline {
        flex-direction: column;
    }

    .process__vine {
        display: none;
    }

    .section {
        padding: 4rem 1.5rem;
    }

    /* Mobile: static grain via CSS noise instead of canvas */
    #grain-canvas {
        display: none;
    }

    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 1000;
        mix-blend-mode: multiply;
        opacity: 0.3;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
        background-repeat: repeat;
        background-size: 256px 256px;
    }
}

/* --- Botanical corner ornaments (mobile) --- */
@media (max-width: 768px) {
    .section::after {
        content: '';
        position: absolute;
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M35,5 C25,8 15,15 8,25 C12,20 18,16 25,14 C20,18 16,24 14,30 C18,22 25,16 35,12' stroke='%233A6B45' stroke-width='1' fill='none' opacity='0.3'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        pointer-events: none;
    }
}
