/* ==========================================================================
   footprint.market - Botanical Environmental Impact Marketplace
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
    --deep-burgundy: #4A1028;
    --botanical-cream: #F5F0E3;
    --leaf-viridian: #2E6B4F;
    --gold-leaf: #C4A44A;
    --petal-rose: #D4728C;
    --earth-umber: #6B4E37;
    --candle-glow: #F5D89A;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    color: var(--botanical-cream);
    background-color: var(--deep-burgundy);
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: -0.01em;
}

h1 {
    font-weight: 600;
    font-size: clamp(28px, 5vw, 64px);
}

h2 {
    font-weight: 600;
    font-size: clamp(24px, 4vw, 52px);
}

h3 {
    font-weight: 600;
    font-size: clamp(20px, 2.5vw, 32px);
}

.botanical-label {
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 14px;
    color: var(--gold-leaf);
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid rgba(196, 164, 74, 0.3);
}

/* ==========================================================================
   HERO SECTION - Opening Viewport
   ========================================================================== */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--deep-burgundy);
    overflow: hidden;
}

/* Candle glow effects */
.candle-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

.candle-glow--center {
    width: 500px;
    height: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(245, 216, 154, 0.15) 0%, rgba(245, 216, 154, 0.05) 40%, transparent 70%);
}

.candle-glow--top-left {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 15%;
    background: radial-gradient(circle, rgba(245, 216, 154, 0.1) 0%, transparent 70%);
}

.candle-glow--top-right {
    width: 250px;
    height: 250px;
    top: 15%;
    right: 20%;
    background: radial-gradient(circle, rgba(245, 216, 154, 0.08) 0%, transparent 70%);
}

.candle-glow--bottom-left {
    width: 280px;
    height: 280px;
    bottom: 15%;
    left: 10%;
    background: radial-gradient(circle, rgba(245, 216, 154, 0.07) 0%, transparent 70%);
}

.candle-glow--bottom-right {
    width: 320px;
    height: 320px;
    bottom: 10%;
    right: 12%;
    background: radial-gradient(circle, rgba(245, 216, 154, 0.09) 0%, transparent 70%);
}

/* Botanical frame container */
.botanical-frame {
    position: relative;
    width: min(80vw, 800px);
    max-width: 800px;
    /* Off-center positioning: 55% left, 45% top */
    transform: translate(5%, -5%);
}

.botanical-frame__svg {
    width: 100%;
    height: auto;
    display: block;
}

/* SVG animation setup */
.frame-rect {
    stroke-dasharray: 2520;
    stroke-dashoffset: 2520;
}

.frame-rect-inner {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
}

.vine {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
}

.botanical-stem {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
}

.corner-leaf {
    transform-origin: center;
    opacity: 0;
    transform: scale(0);
}

.corner-leaf--tl { transform-origin: 55px 45px; }
.corner-leaf--tr { transform-origin: 745px 45px; }
.corner-leaf--bl { transform-origin: 55px 555px; }
.corner-leaf--br { transform-origin: 745px 555px; }

/* Hero content (title + subtitle) */
.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    width: 70%;
}

.hero-title {
    color: var(--botanical-cream);
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 500ms ease, transform 500ms ease;
    text-shadow: 0 2px 20px rgba(74, 16, 40, 0.6);
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(16px, 2.5vw, 28px);
    color: var(--candle-glow);
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 500ms ease 200ms, transform 500ms ease 200ms;
    margin-top: 0.5em;
}

/* Animate in states */
.hero-title.visible,
.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   GOLD LEAF DIVIDERS
   ========================================================================== */
.gold-rule {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    margin: 0 10%;
}

.gold-rule::before,
.gold-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gold-leaf);
    transform: scaleX(0);
    transition: transform 800ms ease;
}

.gold-rule::before {
    transform-origin: right center;
    margin-right: 1rem;
}

.gold-rule::after {
    transform-origin: left center;
    margin-left: 1rem;
}

.gold-rule.visible::before,
.gold-rule.visible::after {
    transform: scaleX(1);
}

.gold-rule__flourish {
    width: 30px;
    height: 10px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 600ms ease 400ms;
}

.gold-rule.visible .gold-rule__flourish {
    opacity: 1;
}

/* ==========================================================================
   CONTENT PANELS - Broken Grid
   ========================================================================== */
.content-panel {
    position: relative;
    padding: 4rem 3rem;
    margin-top: -80px;
    background: rgba(74, 16, 40, 0.6);
    border: 1px solid rgba(196, 164, 74, 0.2);
    backdrop-filter: blur(2px);
    overflow: visible;
    opacity: 0;
    transition: opacity 600ms ease, transform 600ms ease;
}

.content-panel--left {
    margin-left: 5%;
    margin-right: auto;
    transform: translateX(-60px);
}

.content-panel--right {
    margin-right: 5%;
    margin-left: auto;
    transform: translateX(60px);
}

.content-panel--wide {
    width: 60%;
}

.content-panel--extra-wide {
    width: 75%;
}

.content-panel--narrow {
    width: 50%;
}

.content-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Panel candle glow */
.panel-candle-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 216, 154, 0.08) 0%, transparent 70%);
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.panel-content {
    position: relative;
    z-index: 1;
}

.panel-title {
    color: var(--botanical-cream);
    margin-bottom: 1rem;
    position: relative;
}

.panel-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--gold-leaf);
    margin-top: 0.75rem;
}

.panel-body {
    color: var(--botanical-cream);
    opacity: 0.9;
    margin-bottom: 1rem;
    max-width: 65ch;
}

.panel-body:last-of-type {
    margin-bottom: 0;
}

/* ==========================================================================
   SECTION BOTANICAL ILLUSTRATIONS
   ========================================================================== */
.section-botanical {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

.section-botanical--1 {
    width: 120px;
    top: -60px;
    right: -40px;
}

.section-botanical--2 {
    width: 140px;
    top: -50px;
    left: -50px;
}

.section-botanical--3 {
    width: 110px;
    top: -40px;
    right: -30px;
}

.section-botanical--4 {
    width: 130px;
    top: -55px;
    left: -45px;
}

.section-botanical--5 {
    width: 125px;
    top: -50px;
    right: -35px;
}

/* ==========================================================================
   GALLERY SECTION - Mixed-Media Botanical Collage
   ========================================================================== */
.gallery-section {
    position: relative;
    padding: 6rem 5% 4rem;
    overflow: visible;
}

.gallery-title {
    text-align: center;
    color: var(--botanical-cream);
    margin-bottom: 3rem;
    position: relative;
}

.gallery-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 2px;
    background: var(--gold-leaf);
    margin: 1rem auto 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* Broken grid positioning for cards */
.gallery-card {
    background: rgba(245, 240, 227, 0.05);
    border: 1px solid rgba(196, 164, 74, 0.25);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 400ms ease-out, box-shadow 400ms ease-out, border-color 400ms ease-out;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
}

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

.gallery-card:hover {
    transform: scale(1.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 80px rgba(245, 216, 154, 0.08);
    border-color: var(--gold-leaf);
    z-index: 2;
}

/* Broken grid offsets for organic feel */
.gallery-card--1 {
    margin-top: 0;
}

.gallery-card--2 {
    margin-top: 40px;
}

.gallery-card--3 {
    margin-top: -20px;
}

.gallery-card--4 {
    grid-column: 1 / 2;
    margin-top: -30px;
    margin-left: 15%;
}

.gallery-card--5 {
    grid-column: 2 / 3;
    margin-top: 10px;
}

.gallery-card__botanical {
    width: 120px;
    height: 150px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.gallery-card__botanical svg {
    width: 100%;
    height: 100%;
}

.gallery-card__title {
    color: var(--botanical-cream);
    font-size: clamp(18px, 2vw, 26px);
    margin-bottom: 0.5rem;
}

.gallery-card__label {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 14px;
    color: var(--gold-leaf);
}

/* ==========================================================================
   FOOTER - Candle Atmospheric
   ========================================================================== */
.footer-section {
    position: relative;
    padding: 6rem 5% 4rem;
    background: linear-gradient(to bottom, var(--deep-burgundy), #2A0818);
    text-align: center;
    overflow: hidden;
    margin-top: 2rem;
}

.footer-candle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: candleFlicker 4s ease-in-out infinite alternate;
}

.footer-candle--1 {
    width: 250px;
    height: 250px;
    top: 20%;
    left: 10%;
    background: radial-gradient(circle, rgba(245, 216, 154, 0.1) 0%, transparent 70%);
    animation-delay: 0s;
}

.footer-candle--2 {
    width: 200px;
    height: 200px;
    top: 30%;
    right: 15%;
    background: radial-gradient(circle, rgba(245, 216, 154, 0.08) 0%, transparent 70%);
    animation-delay: 1s;
}

.footer-candle--3 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(245, 216, 154, 0.12) 0%, transparent 70%);
    animation-delay: 0.5s;
}

.footer-candle--4 {
    width: 180px;
    height: 180px;
    bottom: 10%;
    left: 25%;
    background: radial-gradient(circle, rgba(245, 216, 154, 0.06) 0%, transparent 70%);
    animation-delay: 1.5s;
}

.footer-candle--5 {
    width: 220px;
    height: 220px;
    bottom: 15%;
    right: 20%;
    background: radial-gradient(circle, rgba(245, 216, 154, 0.07) 0%, transparent 70%);
    animation-delay: 2s;
}

@keyframes candleFlicker {
    0% { opacity: 0.6; transform: scale(1); }
    25% { opacity: 0.8; }
    50% { opacity: 0.5; transform: scale(1.05); }
    75% { opacity: 0.7; }
    100% { opacity: 0.9; transform: scale(0.98); }
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-botanical {
    width: 180px;
    height: auto;
    margin: 0 auto 2rem;
    display: block;
    opacity: 0.7;
}

.footer-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(28px, 4vw, 48px);
    color: var(--botanical-cream);
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(16px, 2vw, 22px);
    color: var(--candle-glow);
    margin-bottom: 2rem;
}

.footer-gold-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    max-width: 300px;
}

.footer-gold-rule::before,
.footer-gold-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gold-leaf);
}

.footer-gold-rule::before {
    margin-right: 1rem;
}

.footer-gold-rule::after {
    margin-left: 1rem;
}

.footer-gold-rule .gold-rule__flourish {
    opacity: 1;
}

.footer-note {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 14px;
    color: var(--earth-umber);
    opacity: 0.8;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .content-panel--wide,
    .content-panel--extra-wide,
    .content-panel--narrow {
        width: 85%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-card--4 {
        grid-column: auto;
        margin-left: 0;
    }

    .gallery-card--5 {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .content-panel {
        padding: 3rem 2rem;
        margin-top: -40px;
    }

    .content-panel--left,
    .content-panel--right {
        margin-left: 3%;
        margin-right: 3%;
    }

    .content-panel--wide,
    .content-panel--extra-wide,
    .content-panel--narrow {
        width: 94%;
    }

    .botanical-frame {
        transform: translate(0, 0);
        width: 90vw;
    }

    .hero-content {
        width: 80%;
    }

    .section-botanical {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gallery-card--1,
    .gallery-card--2,
    .gallery-card--3,
    .gallery-card--4,
    .gallery-card--5 {
        margin-top: 0;
        margin-left: 0;
    }

    .gold-rule {
        margin: 0 5%;
    }
}

@media (max-width: 480px) {
    .content-panel {
        padding: 2rem 1.5rem;
    }

    .hero-content {
        width: 90%;
    }
}
