/*
 * DATACENTER-1 design system (docs/redesign/brief.md, section 6): a soft redesign that stays recognisable next to the live site.
 * Dark theme only, tokens extracted from datacenter-1.ru, Oswald headings and Inter text (self-hosted, assets/fonts/).
 * Plain CSS, no build step. Layout rules: no fixed widths, no nowrap, flex/grid children get min-width: 0, rows wrap.
 */

/* ---------- Fonts ---------- */
/* Variable WOFF2, latin + cyrillic in one file each (assets/fonts/LICENSE.md). Both are preloaded in base.html.twig.
   The fallback faces rescale local Arial to the metrics of the web font, so the swap does not move the layout:
   size-adjust is the measured width ratio of the Russian sample text, the overrides come from the font's hhea metrics. */
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-cyrillic-N_Sh1Fp.woff2") format("woff2");
    font-weight: 400 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Oswald";
    src: url("../fonts/oswald-latin-cyrillic-hvoNAxQ.woff2") format("woff2");
    font-weight: 500 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Inter Fallback";
    src: local("Arial"), local("ArialMT"), local("Helvetica");
    font-weight: 400;
    size-adjust: 106.6%;
    ascent-override: 90.9%;
    descent-override: 22.6%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "Inter Fallback";
    src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica-Bold");
    font-weight: 500 600;
    size-adjust: 102%;
    ascent-override: 95%;
    descent-override: 23.6%;
    line-gap-override: 0%;
}
@font-face {
    font-family: "Oswald Fallback";
    src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica-Bold");
    font-weight: 500 700;
    size-adjust: 83%;
    ascent-override: 143.7%;
    descent-override: 34.8%;
    line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
    color-scheme: dark;

    --bg: #0d0d0f;
    --surface: #0c1c3e;
    --surface-2: #13254d;
    --border: #1d2d4f;
    --field-border: #3d5a8a;
    --ink: #ffffff;
    --ink-muted: #b4c0d6;
    --brand: #2860c0;
    --brand-hover: #0042a2;
    --brand-ink: #ffffff;
    --brand-soft: #0f2550;
    --accent: #29b6f6;
    --cta: #1f8a1f;
    --cta-hover: #187018;
    --good: #4cc38a;
    --bad: #ff7a7a;
    --todo-bg: #3a2e0b;

    --font: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-heading: "Oswald", "Oswald Fallback", "Arial Narrow", Arial, sans-serif;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;

    --radius: 8px;
    --radius-lg: 12px;

    --container: 1200px;
    --gutter: 1rem;
    --section-y: 3rem;
    --header-h: 64px;
    --bar-h: 56px;

    --fs-body: 1rem;
    --lh-body: 1.625rem;
    --fs-h1: 1.875rem;
    --lh-h1: 2.25rem;
    --fs-h2: 1.5rem;
    --lh-h2: 1.875rem;
    --fs-h3: 1.125rem;
    --lh-h3: 1.625rem;
    --fs-stat: 2rem;
    --lh-stat: 2.25rem;
}

@media (min-width: 48rem) {
    :root {
        --gutter: 1.5rem;
        --section-y: 4rem;
        --fs-h1: 2.625rem;
        --lh-h1: 3rem;
        --fs-h2: 2rem;
        --lh-h2: 2.375rem;
        --fs-h3: 1.25rem;
        --lh-h3: 1.75rem;
        --fs-stat: 2.5rem;
        --lh-stat: 2.75rem;
    }
}

@media (min-width: 80rem) {
    :root {
        --gutter: 2rem;
        --section-y: 5rem;
        --fs-body: 1.0625rem;
        --lh-body: 1.75rem;
        --fs-h1: 3.5rem;
        --lh-h1: 3.875rem;
        --fs-h2: 2.75rem;
        --lh-h2: 3.125rem;
        --fs-stat: 3rem;
        --lh-stat: 3.25rem;
    }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 var(--fs-body) / var(--lh-body) var(--font);
    overflow-wrap: break-word;
}

img, svg { max-width: 100%; }
img { height: auto; }
picture { display: contents; }

a { color: var(--accent); text-underline-offset: 0.15em; transition: color 0.15s; }
a:hover { color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4 { margin: 0 0 var(--space-3); font-weight: 600; }
h1 { font-family: var(--font-heading); font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 700; }
h2 { font-family: var(--font-heading); font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.01em; }
h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
h4 { font-size: 1rem; line-height: 1.5rem; }
.accent { color: var(--accent); }

p { margin: 0 0 var(--space-4); }
ul, ol { margin: 0 0 var(--space-4); padding-left: 1.25rem; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -4rem;
    z-index: 100;
    padding: var(--space-3) var(--space-4);
    background: var(--brand);
    color: var(--brand-ink);
    border-radius: var(--radius);
}
.skip-link:hover { color: var(--brand-ink); }
.skip-link:focus { top: var(--space-2); }

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

.small { font-size: 0.875rem; line-height: 1.375rem; }
.muted { color: var(--ink-muted); }

/* A fact the client has not confirmed yet: must never read as a finished claim. */
.todo {
    padding: 0 0.25rem;
    background: var(--todo-bg);
    color: var(--ink);
    border: 1px dashed var(--accent);
    border-radius: 4px;
}

/* ---------- Buttons ---------- */
/* Secondary by default: accent outline. The primary action is the blue radial gradient of the live site;
   green is reserved for the calculator (templates/_partials/button.html.twig picks it by href). */
.btn,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: 0;
    min-height: 48px;
    padding: 0.625rem 1.5rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: transparent;
    color: var(--accent);
    font: 500 1rem / 1.25 var(--font);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover,
.button:hover { background: var(--brand-soft); color: var(--accent); }
.btn--primary,
.button--primary {
    border-color: transparent;
    background: radial-gradient(50% 50% at 50% 50%, var(--brand-hover) 0%, var(--brand) 100%);
    color: var(--brand-ink);
}
.btn--primary:hover,
.button--primary:hover { background: var(--brand-hover); color: var(--brand-ink); }

/* White on --cta is 4.46:1, just under AA for 16 px text: the resting fill is the darker token (6.2:1), --cta shows on hover. */
.btn--cta { border-color: var(--cta); background: var(--cta-hover); color: var(--brand-ink); }
.btn--cta:hover { background: var(--cta); color: var(--brand-ink); }
.btn svg { flex: none; width: 20px; height: 20px; fill: currentColor; }

/* ---------- Header ---------- */
/* Below 1280 px one sticky row: logo, phone, burger; the menu opens as a panel under it (no JavaScript needed).
   From 1280 px it is the two-row header of the live site: logo, tagline, phone, messengers and the request button,
   then the menu bar. It is not sticky there, so it does not eat two rows of every screen. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--header-h);
}

.logo { display: inline-flex; flex: 1 1 auto; align-items: center; min-width: 0; margin-right: auto; }
.site-header__logo { display: block; width: auto; max-width: 100%; height: 40px; }

.site-header__tagline,
.header-contact { display: none; }

.header-phone,
.menu-wrap {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}
.header-phone { color: var(--ink); border-radius: var(--radius); }
.header-phone svg { width: 24px; height: 24px; fill: currentColor; }

/* The checkbox sits invisibly on top of the burger: the menu works without JavaScript. */
.menu-wrap { position: relative; }
.menu-toggle {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.menu-button { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--ink); border-radius: var(--radius); }
.menu-toggle:focus-visible + .menu-button { outline: 2px solid var(--accent); outline-offset: 2px; }

.menu-button__bars,
.menu-button__bars::before,
.menu-button__bars::after {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: transform 0.15s, background-color 0.15s;
}
.menu-button__bars { position: relative; }
.menu-button__bars::before,
.menu-button__bars::after { content: ""; position: absolute; left: 0; }
.menu-button__bars::before { top: -7px; }
.menu-button__bars::after { top: 7px; }
.menu-toggle:checked + .menu-button .menu-button__bars { background: transparent; }
.menu-toggle:checked + .menu-button .menu-button__bars::before { top: 0; transform: rotate(45deg); }
.menu-toggle:checked + .menu-button .menu-button__bars::after { top: 0; transform: rotate(-45deg); }

.site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: var(--space-2) var(--gutter) var(--space-4);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.site-header:has(.menu-toggle:checked) .site-nav { display: block; }

.site-nav__list { margin: 0; padding: 0; list-style: none; }
.site-nav__link {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}
.site-nav__link:hover { color: var(--accent); }
.site-nav__link[aria-current="page"] { color: var(--accent); font-weight: 600; }
.site-nav__action { display: grid; gap: var(--space-3); padding-top: var(--space-4); }
.site-nav__messengers { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.site-nav__messengers .btn { flex: 1 1 8rem; }
.site-nav__phone { display: block; color: var(--ink); text-align: center; font-family: var(--font-heading); font-size: 1.375rem; font-weight: 500; text-decoration: none; }

/* Messenger buttons: Telegram is blue, WhatsApp is green, as on the live site. */
.btn--tg { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.btn--tg:hover { background: var(--brand-hover); color: var(--brand-ink); }
.btn--wa { border-color: var(--cta); background: var(--cta-hover); color: var(--brand-ink); }
.btn--wa:hover { background: var(--cta); color: var(--brand-ink); }

@media (min-width: 48rem) {
    .site-header__logo { height: 44px; }
    .site-nav__action { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
    .site-nav__messengers .btn { flex: 0 1 auto; }
    .site-nav__phone { margin-left: auto; }
}

@media (min-width: 80rem) {
    html { scroll-padding-top: 1rem; }

    .site-header { position: static; }
    .site-header__inner { gap: var(--space-3) var(--space-6); padding-block: var(--space-3); }
    .logo { flex: none; margin-right: 0; }
    .site-header__logo { height: 52px; }
    .header-phone, .menu-wrap, .site-nav__action { display: none; }

    .site-header__tagline {
        display: block;
        flex: 0 1 13rem;
        min-width: 0;
        margin: 0;
        font-size: 0.875rem;
        line-height: 1.375rem;
    }

    .header-contact {
        display: flex;
        flex: 1 1 auto;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: var(--space-2) var(--space-3);
        min-width: 0;
    }
    .header-contact .btn { min-height: 44px; padding-inline: var(--space-4); }
    .header-contact__phone { display: grid; margin: 0 var(--space-2) 0 0; text-align: right; }
    .header-contact__label { color: var(--ink-muted); font-size: 0.75rem; line-height: 1rem; }
    .header-contact__number { color: var(--ink); font-family: var(--font-heading); font-size: 1.375rem; line-height: 1.75rem; font-weight: 500; text-decoration: none; }
    .header-contact__number:hover { color: var(--accent); }

    .site-nav {
        position: static;
        display: block;
        flex: 1 0 100%;
        min-width: 0;
        max-height: none;
        padding: 0;
        overflow: visible;
        background: none;
        border: 0;
    }
    .site-nav__list { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); padding: var(--space-1) var(--space-2); background: var(--surface); border-radius: var(--radius); }
    .site-nav__link { min-height: 40px; padding: 0 var(--space-4); border: 0; border-radius: 6px; color: var(--ink-muted); font-size: 0.9375rem; text-decoration: none; transition: background-color 0.15s, color 0.15s; }
    .site-nav__link:hover { background: var(--surface-2); color: var(--ink); }
    .site-nav__link[aria-current="page"] { background: var(--brand); color: var(--brand-ink); font-weight: 500; }
}

/* ---------- Mobile bar ---------- */
.mobile-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    display: flex;
    gap: var(--space-2);
    padding: 4px var(--gutter) calc(4px + env(safe-area-inset-bottom));
    min-height: var(--bar-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.mobile-bar .btn { flex: 1 1 0; }

@media (min-width: 48rem) {
    .mobile-bar { display: none; }
}
@media (max-width: 47.99rem) {
    body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding-block: var(--space-3); border-bottom: 1px solid var(--border); font-size: 0.875rem; line-height: 1.375rem; }
.breadcrumbs__list { display: flex; flex-wrap: wrap; gap: 0 var(--space-2); margin: 0; padding: 0; list-style: none; }
.breadcrumbs__item { min-width: 0; color: var(--ink-muted); }
.breadcrumbs__item + .breadcrumbs__item::before { content: "/"; margin-right: var(--space-2); }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); }
/* Sections alternate the page colour and this soft gradient, as on the live site. The only background gradient besides the primary button. */
.section-deep,
.section--alt { background: linear-gradient(180deg, #010a29 0%, #0d0d0f 100%); }

.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-8); margin-bottom: var(--space-6); }
.section__title { margin-bottom: var(--space-3); }
.section__head .section__title { flex: 1 1 22rem; min-width: 0; margin-bottom: 0; }
.section__intro { flex: 1 1 18rem; max-width: 34rem; min-width: 0; color: var(--ink-muted); }
.section__intro > :last-child { margin-bottom: 0; }
.section__more { margin: var(--space-6) 0 0; font-weight: 500; }
.section__cta { margin: var(--space-6) 0 0; }

.page-header { padding-block: var(--space-8) var(--space-4); }
.page-header__title { margin: 0; max-width: 56rem; }

.grid--1 { max-width: 46rem; }
.grid.grid--1 { grid-template-columns: minmax(0, 1fr); }
.grid { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
@media (min-width: 48rem) {
    .grid { gap: var(--space-6); grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
    .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.card > :last-child { margin-bottom: 0; }
.card__title { margin-bottom: var(--space-2); }
.card__text { color: var(--ink-muted); }
.card__text p:last-child { margin-bottom: 0; }
.card__text strong { color: var(--ink); }

.card--link { transition: border-color 0.15s; }
.card--link:hover { border-color: var(--accent); }
.card--link:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.card__link { color: var(--ink); text-decoration: none; }
.card__link:hover { color: var(--accent); }
.card__link:focus-visible { outline: 0; }
.card__link::after { content: ""; position: absolute; inset: 0; }
.card__more { margin-top: auto; padding-top: var(--space-3); color: var(--accent); font-weight: 500; }

.card__image { display: block; width: 100%; aspect-ratio: 4 / 3; margin-bottom: var(--space-4); object-fit: cover; border-radius: var(--radius); }

/* The live site's cut-out illustrations: they sit at the bottom of the card, text on top, and are never cropped. */
.card__image--illustration {
    order: 3;
    box-sizing: content-box;
    align-self: flex-end;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 9rem;
    margin: auto 0 0;
    padding-top: var(--space-4);
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 0;
}
.card--link:has(.card__image--illustration) .card__more { margin-top: 0; }
.benefit:has(.card__image--illustration) .benefit__title::before { display: none; }

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-8) var(--section-y); overflow: hidden; }
.hero__inner { display: grid; gap: var(--space-8); grid-template-columns: minmax(0, 1fr); align-items: center; }
.hero__content { min-width: 0; }
.hero__title { margin-bottom: var(--space-4); }
.hero__subtitle { margin-bottom: var(--space-3); color: var(--ink-muted); font-size: 1.25rem; line-height: 1.75rem; }
.hero__lead { max-width: 40rem; margin-bottom: var(--space-6); }
.hero__lead > :last-child { margin-bottom: 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 var(--space-5); }
.hero__actions .btn { flex: 1 1 100%; }
.hero__note { max-width: 40rem; margin: 0; font-size: 0.875rem; line-height: 1.375rem; color: var(--ink-muted); }
.hero__note > :last-child { margin-bottom: 0; }
.hero__note blockquote { margin-block: 0 var(--space-4); }

/* The hero illustration is the live site's own picture; its edge fades into the page colour instead of sitting in a frame. */
.hero__media { min-width: 0; margin: 0; }
.hero__image {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 24%);
    mask-image: linear-gradient(180deg, transparent 0, #000 24%);
}

@media (min-width: 40rem) {
    .hero__actions .btn { flex: 0 1 auto; }
}
@media (min-width: 64rem) {
    .hero { padding-block: var(--space-12) var(--section-y); }
    .hero__inner { gap: var(--space-8); grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
    .hero__inner--text { grid-template-columns: minmax(0, 1fr); }
    .hero__inner--text .hero__content { max-width: 56rem; }
    .hero__image {
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28%), linear-gradient(180deg, transparent 0, #000 14%, #000 84%, transparent 100%);
        -webkit-mask-composite: source-in;
        mask-image: linear-gradient(90deg, transparent 0, #000 28%), linear-gradient(180deg, transparent 0, #000 14%, #000 84%, transparent 100%);
        mask-composite: intersect;
    }
}

/* ---------- Facts ---------- */
.facts { padding-block: var(--space-8); }
.facts__list {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.facts__item { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; padding: var(--space-5); background: var(--surface); }
.facts__value {
    font-family: var(--font-heading);
    font-size: var(--fs-stat);
    line-height: var(--lh-stat);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.facts__value--text { font-size: 1.375rem; line-height: 1.75rem; }
.facts__label { color: var(--ink-muted); font-size: 0.875rem; line-height: 1.375rem; }
.facts__item .todo { display: block; margin-top: var(--space-2); font-size: 0.75rem; line-height: 1.125rem; }
.facts__note { margin: var(--space-3) 0 0; color: var(--ink-muted); font-size: 0.875rem; line-height: 1.375rem; }
.facts__note p { margin: 0; }
.facts .section__head { margin-bottom: var(--space-4); }

@media (min-width: 64rem) {
    .facts__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Benefits ---------- */
.benefit { gap: 0; }
.benefit__title::before {
    content: "";
    display: block;
    width: 1.5rem;
    height: 3px;
    margin-bottom: var(--space-3);
    background: var(--accent);
    border-radius: 2px;
}

/* ---------- Steps ---------- */
.steps__list { max-width: 48rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps__item { position: relative; min-width: 0; padding: 0 0 var(--space-6) 3.5rem; counter-increment: step; }
.steps__item:last-child { padding-bottom: 0; }
.steps__item::before {
    content: counter(step);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: var(--brand);
    border-radius: 50%;
    color: var(--brand-ink);
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.steps__item::after { content: ""; position: absolute; top: 40px; bottom: 0; left: 19px; width: 2px; background: var(--border); }
.steps__item:last-child::after { display: none; }
.steps__item-title { margin: 0 0 var(--space-1); padding-top: 0.4rem; }
.steps__item-text { color: var(--ink-muted); }
.steps__item-text > :last-child { margin-bottom: 0; }
.steps__image { display: block; width: 100%; max-width: 28rem; height: auto; aspect-ratio: 4 / 3; margin-top: var(--space-3); object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }

/* ---------- Tables ---------- */
.table-wrap { max-width: 100%; margin: 0 0 var(--space-4); overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { min-width: 0; padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.table thead th { background: var(--surface-2); font-size: 0.875rem; font-weight: 600; }
.table tbody th { font-weight: 600; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table td > :last-child, .table th > :last-child { margin-bottom: 0; }
.table td ul { margin: 0; padding-left: 1.1rem; }
.table__badge { display: block; margin-bottom: var(--space-1); color: var(--ink-muted); font-size: 0.75rem; line-height: 1.125rem; font-weight: 500; }

@media (max-width: 39.99rem) {
    .table-wrap { overflow: visible; background: none; border: 0; }
    .table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .table, .table tbody, .table tr, .table th, .table td { display: block; }
    .table tr { margin-bottom: var(--space-3); overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
    .table tbody th { padding: var(--space-3) var(--space-4); background: var(--surface-2); border-bottom: 0; }
    .table td { padding: var(--space-3) var(--space-4); border-bottom: 0; border-top: 1px solid var(--border); }
    .table td::before {
        content: attr(data-label);
        display: block;
        color: var(--ink-muted);
        font-size: 0.75rem;
        line-height: 1.125rem;
        font-weight: 500;
    }
    .table tbody tr:last-child > * { border-bottom: 0; }
}

/* ---------- Case cards ---------- */
.tag { display: inline-block; max-width: 100%; padding: 0.125rem 0.625rem; background: var(--brand-soft); border-radius: 999px; color: var(--accent); font-size: 0.75rem; line-height: 1.25rem; font-weight: 600; }

.case-card__meta { margin-bottom: var(--space-2); color: var(--ink-muted); font-size: 0.75rem; line-height: 1.125rem; font-weight: 500; }
.case-card__facts, .case__facts { display: grid; gap: var(--space-3) var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); margin: var(--space-4) 0; }
.case-card__fact, .case__fact { min-width: 0; margin: 0; }
.case-card__facts dt, .case__facts dt { color: var(--ink-muted); font-size: 0.75rem; line-height: 1.125rem; font-weight: 500; }
.case-card__facts dd, .case__facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.case-card__fact:last-child { grid-column: 1 / -1; }
.case-card__comment { color: var(--ink-muted); }
.case-card .card__more { padding-top: 0; }
.case-card .todo { font-size: 0.75rem; }

/* ---------- Team ---------- */
.team-card__photo { display: block; width: 100%; aspect-ratio: 4 / 5; margin-bottom: var(--space-4); object-fit: cover; object-position: top; border-radius: var(--radius); background: var(--surface-2); }
.team-card__role { margin-bottom: var(--space-2); color: var(--accent); font-weight: 500; }

/* ---------- FAQ ---------- */
.faq__list { max-width: 52rem; }
.faq__item { margin-bottom: var(--space-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq__question {
    position: relative;
    display: block;
    min-height: 48px;
    padding: var(--space-3) 3rem var(--space-3) var(--space-4);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.faq__question::-webkit-details-marker { display: none; }
.faq__question::before,
.faq__question::after { content: ""; position: absolute; right: var(--space-4); top: 50%; width: 14px; height: 2px; margin-top: -1px; background: var(--accent); }
.faq__question::before { transition: transform 0.15s; transform: rotate(90deg); }
.faq__item[open] > .faq__question::before { transform: rotate(0deg); }
.faq__answer { padding: 0 var(--space-4) var(--space-4); color: var(--ink-muted); }
.faq__answer > :last-child { margin-bottom: 0; }

/* ---------- Video and photos ---------- */
.video__link {
    position: relative;
    display: block;
    max-width: 52rem;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.video__poster { display: block; width: 100%; height: 100%; object-fit: cover; }
.video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    background: var(--brand);
    border-radius: 50%;
}
.video__play::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 26px;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent var(--brand-ink);
}
.video__label {
    position: absolute;
    left: var(--space-3);
    bottom: var(--space-3);
    max-width: calc(100% - 1.5rem);
    padding: var(--space-1) var(--space-3);
    background: var(--surface);
    border-radius: var(--radius);
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 600;
}
.video__link:hover .video__play { background: var(--brand-hover); }
.video__frame { display: block; width: 100%; height: 100%; border: 0; }
.video__gallery-title { margin: var(--space-8) 0 var(--space-4); }

.photo-grid { display: grid; gap: var(--space-2); grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.photo-grid__item { min-width: 0; margin: 0; }
.photo-grid__image { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
@media (min-width: 48rem) {
    .photo-grid { gap: var(--space-4); grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Text and callouts ---------- */
.prose { min-width: 0; }
.prose > :not(.table-wrap) { max-width: 46rem; }
.prose > :last-child { margin-bottom: 0; }
.prose h3 { margin-top: var(--space-6); }

.callout,
.prose blockquote,
.hero__note blockquote {
    margin: var(--space-4) 0;
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border-left: 4px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--ink);
}
.callout.callout--accent,
.prose blockquote.callout--accent,
.hero__note blockquote.callout--accent { border-left-color: var(--accent); }
.callout--accent { border-left-color: var(--accent); }
.callout > :last-child, blockquote > :last-child { margin-bottom: 0; }
.hero__note blockquote { font-size: 1rem; line-height: 1.625rem; }

.about__facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: var(--space-4) 0; padding: 0; list-style: none; }
.about__fact { min-width: 0; }
.about__fact-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.about__fact-label { color: var(--ink-muted); font-size: 0.875rem; }

/* ---------- Product (antkit21) ---------- */
.product__main { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
.product__image { display: block; width: 100%; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.product__price { margin: 0 0 var(--space-4); font-family: var(--font-heading); font-size: var(--fs-stat); line-height: var(--lh-stat); font-weight: 600; font-variant-numeric: tabular-nums; }
.product__downloads { display: grid; gap: var(--space-3); margin: var(--space-6) 0 0; padding: 0; list-style: none; }
.product__download { min-width: 0; }
.product__download > div { margin-top: var(--space-1); font-size: 0.875rem; color: var(--ink-muted); }
.product__results-title { margin: var(--space-8) 0 var(--space-4); }
.product__result-image { display: block; margin-bottom: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); }
@media (min-width: 64rem) {
    .product__main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .product__downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Lead form and banners ---------- */
.lead__inner { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
.lead__text { min-width: 0; }
.lead__text > :last-child { margin-bottom: 0; }
.lead__intro { color: var(--ink-muted); }

.lead-form { display: grid; gap: var(--space-4); min-width: 0; padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.lead-form__field { display: grid; gap: var(--space-1); min-width: 0; }
.lead-form__label { font-size: 0.875rem; font-weight: 600; }
.lead-form__hint { color: var(--ink-muted); font-size: 0.75rem; line-height: 1.125rem; }
.lead-form__input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0.625rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--field-border);
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
}
textarea.lead-form__input { min-height: 6rem; resize: vertical; }
.lead-form__input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.lead-form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lead-form__consent { display: flex; align-items: flex-start; gap: var(--space-3); font-size: 0.875rem; line-height: 1.375rem; }
.lead-form__consent input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); }
.lead-form__consent label { min-width: 0; }
.lead-form__submit { width: 100%; }
.lead-form__note { margin: 0; color: var(--ink-muted); font-size: 0.875rem; text-align: center; }
.lead-form__errors { padding: var(--space-3) var(--space-4); background: var(--surface-2); border: 1px solid var(--bad); border-left-width: 4px; border-radius: var(--radius); color: var(--ink); }
.lead-form__errors ul { margin: 0; padding-left: 1.25rem; }
.lead-form__errors::before { content: "Исправьте ошибки:"; display: block; font-weight: 600; color: var(--bad); }

.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-6); padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.banner__text { flex: 1 1 20rem; min-width: 0; }
.banner__title { margin-bottom: var(--space-2); }
.banner__body { color: var(--ink-muted); }
.banner__body > :last-child { margin-bottom: 0; }
.banner__action { margin: 0; }

@media (min-width: 48rem) {
    .lead__inner { gap: var(--space-12); grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
    .lead-form { padding: var(--space-8); }
}

/* ---------- Case page ---------- */
.case__comment { max-width: 46rem; color: var(--ink-muted); }
.case__facts { max-width: 46rem; }
.case__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-6) 0; }
.case__actions .btn { flex: 1 1 100%; }
.case__nav { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); margin: 0; padding: 0; list-style: none; }
.case__nav li { min-width: 0; }
@media (min-width: 40rem) {
    .case__actions .btn { flex: 0 1 auto; }
}
@media (min-width: 48rem) {
    .case__facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Article page and article cards ---------- */
/* Article: a readable text column and a sticky side column, together as wide as the site grid. */
.article__layout { display: grid; gap: var(--space-8); padding-top: var(--space-8); }
.article__header { padding-bottom: var(--space-2); }
.article__main { min-width: 0; }
.article__main > .section { padding-block: var(--space-8) 0; background: none; }
.article__main > .section > .container { max-width: none; padding-inline: 0; }
.article__aside { display: grid; gap: var(--space-4); align-content: start; padding-bottom: var(--space-12); }
.article-toc { display: none; }
.article-toc__title, .aside-card__title { margin: 0 0 var(--space-2); font-weight: 600; }
.article-toc__list { margin: 0; padding-left: 1.25rem; font-size: 0.875rem; line-height: 1.375rem; }
.article-toc__list li + li { margin-top: var(--space-2); }
.article-toc__list a { color: var(--ink-muted); text-decoration: none; }
.article-toc__list a:hover { color: var(--ink); text-decoration: underline; }
.aside-card { display: grid; gap: var(--space-3); padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.aside-card__title { margin: 0; }
.aside-card__text { margin: 0; color: var(--ink-muted); font-size: 0.875rem; line-height: 1.375rem; }
.aside-card__link { font-size: 0.875rem; }
.related-list { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.related-list__item { margin: 0; }
.related-list__meta { margin: var(--space-1) 0 0; font-size: 0.75rem; }
@media (min-width: 40rem) and (max-width: 63.99rem) {
    /* Under the text on a tablet: the cards side by side rather than stretched across the page. */
    .article__aside { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
}
@media (min-width: 64rem) {
    .article__layout { grid-template-columns: minmax(0, 46rem) 18rem; justify-content: space-between; gap: var(--space-12); }
    /* align-self: the grid would stretch the column to the article's height, and sticky would have no room to move. */
    .article__aside { --aside-top: calc(var(--header-h) + 1rem); position: sticky; top: var(--aside-top); align-self: start; max-height: calc(100dvh - var(--aside-top) - 1rem); overflow-y: auto; padding-bottom: 0; }
    .article-toc { display: block; padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); }
    .article__main > .section:last-child { padding-bottom: var(--space-12); }
}
@media (min-width: 80rem) {
    /* From 1280px the header scrolls away (two-row layout), so the column sticks right below the top edge. */
    .article__aside { --aside-top: var(--space-6); }
}
.article__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); max-width: 46rem; margin: var(--space-3) 0 0; font-size: 0.875rem; line-height: 1.375rem; }
.article__lead { margin-top: var(--space-4); font-size: 1.125rem; }
/* Most client photos are vertical (phone shots): the cover is cropped to 3:2 (the list cards to 4:3), photos inside the
   text keep the whole frame but no taller than the screen, on the surface colour at the sides. */
.article__cover { display: block; width: 100%; max-width: 46rem; height: auto; aspect-ratio: 3 / 2; margin-top: var(--space-6); object-fit: cover; border-radius: var(--radius-lg); background: var(--surface-2); }
.text__figure { max-width: 46rem; margin: var(--space-6) 0 0; }
.text__image { display: block; width: 100%; height: auto; max-height: min(36rem, 80vh); object-fit: contain; border-radius: var(--radius-lg); background: var(--surface-2); }
.text__caption { margin-top: var(--space-2); color: var(--ink-muted); font-size: 0.875rem; line-height: 1.375rem; }
.article__sources ol { padding-left: 1.25rem; overflow-wrap: anywhere; }
.author-card { display: flex; gap: var(--space-4); align-items: flex-start; max-width: 46rem; }
.author-card__photo { flex: none; width: 6rem; height: 6rem; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-2); }
.author-card__name { margin: 0; font-weight: 600; }
.author-card__role { margin: 0 0 var(--space-2); color: var(--accent); font-weight: 500; }
.author-card__bio { margin: 0; color: var(--ink-muted); }
.article-card__meta { margin-bottom: var(--space-2); color: var(--ink-muted); font-size: 0.75rem; line-height: 1.125rem; font-weight: 500; }
.article-card__meta .tag { margin-right: var(--space-2); }
.tag--draft { background: var(--todo-bg); color: var(--ink); }
.article-card__lead { color: var(--ink-muted); }
.article-card__lead > :last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { padding-block: var(--space-12) var(--space-6); background: var(--surface); border-top: 1px solid var(--border); }
.site-footer__grid { display: grid; gap: var(--space-8) var(--space-6); grid-template-columns: minmax(0, 1fr); }
.site-footer__nav { display: contents; }
.site-footer__col { min-width: 0; }
.site-footer__title { margin: 0 0 var(--space-3); font-size: 0.875rem; line-height: 1.375rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.site-footer__list { margin: 0; padding: 0; list-style: none; }
.site-footer__list a { display: inline-block; padding-block: var(--space-1); color: var(--ink); text-decoration: none; }
.site-footer__list a:hover { color: var(--accent); text-decoration: underline; }
.site-footer__contacts { font-style: normal; }
.site-footer__contacts p { margin: 0 0 var(--space-2); }
.site-footer__contacts a { color: var(--ink); }
.site-footer__contacts a:hover { color: var(--accent); }
.site-footer__address { color: var(--ink-muted); font-size: 0.875rem; line-height: 1.375rem; }

.site-footer__bottom { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--border); color: var(--ink-muted); font-size: 0.875rem; line-height: 1.375rem; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); margin: 0; padding: 0; list-style: none; }
.site-footer__legal a { color: var(--ink-muted); }
.site-footer__fine { flex: 1 1 100%; min-width: 0; margin: 0; }
.site-footer__copy { margin: 0; }
@media (min-width: 40rem) {
    .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
    .site-footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
