/* ============================================
   Screen 3m: Метрики
   Prefix: .s3m-
   ============================================ */

/* === Section wrapper === */
.s3m-section {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 40px 60px;
    scroll-margin-top: var(--nav-height);
    box-sizing: border-box;
}

/* === Section header === */
.s3m-header {
    text-align: center;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1)),
                transform 0.6s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1));
}

.s3m-header.s3m-visible {
    opacity: 1;
    transform: translateY(0);
}

.s3m-header__title {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 0 auto 12px;
    max-width: 700px;
}

.s3m-header__subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 auto;
    line-height: 1.6;
}

/* === Compare wrapper (single full-width panel) === */
.s3m-compare {
    width: 100%;
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1)),
                transform 0.7s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1));
}

.s3m-compare.s3m-visible {
    opacity: 1;
    transform: translateY(0);
}

/* === After panel (full width, no split) === */
.s3m-compare__panel {
    border-radius: 16px;
    padding: 24px;
    position: relative;
}

.s3m-compare__panel--after,
.s3m-compare__panel--full {
    background: rgba(18, 18, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    width: 100%;
    box-sizing: border-box;
}

/* === 4-column metrics grid === */
.s3m-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
}

/* === Column === */
.s3m-col {
    display: flex;
    flex-direction: column;
}

/* Column headers: plain white text, no background, no border */
.s3m-col__header {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding: 0;
    display: block;
    background: none;
    border: none;
    border-radius: 0;
    text-transform: none;
    letter-spacing: normal;
}

/* === Cards list === */
.s3m-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* === Base card === */
.s3m-card {
    border-radius: 10px;
    padding: 10px 14px;
    transition: transform 0.2s ease, opacity 0.5s ease;
    opacity: 0;
    transform: translateY(10px);
    box-sizing: border-box;
}

.s3m-card.s3m-visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Colored card variants === */
.s3m-card--green {
    background: rgba(87, 243, 87, 0.15);
    border: 1px solid rgba(87, 243, 87, 0.3);
}

.s3m-card--red {
    background: rgba(255, 77, 77, 0.25);
    border: 1px solid rgba(255, 77, 77, 0.4);
}

.s3m-card--blue {
    background: rgba(100, 140, 255, 0.15);
    border: 1px solid rgba(100, 140, 255, 0.3);
}

.s3m-card--amber {
    background: rgba(255, 200, 50, 0.15);
    border: 1px solid rgba(255, 200, 50, 0.3);
}

/* === Card content === */
.s3m-card__name {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.3;
    margin-bottom: 4px;
    font-weight: 500;
}

.s3m-card__value {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

/* === Light theme overrides === */
:root.light-theme .s3m-compare__panel--after,
:root.light-theme .s3m-compare__panel--full {
    background: rgba(240, 240, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.08);
}

:root.light-theme .s3m-card__name {
    color: rgba(0, 0, 0, 0.75);
}

:root.light-theme .s3m-card__value {
    color: rgba(0, 0, 0, 0.9);
}

/* === Responsive: tablet (900px) — 2-column grid === */
@media (max-width: 900px) {
    .s3m-section {
        padding: 60px 24px 40px;
    }

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

/* === Responsive: mobile (480px) — 1-column grid === */
@media (max-width: 480px) {
    .s3m-section {
        padding: 48px 16px 32px;
    }

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

    .s3m-header__title {
        font-size: 1.6rem;
    }
}

/* Featured metric cards — larger font */
.s3m-card--featured {
    padding: 14px 18px;
}
.s3m-card--featured .s3m-card__name {
    font-size: 0.8rem;
}
.s3m-card--featured .s3m-card__value {
    font-size: 1.8rem;
    font-weight: 900;
}

/* Inline card row (2 cards side by side) */
.s3m-card-row {
    display: flex;
    gap: 6px;
}
.s3m-card--half {
    flex: 1;
    min-width: 0;
}

/* ===== Light Theme Overrides ===== */
:root.light-theme .s3m-card--green {
    background: rgba(20,170,20,0.1);
    border-color: rgba(20,170,20,0.2);
}

:root.light-theme .s3m-card--green .s3m-card__value {
    color: #0d8a0d;
}

:root.light-theme .s3m-card--green .s3m-card__name {
    color: #333;
}

:root.light-theme .s3m-card--red {
    background: rgba(255,77,77,0.1);
    border-color: rgba(255,77,77,0.2);
}

:root.light-theme .s3m-card--red .s3m-card__value {
    color: #cc3333;
}

:root.light-theme .s3m-card--red .s3m-card__name {
    color: #333;
}

:root.light-theme .s3m-card--blue {
    background: rgba(68,85,204,0.1);
    border-color: rgba(68,85,204,0.2);
}

:root.light-theme .s3m-card--blue .s3m-card__value {
    color: #4455cc;
}

:root.light-theme .s3m-card--blue .s3m-card__name {
    color: #333;
}

:root.light-theme .s3m-card--amber {
    background: rgba(200,150,0,0.1);
    border-color: rgba(200,150,0,0.2);
}

:root.light-theme .s3m-card--amber .s3m-card__value {
    color: #996600;
}

:root.light-theme .s3m-card--amber .s3m-card__name {
    color: #333;
}

:root.light-theme .s3m-col__header {
    color: #1a1a2e;
}
