/* ============================================
   freedom.compare - Cottagecore x Retro-Futurism
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Colors from DESIGN.md */
    --twilight-indigo: #1B1340;
    --meadow-dusk: #2C2156;
    --linen-mist: #F4EDE4;
    --neon-peony: #E84FA5;
    --electric-clover: #3AEDB0;
    --plasma-lavender: #B57FDB;
    --warm-parchment: #FBF5ED;
    --dried-herb: #3A3028;
    --dawn-rose: #FF85B8;
    --linen-dark: #EDE3D6;
    --deep-purple: #3A1F5C;

    /* Gradients */
    --garden-twilight: linear-gradient(175deg, #1B1340 0%, #2C2156 45%, #3A1F5C 100%);
    --neon-bloom: radial-gradient(ellipse at 50% 80%, rgba(232,79,165,0.15) 0%, transparent 70%);
    --linen-fade: linear-gradient(180deg, #F4EDE4 0%, #EDE3D6 100%);

    /* Typography */
    --font-display: 'Caveat', cursive;
    --font-body: 'Nunito', sans-serif;
    --font-accent: 'Indie Flower', cursive;

    /* Sizes */
    --title-size: clamp(2.8rem, 7vw, 6rem);
    --heading-size: clamp(1.6rem, 3vw, 2.8rem);
    --label-size: clamp(0.75rem, 1.2vw, 1rem);
    --body-size: clamp(1rem, 1.6vw, 1.15rem);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--body-size);
    line-height: 1.7;
    letter-spacing: 0.015em;
    color: var(--dried-herb);
    background-color: var(--twilight-indigo);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Floating Elements Layer --- */
.floating-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-el {
    position: absolute;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Individual floating element animations */
@keyframes floatDriftA {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -20px) rotate(4deg); }
    50% { transform: translate(-15px, -40px) rotate(-3deg); }
    75% { transform: translate(20px, -15px) rotate(6deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes floatDriftB {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-25px, 15px) rotate(-5deg); }
    50% { transform: translate(20px, 30px) rotate(3deg); }
    75% { transform: translate(-10px, 10px) rotate(-7deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes floatDriftC {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(18px, -25px) rotate(5deg); }
    66% { transform: translate(-22px, 12px) rotate(-4deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes floatDriftD {
    0% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-20px, -18px) rotate(-6deg); }
    40% { transform: translate(15px, -30px) rotate(3deg); }
    60% { transform: translate(-25px, -10px) rotate(-5deg); }
    80% { transform: translate(10px, -22px) rotate(4deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes floatDriftE {
    0% { transform: translate(0, 0) rotate(0deg); }
    30% { transform: translate(22px, 18px) rotate(7deg); }
    60% { transform: translate(-18px, -12px) rotate(-3deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes opacityPulse {
    0%, 100% { opacity: 0.18; }
    50% { opacity: 0.38; }
}

@keyframes opacityPulseB {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.32; }
}

@keyframes opacityPulseC {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.42; }
}

/* --- Section Base --- */
.section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* --- The Threshold --- */
.section--threshold {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--linen-fade);
    position: relative;
}

/* Linen texture overlay */
.section--threshold::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(58, 48, 40, 0.015) 2px,
            rgba(58, 48, 40, 0.015) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(58, 48, 40, 0.01) 3px,
            rgba(58, 48, 40, 0.01) 4px
        );
    pointer-events: none;
    z-index: 0;
}

.threshold__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.threshold__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--title-size);
    line-height: 1.15;
    color: var(--dried-herb);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 40px rgba(232, 79, 165, 0.12);
}

.threshold__tagline {
    font-family: var(--font-accent);
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--neon-peony);
    opacity: 0.7;
    letter-spacing: 0.05em;
}

.threshold__chevron {
    position: absolute;
    bottom: clamp(6rem, 12vh, 10rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: chevronBounce 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

@keyframes chevronBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(10px); }
    60% { transform: translateX(-50%) translateY(-3px); }
    80% { transform: translateX(-50%) translateY(4px); }
}

/* --- Dividers --- */
.divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 3;
    line-height: 0;
}

.divider svg {
    display: block;
    width: 100%;
    height: auto;
}

.divider--threshold-meadow {
    bottom: -1px;
}

.divider--meadow-garden {
    bottom: -1px;
}

.divider--garden-deep {
    bottom: -1px;
}

/* --- The Meadow Layer --- */
.section--meadow {
    min-height: 80vh;
    background: var(--linen-fade);
    position: relative;
    padding: clamp(6rem, 12vh, 10rem) 2rem clamp(8rem, 14vh, 12rem);
}

/* Botanical pattern overlay */
.section--meadow::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(58, 48, 40, 0.012) 2px,
            rgba(58, 48, 40, 0.012) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(58, 48, 40, 0.008) 3px,
            rgba(58, 48, 40, 0.008) 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* Soft meadow green wash */
.section--meadow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 40%, rgba(58, 237, 176, 0.04) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 60%, rgba(181, 127, 219, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.meadow__content {
    position: relative;
    z-index: 2;
    max-width: 38rem;
    margin: 0 auto;
    text-align: center;
}

.meadow__botanical {
    position: absolute;
    z-index: 1;
    opacity: 0.6;
}

.meadow__botanical--left {
    left: 2%;
    top: 10%;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--heading-size);
    line-height: 1.15;
    color: var(--dried-herb);
    margin-bottom: clamp(1.5rem, 3vh, 2.5rem);
}

.section-heading--light {
    color: var(--warm-parchment);
}

.meadow__text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: var(--body-size);
    line-height: 1.7;
    color: var(--dried-herb);
    margin-bottom: clamp(1.5rem, 3vh, 2.5rem);
    opacity: 0.9;
}

.meadow__emblem {
    display: flex;
    justify-content: center;
    margin: clamp(2rem, 4vh, 3.5rem) 0;
}

/* --- The Comparison Garden --- */
.section--garden {
    background: var(--garden-twilight);
    position: relative;
    padding: clamp(6rem, 12vh, 10rem) 2rem clamp(8rem, 14vh, 14rem);
}

.section--garden::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--neon-bloom);
    pointer-events: none;
    z-index: 0;
}

.garden__header {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 42rem;
    margin: 0 auto clamp(3rem, 6vh, 5rem);
}

.garden__intro {
    font-family: var(--font-accent);
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    color: var(--warm-parchment);
    opacity: 0.7;
}

.garden__cards {
    position: relative;
    z-index: 2;
    max-width: 64rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 5vh, 5rem);
}

/* --- Comparison Pair --- */
.comparison-pair {
    display: flex;
    align-items: stretch;
    gap: 2rem;
    justify-content: center;
}

.comparison-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vs-text {
    font-family: var(--font-accent);
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--neon-peony);
    text-shadow: 0 0 12px rgba(232, 79, 165, 0.4);
    opacity: 0.8;
}

/* --- Cards --- */
.card {
    position: relative;
    background: var(--linen-fade);
    border-radius: 1.2rem;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    flex: 1;
    max-width: 28rem;
    box-shadow:
        0 4px 24px rgba(232, 79, 165, 0.08),
        0 0 4px rgba(232, 79, 165, 0.15);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

/* Linen texture on cards */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.2rem;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(58, 48, 40, 0.018) 2px,
            rgba(58, 48, 40, 0.018) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(58, 48, 40, 0.012) 3px,
            rgba(58, 48, 40, 0.012) 4px
        );
    pointer-events: none;
    z-index: 0;
}

.card:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow:
        0 8px 40px rgba(232, 79, 165, 0.12),
        0 0 12px rgba(232, 79, 165, 0.35);
}

.card--left {
    transform: translateY(0.5rem);
}

.card--right {
    transform: translateY(-0.5rem);
}

.card--left:hover {
    transform: scale(1.02) translateY(-1.5px);
}

.card--right:hover {
    transform: scale(1.02) translateY(-2.5px);
}

.card__vine {
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    opacity: 0.7;
    z-index: 1;
}

.card__vine--right {
    left: auto;
    right: -8px;
}

.card__label {
    display: inline-block;
    font-family: var(--font-accent);
    font-size: var(--label-size);
    color: var(--neon-peony);
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.card__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    line-height: 1.15;
    color: var(--dried-herb);
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.card__text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.9rem, 1.4vw, 1rem);
    line-height: 1.65;
    color: var(--dried-herb);
    opacity: 0.85;
    position: relative;
    z-index: 1;
}

.card__rose {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

/* --- The Deep Glow --- */
.section--deep {
    min-height: 100vh;
    background: var(--garden-twilight);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: clamp(4rem, 8vh, 8rem) 2rem;
}

.deep__neon-bloom {
    position: absolute;
    inset: 0;
    background: var(--neon-bloom);
    pointer-events: none;
    z-index: 0;
}

/* Secondary bloom for stronger glow in deep section */
.section--deep::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(181, 127, 219, 0.1) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 40%, rgba(58, 237, 176, 0.08) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.deep__content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 50rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.deep__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5.5vw, 4.5rem);
    line-height: 1.15;
    color: var(--warm-parchment);
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(232, 79, 165, 0.2);
}

.deep__subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.3rem);
    line-height: 1.6;
    color: var(--warm-parchment);
    opacity: 0.7;
    max-width: 32rem;
    margin-bottom: 2rem;
}

.deep__botanical {
    margin: clamp(1.5rem, 3vh, 3rem) 0;
}

.deep__botanical--left {
    order: -1;
}

.deep__botanical--right {
    order: 3;
}

.deep__footer {
    position: absolute;
    bottom: clamp(2rem, 4vh, 4rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.deep__footer-text {
    font-family: var(--font-accent);
    font-size: var(--label-size);
    color: var(--warm-parchment);
    opacity: 0.35;
    letter-spacing: 0.1em;
}

/* --- Reveal Animations --- */
.reveal-element {
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for sequential reveals */
.reveal-element:nth-child(2) { transition-delay: 80ms; }
.reveal-element:nth-child(3) { transition-delay: 160ms; }
.reveal-element:nth-child(4) { transition-delay: 240ms; }
.reveal-element:nth-child(5) { transition-delay: 320ms; }

/* --- Path Draw Animation for Botanicals --- */
.vine-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.botanical-glow-inner.vine-path {
    transition-delay: 200ms;
}

/* --- Scroll Parallax Helper --- */
.floating-el[data-depth="near"] {
    will-change: transform;
}

.floating-el[data-depth="far"] {
    will-change: transform;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .comparison-pair {
        flex-direction: column;
        align-items: center;
    }

    .card {
        max-width: 100%;
        width: 100%;
        padding: 1.5rem;
    }

    .card--left,
    .card--right {
        transform: translateY(0);
    }

    .card--left:hover,
    .card--right:hover {
        transform: scale(1.01);
    }

    .comparison-vs {
        padding: 0.5rem 0;
    }

    .meadow__botanical {
        display: none;
    }

    .deep__botanical svg {
        width: 120px;
        height: auto;
    }

    .section--meadow {
        padding: clamp(4rem, 8vh, 6rem) 1.5rem clamp(6rem, 10vh, 8rem);
    }

    .section--garden {
        padding: clamp(4rem, 8vh, 6rem) 1.5rem clamp(6rem, 10vh, 10rem);
    }

    .deep__title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .floating-layer .floating-el:nth-child(n+9) {
        display: none;
    }

    .floating-el svg {
        transform: scale(1.3);
    }
}

@media (max-width: 480px) {
    .threshold__title {
        font-size: clamp(2.2rem, 10vw, 3.5rem);
    }

    .card {
        padding: 1.25rem;
    }

    .garden__cards {
        gap: 2rem;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .floating-el {
        animation: none !important;
    }

    .threshold__chevron {
        animation: none;
    }

    .reveal-element {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
