/* ==========================================================================
   Васильчук и партнёры — дизайн-система
   Минималистичная подача: плоские поверхности, волосяные линии,
   тени почти не используются. Шрифты и бирюзовая палитра сохранены.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Шрифты
   Раздаём сами: запрос к fonts.googleapis.com блокировал отрисовку и добавлял
   два обращения к чужим доменам. Файлы — переменные начертания (SIL OFL 1.1),
   поэтому одна ширина шкалы закрывает все нужные веса.
   Подключены только кириллица и латиница: греческий и вьетнамский не нужны.
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/static/fonts/manrope-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/static/fonts/manrope-cyrillic-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: 'Manrope';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/static/fonts/manrope-latin.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: 'Manrope';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/static/fonts/manrope-latin-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: 'Playfair Display';
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url('/static/fonts/playfair-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url('/static/fonts/playfair-latin.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: 'Playfair Display';
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: url('/static/fonts/playfair-latin-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;
}

/* --------------------------------------------------------------------------
   1. Токены
   -------------------------------------------------------------------------- */
:root {
    /* Бирюзовая шкала бренда */
    --brand-50:  #f0fbfa;
    --brand-100: #d9f5f3;
    --brand-200: #b0eae6;
    --brand-300: #7bdbd5;
    --brand-400: #45c7c0;
    --brand-500: #20b2aa;  /* основной цвет */
    --brand-600: #159a93;
    --brand-700: #107b76;
    --brand-800: #0d605d;
    --brand-900: #0a4644;

    /* Глубокие нейтрали с бирюзовым подтоном */
    --ink-900: #061417;
    --ink-800: #0b2126;
    --ink-700: #123037;
    --ink-600: #1d444c;
    --ink-500: #3a5b62;
    /* ink-400 работает приглушённым текстом (--text-muted): прежний #5d7a80
       давал на белом 4.6:1 — впритык, а им набран и мелкий текст карточек.
       Затемнён до 6:1 с запасом, разница с основным текстом сохранилась. */
    --ink-400: #55737a;
    --ink-300: #8aa3a8;
    --ink-200: #c2d4d6;
    --ink-100: #e4eeef;

    /* Поверхности */
    --surface:    #ffffff;
    --surface-2:  #f7fafa;
    --surface-3:  #eef5f4;
    --surface-ink: var(--ink-900);

    /* Семантика */
    --text:        var(--ink-800);
    --text-muted:  var(--ink-400);
    --text-invert: #ffffff;
    --line:        rgba(11, 33, 38, 0.11);
    --line-strong: rgba(11, 33, 38, 0.22);
    --line-invert: rgba(255, 255, 255, 0.14);

    --success: #12855f;
    --success-bg: #e6f7f0;
    --warning: #9a6b00;
    --warning-bg: #fdf3dd;
    --danger:  #b3261e;
    --danger-bg: #fdeceb;
    --info:    var(--brand-700);
    --info-bg: var(--brand-50);

    /* Тени — только там, где элемент физически всплывает над страницей */
    --shadow-sm: 0 1px 2px rgba(6, 20, 23, 0.05);
    --shadow-md: 0 6px 20px -12px rgba(6, 20, 23, 0.28);
    --shadow-lg: 0 20px 44px -28px rgba(6, 20, 23, 0.4);

    /* Скругления */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* Ритм */
    --gutter: clamp(1.15rem, 4vw, 2.5rem);
    --maxw: 1160px;
    --maxw-narrow: 720px;
    --section-y: clamp(3.75rem, 8vw, 7rem);
    --header-h: 72px;

    /* Типографика */
    --font-sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-display: 'Playfair Display', 'Manrope', Georgia, serif;

    --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
    --step-0:  clamp(1rem, 0.97rem + 0.16vw, 1.06rem);
    --step-1:  clamp(1.12rem, 1.07rem + 0.26vw, 1.28rem);
    --step-2:  clamp(1.3rem, 1.2rem + 0.5vw, 1.6rem);
    --step-3:  clamp(1.55rem, 1.36rem + 0.9vw, 2.1rem);
    --step-4:  clamp(1.85rem, 1.53rem + 1.5vw, 2.8rem);
    --step-5:  clamp(2.15rem, 1.66rem + 2.3vw, 3.5rem);

    /* Движение */
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 0.16s;
    --dur: 0.26s;
    --dur-slow: 0.5s;
}

/* --------------------------------------------------------------------------
   2. Сброс и база
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
    font-family: var(--font-sans);
    font-size: var(--step-0);
    line-height: 1.65;
    color: var(--text);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img, svg, video, canvas, iframe {
    display: block;
    max-width: 100%;
}

img { height: auto; }

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button { background: none; border: 0; cursor: pointer; }

a {
    color: var(--brand-700);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}

/* Ссылка при наведении темнеет, а не светлеет: brand-500 на белом даёт 2.6:1. */
a:hover { color: var(--brand-800); }

ul, ol { padding: 0; list-style: none; }

:focus-visible {
    /* brand-700 различим и на белом (5.1:1), и на тёмных секциях (3.6:1) */
    outline: 2px solid var(--brand-700);
    outline-offset: 3px;
    border-radius: 2px;
}

/* На тёмных поверхностях тёмная бирюза обводки почти не читается */
.hero :focus-visible,
.page-hero :focus-visible,
.section--ink :focus-visible,
.cta-band :focus-visible,
.site-footer :focus-visible { outline-color: var(--brand-300); }

::selection {
    background: var(--brand-200);
    color: var(--ink-900);
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2rem 0;
}

/* --------------------------------------------------------------------------
   3. Типографика
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink-900);
    text-wrap: balance;
}

/* Антиква — только крупные заголовки. На кегле карточек и подписей
   высококонтрастный Playfair в кириллице выглядит хлипко, а отрицательный
   трекинг там же только склеивает буквы. */
h1, h2 {
    font-family: var(--font-display);
    line-height: 1.15;
    letter-spacing: -0.015em;
}

/* Заголовок карточки не должен зависеть от уровня разметки: на странице
   ошибок это h2, в услугах — h3, а выглядеть им положено одинаково. */
.card__title,
.article-card__title,
.member__name {
    font-family: var(--font-sans);
    line-height: 1.25;
    letter-spacing: normal;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { text-wrap: pretty; }

.lead {
    font-size: var(--step-1);
    color: var(--text-muted);
    line-height: 1.6;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-sans);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-700);
}

.eyebrow::before {
    content: '';
    width: 22px;
    height: 1px;
    background: currentColor;
    opacity: 0.6;
}

.section-head {
    display: grid;
    gap: 0.9rem;
    max-width: var(--maxw-narrow);
    margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem);
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
    justify-items: center;
}

.text-brand { color: var(--brand-700); }
.text-muted { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   4. Раскладка
   -------------------------------------------------------------------------- */
.container {
    width: min(100% - var(--gutter) * 2, var(--maxw));
    margin-inline: auto;
}

.container--narrow { max-width: var(--maxw-narrow); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

.section--muted {
    background: var(--surface-2);
    border-block: 1px solid var(--line);
}

.section--tinted {
    background: var(--surface-3);
    border-block: 1px solid var(--line);
}

.section--ink {
    background: var(--ink-900);
    color: rgba(255, 255, 255, 0.75);
}

/* Два тёмных раздела подряд читаются как один: на стыке отступ не удваиваем. */
.section--ink + .section--ink { padding-top: 0; }

.section--ink h2,
.section--ink h3 { color: #fff; }

.section--ink .eyebrow { color: var(--brand-300); }

.grid { display: grid; gap: clamp(1rem, 2.2vw, 1.75rem); }

/* 380px удерживает ровно две колонки на десктопе: при 320px в контейнер
   помещалась третья, и последняя карточка оставалась одна в ряду. */
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }

.split {
    display: grid;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.stack { display: grid; gap: 1.15rem; align-content: start; }
.cluster { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* --------------------------------------------------------------------------
   5. Кнопки
   -------------------------------------------------------------------------- */
.btn {
    /* Фон основной кнопки — brand-700: на brand-500 белый текст давал 2.6:1
       при норме 4.5:1, а это самый частый элемент интерфейса. */
    --btn-bg: var(--brand-700);
    --btn-fg: #fff;
    --btn-border: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.7rem 1.4rem;
    border: 1px solid var(--btn-border);
    border-radius: var(--radius-sm);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-weight: 700;
    font-size: var(--step-0);
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease);
}

.btn:hover { color: var(--btn-fg); }

.btn[disabled],
.btn[aria-busy='true'] {
    opacity: 0.6;
    pointer-events: none;
}

.btn--primary:hover { --btn-bg: var(--brand-800); }

.btn--outline {
    --btn-bg: transparent;
    --btn-fg: var(--brand-700);
    --btn-border: var(--line-strong);
}

.btn--outline:hover {
    --btn-bg: var(--brand-50);
    --btn-border: var(--brand-400);
}

.btn--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--ink-700);
    --btn-border: transparent;
}

.btn--ghost:hover { --btn-bg: var(--surface-3); }

.btn--light {
    --btn-bg: transparent;
    --btn-fg: #fff;
    --btn-border: rgba(255, 255, 255, 0.32);
}

.btn--light:hover {
    --btn-bg: rgba(255, 255, 255, 0.1);
    --btn-border: rgba(255, 255, 255, 0.6);
}

.btn--sm { min-height: 38px; padding: 0.4rem 0.95rem; font-size: var(--step--1); }
.btn--lg { min-height: 54px; padding: 0.9rem 1.8rem; font-size: var(--step-1); }
.btn--block { width: 100%; }

.btn .icon { width: 1.1em; height: 1.1em; }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    color: var(--brand-700);
}

.link-arrow .icon { transition: transform var(--dur) var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   6. Иконки
   -------------------------------------------------------------------------- */
.icon {
    width: 1.2rem;
    height: 1.2rem;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-badge {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--brand-600);
    border: 1px solid var(--line);
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.icon-badge .icon { width: 22px; height: 22px; }

.section--ink .icon-badge { border-color: var(--line-invert); color: var(--brand-300); }

/* --------------------------------------------------------------------------
   7. Формы
   -------------------------------------------------------------------------- */
.field { display: grid; gap: 0.4rem; }

.field__label {
    font-size: var(--step--1);
    font-weight: 700;
    color: var(--ink-600);
}

.field__hint { font-size: var(--step--1); font-weight: 500; color: var(--text-muted); }

.field__error {
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--danger);
}

.input,
.textarea,
.select {
    width: 100%;
    min-height: 46px;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.textarea { min-height: 120px; resize: vertical; }

.select {
    appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2355737a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
}

.input::placeholder,
.textarea::placeholder { color: var(--ink-300); }

.input:hover,
.textarea:hover,
.select:hover { border-color: var(--ink-300); }

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--brand-700);
    box-shadow: 0 0 0 3px rgba(16, 123, 118, 0.16);
}

.input[aria-invalid='true'],
.textarea[aria-invalid='true'] {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.1);
}

.honeypot {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.consent {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: var(--step--1);
    line-height: 1.5;
    color: var(--text-muted);
}

.consent input { margin-top: 0.2rem; width: 18px; height: 18px; flex: none; accent-color: var(--brand-700); }

/* Форма на тёмном фоне */
.form--on-dark .field__label { color: rgba(255, 255, 255, 0.7); }
.form--on-dark .field__hint { color: rgba(255, 255, 255, 0.45); }

/* Только background-color: сокращённая запись background сбросила бы
   no-repeat и позицию стрелки селекта — она размножилась бы по всему полю. */
.form--on-dark .input,
.form--on-dark .textarea,
.form--on-dark .select {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Стрелка селекта по умолчанию тёмная — на тёмном фоне её не видно */
.form--on-dark .select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23b0eae6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.form--on-dark .select option { color: var(--ink-800); background: #fff; }

.form--on-dark .input::placeholder,
.form--on-dark .textarea::placeholder { color: rgba(255, 255, 255, 0.45); }

.form--on-dark .input:hover,
.form--on-dark .textarea:hover,
.form--on-dark .select:hover { border-color: rgba(255, 255, 255, 0.35); }

.form--on-dark .input:focus,
.form--on-dark .textarea:focus,
.form--on-dark .select:focus {
    border-color: var(--brand-300);
    box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.25);
}

.form--on-dark .consent { color: rgba(255, 255, 255, 0.6); }

/* --------------------------------------------------------------------------
   8. Сообщения
   -------------------------------------------------------------------------- */
.flash-stack {
    position: fixed;
    z-index: 120;
    top: calc(var(--header-h) + 0.75rem);
    right: var(--gutter);
    width: min(420px, calc(100% - var(--gutter) * 2));
    display: grid;
    gap: 0.6rem;
    pointer-events: none;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    font-size: var(--step--1);
    font-weight: 600;
    pointer-events: auto;
    animation: slide-in var(--dur-slow) var(--ease-out) both;
}

.alert__close {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: inherit;
    opacity: 0.55;
}

.alert__close:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }

.alert--success { background: var(--success-bg); border-color: rgba(18, 133, 95, 0.25); color: var(--success); }
.alert--warning { background: var(--warning-bg); border-color: rgba(154, 107, 0, 0.25); color: var(--warning); }
.alert--error   { background: var(--danger-bg);  border-color: rgba(179, 38, 30, 0.25);  color: var(--danger); }
.alert--info    { background: var(--info-bg);    border-color: var(--line);              color: var(--info); }

.form-status {
    display: none;
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: var(--step--1);
    font-weight: 600;
}

.form-status.is-visible { display: block; }
.form-status--success { background: var(--success-bg); color: var(--success); }
.form-status--error { background: var(--danger-bg); color: var(--danger); }

.form--on-dark .form-status--success { background: rgba(18, 133, 95, 0.22); color: #a7f3d0; }
.form--on-dark .form-status--error { background: rgba(179, 38, 30, 0.24); color: #fecaca; }

/* --------------------------------------------------------------------------
   9. Шапка
   -------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    left: 50%;
    top: 0.5rem;
    transform: translate(-50%, -200%);
    z-index: 200;
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-sm);
    background: var(--ink-900);
    color: #fff;
    font-weight: 700;
    transition: transform var(--dur) var(--ease);
}

.skip-link:focus { transform: translate(-50%, 0); color: #fff; }

/* Шапка прозрачна поверх тёмного героя и становится светлой при прокрутке.
   Все страницы начинаются с тёмной секции, поэтому контраст сохраняется.
   В шапке только логотип с названием и телефон. */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.site-header .brand { color: #fff; }
/* На тёмной шапке общий .brand:hover увёл бы название в тёмную бирюзу. */
.site-header .brand:hover { color: var(--brand-300); }
.site-header.is-stuck .brand:hover { color: var(--brand-700); }
.site-header .brand__sub { color: var(--brand-300); }
.site-header .brand__mark { border-color: rgba(255, 255, 255, 0.28); }
.site-header .header-phone { color: #fff; }
.site-header .header-phone .icon { color: var(--brand-300); }

.site-header.is-stuck {
    background: var(--surface);
    border-bottom-color: var(--line);
}

.site-header.is-stuck .brand { color: var(--ink-900); }
.site-header.is-stuck .brand__sub { color: var(--brand-700); }
.site-header.is-stuck .brand__mark { border-color: var(--line); }
.site-header.is-stuck .header-phone { color: var(--ink-800); }
.site-header.is-stuck .header-phone .icon { color: var(--brand-600); }

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: min(100% - var(--gutter) * 2, var(--maxw));
    margin-inline: auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    color: var(--ink-900);
    font-weight: 800;
}

.brand:hover { color: var(--brand-700); }

/* Логотип — чёрная штриховая графика на прозрачном фоне. Светлая круглая
   подложка держит его читаемым везде: и на тёмном герое, и на белой
   прилипшей шапке, и в подвале. */
.brand__mark {
    width: 44px;
    height: 44px;
    flex: none;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    border: 1px solid var(--line);
}

/* Обёртка для пары гербов: тёмный медальон на прозрачной шапке поверх героя,
   светлый герб — на белой прилипшей. Оба лежат друг на друге и переключаются
   прозрачностью, поэтому подмена не дёргает соседний текст.
   Стили действуют только внутри .brand__logo — в подвале и админке
   .brand__mark остаётся одиночным. */
.brand__logo {
    position: relative;
    flex: none;
    width: 44px;
    height: 44px;
}

.brand__logo .brand__mark {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity var(--dur) var(--ease);
}

.brand__mark--dark {
    background: none;
    border-color: transparent;
    padding: 0;
}

.site-header .brand__mark--light,
.site-header.is-stuck .brand__mark--dark { opacity: 0; }

.site-header .brand__mark--dark,
.site-header.is-stuck .brand__mark--light { opacity: 1; }

.brand__text { display: grid; min-width: 0; line-height: 1.2; }

.brand__name {
    font-family: var(--font-display);
    font-size: 1.02rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand__sub {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--brand-700);
}

/* Навигация осталась только в админ-панели */
.site-nav { margin-left: auto; }

.site-nav__list {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.site-nav__link {
    position: relative;
    display: block;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-xs);
    color: var(--ink-600);
    font-weight: 600;
    font-size: 0.94rem;
    transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.site-nav__link:hover { color: var(--brand-700); }

.site-nav__link.is-active { color: var(--brand-700); }

.site-nav__link.is-active::after {
    content: '';
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.15rem;
    height: 1px;
    background: currentColor;
}

.header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

.header-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    color: var(--ink-800);
    white-space: nowrap;
}

.header-phone:hover { color: var(--brand-700); }
.header-phone .icon { color: var(--brand-600); }

/* --------------------------------------------------------------------------
   10. Герой
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    isolation: isolate;
    padding-top: calc(var(--header-h) + clamp(2.75rem, 6vw, 5rem));
    padding-bottom: clamp(3rem, 7vw, 5.5rem);
    background: var(--ink-900);
    color: rgba(255, 255, 255, 0.78);
    overflow: hidden;
}

/* Здание — декоративная графика, разбавляющая ровный тёмный фон.
   У исходника прозрачный фон, поэтому края картинки не видны и ни фильтры,
   ни blend-режимы не нужны. */
.hero__art {
    position: absolute;
    right: -4%;
    bottom: -6%;
    width: min(64%, 820px);
    z-index: -2;
    pointer-events: none;
}

/* Подложка под текстом: строки идут поверх штриховки, и без затемнения
   заголовок читается по фасаду здания. Лежит между графикой (-2) и текстом. */
.hero::before,
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(100deg,
                var(--ink-900) 32%,
                rgba(6, 20, 23, 0.74) 54%,
                rgba(6, 20, 23, 0) 78%);
}

/* Одна колонка: справа остаётся видимой декоративная графика. */
.hero__content { max-width: min(100%, 46rem); }

.hero__title {
    color: #fff;
    font-size: var(--step-5);
    margin-bottom: 1.1rem;
}

.hero__title em {
    font-style: normal;
    color: var(--brand-300);
}

.hero__text {
    font-size: var(--step-1);
    color: rgba(255, 255, 255, 0.66);
    max-width: 50ch;
    margin-bottom: 1.85rem;
}

.hero .eyebrow { color: var(--brand-300); margin-bottom: 1rem; }

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    margin-top: 2.5rem;
    padding-top: 1.85rem;
    border-top: 1px solid var(--line-invert);
}

.hero__meta-item { display: grid; gap: 0.15rem; }

.hero__meta-value {
    font-family: var(--font-display);
    font-size: var(--step-3);
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.hero__meta-label {
    font-size: var(--step--1);
    color: rgba(255, 255, 255, 0.5);
}

/* Компактный герой внутренних страниц */
.page-hero {
    position: relative;
    isolation: isolate;
    padding-top: calc(var(--header-h) + clamp(2.25rem, 5vw, 4rem));
    padding-bottom: clamp(2.25rem, 5vw, 4rem);
    background: var(--ink-900);
    color: rgba(255, 255, 255, 0.75);
    overflow: hidden;
}

.page-hero__art {
    position: absolute;
    right: -4%;
    bottom: -22%;
    width: min(52%, 660px);
    z-index: -2;
    opacity: 0.4;
    pointer-events: none;
}

.page-hero h1 { color: #fff; font-size: var(--step-4); }

.page-hero .lead {
    color: rgba(255, 255, 255, 0.65);
    max-width: 58ch;
    margin-top: 0.9rem;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    font-size: var(--step--1);
    color: rgba(255, 255, 255, 0.45);
}

.breadcrumbs a { color: rgba(255, 255, 255, 0.7); }
.breadcrumbs a:hover { color: var(--brand-300); }
.breadcrumbs span[aria-hidden] { opacity: 0.4; }

/* --------------------------------------------------------------------------
   11. Карточки
   -------------------------------------------------------------------------- */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: clamp(1.35rem, 2.4vw, 1.85rem);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color var(--dur) var(--ease);
}

.card:hover { border-color: var(--line-strong); }
.card:hover .icon-badge { border-color: var(--brand-400); }

.card__title { font-size: var(--step-2); }
.card__text { color: var(--text-muted); }
.card__footer { margin-top: auto; padding-top: 0.35rem; }

.card--link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

/* Карточка услуги с раскрывающимся списком */
.service-card__list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.service-card__list li {
    position: relative;
    padding-left: 1.5rem;
    font-size: var(--step--1);
    color: var(--ink-600);
}

.service-card__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 10px;
    height: 6px;
    border-left: 1.5px solid var(--brand-600);
    border-bottom: 1.5px solid var(--brand-600);
    transform: rotate(-45deg);
}

details.disclosure { border-top: 1px solid var(--line); padding-top: 0.85rem; }

details.disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    font-weight: 700;
    font-size: var(--step--1);
    color: var(--brand-700);
    list-style: none;
}

details.disclosure > summary::-webkit-details-marker { display: none; }

details.disclosure > summary .icon { transition: transform var(--dur) var(--ease); }
details.disclosure[open] > summary .icon { transform: rotate(180deg); }

details.disclosure > *:not(summary) {
    margin-top: 0.85rem;
    animation: fade-up var(--dur) var(--ease-out) both;
}

/* Аккордеон вопросов */
.faq-item {
    display: block;
    padding: clamp(1rem, 2vw, 1.35rem) 0;
    border-bottom: 1px solid var(--line);
}

.faq-item:first-of-type { border-top: 1px solid var(--line); }

.faq-item > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    color: var(--ink-800);
    list-style: none;
}

.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:hover { color: var(--brand-700); }
.faq-item > summary .icon { color: var(--brand-600); transition: transform var(--dur) var(--ease); }
.faq-item[open] > summary .icon { transform: rotate(180deg); }

.faq-item > *:not(summary) {
    margin-top: 0.75rem;
    max-width: 62ch;
    color: var(--text-muted);
    animation: fade-up var(--dur) var(--ease-out) both;
}

/* Статистика */
.stat {
    display: grid;
    gap: 0.3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    transition: border-color var(--dur) var(--ease);
}

a.stat { color: inherit; }
a.stat:hover { border-top-color: var(--brand-600); }

.section--ink .stat { border-top-color: var(--line-invert); }

.stat__value {
    font-family: var(--font-display);
    font-size: var(--step-4);
    font-weight: 700;
    line-height: 1;
    color: var(--ink-900);
}

.section--ink .stat__value { color: #fff; }

.stat__label { font-size: var(--step--1); color: var(--text-muted); }
.section--ink .stat__label { color: rgba(255, 255, 255, 0.55); }

/* Шаги процесса */
.steps { counter-reset: step; }

.step {
    position: relative;
    display: grid;
    gap: 0.5rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--line);
}

.step::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    font-size: var(--step--1);
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1;
    color: var(--brand-700);
}

.step h3 { font-size: var(--step-1); }
.step p { font-size: var(--step--1); color: var(--text-muted); }

/* Команда */
.member {
    display: grid;
    gap: 0.6rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--line);
    justify-items: start;
}

.member__avatar {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--brand-50);
    border: 1px solid var(--line);
    color: var(--brand-700);
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    overflow: hidden;
}

.member__avatar img { width: 100%; height: 100%; object-fit: cover; }

.member__name { font-size: var(--step-1); }
.member__role { font-size: var(--step--1); font-weight: 700; color: var(--brand-700); }
.member__bio { font-size: var(--step--1); color: var(--text-muted); }

/* Статьи */
.article-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
    transition: border-color var(--dur) var(--ease);
}

.article-card:hover { border-color: var(--line-strong); }

.article-card__media {
    aspect-ratio: 16 / 9;
    background: var(--surface-3);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.article-card__media img { width: 100%; height: 100%; object-fit: cover; }
.article-card__media .icon { width: 32px; height: 32px; color: var(--ink-300); }

.article-card__body { display: grid; gap: 0.6rem; padding: clamp(1.15rem, 2.2vw, 1.5rem); flex: 1; }
.article-card__title { font-size: var(--step-1); }
.article-card__text { font-size: var(--step--1); color: var(--text-muted); }

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    font-size: var(--step--1);
    color: var(--text-muted);
}

.meta-row span { display: inline-flex; align-items: center; gap: 0.35rem; }
.meta-row .icon { width: 14px; height: 14px; }

/* Текст статьи */
.prose { font-size: 1.05rem; line-height: 1.78; color: var(--ink-700); }
.prose > * + * { margin-top: 1.3rem; }
.prose h2 { font-size: var(--step-3); margin-top: 2.5rem; }
.prose h3 { font-size: var(--step-2); margin-top: 2rem; }
.prose ul { display: grid; gap: 0.6rem; padding-left: 1.3rem; list-style: disc; }
.prose blockquote {
    padding: 0.35rem 0 0.35rem 1.35rem;
    border-left: 2px solid var(--brand-600);
    font-style: italic;
    color: var(--ink-600);
}

.prose__cover { width: 100%; border-radius: var(--radius-md); }

/* Контактные карточки */
.contact-card {
    display: flex;
    gap: 0.9rem;
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
}

.contact-card:first-child { border-top: 1px solid var(--line); }
.contact-card__label { font-size: var(--step--1); color: var(--text-muted); }

.contact-card__value {
    display: block;
    font-weight: 700;
    color: var(--ink-800);
    font-size: 1rem;
    overflow-wrap: anywhere;
}

a.contact-card__value:hover { color: var(--brand-700); }

/* Мессенджер под номером: подпись, а не вторая крупная строка */
.contact-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.2rem;
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--brand-700);
}

.contact-card__link:hover { text-decoration: underline; }
.contact-card__link .icon { width: 1em; height: 1em; }

/* Декоративное изображение здания. У картинки прозрачный фон, поэтому рамка
   и подложка не нужны — графика лежит прямо на тёмном фоне раздела. */
.blueprint {
    position: relative;
}

.blueprint img {
    display: block;
    width: 100%;
}

/* Полоса призыва к действию */
.cta-band {
    position: relative;
    padding: clamp(2.25rem, 5vw, 3.75rem);
    border-radius: var(--radius-lg);
    background: var(--ink-900);
    color: rgba(255, 255, 255, 0.72);
    overflow: hidden;
    text-align: center;
}

.cta-band h2 { color: #fff; margin-bottom: 0.8rem; font-size: var(--step-3); }
.cta-band p { max-width: 56ch; margin-inline: auto; margin-bottom: 1.85rem; }
.cta-band .cluster { justify-content: center; }

/* Карта */
.map-frame {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface-3);
}

.map-frame iframe { width: 100%; height: clamp(280px, 42vw, 420px); border: 0; }

/* Пустое состояние */
.empty-state {
    display: grid;
    gap: 0.9rem;
    justify-items: center;
    text-align: center;
    padding: clamp(2.25rem, 5vw, 3.5rem);
    border-radius: var(--radius-md);
    border: 1px dashed var(--line-strong);
    background: var(--surface-2);
}

.empty-state .icon-badge { width: 52px; height: 52px; }

/* Бейджи и чипы */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 700;
    background: transparent;
    color: var(--brand-700);
    border: 1px solid var(--line-strong);
}

.badge .icon { width: 13px; height: 13px; }

.badge--new { background: var(--warning-bg); color: var(--warning); border-color: rgba(154, 107, 0, 0.25); }
.badge--in_progress { background: var(--info-bg); color: var(--info); border-color: rgba(32, 178, 170, 0.3); }
.badge--processed { background: var(--success-bg); color: var(--success); border-color: rgba(18, 133, 95, 0.25); }
.badge--spam { background: var(--danger-bg); color: var(--danger); border-color: rgba(179, 38, 30, 0.25); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 38px;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--ink-600);
    transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.chip:hover { border-color: var(--brand-400); color: var(--brand-700); }
.chip.is-active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }

/* Пагинация */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 2.5rem;
}

.pagination a,
.pagination span {
    display: grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    font-weight: 700;
    font-size: var(--step--1);
    color: var(--ink-600);
}

.pagination a:hover { border-color: var(--brand-400); color: var(--brand-700); }
.pagination .is-current { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.pagination .is-gap { border-color: transparent; }

/* --------------------------------------------------------------------------
   12. Консультация — ссылки в мессенджеры
   -------------------------------------------------------------------------- */
.consult { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

.channels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: var(--maxw-narrow);
    margin-inline: auto;
}

.channel {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    padding: clamp(1.4rem, 3vw, 1.9rem) 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    text-align: center;
    transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
        box-shadow var(--dur) var(--ease);
}

.channel:hover {
    border-color: var(--brand-400);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.channel:focus-visible { outline: 2px solid var(--brand-700); outline-offset: 3px; }

.channel__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 0.35rem;
    border-radius: 50%;
    background: var(--brand-50);
    color: var(--brand-700);
}

.channel__icon .icon { width: 26px; height: 26px; }

.channel__label { font-weight: 700; color: var(--ink-800); }
.channel__note { font-size: var(--step--1); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   12b. Статья во всплывающем окне
   Сайт одностраничный: полный текст материала открывается поверх страницы,
   а не на отдельном адресе.
   -------------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: grid;
    place-items: center;
    padding: var(--gutter);
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 20, 23, 0.55);
    animation: fade-in var(--dur) var(--ease-out) both;
}

.modal__panel {
    position: relative;
    width: min(100%, 760px);
    max-height: min(88svh, 900px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    animation: fade-up var(--dur-slow) var(--ease-out) both;
}

.modal__panel:focus { outline: none; }

.modal__title { font-size: var(--step-3); margin: 0.75rem 0 1.15rem; }

.modal__close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-600);
    transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.modal__close:hover { border-color: var(--brand-400); color: var(--brand-700); }

body.modal-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   12c. Загрузка одностраничника
   -------------------------------------------------------------------------- */
.app-boot {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 2rem var(--gutter);
}

.app-boot--dark { background: var(--ink-900); color: var(--brand-300); }
.app-boot .spinner { width: 2rem; height: 2rem; border-width: 3px; }

/* --------------------------------------------------------------------------
   13. Подвал
   -------------------------------------------------------------------------- */
.site-footer {
    position: relative;
    padding-top: clamp(2.75rem, 6vw, 4.5rem);
    padding-bottom: 2rem;
    background: var(--ink-900);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.94rem;
}

.site-footer h4 {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1rem;
}

.site-footer a { color: rgba(255, 255, 255, 0.7); }
.site-footer a:hover { color: var(--brand-300); }

.footer-grid {
    display: grid;
    gap: clamp(1.85rem, 4vw, 3rem);
    grid-template-columns: minmax(240px, 1.5fr) repeat(auto-fit, minmax(150px, 1fr));
}

.footer-brand { display: grid; gap: 1rem; align-content: start; }

.footer-brand .brand { color: #fff; }
.footer-brand .brand:hover { color: var(--brand-300); }
.footer-brand .brand__mark { border-color: rgba(255, 255, 255, 0.2); }
/* Тёмный медальон уже с собственным фоном — светлая подложка и кольцо лишние */
.footer-brand .brand__mark--dark { border-color: transparent; }

/* В подвале места достаточно — обрезать название многоточием, как в шапке,
   здесь не нужно. */
.footer-brand .brand__name {
    color: #fff;
    font-size: 1.12rem;
    white-space: normal;
    overflow: visible;
}

.footer-list { display: grid; gap: 0.6rem; overflow-wrap: anywhere; }

.social-links { display: flex; gap: 0.5rem; }

.social-links a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-invert);
    color: rgba(255, 255, 255, 0.75);
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.social-links a:hover { border-color: var(--brand-400); color: var(--brand-300); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-top: clamp(2.25rem, 5vw, 3.25rem);
    padding-top: 1.35rem;
    border-top: 1px solid var(--line-invert);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.42);
}

.footer-note { max-width: 62ch; font-size: 0.8rem; line-height: 1.6; }

/* Кнопка «наверх» */
.to-top {
    position: fixed;
    right: var(--gutter);
    bottom: var(--gutter);
    z-index: 80;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink-700);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease),
                border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { border-color: var(--brand-400); color: var(--brand-700); }

/* --------------------------------------------------------------------------
   14. Админ-панель
   -------------------------------------------------------------------------- */
.admin-shell {
    padding-top: calc(var(--header-h) + 2.25rem);
    padding-bottom: 4rem;
    background: var(--surface-2);
    min-height: 100svh;
}

.admin-head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.85rem;
}

.admin-head h1 { font-size: var(--step-3); }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.panel__head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem clamp(1rem, 2vw, 1.5rem);
    border-bottom: 1px solid var(--line);
}

.panel__head h2 { font-size: var(--step-1); }
.panel__body { padding: clamp(1rem, 2vw, 1.5rem); }

.table-scroll { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

.table th,
.table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table th {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface-2);
}

.table tbody tr:hover { background: var(--surface-2); }
.table td.is-wrap { white-space: normal; min-width: 240px; }

/* Флажок и подпись в одну строку — используется формами раздела «Контент» */
.field--check {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.6rem;
}

.field--check input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--brand-700);
}

.field--check label { font-weight: 600; cursor: pointer; }

.auth-shell {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 2rem var(--gutter);
    background: var(--ink-900);
}

.auth-card {
    width: min(100%, 400px);
    padding: clamp(1.65rem, 4vw, 2.25rem);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}

.detail-list { display: grid; gap: 0.85rem; }

.detail-list div {
    display: grid;
    gap: 0.15rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.detail-list dt { font-size: var(--step--1); color: var(--text-muted); }
.detail-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   15. Анимации
   -------------------------------------------------------------------------- */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: none; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* По умолчанию контент виден. Скрытое состояние включает сам скрипт
   (класс js-reveal на <html>) — иначе без JS страница осталась бы пустой. */
.reveal {
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}

.js-reveal .reveal {
    opacity: 0;
    transform: translateY(16px);
}

.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

.spinner {
    width: 1.05em;
    height: 1.05em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* --------------------------------------------------------------------------
   16. Утилиты
   -------------------------------------------------------------------------- */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; }
.full-width { width: 100%; }

/* --------------------------------------------------------------------------
   17. Адаптив
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    :root { --header-h: 64px; }

    /* В одну колонку графика оказывается прямо под текстом — приглушаем
       и разворачиваем подложку сверху вниз: текст идёт над зданием. */
    .hero__art { right: -14%; bottom: -2%; width: 105%; opacity: 0.4; }
    .page-hero__art { right: -12%; bottom: -12%; width: 88%; opacity: 0.25; }

    .hero::before,
    .page-hero::before {
        background: linear-gradient(180deg,
                    var(--ink-900) 40%,
                    rgba(6, 20, 23, 0.8) 62%,
                    rgba(6, 20, 23, 0.4) 100%);
    }
    .footer-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

@media (max-width: 560px) {
    /* Растягиваем на всю ширину только крупные призывы к действию.
       Служебные кнопки (например, в админ-панели) сохраняют свой размер. */
    .hero .cluster > .btn,
    .page-hero .cluster > .btn,
    .cta-band .cluster > .btn,
    .empty-state .cluster > .btn { flex: 1 1 100%; width: 100%; }

    .hero__meta { gap: 1.1rem 1.75rem; }
    .flash-stack { left: var(--gutter); right: var(--gutter); width: auto; }
    .footer-grid { grid-template-columns: 1fr; }
    .table th, .table td { padding: 0.65rem 0.7rem; }

    /* Мессенджеры — в одну колонку: кнопка во всю ширину под большим пальцем */
    .channels { grid-template-columns: 1fr; }
    .channel { grid-template-columns: auto 1fr; justify-items: start; text-align: left; }
    .channel__icon { grid-row: span 2; width: 44px; height: 44px; margin-bottom: 0; }
    .channel__icon .icon { width: 22px; height: 22px; }
}

@media (max-width: 420px) {
    /* Название и телефон делят одну строку — подпись уступает место первой */
    .site-header .brand__sub { display: none; }
    .site-header .brand__name { font-size: 0.95rem; }
    .header-phone span { display: none; }
    .to-top { width: 40px; height: 40px; }
}

/* --------------------------------------------------------------------------
   18. Доступность и печать
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .js-reveal .reveal { opacity: 1; transform: none; }
}

@media (prefers-contrast: more) {
    :root { --line: rgba(6, 20, 23, 0.35); --text-muted: var(--ink-600); }
}

@media print {
    .site-header, .site-footer, .to-top, .flash-stack, .nav-backdrop, .map-frame { display: none !important; }
    body { color: #000; background: #fff; }
    .hero, .page-hero { background: #fff; color: #000; padding-top: 1rem; }
    .hero h1, .page-hero h1, .hero__title { color: #000; }
}
