/* ============================================================
   DESH FUNDING — STATS.CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
    --s-green: #1a9e63;
    --s-green-dark: #0f6340;
    --s-green-deep: #062e1f;
    --s-green-glow: rgba(26, 158, 99, 0.22);
    --s-gold: #f59e0b;
    --s-gold-dark: #d97706;
    --s-gold-glow: rgba(245, 158, 11, 0.18);
    --s-teal: #0d9488;
    --s-teal-glow: rgba(13, 148, 136, 0.18);
    --s-emerald: #10b981;
    --s-emerald-glow: rgba(16, 185, 129, 0.18);
    --s-white: #ffffff;
    --s-text: rgba(255, 255, 255, 0.88);
    --s-muted: rgba(255, 255, 255, 0.45);
    --s-border: rgba(255, 255, 255, 0.07);
    --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1.0);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1.0);
}

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

body {
    font-family: 'DM Sans', system-ui, sans-serif;
}

/* ============================================================
   1. SECTION
   ============================================================ */
.stats {
    position: relative;
    background: linear-gradient(180deg, #041f12 0%, #031510 40%, #041f12 100%);
    overflow: hidden;
    isolation: isolate;
}

/* ── Top wave ── */
.stats__wave-top {
    line-height: 0;
    margin-bottom: -2px;
}

.stats__wave-top svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* ── Bottom wave ── */
.stats__wave-bottom {
    line-height: 0;
    margin-top: -2px;
}

.stats__wave-bottom svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* ============================================================
   2. BACKGROUND
   ============================================================ */
.stats__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.stats__bg-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.stats__bg-glow--left {
    top: -100px;
    left: -120px;
    background: radial-gradient(circle, rgba(26, 158, 99, 0.12) 0%, transparent 70%);
}

.stats__bg-glow--right {
    bottom: -100px;
    right: -120px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
}

.stats__bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(26, 158, 99, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 158, 99, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 30%, transparent 100%);
}

/* ============================================================
   3. CONTAINER
   ============================================================ */
.stats__container {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: 0 auto;
    padding: 3.5rem 2rem 4rem;
}

/* ============================================================
   4. SECTION LABEL
   ============================================================ */
.stats__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    opacity: 1;
}

.stats__label-line {
    flex: 1;
    max-width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(26, 158, 99, 0.4));
}

.stats__label-line:last-child {
    background: linear-gradient(90deg, rgba(26, 158, 99, 0.4), transparent);
}

.stats__label-text {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--s-green);
    white-space: nowrap;
}

/* ============================================================
   5. GRID
   ============================================================ */
.stats__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* ============================================================
   6. CARD
   ============================================================ */
.stats__card {
    position: relative;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--s-border);
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition:
        transform 0.3s var(--ease-out),
        box-shadow 0.3s var(--ease-out),
        border-color 0.3s var(--ease-out);
    cursor: default;
}

.stats__card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.13);
}

.stats__card:hover .stats__card-glow {
    opacity: 1;
}

.stats__card:hover .stats__icon-ring {
    transform: scale(1.35);
    opacity: 0;
}

/* Card inner */
.stats__card-inner {
    position: relative;
    z-index: 2;
    padding: 1.75rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Glow blob behind card */
.stats__card-glow {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
    z-index: 1;
}

.stats__card-glow--green {
    background: radial-gradient(circle at 30% 30%, rgba(26, 158, 99, 0.14) 0%, transparent 65%);
}

.stats__card-glow--gold {
    background: radial-gradient(circle at 30% 30%, rgba(245, 158, 11, 0.12) 0%, transparent 65%);
}

.stats__card-glow--teal {
    background: radial-gradient(circle at 30% 30%, rgba(13, 148, 136, 0.13) 0%, transparent 65%);
}

.stats__card-glow--emerald {
    background: radial-gradient(circle at 30% 30%, rgba(16, 185, 129, 0.13) 0%, transparent 65%);
}

/* Top accent line */
.stats__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 20px 20px 0 0;
    opacity: 0.7;
    z-index: 3;
}

.stats__card:nth-child(1)::before {
    background: linear-gradient(90deg, var(--s-green), transparent);
}

.stats__card:nth-child(2)::before {
    background: linear-gradient(90deg, var(--s-gold), transparent);
}

.stats__card:nth-child(3)::before {
    background: linear-gradient(90deg, var(--s-teal), transparent);
}

.stats__card:nth-child(4)::before {
    background: linear-gradient(90deg, var(--s-emerald), transparent);
}

/* ── Icon wrap ── */
.stats__icon-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stats__icon-wrap--green {
    background: rgba(26, 158, 99, 0.18);
    color: #4ade80;
}

.stats__icon-wrap--gold {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

.stats__icon-wrap--teal {
    background: rgba(13, 148, 136, 0.18);
    color: #5eead4;
}

.stats__icon-wrap--emerald {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
}

.stats__icon {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 2;
}

.stats__icon-ring {
    position: absolute;
    inset: -4px;
    border-radius: 18px;
    border: 1.5px solid currentColor;
    opacity: 0.3;
    transition: transform 0.4s var(--ease-out), opacity 0.4s var(--ease-out);
}

/* ── Body ── */
.stats__body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* ── Value row ── */
.stats__value-row {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    line-height: 1;
}

.stats__prefix {
    font-family: serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--s-green);
    line-height: 1;
}

.stats__value {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 700;
    color: var(--s-white);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s;
}

.stats__card:nth-child(2) .stats__value {
    color: #fef3c7;
}

.stats__card:nth-child(3) .stats__value {
    color: #ccfbf1;
}

.stats__card:nth-child(4) .stats__value {
    color: #d1fae5;
}

/* suffix is rendered by JS inside .stats__value as a span */
.stats__value .stats__suffix {
    font-size: 0.5em;
    font-weight: 600;
    letter-spacing: 0;
    vertical-align: middle;
    margin-left: 0.05em;
    font-family: 'DM Sans', sans-serif;
}

/* ── Title ── */
.stats__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

/* ── Progress bar ── */
.stats__bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.stats__bar-fill {
    height: 100%;
    border-radius: 99px;
    width: 0%;
    transition: width 1.4s var(--ease-out);
}

.stats__bar-fill--green {
    background: linear-gradient(90deg, var(--s-green), #4ade80);
}

.stats__bar-fill--gold {
    background: linear-gradient(90deg, var(--s-gold), #fcd34d);
}

.stats__bar-fill--teal {
    background: linear-gradient(90deg, var(--s-teal), #5eead4);
}

/* ── Sub text ── */
.stats__sub {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* ── Circular ring (card 4) ── */
.stats__ring-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.15rem;
}

.stats__ring {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    transform: rotate(-90deg);
}

.stats__ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 4;
}

.stats__ring-fill {
    fill: none;
    stroke: url(#ringGradient);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 138.23;
    /* 2π×22 */
    stroke-dashoffset: 138.23;
    transition: stroke-dashoffset 1.6s var(--ease-out);
}

.stats__ring-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6ee7b7;
    letter-spacing: 0.02em;
}

/* SVG gradient defs — injected via CSS trick using a hidden SVG */

/* ============================================================
   7. TICKER
   ============================================================ */
.stats__ticker {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    overflow: hidden;
    opacity: 1;
}

.stats__ticker-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--s-green);
    white-space: nowrap;
    flex-shrink: 0;
    padding-right: 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.stats__ticker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--s-green);
    box-shadow: 0 0 8px var(--s-green);
    animation: tickerPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.stats__ticker-track {
    overflow: hidden;
    flex: 1;
    height: 1.4rem;
    position: relative;
}

.stats__ticker-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats__ticker-list li {
    height: 1.4rem;
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    font-family: 'DM Sans', sans-serif;
}

.stats__ticker-list li strong {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* ============================================================
   8. ENTRY ANIMATIONS
   ============================================================ */
[data-stats-animate] {
    opacity: 1;
    transform: translateY(0);
}

.stats--animate [data-stats-animate] {
    opacity: 0;
    transform: translateY(32px);
    animation: statsUp 0.65s var(--ease-out) forwards;
}

[data-delay="0"] {
    animation-delay: 0.05s !important;
}

[data-delay="1"] {
    animation-delay: 0.18s !important;
}

[data-delay="2"] {
    animation-delay: 0.31s !important;
}

[data-delay="3"] {
    animation-delay: 0.44s !important;
}

[data-delay="4"] {
    animation-delay: 0.58s !important;
}

/* ============================================================
   9. KEYFRAMES
   ============================================================ */
@keyframes statsUp {
    from {
        opacity: 0;
        transform: translateY(32px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tickerPulse {

    0%,
    100% {
        box-shadow: 0 0 5px var(--s-green);
    }

    50% {
        box-shadow: 0 0 14px var(--s-green), 0 0 28px var(--s-green);
    }
}

@keyframes countUp {
    from {
        opacity: 0.4;
    }

    to {
        opacity: 1;
    }
}

/* ============================================================
   10. RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .stats__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .stats__container {
        padding: 2.5rem 1.25rem 3rem;
    }

    .stats__grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.85rem;
    }

    .stats__card-inner {
        padding: 1.25rem 1.1rem 1.1rem;
        gap: 0.75rem;
    }

    .stats__value {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
    }

    .stats__label {
        margin-bottom: 2rem;
    }

    .stats__ticker {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.9rem 1rem;
    }

    .stats__ticker-label {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-right: 0;
        padding-bottom: 0.4rem;
        width: 100%;
    }

    .stats__ticker-track {
        width: 100%;
    }

    .stats__ticker-list li {
        font-size: 0.76rem;
    }
}

@media (max-width: 420px) {
    .stats__grid {
        grid-template-columns: 1fr;
    }

    .stats__card-inner {
        flex-direction: row;
        align-items: flex-start;
    }

    .stats__icon-wrap {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }
}

/* ============================================================
   11. SVG ring gradient (injected inline)
   ============================================================ */
.stats__svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}