/* footprint.market - Scandinavian Functional Carbon Offset Marketplace */

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

:root {
    --warm-off-white: #FAFAF5;
    --pure-white: #FFFFFF;
    --deep-pine: #2D4A3E;
    --sage-green: #5A8A70;
    --soft-sage: #D4E7D0;
    --muted-border: #C8D8C4;
    --pill-bg: #EDF5ED;
    --card-border: #E8EDE6;
    --footer-dark: #1A3028;
    --mist-text: #8A9E90;
    --forest: #B8D4B0;
    --ocean: #A8C8D8;
    --agriculture: #D4C8A0;
    --renewable: #C8D0B0;
    --methane: #C4B8A8;
    --soil: #C8B8A0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1vw, 1rem);
    line-height: 1.75;
    background-color: var(--pure-white);
    color: var(--deep-pine);
    overflow-x: hidden;
    transition: background-color 200ms ease;
}

body.loaded {
    background-color: var(--warm-off-white);
}

/* ==================== HERO ==================== */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--warm-off-white);
    overflow: hidden;
}

.hero-blob {
    position: absolute;
    width: 60vmin;
    height: 60vmin;
    background: var(--soft-sage);
    border-radius: 50%;
    animation: blobMorph 8s ease-in-out infinite;
    opacity: 0;
    transition: opacity 600ms ease, border-radius 600ms ease;
}

body.loaded .hero-blob {
    opacity: 1;
}

@keyframes blobMorph {
    0%, 100% {
        border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    }
    50% {
        border-radius: 55% 45% 40% 60% / 45% 55% 50% 40%;
    }
}

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

.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.title-main {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--deep-pine);
    line-height: 1.1;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 400ms ease, transform 400ms ease;
}

body.loaded .title-main {
    opacity: 1;
    transform: translateY(0);
}

.title-tld {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--sage-green);
    line-height: 1.1;
    opacity: 0;
    transition: opacity 300ms ease 400ms;
}

body.loaded .title-tld {
    opacity: 1;
}

.search-bar {
    margin-top: 2rem;
    width: 50vw;
    max-width: 600px;
    min-width: 280px;
    height: 56px;
    border: 2px solid var(--muted-border);
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 300ms ease 700ms, transform 300ms ease 700ms;
}

body.loaded .search-bar {
    opacity: 1;
    transform: translateY(0);
}

.search-placeholder {
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--mist-text);
    font-weight: 400;
}

/* ==================== CATEGORIES ==================== */
#categories {
    padding: 2rem 0;
    background: var(--warm-off-white);
}

.category-ribbon {
    display: flex;
    gap: 12px;
    padding: 0 clamp(1rem, 4vw, 3rem);
    overflow-x: auto;
    white-space: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.category-ribbon::-webkit-scrollbar {
    display: none;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--pill-bg);
    border: 1px solid var(--muted-border);
    border-radius: 20px;
    padding: 8px 20px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--deep-pine);
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
    opacity: 0;
    transform: translateY(8px);
    flex-shrink: 0;
}

.pill.visible {
    opacity: 1;
    transform: translateY(0);
    transition: background 200ms ease, color 200ms ease, opacity 300ms ease, transform 300ms ease;
}

.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--deep-pine);
    transition: background 200ms ease;
}

.pill:hover,
.pill.active {
    background: var(--deep-pine);
    color: var(--warm-off-white);
}

.pill:hover .pill-dot,
.pill.active .pill-dot {
    background: var(--warm-off-white);
}

/* ==================== LISTING GRID ==================== */
#listings {
    padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 4vw, 3rem);
    background: var(--warm-off-white);
}

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.listing-card {
    background: var(--pure-white);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 300ms ease, box-shadow 300ms ease;
    opacity: 0;
    transform: translateY(20px);
}

.listing-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: transform 300ms ease, box-shadow 300ms ease, opacity 400ms ease;
}

.listing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.card-band {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 200ms ease;
}

.listing-card:hover .card-band {
    filter: brightness(1.05);
}

.card-band.forest { background: var(--forest); }
.card-band.ocean { background: var(--ocean); }
.card-band.agriculture { background: var(--agriculture); }
.card-band.renewable { background: var(--renewable); }
.card-band.methane { background: var(--methane); }
.card-band.soil { background: var(--soil); }

.card-icon {
    width: 24px;
    height: 24px;
    opacity: 0.6;
    transition: transform 200ms ease;
}

.listing-card:hover .card-icon {
    transform: scale(1.1);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    color: var(--deep-pine);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-desc {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
    color: var(--sage-green);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.card-price {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--deep-pine);
}

/* ==================== IMPACT COUNTER ==================== */
#impact {
    background: var(--deep-pine);
    padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 4vw, 3rem);
}

.impact-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(2rem, 6vw, 6rem);
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.impact-stat {
    text-align: center;
}

.impact-number {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--soft-sage);
    display: block;
    line-height: 1.1;
}

.impact-label {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--mist-text);
    display: block;
    margin-top: 0.5rem;
}

/* ==================== FOOTER ==================== */
#footer {
    background: var(--footer-dark);
    padding: 3rem 2rem 2rem;
    text-align: center;
    position: relative;
}

.footer-hills {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    transform: translateY(-50%);
}

.hills-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease;
}

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

.footer-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: #8FBC8B;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .impact-row {
        flex-direction: column;
        gap: 2rem;
    }

    .search-bar {
        width: 80vw;
    }

    .listing-grid {
        grid-template-columns: 1fr;
    }
}
