/* ===========================
   1. СБРОС И ПЕРЕМЕННЫЕ
   =========================== */

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

:root {
    --bg: #11131a;
    --bg-alt: #171922;
    --bg-card: #191b24;
    --accent: #ff6b2c;
    --accent-strong: #ff4b11;
    --text: #f9fafb;
    --muted: #9ca3af;
    --border: #242735;
}

/* ===========================
   2. ТЕМЫ (ночь / день)
   =========================== */

body.theme-dark {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1e2333 0, #0b0c10 55%);
    color: var(--text);
    line-height: 1.6;
}

body.theme-light {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
    background: #f5f6f9;
    color: #11131a;
    line-height: 1.6;
}

body.theme-light .section-dark {
    background: #ffffff;
    border-top: 1px solid #d1d5db;
    border-bottom: 1px solid #d1d5db;
}

body.theme-light .card,
body.theme-light .card-ghost,
body.theme-light .hero-chart-wrapper,
body.theme-light .metric-card,
body.theme-light .cta-block {
    background: #ffffff;
    border-color: #d1d5db;
}

/* ===========================
   3. ХЕДЕР
   =========================== */

.header {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 1250px;
    padding: 14px 22px;

    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(30px);
    border-radius: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    z-index: 999;
    transition: background 0.3s ease;
}

body.theme-light .header {
    background: rgba(255, 255, 255, 0.1);
}

.header .logo {
    font-weight: 800;
    letter-spacing: 0.16em;
    font-size: 14px;
}

nav a {
    margin: 0 14px;
    font-size: 14px;
    opacity: 0.8;
    color: inherit;
    text-decoration: none;
}

nav a:hover {
    opacity: 1;
    color: var(--accent);
}

.header-controls {
    display: flex;
    gap: 10px;
}

.header-btn {
    border: 0;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    color: inherit;
    transition: 0.3s;
    text-decoration: none;
}

body.theme-light .header-btn {
    background: rgba(0, 0, 0, 0.06);
}

/* ===========================
   4. HERO
   =========================== */

.hero {
    margin-top: 120px;
    padding: 64px 32px 32px;
}

.hero-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}

.hero-eyebrow {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.hero h1 {
    font-size: 40px;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-note {
    font-size: 13px;
    color: var(--muted);
}

/* ===========================
   5. HERO-ЧАРТ
   =========================== */

.hero-chart-wrapper {
    background: radial-gradient(circle at top, #24273a 0, #151724 70%);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 20px 20px 16px;
}

.hero-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 180px;
    gap: 10px;
}

.hero-bar {
    flex: 1;
    border-radius: 999px;
    background: rgba(15, 17, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.hero-bar-inner {
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(to top, var(--accent-strong), var(--accent));
}

/* ===========================
   6. СЕКЦИИ И КАРТОЧКИ
   =========================== */

.section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 48px 32px;
}

.section-dark {
    background: radial-gradient(circle at top, #171a27 0, #0d0f16 60%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section h2 {
    font-size: 28px;
    margin-bottom: 16px;
}

.lead {
    color: var(--muted);
    margin-bottom: 24px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* КАРТОЧКИ + ХОВЕР */
.card,
.card-ghost {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 18px 18px 16px;
    transition:
        transform 0.18s ease-out,
        box-shadow 0.18s ease-out,
        border-color 0.18s ease-out,
        background 0.18s ease-out;
}

.card-ghost {
    background: rgba(25, 27, 36, 0.8);
}

/* Общий hover */
.card:hover,
.card-ghost:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.22);
}

/* Тёмная тема — красивые тени */
body.theme-dark .card:hover,
body.theme-dark .card-ghost:hover {
    background: #202331;
    box-shadow:
        0 8px 20px rgba(78, 93, 157, 0.25),
        0 0 14px rgba(255, 107, 44, 0.10);
}

/* Светлая тема */
body.theme-light .card:hover,
body.theme-light .card-ghost:hover {
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
}

/* ===========================
   7. МЕТРИКИ (vertical bar chart + lazy animation)
   =========================== */

.metrics {
    margin-top: 32px;
}

.metrics-grid {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* узкая колонка-метрика */
.metric-card {
    background: transparent;
    border: none;
    padding: 0;
    width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
}

/* заголовок и значение сверху */
.metric-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
}

.metric-name {
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.metric-value {
    font-weight: 600;
}

/* сам столбик */
.metric-tube {
    position: relative;
    width: 34px;
    height: 140px;
    border-radius: 999px;
    padding: 3px;
    overflow: hidden;

    background: radial-gradient(circle at 20% 0%, #4a5269 0%, #1a1d28 70%);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.20),
        0 8px 18px rgba(0, 0, 0, 0.7);
}

/* “жидкость” столбика – начальное состояние (скрыта) */
.metric-tube-fill {
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff6b2c, #ff4b11);
    box-shadow:
        0 -3px 8px rgba(255, 255, 255, 0.2),
        0 5px 10px rgba(0, 0, 0, 0.7);
    height: 0;
}

/* класс, который добавляет JS, запускает анимацию */
.metric-tube-fill.metric-animate {
    animation: metric-fill 1.25s cubic-bezier(0.22, 0.61, 0.25, 1) forwards;
}

/* лёгкая поочерёдность заполнения */
.metrics-grid .metric-card:nth-child(1) .metric-tube-fill.metric-animate { animation-delay: 0.05s; }
.metrics-grid .metric-card:nth-child(2) .metric-tube-fill.metric-animate { animation-delay: 0.14s; }
.metrics-grid .metric-card:nth-child(3) .metric-tube-fill.metric-animate { animation-delay: 0.23s; }
.metrics-grid .metric-card:nth-child(4) .metric-tube-fill.metric-animate { animation-delay: 0.32s; }
.metrics-grid .metric-card:nth-child(5) .metric-tube-fill.metric-animate { animation-delay: 0.41s; }

/* диапазон под столбиком */
.metric-range {
    margin-top: 6px;
    font-size: 10px;
    color: var(--muted);
}

/* светлая тема для столбиков */
body.theme-light .metric-tube {
    background: radial-gradient(circle at 20% 0%, #e5e7f0 0, #151827 70%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 10px 18px rgba(148, 163, 184, 0.65);
}

/* плавный рост с лёгким овершутом */
@keyframes metric-fill {
    0%   { height: 0; }
    70%  { height: calc(var(--fill) + 8%); }
    100% { height: var(--fill); }
}

/* ===========================
   8. CTA-БЛОК И ФУТЕР
   =========================== */

.cta-block {
    max-width: 720px;
    margin: 80px auto 40px;
    text-align: center;
    padding: 40px 24px;
    background: radial-gradient(circle at top, #1f2234 0, #101118 70%);
    border-radius: 24px;
    border: 1px solid var(--border);
    /* лёгкая нейтральная тень, без свечения вокруг всего экрана */
    box-shadow: 0 18px 40px rgba(0, 0, 0, 1.1);
}

/* убираем анимацию блока при наведении */
.cta-block:hover {
    transform: none;
}

.cta-block p {
    color: var(--muted);
    margin: 8px 0 16px;
}

footer {
    padding: 20px 32px 28px;
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    text-align: center;
}

/* ===========================
   9. АДАПТИВ
   =========================== */

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .header {
        flex-direction: column;
        gap: 10px;
    }

    nav a {
        margin: 0 8px;
    }
}

/* ===========================
   10. FORM STYLES
   =========================== */

.contact-form {
    max-width: 480px;
    margin: 20px auto 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

body.theme-light .contact-form input,
body.theme-light .contact-form textarea {
    background: #fff;
    border-color: #d1d5db;
    color: #111;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255,107,44,0.3);
}

/* honeypot */
.hp-field {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

/* CTA-кнопка с анимацией */
.cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    /* тень от оранжевого свечения, а не чёрная */
    box-shadow: 0 12px 28px rgba(255, 107, 44, 0.15);
}

.cta:active {
    transform: translateY(0);
    filter: brightness(0.97);
    box-shadow: 0 6px 14px rgba(255, 107, 44, 0.65);
}

/* когда отправляем форму */
.contact-form.is-sending .cta {
    opacity: 0.7;
    pointer-events: none;
}

/* статус под формой */
.form-status {
    margin-top: 6px;
    font-size: 13px;
}

.form-status-success {
    color: #22c55e;
}

.form-status-error {
    color: #f87171;
}

/* график в верху страницы  */
.hero-chart-wrapper {
    background: radial-gradient(circle at top, #24273a 0, #151724 70%);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero-chart-inner {
    width: 100%;
    height: 260px; /* можно 280–320, если хочешь выше */
}

.hero-chart-inner canvas {
    width: 100% !important;
    height: 100% !important;
}

body.theme-light .chartjs-render-monitor {
    color: #0f172a !important; /* тёмный текст */
}

body.theme-light .chart-container canvas {
    background: #ffffff !important;
}

body.theme-dark .chart-container canvas {
    background: transparent !important;
}


/* ===== HERO CHART FULL-WIDTH ON MOBILE ===== */

/* обёртка графика (если нет – создай div.hero-chart-shell вокруг heroChart) */
.hero-chart-shell {
    max-width: 640px;
    margin: 0 auto;
}

