/* ============================================
   economic.day - Styles
   Victorian Conservatory x Vaporwave Aesthetic
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --midnight-conservatory: #1a0a2e;
    --twilight-teal: #0d3b4f;
    --dried-rose: #c4727f;
    --lavender-mist: #d4a0e0;
    --pressed-petal-gold: #e8c547;
    --herbarium-paper: #f0e6d3;
    --economic-dusk: #2d1854;
    --market-floor: #5a7c6b;

    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-caption: 'Josefin Sans', 'Helvetica Neue', Helvetica, sans-serif;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    color: var(--herbarium-paper);
    background-color: var(--midnight-conservatory);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Scroll Progress Bar --- */
#scroll-progress {
    position: fixed;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
    padding: 16px 0;
}

#progress-leaf-top {
    flex-shrink: 0;
}

#progress-track {
    flex: 1;
    width: 2px;
    background-color: rgba(212, 160, 224, 0.15);
    position: relative;
    margin: 4px 0;
}

#progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: var(--lavender-mist);
    transition: height 0.1s linear;
}

#progress-root-bottom {
    flex-shrink: 0;
}

/* --- Cursor Loupe --- */
#cursor-loupe {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 224, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 5;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#cursor-loupe.active {
    opacity: 1;
}

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

/* --- Section Dividers --- */
.section-divider {
    display: block;
    width: 100%;
    height: 60px;
    position: relative;
    z-index: 2;
}

/* --- Background Pattern Curves --- */
.bg-pattern-curves {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- SECTION 1: THE CONSERVATORY (Hero) --- */
.section-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--twilight-teal) 0%, var(--midnight-conservatory) 55%, var(--economic-dusk) 100%);
    position: relative;
}

.hero-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(240, 230, 211, 0.04) 0%, rgba(232, 197, 71, 0.02) 100%);
    pointer-events: none;
}

.section-hero .flowing-curves {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Flowing Curve Animations */
.flow-curve-1 {
    animation: flowWave1 17s ease-in-out infinite;
    animation-delay: -3s;
}

.flow-curve-2 {
    animation: flowWave2 23s ease-in-out infinite;
    animation-delay: -7s;
}

.flow-curve-3 {
    animation: flowWave3 19s ease-in-out infinite;
    animation-delay: -11s;
}

.flow-curve-4 {
    animation: flowWave4 13s ease-in-out infinite;
    animation-delay: -15s;
}

.flow-curve-5 {
    animation: flowWave5 29s ease-in-out infinite;
    animation-delay: -5s;
}

@keyframes flowWave1 {
    0%, 100% { transform: translateY(0px); }
    25% { transform: translateY(-12px); }
    50% { transform: translateY(8px); }
    75% { transform: translateY(-6px); }
}

@keyframes flowWave2 {
    0%, 100% { transform: translateY(0px); }
    33% { transform: translateY(15px); }
    66% { transform: translateY(-10px); }
}

@keyframes flowWave3 {
    0%, 100% { transform: translateY(0px); }
    20% { transform: translateY(-8px); }
    50% { transform: translateY(14px); }
    80% { transform: translateY(-5px); }
}

@keyframes flowWave4 {
    0%, 100% { transform: translateY(0px); }
    40% { transform: translateY(10px); }
    70% { transform: translateY(-12px); }
}

@keyframes flowWave5 {
    0%, 100% { transform: translateY(0px); }
    30% { transform: translateY(-18px); }
    60% { transform: translateY(10px); }
    90% { transform: translateY(-5px); }
}

/* Hero Illustrations */
.hero-illustrations {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

.hero-plant {
    position: absolute;
    opacity: 0.8;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease, filter 0.6s ease;
    pointer-events: auto;
}

.hero-plant:hover {
    transform: scale(1.08);
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(212, 160, 224, 0.15));
}

.hero-plant-1 {
    left: 5%;
    top: 10%;
    animation: breathePlant 8s ease-in-out infinite;
}

.hero-plant-2 {
    right: 5%;
    top: 15%;
    animation: breathePlant 8s ease-in-out infinite;
    animation-delay: -2.7s;
}

.hero-plant-3 {
    left: 50%;
    top: 8%;
    transform: translateX(-50%);
    opacity: 0.35;
    z-index: -1;
    animation: breathePlantCenter 8s ease-in-out infinite;
    animation-delay: -5.3s;
}

.hero-plant-4 {
    left: -3%;
    bottom: 5%;
    opacity: 0.5;
    animation: breathePlant 8s ease-in-out infinite;
    animation-delay: -1.5s;
}

.hero-plant-5 {
    right: -3%;
    bottom: 8%;
    opacity: 0.45;
    animation: breathePlant 8s ease-in-out infinite;
    animation-delay: -4s;
}

@keyframes breathePlant {
    0%, 100% { transform: scale(0.98); }
    50% { transform: scale(1.02); }
}

@keyframes breathePlantCenter {
    0%, 100% { transform: translateX(-50%) scale(0.98); }
    50% { transform: translateX(-50%) scale(1.02); }
}

/* Hero Title */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.02em;
    color: var(--herbarium-paper);
    text-shadow: 0 2px 40px rgba(26, 10, 46, 0.6);
    line-height: 1;
}

.hero-title .char-animate {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-title .char-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: var(--lavender-mist);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50% { opacity: 0.8; transform: scaleY(1); }
}

/* --- SECTION 2: TRADING FLOOR GARDEN --- */
.section-trading {
    min-height: 150vh;
    background: linear-gradient(180deg, var(--economic-dusk) 0%, var(--midnight-conservatory) 40%, #14082a 100%);
    padding: 6vh 0;
    position: relative;
}

.section-trading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(240, 230, 211, 0.03) 0%, rgba(232, 197, 71, 0.015) 100%);
    pointer-events: none;
}

.trading-columns {
    display: flex;
    gap: 0;
    max-width: 100%;
    position: relative;
}

.trading-text {
    width: 62%;
    padding: 4vh 5vw 4vh 6vw;
    position: relative;
    z-index: 2;
}

.trading-illustration {
    width: 38%;
    position: relative;
}

.illustration-sticky {
    position: sticky;
    top: 10vh;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Plant morph illustrations */
.plant-morph {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: 70vh;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, filter 0.6s ease;
    pointer-events: auto;
}

.plant-morph:hover {
    filter: drop-shadow(0 0 8px rgba(212, 160, 224, 0.2));
}

.plant-morph.active {
    opacity: 0.8;
}

.plant-morph.active:hover {
    opacity: 1;
}

.specimen-label {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-caption);
    font-weight: 300;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--pressed-petal-gold);
    opacity: 0.7;
    white-space: nowrap;
    transition: opacity 0.6s ease;
}

/* Section Headers */
.section-header {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    color: var(--herbarium-paper);
    margin-bottom: 2em;
    line-height: 1.2;
}

.section-header .header-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.section-header .header-char.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Essay Text */
.essay-text p {
    text-indent: 2em;
    margin-bottom: 0;
    color: var(--herbarium-paper);
    opacity: 0.92;
}

.essay-text p:first-child {
    text-indent: 2em;
}

/* Botanical Dividers */
.botanical-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2em 0;
    position: relative;
}

.botanical-divider hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(232, 197, 71, 0.4), transparent);
    width: 100%;
    position: absolute;
}

.divider-ornament {
    position: relative;
    z-index: 1;
    background: var(--midnight-conservatory);
    padding: 0 12px;
}

/* --- SECTION 3: SPECIMEN ARCHIVE --- */
.section-archive {
    position: relative;
}

.specimen-band {
    width: 100%;
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.specimen-band::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 20px,
        rgba(212, 160, 224, 0.3) 20px,
        rgba(212, 160, 224, 0.3) 21px
    );
    pointer-events: none;
}

.band-1 {
    background-color: var(--herbarium-paper);
}

.band-1 .specimen-caption {
    color: var(--midnight-conservatory);
}

.band-2 {
    background-color: var(--midnight-conservatory);
}

.band-2 .specimen-caption {
    color: var(--herbarium-paper);
}

.band-3 {
    background-color: var(--economic-dusk);
}

.band-3 .specimen-caption {
    color: var(--herbarium-paper);
}

.band-4 {
    background-color: var(--herbarium-paper);
}

.band-4 .specimen-caption {
    color: var(--midnight-conservatory);
}

.specimen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.specimen-illustration {
    opacity: 0.8;
    transform: scale(0.85);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease, filter 0.6s ease;
    pointer-events: auto;
}

.specimen-illustration:hover {
    transform: scale(1.05);
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(212, 160, 224, 0.2));
}

.specimen-illustration.in-view {
    transform: scale(1.0);
    opacity: 0.85;
}

.specimen-illustration.in-view:hover {
    transform: scale(1.08);
    opacity: 1;
}

.specimen-caption {
    font-family: var(--font-caption);
    font-weight: 300;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.7;
}

/* --- SECTION 4: READING ROOM --- */
.section-reading {
    min-height: 150vh;
    background-color: var(--midnight-conservatory);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 0;
}

/* Margin illustrations */
.margin-illustration {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.margin-left {
    left: -20px;
}

.margin-right {
    right: -20px;
}

/* Reading content */
.reading-content {
    max-width: 65ch;
    width: 90%;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.reading-header {
    text-align: center;
    margin-bottom: 2.5em;
}

.reading-content .essay-text p {
    text-indent: 2em;
    color: var(--herbarium-paper);
    opacity: 0.92;
}

/* Pull Quote */
.pull-quote {
    margin: 3em 0;
    padding: 2em 2.5em;
    border: 1px solid rgba(232, 197, 71, 0.25);
    border-radius: 4px;
    position: relative;
}

/* Corner ornaments for pull quote */
.corner-ornament {
    position: absolute;
    width: 24px;
    height: 24px;
    z-index: 2;
}

.corner-tl {
    top: -12px;
    left: -12px;
}

.corner-tr {
    top: -12px;
    right: -12px;
}

.corner-bl {
    bottom: -12px;
    left: -12px;
}

.corner-br {
    bottom: -12px;
    right: -12px;
}

.pull-quote blockquote {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    line-height: 1.6;
    color: var(--pressed-petal-gold);
    text-indent: 0;
}

.pull-quote blockquote p {
    text-indent: 0;
}

/* --- SECTION 5: THE CLOSING BELL --- */
.section-closing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--economic-dusk) 0%, var(--midnight-conservatory) 45%, var(--twilight-teal) 100%);
    position: relative;
}

.closing-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(232, 197, 71, 0.02) 0%, rgba(240, 230, 211, 0.04) 100%);
    pointer-events: none;
}

.section-closing .flowing-curves {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.closing-illustrations {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

.closing-plant {
    position: absolute;
    opacity: 0.5;
    pointer-events: auto;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease, filter 0.6s ease;
}

.closing-plant:hover {
    transform: scale(1.08);
    opacity: 0.75;
    filter: drop-shadow(0 0 8px rgba(212, 160, 224, 0.15));
}

.closing-plant-1 {
    left: 5%;
    top: 8%;
}

.closing-plant-2 {
    right: 5%;
    top: 12%;
}

.closing-plant-3 {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.2;
    z-index: -1;
}

.closing-plant-3:hover {
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 0.35;
}

.closing-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.closing-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    color: var(--herbarium-paper);
    text-shadow: 0 2px 30px rgba(26, 10, 46, 0.5);
    margin-bottom: 0.5em;
}

.closing-subtitle {
    font-family: var(--font-caption);
    font-weight: 300;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lavender-mist);
    opacity: 0.7;
}

/* Closing vine curve */
.closing-vine-curve {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 5;
}

.vine-path {
    animation: vineFlow 19s ease-in-out infinite;
}

.vine-path-2 {
    animation: vineFlow2 23s ease-in-out infinite;
    animation-delay: -8s;
}

@keyframes vineFlow {
    0%, 100% { transform: translateY(0px); }
    30% { transform: translateY(-5px); }
    60% { transform: translateY(5px); }
}

@keyframes vineFlow2 {
    0%, 100% { transform: translateY(0px); }
    40% { transform: translateY(4px); }
    70% { transform: translateY(-6px); }
}

/* --- Scroll Reveal Animation --- */
.section-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Staggered illustration reveal */
.botanical-illustration.section-reveal {
    transition-delay: 0.2s;
}

/* --- Background Patterns (subtle curves) --- */
.section-trading::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.035;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 40px,
            rgba(212, 160, 224, 0.15) 40px,
            rgba(212, 160, 224, 0.15) 41px
        );
    pointer-events: none;
}

.section-reading::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.025;
    background-image:
        repeating-linear-gradient(
            -30deg,
            transparent,
            transparent 35px,
            rgba(212, 160, 224, 0.2) 35px,
            rgba(212, 160, 224, 0.2) 36px
        );
    pointer-events: none;
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    .trading-columns {
        flex-direction: column;
    }

    .trading-text {
        width: 100%;
        padding: 4vh 6vw;
    }

    .trading-illustration {
        width: 100%;
        height: auto;
    }

    .illustration-sticky {
        position: relative;
        top: auto;
        height: 50vh;
    }

    .plant-morph {
        max-height: 45vh;
    }

    .hero-plant-1 {
        left: -5%;
        top: 15%;
        width: 180px;
    }

    .hero-plant-2 {
        right: -5%;
        top: 20%;
        width: 160px;
    }

    .hero-plant-3 {
        opacity: 0.2;
        width: 140px;
    }

    .hero-plant-4 {
        left: -8%;
        width: 140px;
    }

    .hero-plant-5 {
        right: -8%;
        width: 120px;
    }

    .closing-plant-1 {
        left: -5%;
        width: 220px;
    }

    .closing-plant-2 {
        right: -5%;
        width: 180px;
    }

    .closing-plant-3 {
        width: 160px;
    }

    .margin-illustration {
        display: none;
    }

    .specimen-band {
        height: 60vh;
    }

    #scroll-progress {
        left: 6px;
    }

    .pull-quote {
        padding: 1.5em;
    }

    .section-hero {
        min-height: 100svh;
    }

    .corner-ornament {
        width: 20px;
        height: 20px;
    }

    .corner-tl {
        top: -10px;
        left: -10px;
    }

    .corner-tr {
        top: -10px;
        right: -10px;
    }

    .corner-bl {
        bottom: -10px;
        left: -10px;
    }

    .corner-br {
        bottom: -10px;
        right: -10px;
    }
}

/* --- Selection --- */
::selection {
    background-color: rgba(196, 114, 127, 0.4);
    color: var(--herbarium-paper);
}

/* --- Scrollbar (WebKit) --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--midnight-conservatory);
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 224, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 160, 224, 0.5);
}
