    /* =========================================================
       ПЕРЕМЕННЫЕ
       Все цвета, шрифты и размеры сайта живут здесь.
       Хочешь сменить палитру — меняй только этот блок.
       ========================================================= */

    :root {
      /* Фоны */
      --bg: #171a1f;
      --surface: #20252b;
      --surface-2: #252b32;

      /* Линии-разделители */
      --line: rgba(235, 242, 250, 0.12);
      --line-strong: rgba(235, 242, 250, 0.2);

      /* Текст */
      --text: #edf2f7;
      --muted: #9ba5b0;
      --faint: #68727e;

      /* Акцентные голубые */
      --blue: #8baecc;
      --blue-light: #b3cde4;
      --tech: rgb(93, 160, 202);

      --radius: 18px;
      --ease: cubic-bezier(.2, .75, .2, 1);
      --max-width: 1440px;

      /* Отступы секций: считаются от высоты экрана (svh),
         чтобы блок помещался в один экран на любом устройстве */
      --section-pt: clamp(100px, 14svh, 140px);
      --section-pb: clamp(56px, 9svh, 100px);

      --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

      /* Подстраиваем переменные самого Bootstrap под нашу тему */
      --bs-body-bg: var(--bg);
      --bs-body-color: var(--text);
      --bs-body-font-family: var(--font);
      --bs-border-color: var(--line);
    }

    /* =========================================================
       БАЗА
       ========================================================= */

    html {
      scroll-behavior: smooth;
      scroll-padding-top: 96px; /* якоря не прячутся под шапкой */
      background: var(--bg);
    }

    body {
      margin: 0;
      overflow-x: hidden;
      color: var(--text);
      background:
        radial-gradient(
          circle at 80% 0,
          rgba(139, 174, 204, 0.08),
          transparent 30rem
        ),
        var(--bg);

      font-family: var(--font);
      -webkit-font-smoothing: antialiased;
    }

    /* Пока язык страницы не применён JS — прячем body, чтобы
       не мелькнул английский текст перед переключением на русский */
    html.i18n-pending body {
      visibility: hidden;
    }

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

    button {
      font: inherit;
      color: inherit;
    }

    /* Видимый фокус для навигации с клавиатуры */
    :focus-visible {
      outline: 2px solid var(--blue-light);
      outline-offset: 3px;
    }

    .tech {
      color: var(--tech);
    }

    .accent {
      color: var(--blue-light);
    }

    /* Переопределяем .container Bootstrap под ширину 1440px */
    .container {
      width: 100%;
      max-width: var(--max-width);
      padding-left: max(20px, env(safe-area-inset-left));
      padding-right: max(20px, env(safe-area-inset-right));
      margin-inline: auto;
    }

    /* Фото приглушаются и подгоняются под палитру сайта.
       Если картинка не загрузилась — класс img-fail её прячет,
       и остаётся тёмный градиент рамки. */
    .photo {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: saturate(.72) contrast(1.06) brightness(.82);
    }

    .img-fail {
      display: none;
    }

    /* =========================================================
       ШАПКА (TOPBAR)
       Плавающая «стеклянная» плашка. Стиль сохранён,
       добавлены: активный пункт меню, кнопка, полоса прогресса.
       ========================================================= */

    .topbar {
      position: fixed;
      z-index: 1030;
      top: calc(16px + env(safe-area-inset-top));
      left: 50%;

      width: min(calc(100% - 32px), 1180px);

      transform: translateX(-50%);

      padding: 9px 10px 9px 16px;

      border: 1px solid var(--line);
      border-radius: 16px;

      background: rgba(24, 27, 32, 0.78);
      -webkit-backdrop-filter: blur(22px);
      backdrop-filter: blur(22px);

      box-shadow: 0 14px 50px rgba(0, 0, 0, 0.18);

      transition:
        background 0.3s var(--ease),
        border-color 0.3s var(--ease);
    }

    /* После прокрутки плашка становится плотнее (класс ставит JS) */
    .topbar.scrolled {
      background: rgba(24, 27, 32, 0.92);
      border-color: var(--line-strong);
    }

    .topbar-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;

      gap: 16px;
    }

    .brand {
      font-size: 15px;
      font-weight: 700;
      letter-spacing: -0.04em;
      white-space: nowrap;
    }

    .brand-dot {
      color: var(--blue-light);
    }

    .brand-meta {
      margin-left: 8px;

      color: var(--faint);

      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.02em;
    }

    /* Меню для планшета и десктопа */
    .navigation {
      gap: 3px;

      color: var(--muted);
      font-size: 13px;
    }

    .navigation a {
      padding: 8px 10px;
      border-radius: 10px;

      transition:
        background 0.25s var(--ease),
        color 0.25s var(--ease);
    }

    .navigation a:hover,
    .navigation a.active {
      color: var(--text);
      background: rgba(255, 255, 255, 0.06);
    }

    /* Индикатор «свободен для проектов» */
    .status {
      display: flex;
      align-items: center;
      gap: 7px;

      color: var(--muted);

      font: 11px var(--mono);
    }

    .status-dot {
      width: 6px;
      height: 6px;

      border-radius: 50%;

      background: #9bbbd8;
      box-shadow: 0 0 12px rgba(155, 187, 216, 0.6);
    }

    /* Кнопка-бургер (только телефон) */
    .menu-toggle {
      display: grid;
      place-items: center;

      width: 40px;
      height: 40px;

      border: 1px solid var(--line);
      border-radius: 10px;

      background: transparent;

      font-size: 20px;
    }

    /* Иконка меняется на крестик, когда меню открыто */
    .menu-toggle .bi-x-lg,
    .menu-toggle[aria-expanded="true"] .bi-list {
      display: none;
    }

    .menu-toggle[aria-expanded="true"] .bi-x-lg {
      display: block;
    }

    /* Выпадающее меню на телефоне */
    .mobile-nav-inner {
      display: grid;
      gap: 2px;

      margin-top: 9px;
      padding: 8px 6px 4px 0;

      border-top: 1px solid var(--line);
    }

    .mobile-nav a {
      display: flex;
      align-items: center;
      gap: 12px;

      padding: 13px 10px;
      border-radius: 10px;

      color: var(--muted);
      font-size: 15px;
    }

    .mobile-nav a:active,
    .mobile-nav a.active {
      color: var(--text);
      background: rgba(255, 255, 255, 0.06);
    }

    .mobile-nav .bi {
      color: var(--blue);
    }

    /* Кнопка в мобильном меню */
    .mobile-nav .cta {
      justify-content: center;

      margin-top: 6px;

      color: var(--text);
    }

    /* Тонкая полоса прогресса чтения страницы (ширину задаёт JS) */
    .topbar-progress {
      position: absolute;
      left: 16px;
      right: 16px;
      bottom: 0;

      height: 2px;

      border-radius: 2px;

      background: linear-gradient(90deg, var(--blue), var(--blue-light));

      transform: scaleX(var(--progress, 0));
      transform-origin: left;

      pointer-events: none;
    }

    /* =========================================================
       ОБЩИЕ ЭЛЕМЕНТЫ ТИПОГРАФИКИ
       ========================================================= */

    .section-meta {
      color: var(--muted);

      font: 500 11px/1.3 var(--mono);

      letter-spacing: 0.1em;
      text-transform: uppercase;
    }

    /* =========================================================
       HERO — первый экран
       Фото лежит ПОД текстом (.hero-bg), поверх него тёмные
       градиенты, чтобы текст всегда читался.
       ========================================================= */

    .hero {
      position: relative;
      overflow: hidden;

      display: flex;
      flex-direction: column;
      justify-content: center;

      min-height: 100vh;  /* запасной вариант для старых браузеров */
      min-height: 100svh; /* примерно один экран — без жёсткой привязки */

      padding-top: clamp(100px, 14svh, 150px);
      padding-bottom: clamp(56px, 8svh, 90px);
    }

    /* Слой с фотографией */
    .hero-bg {
      position: absolute;
      z-index: 0;
      inset: 0;

      background: var(--bg);
    }

    .hero-bg img {
      display: block;

      width: 100%;
      height: 100%;

      object-fit: cover;
      object-position: 62% 100%; /* люди остаются внизу кадра */
    }

    /* Градиенты поверх фото: слева и сверху темнее (под текст),
       снизу фото плавно уходит в фон страницы */
    .hero-bg::after {
      content: "";

      position: absolute;
      inset: -1px;

      background:
        linear-gradient(
          90deg,
          rgba(23, 26, 31, 0.92) 0%,
          rgba(23, 26, 31, 0.7) 32%,
          rgba(23, 26, 31, 0.12) 62%,
          rgba(23, 26, 31, 0) 100%
        ),
        linear-gradient(
          to bottom,
          rgba(23, 26, 31, 0.85) 0,
          rgba(23, 26, 31, 0) 28%
        ),
        linear-gradient(
          to top,
          var(--bg) 0,
          rgba(23, 26, 31, 0) 16%
        );
    }

    /* Текстовый слой */
    .hero-content {
      position: relative;
      z-index: 2;

      width: 100%;
    }

    /* Верхняя строка: кикер слева, статус «свободен для проектов» справа */
    .hero-top {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;

      gap: 12px;

      margin-bottom: clamp(20px, 4svh, 40px);
    }

    .hero-kicker {
      display: inline-flex;
      align-items: center;
      gap: 8px;

      color: var(--muted);

      font: 11px var(--mono);
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }

    .hero-kicker .bi {
      color: var(--blue-light);
    }

    /* Такая же плашка, как «AVAILABLE» в шапке, но крупнее и с рамкой —
       здесь это первое, что подтверждает: со студией можно связаться */
    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;

      padding: 7px 13px;

      border: 1px solid var(--line);
      border-radius: 999px;

      background: rgba(23, 26, 31, 0.45);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);

      color: var(--muted);

      font: 11px var(--mono);
      letter-spacing: 0.03em;
      text-transform: uppercase;
    }

    /* Размер заголовка зависит и от ширины, и от высоты экрана —
       так он не вылезает за первый экран на низких дисплеях.
       Заголовок теперь одна собранная строка, без второй
       дублирующей надписи — акцент делает кикер сверху. */
    .hero-title {
      max-width: 1100px;

      margin: 0 0 clamp(18px, 3svh, 30px);

      font-size: clamp(52px, min(9.5vw, 15svh), 168px);
      line-height: 0.86;

      letter-spacing: -0.085em;
      font-weight: 720;
    }

    .hero-description {
      max-width: 560px;

      margin: 0 0 clamp(28px, 4.5svh, 46px);

      color: var(--muted);

      font-size: 18px;
      line-height: 1.55;
    }

    /* Ряд действий: основная (заполненная) и второстепенная кнопки */
    .hero-actions {
      display: flex;
      flex-wrap: wrap;
      align-items: center;

      gap: 12px;

      margin-bottom: clamp(34px, 6svh, 58px);
    }

    .cta-primary {
      display: inline-flex;
      align-items: center;

      gap: 12px;

      padding: 15px 20px;

      border: 1px solid transparent;
      border-radius: 12px;

      background: linear-gradient(135deg, var(--blue-light), var(--tech));

      color: #12161b;
      font-weight: 620;

      transition:
        transform 0.3s var(--ease),
        filter 0.3s var(--ease);
    }

    .cta-primary:hover {
      transform: translateY(-2px);
      filter: brightness(1.08);
    }

    .cta-ghost {
      display: inline-flex;
      align-items: center;

      gap: 10px;

      padding: 14px 19px;

      border: 1px solid var(--line);
      border-radius: 12px;

      color: var(--muted);

      transition:
        color 0.25s var(--ease),
        border-color 0.25s var(--ease),
        background 0.25s var(--ease);
    }

    .cta-ghost:hover {
      color: var(--text);
      border-color: var(--line-strong);
      background: rgba(255, 255, 255, 0.04);
    }

    /* Короткая строка живых цифр студии */
    .hero-stats {
      display: flex;
      flex-wrap: wrap;

      gap: clamp(22px, 4vw, 44px);
    }

    .stat {
      display: flex;
      flex-direction: column;
      gap: 4px;

      padding-left: clamp(16px, 2vw, 22px);

      border-left: 1px solid var(--line);
    }

    .stat:first-child {
      padding-left: 0;
      border-left: 0;
    }

    .stat-value {
      color: var(--text);

      font-size: clamp(20px, 2.6vw, 26px);
      font-weight: 680;
      letter-spacing: -0.03em;
    }

    .stat-label {
      color: var(--faint);

      font: 10px var(--mono);
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    /* Бегущая строка внизу первого экрана: тихо повторяет
       «WEB · DESIGN · DEVELOPMENT» из фонового кадра */
    .hero-marquee {
      position: relative;
      z-index: 2;

      overflow: hidden;

      margin-top: clamp(36px, 7svh, 64px);
      padding-top: 18px;

      border-top: 1px solid var(--line);

      -webkit-mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 8%,
        #000 92%,
        transparent 100%
      );
      mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 8%,
        #000 92%,
        transparent 100%
      );
    }

    .marquee-track {
      display: flex;
      flex-shrink: 0;

      gap: 22px;

      width: max-content;

      animation: marquee 26s linear infinite;

      color: var(--faint);

      font: 11px var(--mono);
      letter-spacing: 0.14em;
      white-space: nowrap;
    }

    .marquee-track span {
      display: inline-flex;
      align-items: center;
    }

    .marquee-track .dot {
      color: var(--blue);
    }

    @keyframes marquee {
      from { transform: translateX(0); }
      to   { transform: translateX(-50%); }
    }

    /* Стрелка «листай вниз» внизу первого экрана */
    .scroll-cue {
      position: absolute;
      z-index: 2;
      left: 50%;
      bottom: calc(18px + env(safe-area-inset-bottom));

      display: grid;
      place-items: center;

      width: 40px;
      height: 40px;

      transform: translateX(-50%);

      border: 1px solid var(--line-strong);
      border-radius: 50%;

      background: rgba(23, 26, 31, 0.55);
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);

      color: var(--muted);

      transition:
        color 0.25s var(--ease),
        border-color 0.25s var(--ease);
    }

    .scroll-cue:hover {
      color: var(--text);
      border-color: rgba(168, 200, 231, 0.5);
    }

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

    /* =========================================================
       СЕКЦИИ
       Каждая секция минимум на один экран (100svh) и центрирует
       своё содержимое по вертикали. Если контента больше,
       чем помещается — секция просто становится выше.
       ========================================================= */

    .section {
      display: flex;
      flex-direction: column;
      justify-content: center;

      /* Раньше секция принудительно занимала ровно 100svh, из-за чего
         контент выглядел зажатым. Теперь это мягкий ориентир: обычно
         укладывается в один экран, но без жёсткой границы — если
         контенту нужно чуть больше места, он его получает. */
      min-height: clamp(600px, 92svh, 980px);

      padding: var(--section-pt) 0 var(--section-pb);

      border-top: 1px solid var(--line);
    }

    /* Заголовок секции: подпись слева + большой заголовок */
    .section-heading {
      margin-bottom: clamp(30px, 5svh, 60px);
    }

    .section-title {
      max-width: 950px;

      margin: 0;

      font-size: clamp(40px, min(6.4vw, 9svh), 104px);
      line-height: 0.9;

      letter-spacing: -0.065em;
      font-weight: 650;
    }

    /* Короткая вводная строка под заголовком секции (не везде нужна) */
    .section-lead {
      max-width: 520px;
      margin: 18px 0 0;

      color: var(--muted);

      font-size: 15px;
      line-height: 1.6;
    }

    /* =========================================================
       ОКНА В СТИЛЕ macOS
       Общая «шапка» окна: цветные точки слева, подпись справа.
       Используется в блоках Live viewer и Under the hood.
       ========================================================= */

    .window {
      overflow: hidden;

      border: 1px solid var(--line-strong);
      border-radius: 22px;

      background: #20242a;

      box-shadow: 0 30px 100px rgba(0, 0, 0, 0.25);
    }

    .window-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;

      padding: 12px 15px;

      border-bottom: 1px solid var(--line);

      background: #1b1f24;
    }

    /* Светофор macOS: закрыть / свернуть / развернуть */
    .traffic-lights {
      display: flex;
      flex-shrink: 0;
      gap: 8px;
    }

    .traffic-lights i {
      width: 11px;
      height: 11px;

      border-radius: 50%;

      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
    }

    .traffic-lights i:nth-child(1) { background: #ff5f57; }
    .traffic-lights i:nth-child(2) { background: #febc2e; }
    .traffic-lights i:nth-child(3) { background: #28c840; }

    .window-label {
      display: flex;
      align-items: center;
      flex-shrink: 0;
      gap: 7px;

      white-space: nowrap;

      color: var(--faint);

      font: 10px var(--mono);
    }

    /* =========================================================
       WORK — окно «Live viewer»
       ========================================================= */

    .viewer {
      min-height: 0;
    }

    /* Список проектов: на телефоне — горизонтальная лента */
    .project-list {
      display: flex;
      gap: 4px;

      overflow-x: auto;

      padding: 12px;

      border-bottom: 1px solid var(--line);

      scrollbar-width: none;
    }

    .project-list::-webkit-scrollbar {
      display: none;
    }

    .project-button {
      flex: 0 0 auto;

      min-width: 160px;

      display: grid;
      grid-template-columns: 28px 1fr auto;
      align-items: center;

      gap: 10px;

      padding: 14px 10px;

      border: 0;
      border-radius: 10px;

      background: transparent;

      text-align: left;

      cursor: pointer;

      color: var(--muted);

      transition:
        background 0.25s var(--ease),
        color 0.25s var(--ease);
    }

    .project-button:hover,
    .project-button.active {
      color: var(--text);
      background: rgba(255, 255, 255, 0.06);
    }

    /* Стрелка справа видна только на планшете/десктопе */
    .project-button .bi {
      display: none;

      color: var(--faint);
      font-size: 12px;
    }

    .project-button.active .bi {
      color: var(--blue-light);
    }

    .project-number {
      color: var(--faint);

      font: 10px var(--mono);
    }

    .project-name {
      font-size: 13px;
      font-weight: 550;
    }

    /* Название + статус проекта живут в одной колонке грида */
    .project-main {
      display: flex;
      align-items: center;
      min-width: 0;

      gap: 9px;
    }

    .project-status {
      display: inline-flex;
      align-items: center;
      flex-shrink: 0;

      gap: 5px;

      padding: 3px 8px;

      border: 1px solid var(--line);
      border-radius: 999px;

      color: var(--faint);

      font: 9px var(--mono);
      letter-spacing: 0.05em;
    }

    .project-status .dot {
      width: 5px;
      height: 5px;

      border-radius: 50%;

      background: var(--faint);
    }

    /* Статус «LIVE» — единственный проект с реальным встроенным сайтом */
    .project-status.is-live {
      border-color: rgba(139, 174, 204, 0.45);

      background: rgba(139, 174, 204, 0.1);
      color: var(--blue-light);
    }

    .project-status.is-live .dot {
      background: #9bbbd8;
      box-shadow: 0 0 8px rgba(155, 187, 216, 0.7);
    }

    /* Правая часть окна: теперь только сама витрина сайта —
       никакого текста рядом, максимум места под окно */
    .preview {
      position: relative;

      overflow: hidden;

      padding: 0;

      background:
        linear-gradient(
          rgba(255, 255, 255, 0.035) 1px,
          transparent 1px
        ),
        linear-gradient(
          90deg,
          rgba(255, 255, 255, 0.035) 1px,
          transparent 1px
        ),
        #242930;

      background-size: 40px 40px;
    }

    /* Голубое свечение в углу */
    .preview::after {
      content: "";

      position: absolute;
      inset: 0;

      pointer-events: none;

      background:
        radial-gradient(
          circle at 75% 30%,
          rgba(139, 174, 204, 0.18),
          transparent 35%
        );
    }

    .preview > .shot-body {
      z-index: 1;
    }

    /* Плавная смена окна при переключении проектов */
    .preview-swap {
      transition: opacity 0.16s ease;
    }

    .is-swapping {
      opacity: 0;
    }

    /* Адресная строка (замок + домен) и кнопка «открыть в новой вкладке»
       теперь живут в шапке главного окна .window-bar */
    .shot-url {
      display: flex;
      min-width: 0;
      align-items: center;
      overflow: hidden;

      flex: 1;

      gap: 6px;

      padding: 6px 10px;

      border-radius: 8px;

      background: rgba(255, 255, 255, 0.04);

      color: var(--muted);

      font: 11px var(--mono);
    }

    .shot-url .bi {
      flex-shrink: 0;

      font-size: 10px;
      color: var(--faint);
    }

    .shot-url span {
      overflow: hidden;

      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .shot-open {
      display: grid;
      flex-shrink: 0;
      place-items: center;

      width: 28px;
      height: 28px;

      border-radius: 8px;

      color: var(--muted);
      font-size: 12px;

      transition:
        color 0.2s var(--ease),
        background 0.2s var(--ease);
    }

    .shot-open:hover {
      color: var(--text);
      background: rgba(255, 255, 255, 0.06);
    }

    .shot-open.is-disabled {
      pointer-events: none;
      opacity: 0.35;
    }

    /* Тело окна: высоту выставляет JS (scaleLiveFrame) — ровно такую,
       чтобы масштабированный сайт помещался без обрезки и без пустот.
       aspect-ratio здесь — лишь запасной вариант на случай, если JS
       ещё не отработал (первая отрисовка) или отключён. */
    .shot-body {
      position: relative;

      overflow: hidden;

      width: 100%;
      aspect-ratio: var(--frame-w, 1440) / var(--frame-h, 900);
    }

    /* Голубоватая дымка поверх содержимого — сохраняет фирменную палитру
       даже когда внутри живой сайт с другими цветами */
    .shot-body::after {
      content: "";

      position: absolute;
      inset: 0;
      z-index: 2;

      pointer-events: none;

      background:
        linear-gradient(
          160deg,
          rgba(139, 174, 204, 0.14),
          transparent 55%,
          rgba(23, 26, 31, 0.4)
        );
    }

    /* Живой iframe рисуется в «настоящем» размере (десктоп 1440×900
       или мобильный вьюпорт 390×844 — см. scaleLiveFrame в main.js)
       и уменьшается под ширину окна через transform: scale.
       Конкретные width/height и scale выставляет JS — здесь только
       базовое поведение самого блока. */
    .frame-scale {
      position: absolute;
      top: 0;
      left: 0;

      transform-origin: top left;
    }

    .frame-scale iframe {
      display: block;

      width: 100%;
      height: 100%;

      border: 0;
    }

    .frame-loading {
      position: absolute;
      z-index: 1;
      inset: 0;

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

      gap: 10px;

      background: #1b1f24;

      color: var(--faint);

      font: 11px var(--mono);
      letter-spacing: 0.04em;

      opacity: 1;

      transition: opacity 0.3s var(--ease);
    }

    .frame-loading.done {
      pointer-events: none;
      opacity: 0;
    }

    .spinner {
      width: 14px;
      height: 14px;

      border: 2px solid var(--line-strong);
      border-top-color: var(--blue-light);
      border-radius: 50%;

      animation: spin 0.8s linear infinite;
    }

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

    /* Заглушка для проектов без публичного сайта: каркас страницы
       вместо стоковой фотографии, чтобы не выдавать её за реальный сайт */
    .stub {
      display: flex;
      flex-direction: column;

      height: 100%;
      padding: 22px;

      background:
        linear-gradient(
          rgba(255, 255, 255, 0.035) 1px,
          transparent 1px
        ),
        linear-gradient(
          90deg,
          rgba(255, 255, 255, 0.035) 1px,
          transparent 1px
        ),
        #242930;

      background-size: 40px 40px;
    }

    .stub-chrome {
      display: flex;

      gap: 6px;

      margin-bottom: 20px;
    }

    .stub-chrome span {
      width: 7px;
      height: 7px;

      border-radius: 50%;

      background: rgba(255, 255, 255, 0.12);
    }

    .stub-skeleton {
      display: flex;
      flex: 1;
      flex-direction: column;

      gap: 12px;
    }

    .sk-line,
    .sk-block,
    .sk-chip {
      border-radius: 6px;

      background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0.05) 30%,
        rgba(255, 255, 255, 0.11) 50%,
        rgba(255, 255, 255, 0.05) 70%
      );
      background-size: 200% 100%;

      animation: shimmer 2.4s ease-in-out infinite;
    }

    .sk-line {
      height: 10px;
    }

    .sk-w-40 { width: 40%; }
    .sk-w-50 { width: 55%; }
    .sk-w-70 { width: 78%; }

    .sk-block {
      flex: 1;
      min-height: 70px;

      border-radius: 10px;
    }

    .sk-row {
      display: flex;
      gap: 10px;
    }

    .sk-chip {
      width: 74px;
      height: 26px;

      border-radius: 999px;
    }

    @keyframes shimmer {
      0%   { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }

    .stub-caption {
      display: flex;
      align-items: center;

      gap: 8px;
      margin-top: 16px;

      color: var(--faint);

      font: 10px var(--mono);
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    @media (prefers-reduced-motion: reduce) {
      .sk-line,
      .sk-block,
      .sk-chip {
        animation: none;
      }
    }

    /* =========================================================
       BUILD — карточки услуг
       Фото на весь фон карточки, текст поверх внизу.
       Десктоп: 4 в ряд. Планшет: 2×2.
       Телефон: горизонтальная лента со свайпом (влезает в экран).
       ========================================================= */

    .service {
      position: relative;
      isolation: isolate;
      overflow: hidden;

      height: 100%;
      min-height: clamp(300px, 50svh, 520px);

      display: flex;
      flex-direction: column;
      justify-content: space-between;

      padding: 20px;

      border: 1px solid var(--line);
      border-radius: var(--radius);

      background: linear-gradient(135deg, #2c343e, #1b1f24);

      transition: border-color 0.3s var(--ease);
    }

    .service:hover {
      border-color: rgba(168, 200, 231, 0.4);
    }

    /* Фото — самый нижний слой карточки */
    .service .photo {
      position: absolute;
      z-index: -2;
      inset: 0;

      transition: transform 0.9s var(--ease);
    }

    .service:hover .photo {
      transform: scale(1.04);
    }

    /* Затемнение снизу, чтобы читался текст */
    .service::after {
      content: "";

      position: absolute;
      z-index: -1;
      inset: 0;

      background:
        linear-gradient(
          to top,
          rgba(23, 26, 31, 0.94) 0%,
          rgba(23, 26, 31, 0.62) 45%,
          rgba(139, 174, 204, 0.08) 100%
        );
    }

    /* Иконка услуги в стеклянном квадрате */
    .service-icon {
      display: grid;
      place-items: center;

      width: 42px;
      height: 42px;

      border: 1px solid var(--line-strong);
      border-radius: 12px;

      background: rgba(23, 26, 31, 0.6);
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);

      color: var(--blue-light);
      font-size: 19px;
    }

    .service-number {
      color: var(--muted);

      font: 11px var(--mono);
    }

    .service h3 {
      margin: 10px 0 10px;

      font-size: clamp(28px, 2.6vw, 42px);
      letter-spacing: -0.05em;
    }

    .service p {
      margin: 0;

      color: var(--muted);

      font-size: 14.5px;
      line-height: 1.5;
    }

    /* =========================================================
       CODE — окно редактора и живой результат
       ========================================================= */

    .code-layout {
      overflow: hidden;

      border: 1px solid var(--line-strong);
      border-radius: 20px;

      background: #1b1f24;
    }

    .code-pane {
      display: flex;
      flex-direction: column;
    }

    /* Размер шрифта кода зависит от высоты экрана,
       чтобы весь листинг помещался в один экран */
    pre.code {
      flex: 1;

      margin: 0;
      padding: 20px 22px;

      overflow: auto;

      color: #b9c2cd;

      font: clamp(11px, 1.35svh, 13px) / 1.5 var(--mono);
    }

    .code code {
      font: inherit;
      color: inherit;
    }

    /* Подсветка синтаксиса */
    .code-comment  { color: #6f7985; }
    .code-keyword  { color: #9ab9d7; }
    .code-function { color: #d2dbe5; }
    .code-number   { color: #c9b58f; }
    .code-string   { color: #9fc4a8; }

    /* Правая панель с результатом */
    .result {
      height: 100%;

      padding: 24px 22px;

      border-top: 1px solid var(--line);

      background: #22272e;
    }

    .result-title {
      display: flex;
      align-items: center;
      gap: 9px;

      margin: 0 0 20px;

      color: var(--muted);

      font: 11px var(--mono);

      text-transform: uppercase;
      letter-spacing: 0.1em;
    }

    /* Мигающая точка «live» */
    .result-title .status-dot {
      animation: pulse 2s ease-in-out infinite;
    }

    @keyframes pulse {
      50% { opacity: 0.35; }
    }

    .wave-frame {
      position: relative;

      overflow: hidden;

      border: 1px solid var(--line);
      border-radius: 14px;

      background: #22272e;
    }

    /* Плавное растворение волн вверху + свечение снизу */
    .wave-frame::after {
      content: "";

      position: absolute;
      inset: 0;

      pointer-events: none;

      background:
        linear-gradient(
          to bottom,
          #22272e 0,
          rgba(34, 39, 46, 0) 30%
        ),
        radial-gradient(
          circle at 70% 100%,
          rgba(139, 174, 204, 0.16),
          transparent 60%
        );
    }

    #waves {
      display: block;

      width: 100%;
      height: clamp(240px, 42svh, 380px);

      touch-action: pan-y; /* вертикальный скролл страницы не блокируется */
      cursor: crosshair;
    }

    .result-hint {
      display: flex;
      align-items: center;
      gap: 8px;

      margin: 16px 0 0;

      color: var(--faint);

      font: 11px var(--mono);
    }

    /* =========================================================
       PROCESS — линейный таймлайн с точками
       Телефон/планшет: вертикальный. Десктоп: горизонтальный.
       Пока таймлайн не появился на экране, линия и точки «серые»;
       класс .play (ставит JS) зажигает их по очереди.
       ========================================================= */

    .timeline {
      list-style: none;

      margin: 0;
      padding: 0;
    }

    .step {
      position: relative;

      padding: 0 0 34px 56px;
    }

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

    /* Линия к следующему шагу: ::before — серая основа, ::after — заливка */
    .step::before,
    .step::after {
      content: "";

      position: absolute;
      left: 17px;
      top: 29px;
      bottom: -7px;

      width: 1px;
    }

    .step::before {
      background: var(--line-strong);
    }

    .step::after {
      background: var(--blue);

      transform: scaleY(0);
      transform-origin: top;

      /* --i — номер шага, задаёт задержку «волны» */
      transition: transform 0.32s linear calc(var(--i) * 0.32s + 0.16s);
    }

    /* У последнего шага линии нет */
    .step:last-child::before,
    .step:last-child::after {
      display: none;
    }

    /* Сама точка */
    .step-dot {
      position: absolute;
      left: 11px;
      top: 11px;

      width: 14px;
      height: 14px;

      border: 1px solid var(--line-strong);
      border-radius: 50%;

      background: var(--bg);

      transition:
        background 0.4s var(--ease) calc(var(--i) * 0.32s),
        border-color 0.4s var(--ease) calc(var(--i) * 0.32s),
        box-shadow 0.4s var(--ease) calc(var(--i) * 0.32s);
    }

    .step-body {
      display: flex;
      align-items: flex-start;
      gap: 12px;

      min-height: 36px;
    }

    .step-icon {
      flex-shrink: 0;

      color: var(--faint);
      font-size: 18px;

      transition: color 0.4s var(--ease) calc(var(--i) * 0.32s);
    }

    .step-text {
      display: flex;
      flex-direction: column;

      min-width: 0;
    }

    .step small {
      color: var(--faint);

      font: 10px var(--mono);
    }

    .step strong {
      font-size: 14px;
      font-weight: 550;
    }

    /* Короткое пояснение, что реально происходит на этом этапе */
    .step-desc {
      max-width: 210px;
      margin: 7px 0 0;

      color: var(--muted);

      font-size: 12.5px;
      line-height: 1.5;
    }

    /* Что получает клиент на выходе из этапа — конкретный артефакт */
    .step-deliverable {
      display: inline-flex;
      align-items: center;

      gap: 5px;
      margin-top: 12px;

      color: var(--faint);

      font: 9px var(--mono);
      letter-spacing: 0.04em;
      text-transform: uppercase;

      transition: color 0.4s var(--ease) calc(var(--i) * 0.32s);
    }

    .step-deliverable .bi {
      font-size: 10px;
    }

    .timeline.play .step-deliverable {
      color: var(--blue-light);
    }

    /* Состояние «проиграно»: всё загорается */
    .timeline.play .step::after {
      transform: scaleY(1);
    }

    .timeline.play .step-dot {
      border-color: var(--blue-light);
      background: var(--blue-light);
      box-shadow: 0 0 0 5px rgba(139, 174, 204, 0.16);
    }

    .timeline.play .step-icon {
      color: var(--blue-light);
    }

    /* =========================================================
       CONTACT
       ========================================================= */

    .contact {
      position: relative;
      isolation: isolate;
      overflow: hidden;
    }

    /* Фото-фон за контактами */
    .contact-bg {
      position: absolute;
      z-index: -1;
      inset: 0;

      background: linear-gradient(135deg, #232a33, #171a1f);
    }

    .contact-bg .photo {
      filter: saturate(.6) brightness(.5);
    }

    .contact-bg::after {
      content: "";

      position: absolute;
      inset: 0;

      background:
        linear-gradient(
          90deg,
          var(--bg) 6%,
          rgba(23, 26, 31, 0.55) 62%,
          rgba(23, 26, 31, 0.8)
        ),
        linear-gradient(
          to bottom,
          var(--bg) 0,
          transparent 28%,
          transparent 72%,
          var(--bg) 100%
        );
    }

    .contact-title {
      max-width: 1000px;

      margin: 20px 0 clamp(24px, 5svh, 40px);

      font-size: clamp(56px, min(10vw, 17svh), 150px);
      line-height: 0.82;

      letter-spacing: -0.085em;
    }

    /* Кнопка (используется в шапке, меню и контактах) */
    .cta {
      display: inline-flex;
      align-items: center;

      gap: 14px;

      padding: 14px 18px;

      border: 1px solid var(--line-strong);
      border-radius: 12px;

      background: var(--surface);

      transition:
        transform 0.3s var(--ease),
        background 0.3s var(--ease),
        border-color 0.3s var(--ease);
    }

    .cta:hover {
      transform: translateY(-2px);

      background: var(--surface-2);
      border-color: rgba(168, 200, 231, 0.5);
    }

    /* Уменьшенная кнопка для шапки */
    .cta-sm {
      gap: 8px;

      padding: 9px 13px;

      border-radius: 11px;

      font-size: 13px;
      font-weight: 550;
    }

    /* Ссылки на соцсети / мессенджеры в блоке «Contact» */
    .social-links {
      display: flex;
      flex-wrap: wrap;

      gap: 10px;

      margin-top: 22px;
    }

    .contact-group {
      margin-top: 26px;
    }

    .contact-group-title {
      display: block;

      color: var(--faint);

      font: 500 10px/1.3 var(--mono);

      letter-spacing: 0.14em;
      text-transform: uppercase;
    }

    .contact-group .social-links {
      margin-top: 10px;
    }

    .social-link {
      display: inline-flex;
      align-items: center;
      gap: 8px;

      padding: 10px 14px;

      border: 1px solid var(--line);
      border-radius: 11px;

      background: rgba(255, 255, 255, 0.02);

      color: var(--muted);

      font: 12px var(--mono);
      letter-spacing: 0.02em;

      transition:
        transform 0.3s var(--ease),
        background 0.3s var(--ease),
        border-color 0.3s var(--ease),
        color 0.3s var(--ease);
    }

    .social-link:hover {
      transform: translateY(-2px);

      color: var(--text);
      background: var(--surface-2);
      border-color: rgba(168, 200, 231, 0.5);
    }

    .social-link .bi,
    .social-link svg {
      color: var(--blue-light);
      font-size: 15px;
    }

    .social-link svg {
      width: 15px;
      height: 15px;
      fill: currentColor;
    }

    /* =========================================================
       MODAL «Start a project»
       Окно в стиле macOS: та же шапка .window-bar, сетка и голубое
       свечение, как у окна «Live viewer».
       ========================================================= */

    /* Мягкое появление окна: чуть снизу и с лёгким увеличением */
    .contact-modal.fade .modal-dialog {
      transform: translateY(18px) scale(0.97);

      transition: transform 0.45s var(--ease);
    }

    .contact-modal.show .modal-dialog {
      transform: none;
    }

    .modal-backdrop {
      --bs-backdrop-bg: #0c0e11;

      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
    }

    .contact-modal .modal-dialog {
      max-width: 520px;
    }

    .contact-modal .modal-content {
      overflow: hidden;

      border: 1px solid var(--line-strong);
      border-radius: 22px;

      background: #20242a;

      box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
    }

    /* Красная точка светофора — рабочая кнопка «закрыть» */
    .tl-close {
      position: relative;

      width: 11px;
      height: 11px;
      padding: 0;

      border: 0;
      border-radius: 50%;

      background: #ff5f57;
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);

      transition: filter 0.2s var(--ease);
    }

    /* Увеличенная область нажатия, чтобы попасть пальцем */
    .tl-close::after {
      content: "";

      position: absolute;
      inset: -8px;
    }

    .tl-close:hover {
      filter: brightness(1.15);
    }

    .modal-esc {
      padding: 4px 8px;

      border: 1px solid var(--line);
      border-radius: 7px;

      background: transparent;

      color: var(--faint);

      font: 10px var(--mono);
      letter-spacing: 0.08em;

      transition:
        color 0.2s var(--ease),
        border-color 0.2s var(--ease),
        background 0.2s var(--ease);
    }

    .modal-esc:hover {
      color: var(--text);
      border-color: var(--line-strong);
      background: rgba(255, 255, 255, 0.05);
    }

    /* Тело окна: сетка + голубое свечение, как в .preview */
    .contact-modal .modal-body {
      position: relative;

      display: flex;
      flex-direction: column;
      align-items: flex-start;

      gap: 20px;

      padding: clamp(20px, 5vw, 30px);

      background:
        radial-gradient(
          circle at 85% 0%,
          rgba(139, 174, 204, 0.2),
          transparent 45%
        ),
        linear-gradient(
          rgba(255, 255, 255, 0.035) 1px,
          transparent 1px
        ),
        linear-gradient(
          90deg,
          rgba(255, 255, 255, 0.035) 1px,
          transparent 1px
        ),
        #242930;

      background-size: auto, 40px 40px, 40px 40px, auto;
    }

    .contact-modal .modal-body > * {
      width: 100%;
    }

    .contact-modal .modal-body > .hero-badge {
      width: auto;
    }

    .contact-modal .modal-title {
      margin: 0;

      font-size: clamp(38px, 9vw, 56px);
      font-weight: 720;
      line-height: 0.9;

      letter-spacing: -0.075em;
    }

    .modal-lead {
      max-width: 420px;

      margin: 0;

      color: var(--muted);

      font-size: 15px;
      line-height: 1.55;
    }

    .modal-label {
      display: block;

      margin-bottom: 10px;

      color: var(--faint);

      font: 500 10px/1.3 var(--mono);

      letter-spacing: 0.14em;
      text-transform: uppercase;
    }

    /* Чипы выбора типа проекта */
    .chips {
      display: flex;
      flex-wrap: wrap;

      gap: 8px;
    }

    .chip {
      display: inline-flex;
      align-items: center;

      gap: 8px;

      padding: 8px 13px;

      border: 1px solid var(--line);
      border-radius: 999px;

      background: rgba(255, 255, 255, 0.02);

      color: var(--muted);

      font: 12px var(--mono);

      transition:
        transform 0.25s var(--ease),
        color 0.25s var(--ease),
        border-color 0.25s var(--ease),
        background 0.25s var(--ease);
    }

    .chip .bi {
      color: var(--faint);
      font-size: 13px;

      transition: color 0.25s var(--ease);
    }

    .chip:hover {
      transform: translateY(-1px);

      color: var(--text);
      border-color: var(--line-strong);
    }

    .chip.active {
      color: var(--text);
      border-color: rgba(168, 200, 231, 0.6);
      background: rgba(139, 174, 204, 0.16);
    }

    .chip.active .bi {
      color: var(--blue-light);
    }

    /* Способы связи */
    .contact-options {
      display: flex;
      flex-direction: column;

      gap: 8px;
    }

    .contact-option {
      display: flex;
      align-items: stretch;

      overflow: hidden;

      border: 1px solid var(--line);
      border-radius: 14px;

      background: rgba(23, 26, 31, 0.55);

      color: var(--muted);

      transition:
        transform 0.3s var(--ease),
        background 0.3s var(--ease),
        border-color 0.3s var(--ease);
    }

    .contact-option:hover,
    .contact-option:focus-within {
      transform: translateY(-2px);

      background: var(--surface-2);
      border-color: rgba(168, 200, 231, 0.5);
    }

    .contact-option-link {
      display: flex;
      align-items: center;
      flex: 1;

      gap: 14px;

      min-width: 0;
      padding: 13px 16px;

      color: inherit;
    }

    .contact-option-icon {
      display: grid;
      flex-shrink: 0;
      place-items: center;

      width: 40px;
      height: 40px;

      border-radius: 11px;

      background: rgba(139, 174, 204, 0.12);

      color: var(--blue-light);
      font-size: 18px;

      transition:
        background 0.3s var(--ease),
        transform 0.3s var(--ease);
    }

    .contact-option:hover .contact-option-icon {
      background: rgba(139, 174, 204, 0.22);
      transform: scale(1.06);
    }

    .contact-option-icon svg {
      width: 18px;
      height: 18px;
      fill: currentColor;
    }

    .contact-option-text {
      display: flex;
      flex-direction: column;
      flex: 1;

      min-width: 0;
    }

    .contact-option-text strong {
      color: var(--text);

      font-size: 15px;
      font-weight: 550;
    }

    .contact-option-text small {
      overflow: hidden;

      font: 12px var(--mono);

      text-overflow: ellipsis;
    }

    .contact-option-arrow {
      color: var(--faint);

      transition:
        color 0.25s var(--ease),
        transform 0.3s var(--ease);
    }

    .contact-option:hover .contact-option-arrow {
      color: var(--blue-light);
      transform: translate(2px, -2px);
    }

    /* Кнопка «скопировать почту» */
    .contact-copy {
      display: grid;
      flex-shrink: 0;
      place-items: center;

      width: 52px;

      border: 0;
      border-left: 1px solid var(--line);

      background: transparent;

      color: var(--faint);
      font-size: 15px;

      transition:
        color 0.25s var(--ease),
        background 0.25s var(--ease);
    }

    .contact-copy:hover {
      color: var(--text);
      background: rgba(255, 255, 255, 0.05);
    }

    .contact-copy.copied {
      color: #28c840;
    }

    .modal-note {
      display: flex;
      align-items: center;

      gap: 8px;

      margin: 0;
      padding-top: 16px;

      border-top: 1px solid var(--line);

      color: var(--faint);

      font: 11px var(--mono);
    }

    .modal-note-tz {
      margin-left: auto;
    }

    /* Каскадное появление содержимого при открытии окна */
    .contact-modal.show .modal-rise {
      animation: modal-rise 0.6s var(--ease) both;
      animation-delay: calc(0.08s + var(--i, 0) * 0.06s);
    }

    @keyframes modal-rise {
      from {
        opacity: 0;
        transform: translateY(14px);
      }

      to {
        opacity: 1;
        transform: none;
      }
    }

    /* =========================================================
       ЛЁГКИЕ АНИМАЦИИ САЙТА
       Немного жизни, без перегруза. При «уменьшить анимацию»
       в системе всё автоматически отключается (см. конец стилей).
       ========================================================= */

    /* Каскад: блоки в одной группе появляются друг за другом.
       Задержку выставляет JS через --reveal-delay */
    .reveal {
      transition-delay: var(--reveal-delay, 0s);
    }

    /* Фон первого экрана медленно «оседает» при загрузке */
    .hero-bg img {
      animation: hero-settle 2.6s var(--ease) both;
    }

    @keyframes hero-settle {
      from { transform: scale(1.06); }
      to   { transform: scale(1); }
    }

    /* Точка статуса «свободен для проектов» мягко пульсирует */
    .hero-badge .status-dot,
    .modal-rise .status-dot,
    .modal-note .status-dot {
      animation: pulse 2s ease-in-out infinite;
    }

    /* Стрелка вниз на первом экране слегка покачивается */
    .scroll-cue .bi {
      animation: cue-bob 2.2s ease-in-out infinite;
    }

    @keyframes cue-bob {
      0%, 100% { transform: translateY(-1px); }
      50%      { transform: translateY(3px); }
    }

    /* Стрелки на кнопках чуть «уходят» по диагонали при наведении */
    .cta .bi-arrow-up-right,
    .cta-primary .bi-arrow-up-right,
    .cta-ghost .bi-arrow-down {
      transition: transform 0.3s var(--ease);
    }

    .cta:hover .bi-arrow-up-right,
    .cta-primary:hover .bi-arrow-up-right {
      transform: translate(2px, -2px);
    }

    .cta-ghost:hover .bi-arrow-down {
      transform: translateY(2px);
    }

    /* Нажатие ощущается физически */
    .cta:active,
    .cta-primary:active,
    .cta-ghost:active,
    .social-link:active,
    .chip:active {
      transform: scale(0.98);
    }

    /* Иконка карточки услуги приподнимается */
    .service-icon {
      transition: transform 0.4s var(--ease);
    }

    .service:hover .service-icon {
      transform: translateY(-3px);
    }

    /* Мигающий курсор в конце contact.json */
    .code-caret {
      display: inline-block;

      width: 0.55em;
      height: 1.05em;

      margin-left: 2px;

      vertical-align: text-bottom;

      background: var(--blue-light);

      animation: caret 1.1s steps(1) infinite;
    }

    @keyframes caret {
      50% { opacity: 0; }
    }

    /* Пока код «печатается», курсор горит ровно и не мигает */
    .code-caret.typing {
      animation: none;
    }

    /* Ещё не напечатанная часть кода: занимает место (вёрстка не прыгает),
       но не видна */
    .code-pending {
      visibility: hidden;
    }

    /* =========================================================
       FOOTER
       ========================================================= */

    footer {
      padding: 24px 0 calc(35px + env(safe-area-inset-bottom));

      border-top: 1px solid var(--line);

      color: var(--faint);

      font: 11px var(--mono);
    }

    /* =========================================================
       REVEAL — плавное появление блоков при прокрутке
       Класс .visible добавляет JS (IntersectionObserver)
       ========================================================= */

    .reveal {
      opacity: 0;

      transform: translateY(24px);

      transition:
        opacity 0.8s var(--ease),
        transform 0.8s var(--ease);
    }

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

    /* =========================================================
       АДАПТИВ (брейкпоинты совпадают с Bootstrap)
       md ≥ 768px — планшет, lg ≥ 992px — ноутбук, xl ≥ 1200px
       ========================================================= */

    /* ---- Планшет и выше ---- */
    @media (min-width: 768px) {

      /* Список проектов становится вертикальным столбцом слева */
      .project-list {
        flex-direction: column;

        overflow: visible;

        border-bottom: 0;
        border-right: 1px solid var(--line);
      }

      .project-button {
        min-width: 0;
        width: 100%;
      }

      .project-button .bi {
        display: block;
      }

      /* Окно проектов подстраивается под высоту экрана —
         сделано заметно крупнее, чтобы сайт было видно, а не угадывать.
         Высоту .shot-body здесь больше не трогаем: она полностью
         зависит от aspect-ratio / JS, чтобы не спорить с масштабом iframe. */
      .viewer {
        min-height: clamp(440px, 68svh, 700px);
      }
    }

    /* ---- Ноутбук и выше ---- */
    @media (min-width: 992px) {

      /* Результат справа от кода, а не под ним */
      .result {
        border-top: 0;
        border-left: 1px solid var(--line);
      }

      /* Горизонтальный таймлайн: шаги идут в ряд */
      .step {
        padding: 44px 14px 0 0;
      }

      .step::before,
      .step::after {
        left: 22px;
        right: 4px;
        top: 7px;
        bottom: auto;

        width: auto;
        height: 1px;
      }

      .step::after {
        transform: scaleX(0);
        transform-origin: left;
      }

      .timeline.play .step::after {
        transform: scaleX(1);
      }

      .step-dot {
        left: 0;
        top: 0;
      }

      .step-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;

        min-height: 0;
      }

      .step-icon {
        margin-bottom: 26px;

        font-size: 22px;
      }

      .step strong {
        margin-top: 8px;
      }
    }

    /* ---- Планшет в портретной ориентации и телефон ---- */
    @media (max-width: 991.98px) {

      /* Фото на весь первый экран, но сверху сильное затемнение под текст */
      .hero-bg img {
        object-position: 40% 100%;
      }

      .hero-bg::after {
        background:
          linear-gradient(
            to bottom,
            rgba(23, 26, 31, 0.94) 0,
            rgba(23, 26, 31, 0.84) 45%,
            rgba(23, 26, 31, 0.6) 78%,
            rgba(23, 26, 31, 0.2) 100%
          ),
          linear-gradient(
            to top,
            var(--bg) 0,
            rgba(23, 26, 31, 0) 14%
          );
      }
    }

    /* ---- Только телефон ---- */
    @media (max-width: 767.98px) {

      .window {
        border-radius: 18px;
      }

      /* Услуги: горизонтальная лента со свайпом.
         Так весь блок помещается в один экран телефона. */
      .services-row {
        flex-wrap: nowrap;
        overflow-x: auto;

        margin-left: -14px;
        margin-right: -14px;
        padding: 0 6px 8px;

        scroll-snap-type: x mandatory;
        scroll-padding: 0 6px;
        scrollbar-width: none;
      }

      .services-row::-webkit-scrollbar {
        display: none;
      }

      .services-row > * {
        scroll-snap-align: start;
      }

      .service {
        min-height: clamp(320px, 54svh, 460px);
      }

      /* На телефоне вьювер эмулирует реальный мобильный вьюпорт
         (390×844) — запасной вариант для aspect-ratio, пока не
         отработал JS (см. .shot-body в базовых стилях и main.js) */
      .shot-body {
        aspect-ratio: 390 / 844;
      }
    }

    @media (max-width: 419.98px) {

      /* В шапке окна просмотра на узком экране оставляем место под URL */
      .window-bar:has(.shot-url) .window-label {
        display: none;
      }
    }

    @media (max-width: 575.98px) {

      .container {
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
      }

      .topbar {
        top: calc(8px + env(safe-area-inset-top));
        width: calc(100% - 16px);
      }

      .hero {
        padding-top: 104px;

        /* Запас снизу, чтобы стрелка «вниз» не налезала на цифры */
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
      }

      .hero-title {
        font-size: clamp(40px, min(15.5vw, 13svh), 110px);
      }

      .hero-description {
        font-size: 16px;
      }

      /* Три цифры в одну строку вместо неровного переноса */
      .hero-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));

        gap: 14px;
      }

      .stat {
        padding-left: 12px;
      }

      .stat-value {
        font-size: 20px;
      }

      .stat-label {
        font-size: 9px;
        line-height: 1.4;

        overflow-wrap: anywhere;
      }

      .hero-marquee {
        margin-top: 28px;
      }

      pre.code {
        padding: 18px 16px;
      }

      .result {
        padding: 20px 14px;
      }
    }

    /* =========================================================
       МОБИЛЬНАЯ ОПТИМИЗАЦИЯ
       ========================================================= */

    a,
    button {
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation; /* без задержки тапа и двойного зума */
    }

    /* Сенсорные экраны: наведения нет — «залипающие» hover-эффекты
       (подъём карточек, сдвиг стрелок) отключаем, оставляем нажатие */
    @media (hover: none) {

      .cta:hover,
      .cta-primary:hover,
      .social-link:hover,
      .contact-option:hover,
      .chip:hover {
        transform: none;
      }

      .service:hover .photo,
      .service:hover .service-icon,
      .contact-option:hover .contact-option-icon,
      .contact-option:hover .contact-option-arrow,
      .cta:hover .bi-arrow-up-right,
      .cta-primary:hover .bi-arrow-up-right,
      .cta-ghost:hover .bi-arrow-down {
        transform: none;
      }

      .cta:active,
      .cta-primary:active,
      .cta-ghost:active,
      .social-link:active,
      .chip:active {
        transform: scale(0.98);
      }
    }

    /* Пальцу нужны цели покрупнее (минимум ~40–44 px) */
    @media (pointer: coarse) {

      .chip {
        padding: 11px 15px;
      }

      .social-link {
        padding: 13px 15px;
      }

      .modal-esc {
        padding: 9px 12px;
      }

      .contact-copy {
        width: 58px;
      }

      .navigation a {
        padding: 11px 12px;
      }

      .project-button {
        padding: 16px 12px;
      }

      .shot-open {
        width: 40px;
        height: 40px;
      }

      /* Палец над встроенным сайтом должен листать страницу,
         а не «застревать» внутри iframe. Открыть сайт — кнопкой в шапке окна */
      .frame-scale iframe {
        pointer-events: none;
      }
    }

    /* ---- Планшет / телефон ---- */
    @media (max-width: 767.98px) {

      /* Секции компактнее: меньше пустоты между блоками */
      :root {
        --section-pt: 84px;
        --section-pb: 48px;
      }

      .section {
        min-height: auto;
      }

      .section-heading {
        margin-bottom: 26px;
      }

      /* Шапка легче для слабых GPU; открытое меню — плотнее,
         чтобы текст страницы не просвечивал */
      .topbar {
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
      }

      .topbar:has(.mobile-nav.show) {
        background: rgba(24, 27, 32, 0.97);
      }

      /* В ландшафте меню не должно выходить за экран */
      .mobile-nav-inner {
        max-height: calc(100svh - 110px);

        overflow-y: auto;
      }

      /* Лента проектов: мягкая «примагниченная» прокрутка */
      .project-list {
        scroll-snap-type: x proximity;
      }

      .project-button {
        min-width: 150px;

        scroll-snap-align: start;
      }
    }

    /* ---- Телефон ---- */
    @media (max-width: 575.98px) {

      /* Листинги: длинные строки переносятся, а не обрезаются */
      pre.code {
        font-size: 11px;

        white-space: pre-wrap;
        overflow-wrap: anywhere;
      }

      .contact-window .window-bar {
        padding: 11px 13px;
      }

      /* Модальное окно: компактнее и с учётом «чёлки» */
      .contact-modal .modal-dialog {
        margin:
          8px
          max(8px, env(safe-area-inset-right))
          8px
          max(8px, env(safe-area-inset-left));
      }

      .contact-modal .modal-body {
        gap: 16px;
      }

      .contact-option-link {
        gap: 12px;

        padding: 11px 12px;
      }

      .contact-option-icon {
        width: 36px;
        height: 36px;
      }

      .contact-copy {
        width: 50px;
      }
    }

    /* Невысокие экраны (маленькие телефоны, ландшафт) */
    @media (max-height: 700px) {

      .contact-modal .modal-body {
        gap: 14px;
        padding: 18px;
      }

      .contact-modal .modal-title {
        font-size: clamp(32px, 8vw, 44px);
      }

      .modal-lead {
        font-size: 14px;
      }

      .modal-note {
        padding-top: 12px;
      }
    }

    @media (max-height: 520px) {

      .modal-lead {
        display: none;
      }

      .contact-modal .modal-title {
        font-size: 32px;
      }
    }

    /* Уважаем настройку «уменьшить анимацию» в системе */
    @media (prefers-reduced-motion: reduce) {
      html {
        scroll-behavior: auto;
      }

      *,
      *::before,
      *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
      }
    }
