/* ============================================================
   footprint.markets v2 - Blobitecture Environmental Markets
   Colors: #F2E6D9, #4A1942, #8B9E7C, #C7919B, #7B8794, #FDFAF5, #A85C3B
   Fonts: Libre Baskerville, Poppins, DM Mono
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #F2E6D9;
    color: #4A1942;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

h1 {
    font-size: clamp(32px, 5vw, 64px);
    color: #4A1942;
}

h1 .dot {
    color: #A85C3B;
}

h2 {
    font-size: clamp(26px, 4.5vw, 56px);
    color: #4A1942;
    margin-bottom: 0.5em;
}

.market-label {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #A85C3B;
    display: block;
    margin-bottom: 0.75em;
}

/* ============================================================
   Hero Section
   ============================================================ */

.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #F2E6D9;
}

.hero-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-blob {
    opacity: 0;
    transform-origin: center;
}

/* Connection lines in hero */
.connection-line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

/* Hero title */
.hero-title {
    position: relative;
    z-index: 10;
    text-align: center;
    opacity: 0;
    transform: translateY(15px);
}

.hero-tagline {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(14px, 1.8vw, 20px);
    font-weight: 400;
    color: #4A1942;
    opacity: 0.65;
    margin-top: 0.6em;
    letter-spacing: 0.02em;
}

/* ============================================================
   Cultural Icon Circles
   ============================================================ */

.cultural-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.culture-circle {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #FDFAF5;
    border: 1.5px solid rgba(74, 25, 66, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    pointer-events: auto;
    cursor: default;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

.culture-circle:hover {
    transform: scale(1.15) !important;
}

/* Positioned around the hero edges -- asymmetric constellation */
.culture-circle-1 { top: 10%; left: 7%; }
.culture-circle-2 { top: 16%; right: 10%; }
.culture-circle-3 { bottom: 24%; left: 12%; }
.culture-circle-4 { bottom: 14%; right: 7%; }
.culture-circle-5 { top: 48%; right: 4%; }
.culture-circle-6 { top: 55%; left: 5%; }

/* Inline cultural circles near market blobs */
.culture-circle-inline {
    position: relative;
    margin: 24px auto;
    opacity: 0;
    transform: scale(0);
}

.culture-inline-1 {
    margin-left: auto;
    margin-right: 18%;
    margin-top: -10px;
}

.culture-inline-2 {
    margin-left: 15%;
    margin-top: -10px;
}

.culture-inline-3 {
    margin-left: auto;
    margin-right: 12%;
    margin-top: -10px;
}

/* Closing section circles */
.cultural-icons-closing {
    position: relative;
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: center;
    gap: 70px;
    align-items: center;
    margin-top: 40px;
}

.culture-circle-closing {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
}

/* ============================================================
   Markets Flow Section
   ============================================================ */

.markets-flow {
    position: relative;
    padding: 80px 0 140px;
}

.market-blob-wrapper {
    position: relative;
    margin-bottom: 30px;
}

/* Asymmetric positioning classes -- each uniquely placed */
.market-blob-left {
    width: 55%;
    margin-left: 7%;
}

.market-blob-right {
    width: 48%;
    margin-left: auto;
    margin-right: 9%;
}

.market-blob-left-wide {
    width: 62%;
    margin-left: 5%;
}

.market-blob-center {
    width: 50%;
    margin-left: auto;
    margin-right: auto;
}

.market-blob-right-narrow {
    width: 42%;
    margin-left: auto;
    margin-right: 14%;
}

/* The blob containers with organic clip-paths */
.market-blob {
    position: relative;
    padding: 60px 50px;
    background-color: #FDFAF5;
    transition: transform 400ms ease-out;
    overflow: hidden;
}

/* Each blob gets a unique organic clip-path shape */
#market-carbon {
    clip-path: polygon(
        4% 8%,
        16% 2%,
        34% 0%,
        54% 1%,
        72% 3%,
        88% 7%,
        96% 17%,
        99% 32%,
        100% 50%,
        98% 68%,
        95% 82%,
        87% 93%,
        71% 98%,
        53% 100%,
        34% 99%,
        17% 95%,
        5% 88%,
        1% 74%,
        0% 58%,
        1% 42%,
        2% 26%,
        3% 14%
    );
}

#market-biodiversity {
    clip-path: polygon(
        6% 12%,
        18% 4%,
        35% 1%,
        52% 0%,
        70% 2%,
        86% 6%,
        95% 16%,
        100% 32%,
        99% 52%,
        96% 70%,
        90% 84%,
        80% 94%,
        64% 100%,
        44% 99%,
        26% 96%,
        12% 90%,
        3% 78%,
        0% 62%,
        1% 44%,
        3% 26%
    );
}

#market-water {
    clip-path: polygon(
        7% 5%,
        22% 0%,
        42% 2%,
        62% 1%,
        80% 0%,
        93% 7%,
        98% 20%,
        100% 40%,
        99% 58%,
        95% 74%,
        88% 88%,
        76% 97%,
        58% 100%,
        38% 99%,
        20% 94%,
        9% 86%,
        2% 70%,
        0% 52%,
        1% 34%,
        4% 16%
    );
}

#market-energy {
    clip-path: polygon(
        5% 10%,
        19% 2%,
        37% 0%,
        57% 2%,
        74% 5%,
        89% 12%,
        97% 26%,
        100% 46%,
        98% 66%,
        92% 80%,
        83% 92%,
        68% 98%,
        50% 100%,
        32% 98%,
        16% 92%,
        6% 80%,
        1% 66%,
        0% 48%,
        2% 30%,
        4% 16%
    );
}

#market-soil {
    clip-path: polygon(
        3% 6%,
        15% 1%,
        32% 0%,
        50% 2%,
        68% 1%,
        84% 4%,
        95% 14%,
        100% 30%,
        99% 50%,
        96% 70%,
        89% 86%,
        78% 96%,
        60% 100%,
        40% 98%,
        22% 94%,
        9% 86%,
        2% 70%,
        0% 50%,
        1% 32%,
        2% 14%
    );
}

#market-ocean {
    clip-path: polygon(
        8% 10%,
        22% 3%,
        40% 1%,
        58% 0%,
        76% 3%,
        90% 10%,
        97% 24%,
        100% 44%,
        98% 64%,
        93% 80%,
        84% 91%,
        70% 98%,
        52% 100%,
        34% 98%,
        18% 92%,
        7% 80%,
        1% 64%,
        0% 46%,
        2% 28%,
        5% 14%
    );
}

/* Marble texture overlay for market blobs */
.market-blob::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(139, 158, 124, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 55%, rgba(199, 145, 155, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 45% 80%, rgba(123, 135, 148, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 15%, rgba(168, 92, 59, 0.03) 0%, transparent 35%);
    pointer-events: none;
    animation: marbleShift 20s ease-in-out infinite alternate;
}

@keyframes marbleShift {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%; }
    50% { background-position: 5% 3%, -3% 5%, 3% -2%, -2% 4%; }
    100% { background-position: 10% 5%, -5% 10%, 5% -5%, -4% 8%; }
}

/* Scale-hover expansion on blob containers */
.market-blob:hover {
    transform: scale(1.02);
}

/* Content inside blobs -- radial reveal */
.blob-inner {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 700ms ease-out, transform 700ms ease-out;
}

.blob-inner.visible {
    opacity: 1;
    transform: scale(1);
}

.blob-inner p {
    margin-top: 0.75em;
    color: #4A1942;
    opacity: 0.85;
}

/* ============================================================
   Section Connectors (SVG splines between blobs)
   ============================================================ */

.section-connector {
    width: 100%;
    height: 80px;
    display: block;
    margin: -10px 0;
}

.connector-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1400ms ease-in-out;
}

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

/* ============================================================
   Closing Section
   ============================================================ */

.closing-section {
    position: relative;
    padding: 100px 0 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.closing-blob {
    width: 58%;
    max-width: 680px;
    padding: 70px 60px;
    background-color: #FDFAF5;
    clip-path: polygon(
        5% 8%,
        18% 2%,
        36% 0%,
        56% 1%,
        74% 3%,
        89% 10%,
        97% 22%,
        100% 40%,
        99% 60%,
        96% 78%,
        89% 90%,
        74% 98%,
        56% 100%,
        36% 99%,
        18% 96%,
        5% 88%,
        1% 72%,
        0% 52%,
        1% 34%,
        3% 18%
    );
    text-align: center;
    position: relative;
    transition: transform 400ms ease-out;
}

.closing-blob::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 35%, rgba(139, 158, 124, 0.09) 0%, transparent 50%),
        radial-gradient(ellipse at 65% 70%, rgba(199, 145, 155, 0.09) 0%, transparent 50%);
    pointer-events: none;
    animation: marbleShift 20s ease-in-out infinite alternate;
}

.closing-blob:hover {
    transform: scale(1.02);
}

.closing-inner {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 700ms ease-out, transform 700ms ease-out;
}

.closing-inner.visible {
    opacity: 1;
    transform: scale(1);
}

.closing-inner h2 {
    font-size: clamp(24px, 3.5vw, 44px);
    margin-bottom: 0.6em;
}

.closing-inner p {
    color: #4A1942;
    opacity: 0.85;
    margin-bottom: 1em;
}

.closing-domain {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(20px, 3vw, 36px);
    font-weight: 700;
    color: #A85C3B;
    letter-spacing: -0.01em;
    margin-top: 1.5em !important;
    opacity: 1 !important;
}

.closing-domain .dot {
    color: #4A1942;
}

/* ============================================================
   Hero Blob Animations
   ============================================================ */

/* Blob entrance: circle to organic shape morph */
@keyframes blobMorphIn {
    0% {
        opacity: 0;
        transform: scale(0.4);
        filter: blur(8px);
    }
    60% {
        opacity: 0.85;
        transform: scale(1.03);
        filter: blur(0px);
    }
    100% {
        opacity: 0.85;
        transform: scale(1);
        filter: blur(0px);
    }
}

.hero-blob.animate-in {
    animation: blobMorphIn 600ms ease-out forwards;
}

.hero-blob-2.animate-in {
    animation-delay: 300ms;
}

.hero-blob-3.animate-in {
    animation-delay: 600ms;
}

/* Title fade in */
.hero-title.animate-in {
    animation: titleFadeIn 600ms ease-out 1200ms forwards;
}

@keyframes titleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Connection lines draw */
.connection-line.animate-in {
    animation: drawLine 400ms ease-in-out forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

.connection-line.animate-in:nth-of-type(1) { animation-delay: 1200ms; }
.connection-line.animate-in:nth-of-type(2) { animation-delay: 1400ms; }
.connection-line.animate-in:nth-of-type(3) { animation-delay: 1600ms; }

/* Cultural circles pop in with spring easing */
@keyframes circlePopIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    70% {
        opacity: 1;
        transform: scale(1.12);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.culture-circle.animate-in {
    animation: circlePopIn 350ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Stagger for hero cultural circles */
.culture-circle-1.animate-in { animation-delay: 1800ms; }
.culture-circle-2.animate-in { animation-delay: 1900ms; }
.culture-circle-3.animate-in { animation-delay: 2000ms; }
.culture-circle-4.animate-in { animation-delay: 2100ms; }
.culture-circle-5.animate-in { animation-delay: 2200ms; }
.culture-circle-6.animate-in { animation-delay: 2300ms; }

/* Closing circle stagger */
.culture-circle-closing:nth-child(1).animate-in { animation-delay: 0ms; }
.culture-circle-closing:nth-child(2).animate-in { animation-delay: 100ms; }
.culture-circle-closing:nth-child(3).animate-in { animation-delay: 200ms; }
.culture-circle-closing:nth-child(4).animate-in { animation-delay: 300ms; }

/* ============================================================
   Blob Morph Transitions (used by JS)
   ============================================================ */

.market-blob.morphing {
    transition: clip-path 800ms ease-in-out, transform 400ms ease-out;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
    .market-blob-left,
    .market-blob-right,
    .market-blob-left-wide,
    .market-blob-center,
    .market-blob-right-narrow {
        width: 90%;
        margin-left: 5%;
        margin-right: 5%;
    }

    .market-blob {
        padding: 50px 35px;
    }

    .closing-blob {
        width: 90%;
        padding: 50px 35px;
    }

    .culture-circle-1 { top: 8%; left: 3%; }
    .culture-circle-2 { top: 10%; right: 3%; }
    .culture-circle-3 { bottom: 20%; left: 4%; }
    .culture-circle-4 { bottom: 10%; right: 3%; }
    .culture-circle-5 { top: 44%; right: 2%; }
    .culture-circle-6 { top: 52%; left: 2%; }

    .cultural-icons-closing {
        gap: 30px;
    }

    h1 {
        font-size: clamp(28px, 8vw, 48px);
    }

    h2 {
        font-size: clamp(22px, 5vw, 36px);
    }

    .culture-circle-inline {
        margin-left: 10% !important;
        margin-right: 10% !important;
    }
}

@media (max-width: 480px) {
    .market-blob {
        padding: 40px 25px;
    }

    .closing-blob {
        padding: 40px 25px;
    }

    .culture-circle {
        width: 44px;
        height: 44px;
    }

    .hero-tagline {
        font-size: clamp(12px, 3.5vw, 16px);
    }
}
