/* =============================================================
   Phoenixedu Stats Section v2.0 — Editorial Design
   BEM + CSS Custom Properties + Dark Mode + Responsive
   ============================================================= */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500;1,600&family=Be+Vietnam+Pro:wght@400;500;600&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
.pxedu-stats {
    /* Brand palette */
    --pxedu-bg:         #F4EDE2;
    --pxedu-surface:    #EBE3D5;
    --pxedu-text:       #1A1410;
    --pxedu-text-2:     #7A6E62;
    --pxedu-text-3:     #A89D93;
    --pxedu-accent:     #9B3A26;
    --pxedu-rule:       #CFC5B4;

    /* Typography */
    --pxedu-serif: 'Cormorant Garamond', Georgia, 'Palatino Linotype', Palatino, serif;
    --pxedu-sans:  'Be Vietnam Pro', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

    /* Easing */
    --pxedu-ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
    --pxedu-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .pxedu-stats {
        --pxedu-bg:      #1C1714;
        --pxedu-surface: #252018;
        --pxedu-text:    #F0E8DC;
        --pxedu-text-2:  #9A9080;
        --pxedu-text-3:  #6A6055;
        --pxedu-accent:  #D4634C;
        --pxedu-rule:    #3A342C;
    }
}

/* ── Block ────────────────────────────────────────────────── */
.pxedu-stats {
    position: relative;
    overflow: hidden;
    background: var(--pxedu-bg);
    padding: clamp(64px, 9vw, 112px) clamp(28px, 7vw, 96px) clamp(72px, 10vw, 120px);
    font-family: var(--pxedu-sans);
}

/* ── Decorative art (concentric circles) ─────────────────── */
.pxedu-stats__art {
    position: absolute;
    right: -80px;
    top: -80px;
    width: clamp(260px, 35vw, 440px);
    height: clamp(260px, 35vw, 440px);
    color: var(--pxedu-accent);
    opacity: .055;
    pointer-events: none;
    /* no animation — purposefully static for refinement */
}

.pxedu-stats__art svg {
    width: 100%;
    height: 100%;
}

/* ── Header block ─────────────────────────────────────────── */
.pxedu-stats__header {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin-bottom: clamp(44px, 6vw, 72px);
}

/* Tag / eyebrow */
.pxedu-stats__tag {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--pxedu-accent);
    font-weight: 600;
    margin: 0 0 22px;
}

.pxedu-stats__tag-rule {
    display: block;
    width: 28px;
    height: 1px;
    background: var(--pxedu-accent);
    flex-shrink: 0;
}

/* Heading */
.pxedu-stats__title {
    font-family: var(--pxedu-serif);
    font-size: clamp(30px, 4.5vw, 52px);
    font-weight: 500;
    color: var(--pxedu-text);
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin: 0 0 22px;
}

.pxedu-stats__title em {
    font-style: italic;
    color: var(--pxedu-accent);
    font-weight: 500;
}

/* Description */
.pxedu-stats__description {
    font-size: 15px;
    line-height: 1.75;
    color: var(--pxedu-text-2);
    margin: 0;
    max-width: 480px;
}

/* ── Horizontal rule ──────────────────────────────────────── */
.pxedu-stats__divider {
    border: none;
    border-top: .5px solid var(--pxedu-rule);
    margin-bottom: clamp(40px, 5vw, 60px);
    position: relative;
    z-index: 1;
}

/* ── Stats row ────────────────────────────────────────────── */
.pxedu-stats__row {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr .5px 1fr .5px 1fr;
    align-items: start;
}

/* ── Vertical separator ───────────────────────────────────── */
.pxedu-stats__vsep {
    background: var(--pxedu-rule);
    align-self: stretch;
    min-height: 120px;
}

/* ── Individual stat ──────────────────────────────────────── */
.pxedu-stats__stat {
    padding: 0 clamp(28px, 3.5vw, 52px) 0 0;
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity  .65s var(--pxedu-ease-out),
        transform .65s var(--pxedu-ease-out);
}

.pxedu-stats__stat--2 {
    padding: 0 clamp(28px, 3.5vw, 52px);
    transition-delay: .12s;
}

.pxedu-stats__stat--3 {
    padding: 0 0 0 clamp(28px, 3.5vw, 52px);
    transition-delay: .24s;
}

/* Revealed state */
.pxedu-stats__stat.is-visible {
    opacity: 1;
    transform: none;
}

/* ── Number row ───────────────────────────────────────────── */
.pxedu-stats__num-row {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    line-height: 1;
    margin-bottom: 14px;
    overflow: hidden;
}

.pxedu-stats__num {
    font-family: var(--pxedu-serif);
    font-size: clamp(44px, 6.5vw, 76px);
    font-weight: 500;
    color: var(--pxedu-text);
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.pxedu-stats__suf {
    font-family: var(--pxedu-serif);
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 500;
    color: var(--pxedu-accent);
    line-height: 1;
    padding-bottom: .1em;
}

/* ── Label ────────────────────────────────────────────────── */
.pxedu-stats__label {
    font-size: 10.5px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--pxedu-text-2);
    font-weight: 600;
    margin: 0 0 6px;
}

/* ── Meta text ────────────────────────────────────────────── */
.pxedu-stats__meta {
    font-size: 13px;
    color: var(--pxedu-text-3);
    margin: 0;
    line-height: 1.5;
}

/* ── Progress bar ─────────────────────────────────────────── */
.pxedu-stats__bar-wrap {
    margin-top: 18px;
    height: 2px;
    background: var(--pxedu-rule);
    border-radius: 2px;
    overflow: hidden;
}

.pxedu-stats__bar {
    height: 100%;
    background: var(--pxedu-accent);
    border-radius: 2px;
    width: 0;
    transition: width 1.6s var(--pxedu-ease-out);
}

/* ── Responsive ───────────────────────────────────────────── */

/* Tablet — shrink number sizes */
@media (max-width: 860px) {
    .pxedu-stats__row {
        grid-template-columns: 1fr .5px 1fr .5px 1fr;
    }
    .pxedu-stats__stat,
    .pxedu-stats__stat--2,
    .pxedu-stats__stat--3 {
        padding-left: 20px;
        padding-right: 20px;
    }
    .pxedu-stats__stat--1 {
        padding-left: 0;
    }
    .pxedu-stats__stat--3 {
        padding-right: 0;
    }
}

/* Mobile — single column */
@media (max-width: 600px) {
    .pxedu-stats__art { display: none; }

    .pxedu-stats__row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .pxedu-stats__vsep {
        display: none;
    }

    .pxedu-stats__stat,
    .pxedu-stats__stat--2,
    .pxedu-stats__stat--3 {
        padding: 32px 0 0;
        border-top: .5px solid var(--pxedu-rule);
    }

    .pxedu-stats__stat--1 {
        padding-top: 0;
        border-top: none;
    }
}

/* ── Accessibility: reduced motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .pxedu-stats__stat {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .pxedu-stats__bar {
        transition: none;
    }
}
