/* =========================================================
   STYLE.CSS — Переменные, сброс, типографика, утилиты
   ========================================================= */

/* ---------------------------------------------------------
   Self-hosted fonts (WOFF2, latin + cyrillic subsets)
   --------------------------------------------------------- */

/* DM Sans — variable font (300–700), latin + latin-ext */
@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/dm-sans-lat-ext.woff2") format("woff2");
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/dm-sans-lat.woff2") format("woff2");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "DM Sans";
    font-style: italic;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/dm-sans-italic-lat-ext.woff2") format("woff2");
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "DM Sans";
    font-style: italic;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/dm-sans-italic-lat.woff2") format("woff2");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Oswald — variable font (400–700), latin + cyrillic */
@font-face {
    font-family: "Oswald";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/oswald-cyr-ext.woff2") format("woff2");
    unicode-range:
        U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: "Oswald";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/oswald-cyr.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Oswald";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/oswald-lat-ext.woff2") format("woff2");
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Oswald";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/oswald-lat.woff2") format("woff2");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------------------------------------------------------
   CSS Custom Properties
   --------------------------------------------------------- */

/* ─── Тёмная тема (по умолчанию) ─────────────────────── */
:root {
    --clr-bg: #0a0a0a;
    --clr-bg-card: #111111;
    --clr-bg-card-alt: #1a1a1a;
    --clr-accent: #1c6bba;
    --clr-accent-h: #2e80d8;
    --clr-accent-glow: rgba(28, 107, 186, 0.25);
    --clr-text: #f5f5f5;
    --clr-muted: #888888;
    --clr-border: #222222;
    --clr-error: #cf3a3a;
    --clr-success: #3a9a4f;

    --font-head: "Oswald", "Arial Narrow", "Barlow Condensed", sans-serif;
    --font-body: "DM Sans", "Nunito Sans", system-ui, -apple-system, sans-serif;
    --font-mono: "Courier New", Courier, monospace;

    --hdr-h: 72px;
    --container: 1200px;
    --gap: clamp(1rem, 4vw, 2rem);

    --sp-xs: 0.5rem;
    --sp-sm: 1rem;
    --sp-md: 1.5rem;
    --sp-lg: 2.5rem;
    --sp-xl: 4rem;
    --sp-2xl: 6rem;

    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;

    --tr: 200ms ease;
    --tr-md: 300ms ease;
    --tr-lg: 500ms ease;

    --sh-card: 0 2px 16px rgba(0, 0, 0, 0.5);
    --sh-hover: 0 0 0 1px var(--clr-accent), 0 4px 32px var(--clr-accent-glow);

    /* Компоненты — значения зависящие от темы */
    --header-bg: rgba(10, 10, 10, 0.92);
    --header-bg-scrolled: rgba(10, 10, 10, 0.97);
    --mobile-menu-bg: rgba(10, 10, 10, 0.98);
    --accordion-inset-bg: rgba(0, 0, 0, 0.2);

    /* Hero */
    --hero-bg-overlay: linear-gradient(
        180deg,
        rgba(5, 8, 13, 0.15) 0%,
        rgba(10, 10, 10, 0.88) 55%,
        var(--clr-bg) 100%
    );
    --hero-grid-color: rgba(28, 107, 186, 0.035);
    --hero-glow:
        radial-gradient(
            circle 280px at 78% 38%,
            rgba(28, 107, 186, 0.2) 0%,
            transparent 100%
        ),
        radial-gradient(
            ellipse 65% 55% at 75% 40%,
            rgba(28, 107, 186, 0.07) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse 50% 40% at 10% 95%,
            rgba(0, 0, 0, 0.7) 0%,
            transparent 55%
        );
}

/* ─── Светлая тема — системная ────────────────────────── */
@media (prefers-color-scheme: light) {
    :root {
        --clr-bg: #f5f7fa;
        --clr-bg-card: #ffffff;
        --clr-bg-card-alt: #edf0f5;
        --clr-accent-glow: rgba(28, 107, 186, 0.12);
        --clr-text: #111111;
        --clr-muted: #5a5e6b;
        --clr-border: #dde1e9;
        --clr-success: #2e8b43;
        --sh-card: 0 2px 16px rgba(0, 0, 0, 0.07);

        --header-bg: rgba(245, 247, 250, 0.92);
        --header-bg-scrolled: rgba(245, 247, 250, 0.97);
        --mobile-menu-bg: rgba(245, 247, 250, 0.99);
        --accordion-inset-bg: rgba(0, 0, 0, 0.03);

        --hero-bg-overlay: linear-gradient(
            180deg,
            transparent 0%,
            rgba(245, 247, 250, 0.4) 55%,
            var(--clr-bg) 100%
        );
        --hero-grid-color: rgba(28, 107, 186, 0.07);
        --hero-glow:
            radial-gradient(
                circle 400px at 78% 38%,
                rgba(28, 107, 186, 0.07) 0%,
                transparent 100%
            ),
            radial-gradient(
                ellipse 65% 55% at 75% 40%,
                rgba(28, 107, 186, 0.04) 0%,
                transparent 60%
            );
    }
}

/* ── Принудительно светлая тема ──────────────────────────
   Убрать этот блок, чтобы тема переключалась от системы  */
[data-theme="light"] {
    --clr-bg: #f5f7fa;
    --clr-bg-card: #ffffff;
    --clr-bg-card-alt: #edf0f5;
    --clr-accent-glow: rgba(28, 107, 186, 0.12);
    --clr-text: #111111;
    --clr-muted: #5a5e6b;
    --clr-border: #dde1e9;
    --clr-success: #2e8b43;
    --sh-card: 0 2px 16px rgba(0, 0, 0, 0.07);

    --header-bg: rgba(245, 247, 250, 0.92);
    --header-bg-scrolled: rgba(245, 247, 250, 0.97);
    --mobile-menu-bg: rgba(245, 247, 250, 0.99);
    --accordion-inset-bg: rgba(0, 0, 0, 0.03);

    --hero-bg-overlay: linear-gradient(
        180deg,
        transparent 0%,
        rgba(245, 247, 250, 0.4) 55%,
        var(--clr-bg) 100%
    );
    --hero-grid-color: rgba(28, 107, 186, 0.07);
    --hero-glow:
        radial-gradient(
            circle 400px at 78% 38%,
            rgba(28, 107, 186, 0.07) 0%,
            transparent 100%
        ),
        radial-gradient(
            ellipse 65% 55% at 75% 40%,
            rgba(28, 107, 186, 0.04) 0%,
            transparent 60%
        );
}
/* ───────────────────────────────────────────────────────── */

/* ---------------------------------------------------------
   Reset
   --------------------------------------------------------- */

@view-transition {
    navigation: auto;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    min-width: 320px;
    font-size: 16px;
    scroll-padding-top: calc(var(--hdr-h) + 1rem);
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--clr-text);
    background: var(--clr-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
video,
svg {
    display: block;
    max-width: 100%;
}
a {
    color: inherit;
    text-decoration: none;
}
ul,
ol {
    list-style: none;
}
button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
}
input,
textarea,
select {
    font: inherit;
}
address {
    font-style: normal;
}

/* ---------------------------------------------------------
   Typography
   --------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.15;
    color: var(--clr-text);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}
h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
}
h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
}

h4,
h5,
h6 {
    font-size: clamp(1rem, 2vw, 1.15rem);
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-body);
}

p {
    color: var(--clr-muted);
    line-height: 1.7;
}
p + p {
    margin-top: 0.9em;
}
strong {
    color: var(--clr-text);
    font-weight: 600;
}

/* ---------------------------------------------------------
   Layout
   --------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gap);
}

.section {
    padding-block: var(--sp-xl);
}

.section + .section {
    border-top: 1px solid var(--clr-border);
}

.section-header {
    margin-bottom: var(--sp-lg);
}

.section-label {
    display: inline-block;
    font-size: 0.68rem;
    font-family: var(--font-head);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--clr-accent);
    margin-bottom: 0.6rem;
}

.section-title {
    color: var(--clr-text);
    margin-bottom: 0.6rem;
}

.section-lead {
    color: var(--clr-muted);
    font-size: 1.05rem;
    max-width: 640px;
    line-height: 1.6;
}

/* Blue accent bar — вырастает слева при появлении секции */
.section-title--bar::before {
    content: "";
    display: block;
    height: 3px;
    width: 36px;
    background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent-h));
    margin-bottom: 0.75rem;
    box-shadow: 0 0 10px rgba(28, 107, 186, 0.5);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Срабатывает при видимости через .visible или на page-hero (всегда виден) */
.visible .section-title--bar::before,
.page-hero .section-title--bar::before,
.hero .section-title--bar::before {
    transform: scaleX(1);
}

/* Немедленно для элементов вне reveal */
@media (prefers-reduced-motion: reduce) {
    .section-title--bar::before {
        transform: scaleX(1);
        transition: none;
    }
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
}

@media (max-width: 1199px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .section {
        padding-block: var(--sp-lg);
    }
    .section-header {
        margin-bottom: var(--sp-md);
    }
}

/* ---------------------------------------------------------
   Utilities
   --------------------------------------------------------- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-accent {
    color: var(--clr-accent);
}
.text-muted {
    color: var(--clr-muted);
}
.text-center {
    text-align: center;
}
.text-center .section-title--bar::before {
    margin-inline: auto;
}
.text-center .section-lead {
    margin-inline: auto;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* Stagger delay helpers */
.reveal-delay-1 {
    transition-delay: 90ms;
}
.reveal-delay-2 {
    transition-delay: 180ms;
}
.reveal-delay-3 {
    transition-delay: 270ms;
}
.reveal-delay-4 {
    transition-delay: 360ms;
}

/* Сокращённая анимация если prefer-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        transition: opacity 0.3s ease;
        transform: none;
    }
}

/* Divider — тонкая синяя линия */
.divider-accent {
    border: none;
    border-top: 1px solid var(--clr-accent);
    opacity: 0.35;
    margin-block: 0;
}

/* Mono phone/number */
.mono {
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

/* Page header (all inner pages) */
.page-hero {
    background: var(--clr-bg-card);
    padding-block: clamp(3rem, 8vw, 5rem);
    border-bottom: 1px solid var(--clr-border);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(28, 107, 186, 0.08) 0%,
        transparent 60%
    );
    pointer-events: none;
}

.page-hero__inner {
    position: relative;
    z-index: 1;
}

.page-hero__label {
    display: inline-block;
    font-size: 0.75rem;
    font-family: var(--font-head);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--clr-accent);
    margin-bottom: 0.6rem;
}

.page-hero__title {
    margin-bottom: 0.75rem;
}

.page-hero__lead {
    color: var(--clr-muted);
    font-size: 1.05rem;
    max-width: 600px;
    line-height: 1.65;
}
