/* ============================================================
   NYRKOFF.RU — style.css
   Mobile-first, Style A: Dark Professional
   ============================================================ */

/* SELF-HOSTED FONTS (Inter)
   Скачать файлы: https://gwfh.mranftl.com/fonts/inter?subsets=cyrillic,latin&styles=400,600,700
   Положить в папку fonts/ с именами: inter-400.woff2, inter-600.woff2, inter-700.woff2
   ============================================================ */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-700.woff2') format('woff2');
}

/* 1. CUSTOM PROPERTIES */
:root {
  /* Colors */
  --c-bg:          #0f0f0f;
  --c-bg-rgb:      15, 15, 15;
  --c-surface:     #1a1a1a;
  --c-surface-2:   #242424;
  --c-border:      #2a2a2a;
  --c-text:        #f0f0f0;
  --c-muted:       #999999;
  --c-subtle:      #8c8c8c;
  --c-accent:       #e8500a;
  --c-accent-rgb:   232, 80, 10;  /* для rgba() — использовать как rgba(var(--c-accent-rgb), var(--a-X)) */

  /* Прозрачность акцента — пять ролей. Своё число вместо токена не подставлять:
     именно россыпь произвольных alpha делает сборку машинной. Тени и кольца
     сюда не входят — у них свои токены ниже. */
  --a-wash:   0.06;   /* подложка: выбранный вариант, врезка, строка таблицы под курсором */
  --a-fill:   0.12;   /* заметная заливка: бейдж, тег, начало градиента */
  --a-line:   0.25;   /* граница акцентного блока */
  --a-strong: 0.5;    /* граница при наведении и выборе */
  --a-glow:   0.16;   /* декоративный радиальный глоу в hero */
  --c-accent-light: #ff7a3d;      /* для мелкого/полупрозрачного текста — проходит WCAG AA */
  --c-accent-dark:  #c94309;
  --c-error:       #e85555;
  --c-error-rgb:   232, 85, 85;
  --c-success:     #4ade80;
  --c-success-rgb: 74, 222, 128;
  --c-on-accent:   #ffffff;       /* текст и иконки поверх акцентной заливки */

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-xs:  clamp(12px, 1.5vw, 14px);
  --fs-sm:  clamp(14px, 1.8vw, 16px);
  --fs-md:  clamp(16px, 2vw, 18px);
  --fs-lg:  clamp(18px, 2.5vw, 20px);
  --fs-xl:  clamp(22px, 3vw, 28px);
  --fs-2xl: clamp(28px, 4.5vw, 44px);
  --fs-3xl: clamp(36px, 6vw, 64px);

  /* Межстрочный интервал — пять ролей, промежуточных значений не заводить */
  --lh-flat:  1;      /* цифры, иконки, счётчики */
  --lh-tight: 1.15;   /* h1–h4, hero, заголовок модалки */
  --lh-head:  1.3;    /* заголовок карточки, короткая акцентная строка */
  --lh-base:  1.6;    /* body, интерфейсные строки, подписи, описания карточек */
  --lh-text:  1.7;    /* абзацы длинного текста, статья, юридические страницы */

  /* Трекинг — три роли. Значение ниже 0.03em неразличимо: не задавать вовсе */
  --ls-tight: -0.02em;  /* заголовки крупного кегля и логотип */
  --ls-loose: 0.04em;   /* мелкие подписи без капслока */
  --ls-caps:  0.08em;   /* всё, что набрано капслоком: лейблы, бейджи, теги */

  /* Spacing (8px grid) */
  --s-half: 4px;   /* полшага: иконка↔текст, подпись под полем, зазор внутри бейджа */
  --s-mid:  12px;  /* полтора шага: вертикаль кнопок и полей, ячейка таблицы */
  --s1:  8px;
  --s2:  16px;
  --s3:  24px;
  --s4:  32px;
  --s5:  40px;
  --s6:  48px;
  --s8:  64px;
  --s10: 80px;
  --s12: 96px;
  --s15: 120px;

  /* Layout */
  --max-w: 1200px;
  --gutter: var(--s2);

  /* Shape */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;   /* чип, таблетка — единственный способ сделать pill */

  /* Transitions */
  --t: 0.2s ease;

  /* Тени и кольца — вся шкала здесь. Произвольную тень в компоненте не заводить:
     нужен новый эффект — сначала новая роль в этом списке. */
  --shadow-card:    0 2px 16px rgba(0, 0, 0, 0.4);                                              /* покой карточки */
  --shadow-hover:   0 12px 32px rgba(0, 0, 0, 0.35), 0 0 24px rgba(var(--c-accent-rgb), 0.12);  /* подъём карточки */
  --shadow-accent:  0 4px 24px rgba(var(--c-accent-rgb), 0.3);                                  /* акцентная кнопка */
  --shadow-overlay: 0 24px 60px rgba(0, 0, 0, 0.6);                                             /* модалка, поповер */
  --shadow-bar:     0 -4px 20px rgba(0, 0, 0, 0.4);                                             /* панель у края экрана */
  --ring-accent:    0 0 0 3px rgba(var(--c-accent-rgb), 0.15);                                  /* фокус поля ввода */
  --ring-edge:      0 0 0 1px var(--c-accent);                                                  /* выбранный/выделенный контур */
  --ring-photo:     0 0 0 12px rgba(var(--c-accent-rgb), 0.07);                                 /* глоу вокруг круглого портрета */
}

/* 2. RESET */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-padding-top: calc(var(--s8) + var(--s1));
  -webkit-text-size-adjust: 100%;
}

/* scroll-behavior управляется через JS (main.js) — только для якорей на текущей странице */

body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  color: var(--c-text);
  background-color: var(--c-bg);
  overflow-x: hidden;
}

img, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

picture { display: contents; }

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

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

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

/* 2b. SKIP LINK */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--s2);
  background: var(--c-accent);
  color: var(--c-on-accent);
  padding: var(--s1) var(--s2);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  white-space: nowrap;
  transition: top var(--t);
}

.skip-link:focus {
  top: var(--s2);
}

/* 3. LAYOUT */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section--alt { background-color: var(--c-surface); }

/* Соседние секции одного фона смыкаются в ОДИН шаг ритма, а не в два.
   Без этого правила 80px снизу + 80px сверху дают 160px пустоты там, где
   фон не меняется, — типовой промах, по которому сборка читается как машинная.
   Между секциями РАЗНОГО фона двойной отступ остаётся: он оплачен сменой цвета. */
.section:not(.section--alt) + .section:not(.section--alt),
.section--alt + .section--alt {
  padding-block-start: 0;
}


/* 4. TYPOGRAPHY */
h1, h2, h3, h4 {
  line-height: var(--lh-tight);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  overflow-wrap: break-word;
  text-wrap: balance;
  hyphens: none;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { line-height: var(--lh-text); }

.link {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--t);
}
.link:hover { opacity: 0.75; }

.section-label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--s2);
}

/* Тот же надзаголовок приглушённым цветом (CTA кейса, вторичные блоки) */
.section-label--muted { color: var(--c-subtle); }

.section-title {
  margin-bottom: var(--s3);
  /* Перенос длинных слов на узких экранах (полагается на &shy; в HTML
     там, где разбиение важно; CSS-hyphens — fallback) */
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

.hero__title {
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}

.section-desc {
  color: var(--c-muted);
  max-width: 640px;
  line-height: var(--lh-text);
}

/* Второй абзац-описание под первым (отбивка между смысловыми частями) */
.section-desc--follow { margin-top: var(--s2); }

/* 5. BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  min-height: 48px;
  min-width: 44px;
  padding: var(--s-mid) var(--s4);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 700;        /* 700 + 14px → "large bold" по WCAG, требование 3:1 вместо 4.5:1 */
  transition: background-color var(--t), color var(--t),
              border-color var(--t), box-shadow var(--t), transform var(--t);
  white-space: nowrap;
  max-width: 100%;
  text-decoration: none;
  cursor: pointer;
}

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

.btn-primary {
  background-color: var(--c-accent);
  color: var(--c-on-accent);
}

.btn-primary:hover {
  background-color: var(--c-accent-dark);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background-color: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-border);
}

.btn-ghost:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

/* 6. HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  background-color: rgba(var(--c-bg-rgb), 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  width: 100%;
}

.header__logo {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  flex-shrink: 0;
}

.header__logo span { color: var(--c-accent); }

.header__nav { display: none; }

.header__nav-list {
  display: flex;
  gap: clamp(var(--s1), 1.2vw, var(--s4));
}

.header__nav-link {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  transition: color var(--t);
  padding-block: var(--s1);
  white-space: nowrap;
}

.header__nav-link:hover,
.header__nav-link.is-active {
  color: var(--c-text);
}

.header__nav-link.is-active {
  color: var(--c-accent);
}

.header__cta { display: none; }

/* Phone */
.header__phone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--c-text);
  text-decoration: none;
  flex-shrink: 0;
  transition: color var(--t);
}

.header__phone:hover { color: var(--c-accent); }

.header__phone-icon { display: block; flex-shrink: 0; }

.header__phone-text { display: none; }

/* Burger */
.header__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-half);
  width: 44px;
  height: 44px;
  padding: var(--s1);
  flex-shrink: 0;
}

.header__burger-line {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--c-text);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
  transform-origin: center;
}

.header__burger[aria-expanded="true"] .header__burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header__burger[aria-expanded="true"] .header__burger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.header__burger[aria-expanded="true"] .header__burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav */
.mobile-nav {
  position: fixed;
  inset: 64px 0 0 0;
  z-index: 99;
  background-color: var(--c-bg);
  padding: var(--s4);
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.mobile-nav[hidden] { display: none; }

.mobile-nav__link {
  font-size: var(--fs-lg);
  color: var(--c-muted);
  padding-block: var(--s2);
  border-bottom: 1px solid var(--c-border);
  display: block;
  transition: color var(--t);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.mobile-nav__link:hover { color: var(--c-text); }

.mobile-nav__cta { margin-top: var(--s4); }

/* 7. HERO */
.hero {
  padding-block: var(--s12) var(--s10);
  background:
    radial-gradient(ellipse 720px 480px at 10% 105%, rgba(var(--c-accent-rgb), var(--a-wash)), transparent 65%),
    linear-gradient(180deg, var(--c-surface) 0%, var(--c-bg) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -35%;
  right: -15%;
  width: 760px;
  height: 760px;
  background: radial-gradient(circle, rgba(var(--c-accent-rgb), var(--a-glow)) 0%, rgba(var(--c-accent-rgb), var(--a-wash)) 45%, transparent 70%);
  pointer-events: none;
}

/* Зерно поверх глоу — снимает «плоскость» тёмного фона */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}

.hero__main {
  display: flex;
  flex-direction: column;
  gap: var(--s6);
}

.hero__photo-col {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.hero__photo {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 3px solid var(--c-accent);
  box-shadow: var(--ring-photo), var(--shadow-card);
  display: block;
  aspect-ratio: 1;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s1);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--s3);
}

.hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  background-color: var(--c-accent);
  flex-shrink: 0;
}

.hero__title {
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--s3);
}

.hero__title span { color: var(--c-accent); }

.hero__subtitle {
  font-size: var(--fs-lg);
  color: var(--c-muted);
  line-height: var(--lh-base);
  max-width: 580px;
  margin-bottom: var(--s6);
}

.hero__utp {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-bottom: var(--s6);
}

.hero__utp-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  font-size: var(--fs-lg);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

.hero__utp-check {
  color: var(--c-accent);
  font-weight: 700;
  flex-shrink: 0;
  padding-top: 2px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4) var(--s6);
  padding-top: var(--s8);
  border-top: 1px solid var(--c-border);
}

.hero__stat-num {
  display: block;
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: var(--lh-flat);
  margin-bottom: var(--s-half);
}

.hero__stat-num span { color: var(--c-accent); }

.hero__stat-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-muted);
  letter-spacing: var(--ls-loose);
}

.hero__cta-note {
  margin-top: var(--s2);
  font-size: var(--fs-xs);
  color: var(--c-subtle);
}

/* 8. DIFFERENCE */
.difference__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
  margin-top: var(--s6);
}

.diff-card {
  background-color: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  transition: border-color var(--t), box-shadow var(--t);
}

.diff-card:hover {
  border-color: var(--c-accent);
  box-shadow: var(--ring-edge), var(--shadow-card);
}

.diff-card__icon {
  display: block;
  width: 28px;
  height: 28px;
  color: var(--c-accent);
  margin-bottom: var(--s3);
}

.diff-card__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--s2);
}

.diff-card__text {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

/* 9. SERVICES */
.services__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
  margin-top: var(--s6);
}

.service-card {
  background-color: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  transition: border-color var(--t), transform var(--t);
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  border-color: var(--c-accent);
  transform: translateY(-2px);
}

.service-card--featured {
  border-color: rgba(var(--c-accent-rgb), var(--a-line));
  background: linear-gradient(160deg, var(--c-surface) 60%, rgba(var(--c-accent-rgb), var(--a-wash)) 100%);
}

/* Бейдж внутри карточки услуги: сам бейдж общий, отбивка — забота карточки */
.service-card .badge { margin-bottom: var(--s3); }

.service-card__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--s2);
}

.service-card__desc {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
  margin-bottom: var(--s3);
}

.service-card__features {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding-top: var(--s3);
  border-top: 1px solid var(--c-border);
  flex: 1;
}

.service-card__feature {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  display: flex;
  align-items: flex-start;
  gap: var(--s1);
}

.service-card__feature::before {
  content: '✓';
  color: var(--c-accent);
  font-weight: 700;
  flex-shrink: 0;
}

.service-card__timing {
  font-size: var(--fs-sm);
  color: var(--c-subtle);
  margin-bottom: var(--s3);
}

.service-card__cta {
  margin-top: var(--s4);
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--s-half);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--t), gap var(--t);
}

.service-card__cta:hover {
  color: var(--c-accent-dark);
  gap: var(--s1);
}

/* 9b. SERVICE-ROW */
.service-row {
  padding-block: var(--s8);
}

.service-row__head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.service-row__title {
  font-size: var(--fs-xl);
  margin-bottom: var(--s1);
}

.service-row__timing {
  font-size: var(--fs-sm);
  color: var(--c-subtle);
}

.service-row__cta {
  flex-shrink: 0;
}

.service-row__body {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.service-row__for {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin-top: var(--s2);
}

.service-row__includes-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-subtle);
  margin-bottom: var(--s2);
}

.service-row__features {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.service-row__feature {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  display: flex;
  gap: var(--s1);
}

.service-row__feature::before {
  content: '✓';
  color: var(--c-accent);
  font-weight: 700;
  flex-shrink: 0;
}

.services__divider {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 0;
}

/* 10. PORTFOLIO */
.portfolio__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
  margin-top: var(--s6);
}

.portfolio-card {
  border-radius: var(--r-lg);
  overflow: hidden;
  background-color: var(--c-surface);
  border: 1px solid var(--c-border);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
  position: relative;
}

.portfolio-card:hover {
  border-color: var(--c-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.portfolio-card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--c-surface-2);
}

.portfolio-card__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.portfolio-card:hover .portfolio-card__img img {
  transform: scale(1.06);
}

.portfolio-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--c-surface-2), var(--c-surface));
  color: var(--c-subtle);
}

.portfolio-card__body { padding: var(--s3); }

/* Надзаголовок внутри карточки работы прижат к заголовку плотнее обычного */
.portfolio-card .section-label { margin-bottom: var(--s1); }

.portfolio-card__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--s1);
}

.portfolio-card__desc {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

.portfolio-card__link {
  display: inline-flex;
  align-items: center;
  margin-top: var(--s2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-accent);
  transition: color var(--t);
}

.portfolio-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
}


/* 10b. CASES */
.cases__list {
  display: flex;
  flex-direction: column;
  gap: var(--s6);
  margin-top: var(--s6);
}

.case-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.case-card__preview {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--c-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--c-surface-2), var(--c-surface));
  color: var(--c-subtle);
}

.case-card__body {
  padding: var(--s4);
}

.case-card__num {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--s1);
}

.case-card__title {
  font-size: var(--fs-xl);
  margin-bottom: var(--s4);
}

.case-card__section {
  margin-bottom: var(--s3);
}


.case-card__section-text {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

.case-card__done {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.case-card__done-item {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  display: flex;
  align-items: flex-start;
  gap: var(--s1);
}

.case-card__done-item::before {
  content: '✓';
  color: var(--c-accent);
  font-weight: 700;
  flex-shrink: 0;
}

.case-card__section--result {
  border-top: 1px solid var(--c-border);
  padding-top: var(--s3);
  margin-top: var(--s3);
}

.case-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s6);
  margin-top: var(--s2);
}

.case-card__metric-num {
  display: block;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-accent);
  line-height: var(--lh-flat);
}

.case-card__metric-lbl {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-muted);
  margin-top: var(--s-half);
}

/* 11. PROCESS */
.process__steps {
  display: flex;
  flex-direction: column;
  margin-top: var(--s6);
}

.process-step {
  display: flex;
  gap: var(--s4);
  position: relative;
}

.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--c-accent) 0%, var(--c-border) 100%);
}

.process-step__num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c-on-accent);
  position: relative;
  z-index: 1;
}

.process-step__content {
  flex: 1;
  padding-bottom: var(--s8);
}

.process-step:last-child .process-step__content {
  padding-bottom: 0;
}

.process-step__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--s1);
  padding-top: var(--s1);
}

.process-step__text {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

/* Врезка «Если пропустить / сэкономить» под описанием этапа (price.html) */
.process-step__note {
  margin-top: var(--s2);
  padding: var(--s1) 0 var(--s1) var(--s2);
  border-left: 2px solid var(--c-accent);
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

.process-step__note strong {
  color: var(--c-accent-light);
  font-weight: 600;
}

.process-step__timing {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-accent);
  margin-bottom: var(--s2);
  letter-spacing: var(--ls-loose);
}

.process__trust {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
  margin-top: var(--s6);
  padding-top: var(--s6);
  border-top: 1px solid var(--c-border);
}

.trust-item {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
}

.trust-item__icon {
  flex-shrink: 0;
  color: var(--c-accent);
}

.trust-item__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-half);
}

.trust-item__title {
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: var(--lh-head);
}

.trust-item__text {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

/* 12. ABOUT */
.about__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  align-items: start;
}

.about__photo-wrap {
  display: flex;
  justify-content: center;
}

.about__photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--c-accent);
  box-shadow: var(--ring-photo);
}


.about__text-block h2 { margin-bottom: var(--s3); }

.about__lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-base);
  margin-bottom: var(--s3);
}

.about__text {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-text);
  margin-bottom: var(--s2);
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
  margin-top: var(--s3);
  margin-bottom: var(--s4);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--c-border);
}

.about__stat-num {
  display: block;
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: var(--lh-flat);
  margin-bottom: var(--s-half);
}

.about__stat-num span { color: var(--c-accent); }

.about__stat-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

.about__bio {
  font-size: var(--fs-md);
  color: var(--c-muted);
  line-height: var(--lh-text);
  margin-bottom: var(--s4);
}

.about__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-top: var(--s4);
}

.about__pill {
  font-size: var(--fs-xs);
  padding: var(--s-half) var(--s-mid);
  border-radius: var(--r-pill);
  background-color: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
}

/* 13. FAQ */
.faq__list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-top: var(--s6);
}


.faq-item {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  background-color: var(--c-surface);
  transition: border-color var(--t);
}

.faq-item.is-open { border-color: var(--c-accent); }

.faq-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  width: 100%;
  min-height: 56px;
  padding: var(--s3) var(--s4);
  text-align: left;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text);
  transition: color var(--t);
  cursor: pointer;
  background: none;
  border: none;
}

.faq-item__trigger:hover { color: var(--c-accent); }

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

.faq-item__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
  color: var(--c-accent);
}

.faq-item__icon::before,
.faq-item__icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: currentColor;
  transform: translateY(-50%);
  transition: transform var(--t), opacity var(--t);
}

.faq-item__icon::after {
  transform: translateY(-50%) rotate(90deg);
}

.faq-item.is-open .faq-item__icon::after {
  transform: translateY(-50%) rotate(0deg);
  opacity: 0;
}

.faq-item__body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.32s ease;
}

.faq-item.is-open .faq-item__body {
  max-height: 480px;
}

.faq-item__text {
  padding: 0 var(--s4) var(--s4);
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-text);
}

/* Form (используется в модалке #contactModal и в brief.html) */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.form__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-loose);
  color: var(--c-muted);
}

.form__input,
.form__textarea {
  background-color: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--s-mid) var(--s2);
  font-size: 16px; /* Не меньше 16px — предотвращает auto-zoom на iOS */
  color: var(--c-text);
  width: 100%;
  transition: border-color var(--t), box-shadow var(--t);
  min-height: 48px;
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--c-subtle);
}

.form__input:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: var(--ring-accent);
}

.form__input.is-error,
.form__textarea.is-error {
  border-color: var(--c-error);
}

.form__error {
  font-size: var(--fs-xs);
  color: var(--c-error);
  display: none;
}

.form__error.is-visible { display: block; }

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

.form__consent {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  cursor: pointer;
}

.form__consent.is-error input[type="checkbox"] {
  outline: 2px solid var(--c-error);
  outline-offset: 2px;
}

.form__consent.is-error .form__consent-text {
  color: var(--c-error);
}

.form__consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--c-accent);
  cursor: pointer;
}

.form__consent-text {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

.form__consent-text a {
  color: var(--c-accent);
  text-decoration: underline;
}

.form__micro {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
  margin-top: var(--s1);
}

.form__success {
  display: none;
  padding: var(--s3);
  background-color: rgba(var(--c-success-rgb), 0.08);
  border: 1px solid rgba(var(--c-success-rgb), 0.25);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--c-success);
  text-align: center;
}

.form__success.is-visible { display: block; }

/* Honeypot */
.honeypot { display: none; }

/* 14b. SECTION CTA — единый стиль для Работы / Процесс / FAQ */
.section-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s2);
  margin-top: var(--s8);
  padding: var(--s4) var(--s5);
  background: linear-gradient(90deg, rgba(var(--c-accent-rgb), var(--a-fill)) 0%, transparent 100%);
  border: 1px solid rgba(var(--c-accent-rgb), var(--a-line));
  border-left: 3px solid var(--c-accent);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
}

.section-cta__text {
  font-size: var(--fs-lg);
  color: var(--c-text);
  line-height: var(--lh-head);
}

/* В строчной раскладке (768+) кнопка не должна ужиматься уже своего текста */
.section-cta .btn { flex-shrink: 0; }

/* Когда .section-cta завершает страницу (блог-листинг) — отступ до футера,
   как у .case-cta. На главной .section-cta живёт внутри секции и это правило не ловит. */
main > .container > .section-cta:last-child { margin-bottom: var(--s8); }

/* 15. FOOTER */
.footer {
  background-color: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding-block: var(--s6);
}

.footer__top {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  margin-bottom: var(--s4);
}

.footer__logo {
  display: inline-block;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
}

.footer__logo span { color: var(--c-accent); }

.footer__tagline {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin-top: var(--s1);
}

.footer__nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
}

.footer__link {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  transition: color var(--t);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer__link:hover { color: var(--c-text); }

.footer__bottom--flush {
  border-top: none;
  padding-top: 0;
}

.footer__bottom {
  padding-top: var(--s4);
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
}

.footer__copy {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
}

.footer__legal {
  display: flex;
  gap: var(--s3);
}

.footer__legal-link {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
  transition: color var(--t);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer__legal-link:hover { color: var(--c-muted); }

.footer__contacts {
  display: flex;
  flex-direction: column;
  gap: var(--s-half);
}

.footer__contact-link {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  transition: color var(--t);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
}

.footer__contact-link:hover { color: var(--c-accent); }

/* ============================================================
   16. CASE PAGES
   ============================================================ */

/* Breadcrumb */
.case-breadcrumb { padding-top: var(--s4); padding-bottom: var(--s3); }

.case-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}

.case-breadcrumb li + li::before {
  content: '→';
  margin-right: var(--s1);
  color: var(--c-subtle);
}

.case-breadcrumb a { color: var(--c-muted); transition: color var(--t); }
.case-breadcrumb a:hover { color: var(--c-accent); }

/* Case hero */
.case-hero { padding-block: var(--s6) var(--s4); }

.case-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-bottom: var(--s3);
}


.case-hero__title {
  font-size: var(--fs-2xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--s3);
  max-width: 720px;
}

.case-hero__lead {
  font-size: var(--fs-lg);
  color: var(--c-muted);
  line-height: var(--lh-base);
  max-width: 640px;
  margin-bottom: var(--s6);
}

/* Metrics strip */
.case-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--s6);
}

.case-metrics__item {
  background: var(--c-surface);
  padding: var(--s2) var(--s1);
  text-align: center;
}

.case-metrics__value {
  display: block;
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--c-accent);
  line-height: var(--lh-flat);
  margin-bottom: var(--s1);
}

.case-metrics__label {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

/* Meta overview */
.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s6);
  padding: var(--s3) var(--s4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  margin-bottom: var(--s6);
}

.case-meta__item {
  display: flex;
  flex-direction: column;
  gap: var(--s-half);
}

.case-meta__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-subtle);
}

.case-meta__value { font-size: var(--fs-sm); }

/* Mockup (SVG-placeholder, legacy) */
.case-mockup {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--s8);
  background: var(--c-surface);
  aspect-ratio: 2 / 1;
}

.case-mockup svg { width: 100%; height: 100%; display: block; }

/* Iframe preview */
.case-preview { margin-bottom: var(--s8); }

.case-preview__browser {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  overflow: hidden;
}

.case-preview__chrome {
  display: flex;
  align-items: center;
  gap: var(--s1);
  padding: var(--s-mid) var(--s2);
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}

.case-preview__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-border);
  flex-shrink: 0;
}

.case-preview__frame-wrap {
  height: 460px;
  overflow: hidden;
  /* Белый здесь — не цвет палитры, а холст под превью клиентского сайта.
     На токен не менять: он должен остаться белым при любой смене темы. */
  background: #fff;
}

.case-preview__frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.case-preview__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: none;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.case-preview__hint {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
}

/* Content sections */
.case-section {
  max-width: 720px;
  margin-bottom: var(--s8);
}

.case-section__title {
  font-size: var(--fs-xl);
  margin-bottom: var(--s3);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--c-border);
}

.case-section p {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-text);
  margin-bottom: var(--s2);
}

.case-section p:last-child { margin-bottom: 0; }

.case-section ol {
  list-style: none;
  padding-left: 0;
  counter-reset: approach;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

/* Отбивка списка от следующего за ним абзаца (напр. «Ориентиры по форматам» на price.html) */
.case-section ol:not(:last-child) { margin-bottom: var(--s3); }

.case-section ol li {
  counter-increment: approach;
  display: flex;
  gap: var(--s2);
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

.case-section ol li::before {
  content: counter(approach, decimal-leading-zero);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c-accent);
  flex-shrink: 0;
  min-width: 24px;
  padding-top: 1px;
}

/* Key decisions */
.case-decisions { margin-bottom: var(--s8); }

.case-decisions__title {
  font-size: var(--fs-xl);
  margin-bottom: var(--s4);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--c-border);
  max-width: 720px;
}

.case-decisions__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s2);
}

.case-decision {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--r-lg);
  padding: var(--s3) var(--s4);
}

.case-decision__num {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--s1);
}

.case-decision__title {
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: var(--s1);
}

.case-decision__text {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

/* CTA block */
.case-cta {
  text-align: center;
  padding: var(--s8) var(--s4);
  background: linear-gradient(160deg, var(--c-surface) 60%, rgba(var(--c-accent-rgb), var(--a-wash)) 100%);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  margin-bottom: var(--s8);
}


.case-cta__title {
  font-size: var(--fs-xl);
  margin-bottom: var(--s2);
}

.case-cta__desc {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin-bottom: var(--s4);
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  line-height: var(--lh-base);
}

/* Case prev/next nav */
.case-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
  padding-block: var(--s6);
  border-top: 1px solid var(--c-border);
  margin-bottom: var(--s6);
}

.case-nav__link {
  display: flex;
  flex-direction: column;
  gap: var(--s-half);
  min-height: 44px;
  justify-content: center;
}

.case-nav__link--next { align-items: flex-end; }

.case-nav__dir {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
}

.case-nav__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-muted);
  transition: color var(--t);
}

.case-nav__link:hover .case-nav__name { color: var(--c-accent); }

/* ============================================================
   17. CALCULATOR
   ============================================================ */

/* Base package */
.calc-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s6);
  padding: var(--s3) var(--s4);
  background: rgba(var(--c-accent-rgb), var(--a-wash));
  border: 1px solid rgba(var(--c-accent-rgb), var(--a-line));
  border-left: 3px solid var(--c-accent);
  border-radius: var(--r-lg);
  margin-bottom: var(--s5);
}

.calc-base__inner {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
}

.calc-base__check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.calc-base__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--s-half);
}


.calc-base__desc {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  line-height: var(--lh-base);
}

.calc-base__price {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-accent);
  flex-shrink: 0;
}

/* Block grid */
.calc-grid { margin-bottom: var(--s4); }

.calc-grid__heading {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-muted);
  margin-bottom: var(--s3);
}

.calc-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s2);
}

/* Card */
.calc-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  position: relative;
  transition: border-color var(--t), background-color var(--t), box-shadow var(--t);
  user-select: none;
  -webkit-user-select: none;
}

.calc-card:hover { border-color: rgba(var(--c-accent-rgb), var(--a-strong)); }

.calc-card.is-selected {
  border-color: var(--c-accent);
  background: rgba(var(--c-accent-rgb), var(--a-wash));
  box-shadow: var(--ring-edge);
}

.calc-card.is-focused {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* Visually hidden checkbox, remains keyboard-focusable */
.calc-card__check {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Checkmark circle (top-right) */
.calc-card__mark {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--c-border);
  transition: background-color var(--t), border-color var(--t);
}

.calc-card.is-selected .calc-card__mark {
  background: var(--c-accent);
  border-color: var(--c-accent);
}

.calc-card.is-selected .calc-card__mark::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 6px;
  height: 10px;
  border-right: 2px solid var(--c-on-accent);
  border-bottom: 2px solid var(--c-on-accent);
  transform: rotate(45deg);
}

.calc-card__icon {
  display: block;
  width: 24px;
  height: 24px;
  color: var(--c-accent);
  margin-bottom: var(--s1);
  flex-shrink: 0;
}

.calc-card__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text);
  line-height: var(--lh-head);
  padding-right: var(--s4);
}

.calc-card__desc {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  line-height: var(--lh-base);
  flex: 1;
}

.calc-card__price {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--c-accent);
  margin-top: var(--s1);
}

/* Result bar */
.calc-result {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-top: var(--s6);
  padding: var(--s4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
}

.calc-result__info { flex: 1; }

.calc-result__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s2) var(--s5);
  margin-bottom: var(--s2);
}

.calc-result__blocks {
  font-size: var(--fs-xs);
  color: var(--c-muted);
}

.calc-result__price-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calc-result__from {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
  line-height: var(--lh-flat);
}

.calc-result__total {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--c-accent);
  line-height: var(--lh-flat);
}

.calc-result__note {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
  line-height: var(--lh-base);
}

.calc-result__cta { align-self: flex-start; }

/* ============================================================
   18. BRIEF PAGE
   ============================================================ */

.brief-hero {
  padding-block: var(--s8) var(--s5);
  max-width: 680px;
}

.brief-hero__title {
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-3xl));
  font-weight: 700;
  line-height: var(--lh-tight);
  margin-bottom: var(--s3);
}

.brief-hero__lead {
  font-size: var(--fs-lg);
  color: var(--c-muted);
  line-height: var(--lh-base);
  margin-bottom: var(--s2);
}

.brief-hero__note {
  font-size: var(--fs-sm);
  color: var(--c-subtle);
  line-height: var(--lh-base);
  padding: var(--s2) var(--s3);
  background: var(--c-surface);
  border-left: 2px solid var(--c-border);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* Form layout */
.brief-form {
  display: flex;
  flex-direction: column;
  gap: var(--s6);
  max-width: 720px;
  padding-bottom: var(--s12);
}

/* Consent + submit — визуально отделены от полей */
.brief-form .form__consent {
  margin-top: var(--s2);
  padding-top: var(--s5);
  border-top: 1px solid var(--c-border);
}

.brief-form .form__consent + div {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-top: var(--s1);
}

/* Override textarea min-height inside brief — rows attribute controls height */
.brief-form .form__textarea {
  min-height: auto;
}

/* Fieldset sections */
.brief-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.brief-fieldset__legend {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-text);
  padding: 0 0 var(--s3);
  border-bottom: 1px solid var(--c-border);
  width: 100%;
  margin-bottom: var(--s1);
}

/* Required asterisk */
.form__required {
  color: var(--c-accent);
  margin-left: 2px;
}

/* Hint text below label */
.form__hint {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
  line-height: var(--lh-base);
  margin-top: -2px;
}

/* Select — inherits .form__input, adds custom arrow */
.form__select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23808080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: var(--s5);
  cursor: pointer;
}

.form__select option { background: var(--c-surface-2); }

/* Checkbox chip group */
.brief-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.brief-check {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-size: var(--fs-sm);
  color: var(--c-text);
  cursor: pointer;
  padding: var(--s1) var(--s-mid);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition: border-color var(--t), background-color var(--t);
  user-select: none;
  -webkit-user-select: none;
}

.brief-check:hover { border-color: rgba(var(--c-accent-rgb), var(--a-strong)); }

.brief-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--c-accent);
  cursor: pointer;
}

.brief-check:has(input:checked) {
  border-color: var(--c-accent);
  background: rgba(var(--c-accent-rgb), var(--a-wash));
}

/* Extra textarea after checkboxes */
.brief-fieldset__extra { margin-top: var(--s2); }

/* Mobile overflow guards */
.container,
.hero__text,
.hero__actions,
.hero__utp-item,
.section-desc,
.case-breadcrumb,
.case-hero__tags,
.case-meta,
.case-meta__item,
.case-preview__bar,
.modal__dialog,
.form__consent,
.form__consent-text,
.cookie-banner__inner,
.cookie-banner__text {
  min-width: 0;
}

.hero__eyebrow,
.section-label,
.badge,
.case-breadcrumb,
.case-meta__value,
.case-preview__hint,
.form__consent-text,
.cookie-banner__text,
.cookie-banner__link {
  overflow-wrap: anywhere;
}

@media (max-width: 479px) {
  .hero__title {
    font-size: clamp(32px, 9vw, 36px);
    overflow-wrap: break-word;
    word-break: normal;
  }

  .hero__eyebrow {
    align-items: flex-start;
    line-height: var(--lh-base);
  }

  .hero__actions {
    align-items: stretch;
  }

  .hero__actions .btn,
  .case-preview__bar .btn,
  .modal .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .case-metrics {
    grid-template-columns: 1fr;
  }

  .case-meta {
    padding: var(--s3);
    gap: var(--s3);
  }

  .case-meta__item {
    flex: 1 1 100%;
  }

  .calc-cards {
    grid-template-columns: 1fr;
  }

  .form__consent input[type="checkbox"] {
    flex: 0 0 18px;
  }

  .modal__dialog {
    padding-inline: var(--s3);
  }

  .cookie-banner__inner {
    padding-inline: 0;
  }

  .cookie-banner__btn {
    width: 100%;
  }
}

/* ============================================================
   19. BLOG
   ============================================================ */
.blog-hero {
  max-width: 720px;
  margin-bottom: var(--s6);
}

.blog-hero__title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--s2);
}

.blog-hero__lead {
  font-size: var(--fs-md);
  color: var(--c-muted);
  line-height: var(--lh-text);
}

.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s2);
  margin-bottom: var(--s10);
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  transition: border-color var(--t), transform var(--t);
}

.blog-card:hover {
  border-color: var(--c-accent);
  transform: translateY(-2px);
}

.blog-card__date {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
  margin-bottom: var(--s1);
}

.blog-card__title {
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: var(--s1);
}

.blog-card__title a {
  color: var(--c-text);
  text-decoration: none;
  transition: color var(--t);
}

.blog-card__title a:hover { color: var(--c-accent); }

.blog-card__desc {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
  margin-bottom: var(--s2);
  flex: 1;
}

.blog-card__link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--t);
}

.blog-card__link:hover { color: var(--c-accent-light); }

/* Статья (прозаический контейнер, по прецеденту .legal-content) */
.article {
  max-width: 720px;
  margin-bottom: var(--s8);
}

.article__meta {
  display: flex;
  gap: var(--s2);
  font-size: var(--fs-xs);
  color: var(--c-subtle);
  margin-bottom: var(--s3);
}

.article__title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--s2);
}

.article__lead {
  font-size: var(--fs-md);
  color: var(--c-muted);
  line-height: var(--lh-text);
  margin-bottom: var(--s4);
}

.article h2 {
  font-size: var(--fs-xl);
  margin-top: var(--s6);
  margin-bottom: var(--s3);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--c-border);
}

.article h3 {
  font-size: var(--fs-lg);
  margin-top: var(--s4);
  margin-bottom: var(--s2);
}

.article p {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-text);
  margin-bottom: var(--s2);
}

.article ul,
.article ol {
  padding-left: var(--s4);
  margin-bottom: var(--s3);
}

.article ul { list-style: disc; }
.article ol { list-style: decimal; }

.article li {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-text);
  margin-bottom: var(--s1);
}

.article li::marker { color: var(--c-accent); }

.article a { color: var(--c-accent); }
.article a:hover { color: var(--c-accent-light); }

.article img {
  max-width: 100%;
  border-radius: var(--r-lg);
  margin-block: var(--s2);
}

.article blockquote {
  border-left: 3px solid var(--c-accent);
  background: var(--c-surface);
  border-radius: var(--r-md);
  padding: var(--s2) var(--s3);
  margin-bottom: var(--s2);
}

.article blockquote p { margin-bottom: 0; }

/* Врезка со ссылкой на кейс/прототип */
.article__case {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--r-lg);
  padding: var(--s3) var(--s4);
  margin-block: var(--s4);
}

.article__case p { margin-bottom: var(--s2); }
.article__case p:last-child { margin-bottom: 0; }

/* ============================================================
   20. VISUAL DEPTH & MOTION (демо визуального апгрейда)
   ============================================================ */

/* Дыхание глоу в hero — только при разрешённой анимации */
@media (prefers-reduced-motion: no-preference) {
  .hero::before {
    animation: hero-glow 9s ease-in-out infinite alternate;
  }
}

@keyframes hero-glow {
  from { opacity: 0.7; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.08); }
}

/* Фирменная точка (рифма с логотипом «Нырков.»):
   белая после акцентной части H1, акцентная после H2 главной */
.hero__title span::after {
  content: '.';
  color: var(--c-text);
}

#difference .section-title::after,
#services .section-title::after,
#portfolio .section-title::after,
#process .section-title::after,
#faq .section-title::after,
#calculator .section-title::after {
  content: '.';
  color: var(--c-accent);
}

/* Стабильная ширина цифр при анимации счётчиков */
.hero__stat-num,
.about__stat-num {
  font-variant-numeric: tabular-nums;
}

/* Появление блоков при скролле. Скрытие активируется только классом
   js-reveal на <html> (ставит main.js) — без JS всё видно сразу.
   После появления main.js снимает классы, чтобы не мешать hover-transform. */
.js-reveal .reveal-item {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  transition-delay: var(--rd, 0s);
}

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

/* ============================================================
   21. FIRST STEP (витрина бесплатного первого шага, index)
   ============================================================ */
.first-step__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  align-items: center;
  margin-top: var(--s6);
}

.first-step__list {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.first-step__cta {
  margin-top: var(--s2);
  align-self: flex-start;
}

.first-step__visual { min-width: 0; }

.first-step__browser {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.first-step__skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4);
}

.fs-sk {
  display: block;
  background: var(--c-surface-2);
  border-radius: var(--r-sm);
}

.fs-sk--eyebrow { width: 38%; height: 10px; }

.fs-sk--title { width: 86%; height: 22px; }

.fs-sk--title-short { width: 58%; }

.fs-sk--text { width: 70%; height: 12px; }

.fs-sk--btn {
  width: 168px;
  height: 40px;
  margin-top: var(--s1);
  border-radius: var(--r-md);
  background: rgba(var(--c-accent-rgb), 0.85);
}

.first-step__map {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  margin-top: var(--s3);
}

.first-step__chip {
  padding: var(--s-half) var(--s-mid);
  font-size: var(--fs-xs);
  color: var(--c-muted);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.first-step__chip--accent {
  color: var(--c-on-accent);
  font-weight: 600;
  background: var(--c-accent);
  border-color: var(--c-accent);
}

.first-step__arrow {
  color: var(--c-subtle);
  font-size: var(--fs-xs);
}

.first-step__caption {
  margin-top: var(--s2);
  font-size: var(--fs-xs);
  color: var(--c-subtle);
  line-height: var(--lh-base);
}

@media (min-width: 1024px) {
  .first-step__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--s8);
  }
}

/* ============================================================
   BREAKPOINTS
   ============================================================ */

/* Tablet 768px+ */
@media (min-width: 768px) {
  :root { --gutter: var(--s6); }

  .header__phone { min-width: auto; min-height: auto; gap: var(--s1); }
  .header__phone-icon { display: none; }
  .header__phone-text {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    white-space: nowrap;
  }

  .hero { padding-block: var(--s15) var(--s12); }

  .hero__main {
    display: grid;
    grid-template-columns: 340px 1fr;
    align-items: center;
    gap: var(--s8);
  }

  .hero__photo-col {
    order: -1;
    justify-content: flex-start;
  }

  .hero__photo {
    width: 320px;
    height: 320px;
  }

  .section-cta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

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

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

  .service-row__body {
    flex-direction: row;
    gap: var(--s8);
  }

  .service-row__desc { flex: 1; }

  .service-row__includes { flex: 0 0 260px; }

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

  .case-card {
    display: grid;
    grid-template-columns: 280px 1fr;
  }

  .case-card__preview {
    aspect-ratio: auto;
    min-height: 100%;
  }

  .about__inner {
    grid-template-columns: 200px 1fr;
    gap: var(--s8);
  }

  .about__photo-wrap { justify-content: flex-start; }


  .footer__top {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .case-metrics__item { padding: var(--s3) var(--s2); }

  .case-decisions__grid { grid-template-columns: repeat(3, 1fr); }

  .calc-cards { grid-template-columns: repeat(3, 1fr); }

  .calc-result {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
  }

  .calc-result__cta { align-self: auto; flex-shrink: 0; }
}

/* Desktop 1024px+ */
@media (min-width: 1024px) {
  .header__nav    { display: flex; }
  .header__cta    { display: inline-flex; }
  .header__burger { display: none; }

  .hero__main {
    grid-template-columns: 420px 1fr;
  }

  .hero__photo {
    width: 400px;
    height: 400px;
  }

  .difference__grid { grid-template-columns: repeat(4, 1fr); }

  .portfolio__grid { grid-template-columns: repeat(3, 1fr); }

  .services__grid { grid-template-columns: repeat(3, 1fr); }

  .case-card {
    grid-template-columns: 320px 1fr;
  }

  .about__inner {
    grid-template-columns: 240px 1fr;
    align-items: center;
  }

  .about__photo {
    width: 240px;
    height: 240px;
  }

}

/* Wide 1440px+ */
@media (min-width: 1440px) {
  :root { --gutter: var(--s8); }
}

/* ============================================================
   PREFERS-REDUCED-MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .faq-item__body { transition: none !important; }

  /* Индикаторы загрузки: движение убрано, но состояние остаётся читаемым */
  .skeleton { background: var(--c-surface-2); }
  .btn.is-loading::before { border-top-color: currentColor; opacity: 0.5; }
}

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */
.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--c-surface-2);
  border-top: 1px solid var(--c-border);
  box-shadow: var(--shadow-bar);
  padding: var(--s2);
  animation: cookie-slide-up 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner { animation: none; }
}

@keyframes cookie-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.cookie-banner--hide {
  transform: translateY(100%);
  transition: transform 0.25s ease-in;
}

.cookie-banner__inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s2);
}

@media (min-width: 768px) {
  .cookie-banner__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
  }
}

.cookie-banner__text {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
  margin: 0;
  flex: 1;
}

.cookie-banner__link {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner__link:hover { opacity: 0.75; }

.cookie-banner__btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: var(--s-mid) var(--s3);
  background: var(--c-accent);
  color: var(--c-on-accent);
  border: none;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t);
  align-self: stretch;
}

@media (min-width: 768px) {
  .cookie-banner__btn { align-self: auto; }
}

.cookie-banner__btn:hover { background: var(--c-accent-dark); }
.cookie-banner__btn:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}

/* ============================================================
   LEGAL CONTENT (privacy.html, consent.html)
   ============================================================ */
.legal-content {
  max-width: 720px;
  margin-inline: auto;
  padding-block: var(--s10);
}
.legal-content h1 {
  font-size: var(--fs-2xl);
  margin-bottom: var(--s3);
}
.legal-content h2 {
  font-size: var(--fs-lg);
  margin-top: var(--s6);
  margin-bottom: var(--s2);
  color: var(--c-text);
}
.legal-content p,
.legal-content li {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-text);
  margin-bottom: var(--s2);
}
.legal-content ul {
  list-style: disc;
  padding-left: var(--s4);
}
.legal-content .updated {
  font-size: var(--fs-xs);
  color: var(--c-subtle);
  margin-bottom: var(--s6);
}
.legal-content a {
  color: var(--c-accent);
}
.legal-content .final-statement {
  margin-top: var(--s8);
  padding: var(--s4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--c-text);
  text-transform: uppercase;
  letter-spacing: var(--ls-loose);
  line-height: var(--lh-base);
  font-weight: 600;
}

/* ============================================================
   CONTACT MODAL (всплывающая форма заявки)
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s2);
  overflow-y: auto;
  animation: modal-fade-in 0.2s ease-out;
}

.modal[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .modal { animation: none; }
}

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

.modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: -1;
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - var(--s6));
  overflow-y: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s6) var(--s4) var(--s4);
  box-shadow: var(--shadow-overlay);
  animation: modal-slide-up 0.25s ease-out;
}

@media (min-width: 768px) {
  .modal__dialog {
    padding: var(--s6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal__dialog { animation: none; }
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__close {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--c-muted);
  cursor: pointer;
  transition: background var(--t), color var(--t);
}

.modal__close:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}

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

.modal__title {
  font-size: var(--fs-xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--s2);
  padding-right: var(--s6); /* чтобы текст не залезал под крестик */
}

.modal__lead {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: var(--lh-base);
  margin-bottom: var(--s4);
}

/* Внутри модалки форма берёт максимальную ширину */
.modal .form { width: 100%; }

/* Блокировка скролла body когда модалка открыта (помечает JS) */
body.modal-open {
  overflow: hidden;
}

/* ============================================================
   22. ОБЩИЕ КОМПОНЕНТЫ: таблица, бейдж, уведомление, состояния
   Живой образец со всеми состояниями — /ui-kit.html.
   ============================================================ */

/* --- Таблица данных ---------------------------------------
   Обёртка обязательна: на узком экране таблица скроллится внутри неё,
   а не рвёт страницу горизонтальным скроллом. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}

.data-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.data-table th,
.data-table td {
  padding: var(--s-mid) var(--s2);
  text-align: left;
  vertical-align: top;
  line-height: var(--lh-base);
  border-bottom: 1px solid var(--c-border);
}

.data-table thead th {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-subtle);
  background-color: var(--c-surface-2);
  white-space: nowrap;
}

.data-table td { color: var(--c-muted); }

.data-table td:first-child {
  color: var(--c-text);
  font-weight: 600;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background-color: rgba(var(--c-accent-rgb), var(--a-wash)); }

/* Числовая ячейка: правый край и одинаковая ширина цифр */
.data-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- Бейдж ------------------------------------------------
   Единственная метка с заливкой во всём проекте: категория кейса,
   пометка услуги, статус. Плоская текстовая метка над заголовком —
   это не бейдж, а .section-label. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-half);
  padding: var(--s-half) var(--s1);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: var(--lh-base);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-accent-light);
  background-color: rgba(var(--c-accent-rgb), var(--a-fill));
}

.badge--muted {
  color: var(--c-subtle);
  background-color: var(--c-surface-2);
}

.badge--success {
  color: var(--c-success);
  background-color: rgba(var(--c-success-rgb), 0.1);
}

.badge--error {
  color: var(--c-error);
  background-color: rgba(var(--c-error-rgb), 0.1);
}

/* --- Уведомление ------------------------------------------
   Блок статуса на всю ширину контейнера: ошибка запроса, важное
   предупреждение, подтверждение. Ошибка отдельного поля формы —
   это .form__error, не сюда. */
.notice {
  padding: var(--s3);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-subtle);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background-color: var(--c-surface-2);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  color: var(--c-muted);
}

.notice__title {
  display: block;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--s-half);
}

.notice--error {
  border-color: rgba(var(--c-error-rgb), 0.25);
  border-left-color: var(--c-error);
  background-color: rgba(var(--c-error-rgb), 0.08);
}

.notice--error .notice__title { color: var(--c-error); }

.notice--success {
  border-color: rgba(var(--c-success-rgb), 0.25);
  border-left-color: var(--c-success);
  background-color: rgba(var(--c-success-rgb), 0.08);
}

.notice--success .notice__title { color: var(--c-success); }

.notice--accent {
  border-color: rgba(var(--c-accent-rgb), var(--a-line));
  border-left-color: var(--c-accent);
  background-color: rgba(var(--c-accent-rgb), var(--a-wash));
}

.notice--accent .notice__title { color: var(--c-accent-light); }

/* --- Загрузка: скелетон -----------------------------------
   Ставится вместо контента, пока он не приехал. Размер задаёт
   модификатор, а не инлайновый стиль. */
.skeleton {
  display: block;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg,
    var(--c-surface-2) 25%,
    var(--c-border) 50%,
    var(--c-surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton--line { height: 12px; }
.skeleton--short { width: 60%; }
.skeleton--title { height: 24px; width: 45%; }
.skeleton--block { height: 160px; border-radius: var(--r-lg); }

.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* --- Загрузка: кнопка в работе ----------------------------
   Ставится классом на .btn на время отправки формы. Текст не прячем:
   кнопка не должна менять ширину и прыгать. */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.is-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

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

/* --- Пусто ------------------------------------------------
   Список загрузился и оказался пустым: ничего не найдено, нет записей. */
.empty-state {
  padding: var(--s8) var(--s4);
  text-align: center;
  border: 1px dashed var(--c-border);
  border-radius: var(--r-lg);
}

.empty-state__title {
  font-size: var(--fs-lg);
  color: var(--c-text);
  margin-bottom: var(--s1);
}

.empty-state__text {
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  color: var(--c-subtle);
  max-width: 420px;
  margin-inline: auto;
}

.empty-state .btn { margin-top: var(--s3); }
