/* ============================================================
   opensource.bid — Playful Bidding Stage
   Palette: Warm sunset tones, glitch accents
   Typography: DM Sans + Space Grotesk
   ============================================================ */

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

:root {
    --warm-dark: #3A2818;
    --warm-brown: #5A4838;
    --sunset-orange: #D07040;
    --wave-amber: #D0A070;
    --warm-cream: #FFF4E8;
    --bid-white: #FFFAF2;
    --glitch-red: #D04040;
    --glitch-blue: #4040D0;
    --gradient-mid: #FFE8D8;
    --gradient-end: #FFF0E4;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    color: var(--warm-brown);
    background-color: var(--warm-cream);
    line-height: 1.8;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    overflow-x: hidden;
}

/* --- Wave Undercurrent (background layer) --- */
.wave-undercurrent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

.wave-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.wave-path--1 {
    animation: waveOscillate1 6s ease-in-out infinite;
}

.wave-path--2 {
    animation: waveOscillate2 8s ease-in-out infinite;
}

.wave-path--3 {
    animation: waveOscillate3 7s ease-in-out infinite;
}

@keyframes waveOscillate1 {
    0%, 100% { d: path("M0,60 C240,20 480,100 720,60 C960,20 1200,100 1440,60"); }
    50% { d: path("M0,60 C240,90 480,30 720,60 C960,90 1200,30 1440,60"); }
}

@keyframes waveOscillate2 {
    0%, 100% { d: path("M0,70 C240,30 480,110 720,70 C960,30 1200,110 1440,70"); }
    50% { d: path("M0,70 C240,100 480,40 720,70 C960,100 1200,40 1440,70"); }
}

@keyframes waveOscillate3 {
    0%, 100% { d: path("M0,50 C240,10 480,90 720,50 C960,10 1200,90 1440,50"); }
    50% { d: path("M0,50 C240,80 480,20 720,50 C960,80 1200,20 1440,50"); }
}

/* --- Underline-Draw Effect --- */
.underline-draw {
    background-image: linear-gradient(var(--sunset-orange), var(--sunset-orange));
    background-size: 0% 3px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 250ms ease;
    padding-bottom: 2px;
    cursor: default;
}

.underline-draw:hover {
    background-size: 100% 3px;
}

/* --- Glitch Effect Utility --- */
@keyframes glitchFlicker {
    0% { text-shadow: none; }
    20% { text-shadow: -2px 0 var(--glitch-red), 2px 0 var(--glitch-blue); }
    40% { text-shadow: 2px 0 var(--glitch-red), -2px 0 var(--glitch-blue); }
    60% { text-shadow: -1px 0 var(--glitch-blue), 1px 0 var(--glitch-red); }
    80% { text-shadow: 1px 0 var(--glitch-red), -1px 0 var(--glitch-blue); }
    100% { text-shadow: none; }
}

.glitch-active {
    animation: glitchFlicker 150ms linear;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--warm-cream) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
    padding: 4rem 2rem 2rem;
    z-index: 1;
}

.hero__content {
    max-width: 720px;
    width: 100%;
    text-align: center;
}

.hero__badge {
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--bid-white);
    background: var(--sunset-orange);
    padding: 0.35rem 1.2rem;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
    animation: pulseBadge 3s ease-in-out infinite;
}

@keyframes pulseBadge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.03); }
}

.hero__title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 6vw, 5rem);
    color: var(--warm-dark);
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero__title-accent {
    color: var(--sunset-orange);
}

.hero__tagline {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--warm-brown);
    max-width: 500px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

/* --- Featured Bid Card --- */
.hero__featured-bid {
    background: var(--bid-white);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    text-align: left;
    box-shadow: 0 8px 40px rgba(58, 40, 24, 0.08);
    border: 1px solid rgba(208, 112, 64, 0.15);
    position: relative;
    overflow: hidden;
}

.hero__featured-bid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--sunset-orange), var(--wave-amber), var(--sunset-orange));
    background-size: 200% 100%;
    animation: shimmerBar 3s linear infinite;
}

@keyframes shimmerBar {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.featured-bid__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.featured-bid__label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--wave-amber);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.featured-bid__status {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: #3a8a3a;
    background: #e8f5e8;
    padding: 0.2rem 0.8rem;
    border-radius: 1rem;
}

.featured-bid__project {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    color: var(--warm-dark);
    margin-bottom: 0.5rem;
}

.featured-bid__description {
    font-size: 0.95rem;
    color: var(--warm-brown);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.featured-bid__amount-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.featured-bid__current,
.featured-bid__time,
.featured-bid__bidders {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.featured-bid__current-label,
.featured-bid__time-label,
.featured-bid__bidders-label {
    font-size: 0.75rem;
    color: var(--wave-amber);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.featured-bid__current-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--sunset-orange);
    line-height: 1.2;
}

.featured-bid__time-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--warm-dark);
    line-height: 1.2;
}

.featured-bid__bidders-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--warm-dark);
    line-height: 1.2;
}

/* --- Wave Separator --- */
.wave-separator {
    width: 100%;
    height: 60px;
    position: relative;
    overflow: hidden;
}

.wave-separator .wave-svg {
    height: 100%;
}

.wave-path--sep1 {
    animation: waveSep1 6s ease-in-out infinite;
}

.wave-path--sep2 {
    animation: waveSep2 8s ease-in-out infinite;
}

@keyframes waveSep1 {
    0%, 100% { d: path("M0,40 C360,10 720,70 1080,40 C1260,25 1380,55 1440,40"); }
    50% { d: path("M0,40 C360,65 720,15 1080,40 C1260,55 1380,25 1440,40"); }
}

@keyframes waveSep2 {
    0%, 100% { d: path("M0,50 C360,20 720,80 1080,50 C1260,35 1380,65 1440,50"); }
    50% { d: path("M0,50 C360,75 720,25 1080,50 C1260,65 1380,35 1440,50"); }
}

.wave-path--mid1 {
    animation: waveMid1 6s ease-in-out infinite;
}

.wave-path--mid2 {
    animation: waveMid2 7s ease-in-out infinite;
}

@keyframes waveMid1 {
    0%, 100% { d: path("M0,30 C480,5 960,55 1440,30"); }
    50% { d: path("M0,30 C480,55 960,5 1440,30"); }
}

@keyframes waveMid2 {
    0%, 100% { d: path("M0,35 C480,10 960,60 1440,35"); }
    50% { d: path("M0,35 C480,60 960,10 1440,35"); }
}

.wave-path--bot1 {
    animation: waveBot1 6s ease-in-out infinite;
}

@keyframes waveBot1 {
    0%, 100% { d: path("M0,30 C360,55 720,5 1080,30 C1260,43 1380,17 1440,30"); }
    50% { d: path("M0,30 C360,5 720,55 1080,30 C1260,17 1380,43 1440,30"); }
}

/* ============================================================
   BIDS SECTION
   ============================================================ */
.bids-section {
    position: relative;
    z-index: 1;
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: var(--warm-dark);
    margin-bottom: 0.75rem;
}

.section-subtitle {
    text-align: center;
    color: var(--warm-brown);
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    margin-bottom: 3rem;
    opacity: 0.8;
}

.bids-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* --- Bid Card --- */
.bid-card {
    background: var(--bid-white);
    border-radius: 14px;
    padding: 1.75rem;
    border: 1px solid rgba(208, 160, 112, 0.2);
    transition: transform 300ms ease, box-shadow 300ms ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.bid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(58, 40, 24, 0.1);
}

.bid-card__tag {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sunset-orange);
    background: rgba(208, 112, 64, 0.1);
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.bid-card__name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--warm-dark);
    margin-bottom: 0.5rem;
    display: inline;
}

.bid-card__desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--warm-brown);
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.bid-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.bid-card__amount {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--sunset-orange);
}

.bid-card__count {
    font-size: 0.8rem;
    color: var(--wave-amber);
    font-weight: 500;
}

.bid-card__bar {
    width: 100%;
    height: 4px;
    background: rgba(208, 160, 112, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.bid-card__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sunset-orange), var(--wave-amber));
    border-radius: 2px;
    transition: width 600ms ease;
}

/* ============================================================
   HOW IT WORKS SECTION
   ============================================================ */
.how-section {
    position: relative;
    z-index: 1;
    padding: 3rem 2rem 5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.steps-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.step-item {
    flex: 0 1 260px;
    text-align: center;
    padding: 1rem;
}

.step-item__number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--sunset-orange);
    line-height: 1;
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.step-item__title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--warm-dark);
    margin-bottom: 0.5rem;
}

.step-item__text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--warm-brown);
}

.step-path {
    flex: 0 0 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
}

.step-path svg {
    width: 60px;
    height: 4px;
}

/* ============================================================
   ACTIVITY SECTION
   ============================================================ */
.activity-section {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(208, 160, 112, 0.15);
    transition: background 200ms ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: rgba(255, 244, 232, 0.5);
}

.activity-item__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sunset-orange), var(--wave-amber));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.activity-item__content {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
}

.activity-item__user {
    font-weight: 500;
    color: var(--warm-dark);
}

.activity-item__amount {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--sunset-orange);
}

.activity-item__project {
    font-weight: 500;
    color: var(--warm-dark);
}

.activity-item__time {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--wave-amber);
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================================
   STATS SECTION
   ============================================================ */
.stats-section {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem 5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-item__value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--warm-dark);
    line-height: 1.1;
}

.stat-item__label {
    font-size: 0.85rem;
    color: var(--wave-amber);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    position: relative;
    z-index: 1;
    background: var(--warm-dark);
    color: var(--warm-cream);
    padding: 3rem 2rem 2rem;
}

.footer__content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.footer__brand {
    margin-bottom: 1.5rem;
}

.footer__logo {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--warm-cream);
}

.footer__logo-accent {
    color: var(--sunset-orange);
}

.footer__tagline {
    font-size: 0.85rem;
    color: var(--wave-amber);
    margin-top: 0.3rem;
    line-height: 1.6;
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.footer__link {
    font-size: 0.9rem;
    color: var(--warm-cream);
    cursor: pointer;
    transition: color 200ms ease;
    background-image: linear-gradient(var(--sunset-orange), var(--sunset-orange));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    padding-bottom: 2px;
}

.footer__link:hover {
    color: var(--sunset-orange);
    background-size: 100% 2px;
}

.footer__copy {
    font-size: 0.75rem;
    color: var(--wave-amber);
    opacity: 0.6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 1.25rem 2rem;
    }

    .hero__featured-bid {
        padding: 1.5rem;
    }

    .featured-bid__amount-row {
        gap: 1.2rem;
    }

    .featured-bid__current-value,
    .featured-bid__time-value,
    .featured-bid__bidders-value {
        font-size: 1.4rem;
    }

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

    .steps-row {
        flex-direction: column;
        align-items: center;
    }

    .step-path {
        transform: rotate(90deg);
        padding-top: 0;
    }

    .activity-item {
        flex-wrap: wrap;
    }

    .activity-item__time {
        width: 100%;
        margin-left: 56px;
        margin-top: -0.25rem;
    }

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

    .footer__links {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .featured-bid__amount-row {
        flex-direction: column;
        gap: 1rem;
    }

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