/* ==========================================================================
   Портфолио — редакционная дизайн-система.

   Тёплая бумага, волосяные линии, Playfair + Inter + JetBrains Mono.
   Никаких пилюль, неона, градиентов, иконок и декоративных теней:
   структуру держат линии, сетка и типографика.

   Правило чтения: текст контрастный, линии заметные, секции разделены
   волосяной линией по ширине колонки и воздухом, поверхности — плоские.
   ========================================================================== */

:root {
  /* Бумага и поверхности */
  --paper: #F4F1EA;
  --paper-2: #EBE7DD;
  --paper-3: #FBFAF6;
  --paper-code: #EDE9E0;

  /* Текст */
  --ink: #17181A;
  --ink-2: #2B2D33;
  --muted: #5B5F66;

  /* Линии */
  --line: rgba(23, 24, 26, .22);
  --line-2: rgba(23, 24, 26, .34);

  /* Единственный акцент */
  --accent: #0B5348;
  --accent-2: #083F37;
  --accent-soft: rgba(11, 83, 72, .09);

  /* Шрифты */
  --font-display: 'Playfair Display', 'Lora', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  /* Ритм */
  --container: 1180px;
  --gutter: 24px;
  --section-gap: clamp(88px, 10vw, 150px);
  --shadow-paper: 0 26px 50px -28px rgba(23, 24, 26, .42);
  --shadow-soft: 0 14px 30px -22px rgba(23, 24, 26, .50);
}

/* ---------- База ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.64;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked { overflow: hidden; }

img { max-width: 100%; }

h1, h2, h3, h4, p, ul, ol, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

::selection { background: var(--accent-soft); color: var(--ink); }

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

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

/* Секция отбита от соседей волосяной линией по ширине колонки + воздухом */
.section {
  position: relative;
  padding: var(--section-gap) 0;
  scroll-margin-top: 90px;
}

.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(min(var(--container), 100%) - 2 * var(--gutter));
  height: 1px;
  background: var(--line);
  pointer-events: none;
}

/* Под шапкой линия не нужна — там уже есть своя граница */
.section--hero::before { content: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--paper-3);
  color: var(--ink);
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  font-size: 14px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Мелкие моно-подписи ---------- */

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.4;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 18px;
}

.section__head { margin-bottom: clamp(38px, 4.4vw, 62px); }

.section__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -.015em;
  color: var(--ink);
}

/* ---------- Текстовые ссылки вместо кнопок-пилюль ---------- */

/* Подчёркивание — настоящее: 1px, отступ 4px, на hover 2px */
.text-link,
.link-arrow {
  display: inline-block;
  font-size: 17px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
  transition: color .2s ease, text-decoration-color .2s ease, text-decoration-thickness .2s ease;
}
.text-link:hover,
.link-arrow:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 2px;
}

.text-link--accent {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.text-link--accent:hover { color: var(--accent-2); text-decoration-color: var(--accent-2); }

.link-arrow__mark { display: inline-block; transition: transform .25s ease; }
.link-arrow:hover .link-arrow__mark,
.text-link:hover .link-arrow__mark { transform: translateX(4px); }

/* Мелкая служебная кнопка (копирование) */
.copy-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  padding: 0 0 3px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.copy-btn:hover { color: var(--accent); border-bottom-color: var(--accent); }
.copy-btn.is-done { color: var(--accent); border-bottom-color: var(--accent); }

/* ==========================================================================
   Шапка
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 74px;
}

.brand {
  display: block;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.brand__role {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.3;
  letter-spacing: .08em;
  color: var(--muted);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav__link {
  display: inline-block;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-2);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav__link:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav__link.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 0 0 auto;
}

.header-cta {
  font-size: 16px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
  transition: color .2s ease, text-decoration-color .2s ease, text-decoration-thickness .2s ease;
}
.header-cta:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 2px;
}

.burger {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.burger__box { display: block; width: 18px; }
.burger__box span {
  display: block;
  height: 1px;
  background: var(--ink);
  margin: 4px 0;
  transition: transform .25s ease, opacity .2s ease;
}
.burger[aria-expanded="true"] .burger__box span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__box span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] .burger__box span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- Мобильное меню ---------- */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
}
.drawer.is-open { visibility: visible; }

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 24, 26, .42);
  opacity: 0;
  transition: opacity .28s ease;
}
.drawer.is-open .drawer__backdrop { opacity: 1; }

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(330px, 88vw);
  background: var(--paper);
  border-left: 1px solid var(--line-2);
  padding: 26px 24px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.22, .7, .2, 1);
}
.drawer.is-open .drawer__panel { transform: none; }

.drawer__close {
  align-self: flex-end;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.drawer__list { display: flex; flex-direction: column; }
.drawer__list li { border-top: 1px solid var(--line); }
.drawer__list li:last-child { border-bottom: 1px solid var(--line); }

.drawer__link {
  display: block;
  padding: 14px 0;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: color .2s ease, padding-left .2s ease;
}
.drawer__link:hover, .drawer__link.is-active { color: var(--accent); padding-left: 6px; }

.drawer__cta {
  display: inline-block;
  font-size: 17px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
  align-self: flex-start;
  transition: color .2s ease, text-decoration-color .2s ease, text-decoration-thickness .2s ease;
}
.drawer__cta:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 2px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.section--hero {
  padding-top: clamp(52px, 6vw, 96px);
  padding-bottom: clamp(80px, 8vw, 124px);
}

.hero__inner {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(30px, 5vw, 72px);
  align-items: center;
}

/* Сетка не должна раздуваться под минимальную ширину содержимого */
.hero__content, .hero__visual,
.project__body, .project__media, .project__media-inner,
.contact__main, .contact__next,
.media-table, .media-chat, .media-shot,
.table-scroll, .case-table-wrap { min-width: 0; }

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 26px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5.1vw, 64px);
  line-height: 1.02;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0 0 22px;
  max-width: 17ch;
  overflow-wrap: break-word;
}
.hero__title-accent { color: var(--accent); }

.hero__role {
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 20px;
}

.hero__lead {
  font-size: 17.5px;
  line-height: 1.64;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0 0 32px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin: 0 0 26px;
}

.hero__note {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 52ch;
  margin: 0;
}

/* Телефон со скриншотом */

.hero__visual {
  display: flex;
  justify-content: center;
  perspective: 1400px;
}

.phone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0;
}

.phone__frame {
  width: min(268px, 70vw);
  padding: 12px;
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  box-shadow: var(--shadow-paper);
  transform-style: preserve-3d;
  will-change: transform;
}

.phone__screen {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  background: var(--paper-2);
}

.phone__caption {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
}

/* ==========================================================================
   Полоса фактов — обособлена линиями сверху и снизу
   ========================================================================== */

.facts__note {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 24px;
}

.facts__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  padding: 34px 0 30px;
}

.fact {
  padding: 0 28px;
  border-left: 1px solid var(--line);
}
.fact:first-child { border-left: 0; padding-left: 0; }
.fact:last-child { padding-right: 0; }

.fact__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(38px, 3.8vw, 56px);
  line-height: 1;
  letter-spacing: -.015em;
  color: var(--ink);
}

.fact__label {
  display: block;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 22ch;
}

.facts__now {
  margin: 30px 0 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
}

/* ==========================================================================
   Услуги — индексный список
   ========================================================================== */

.services__lead {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 clamp(38px, 4.5vw, 60px);
}

.services__lead li {
  padding: 0 26px;
  border-left: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink-2);
}
.services__lead li:first-child { border-left: 0; padding-left: 0; }
.services__lead li:last-child { padding-right: 0; }

.services__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(34px, 6vw, 84px);
  border-top: 1px solid var(--line);
}

.service {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 4px 16px;
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--line);
}

.service__num {
  grid-row: 1 / span 2;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  padding-top: 5px;
  transition: color .2s ease;
}

.service__title {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 8px;
  transition: transform .25s ease;
}

.service__text {
  font-size: 16px;
  line-height: 1.64;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0;
}

.service:hover .service__num { color: var(--accent); }
.service:hover .service__title { transform: translateX(2px); }

/* ==========================================================================
   Проекты — полноширинные полосы
   ========================================================================== */

.section--projects { background: var(--paper-2); }

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

.project {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(28px, 4.5vw, 68px);
  align-items: start;
  padding: clamp(38px, 4.5vw, 60px) 0;
  border-bottom: 1px solid var(--line);
}

.project__meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 16px;
}

.project__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.12;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0 0 10px;
}

.project__subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.35;
  color: var(--ink-2);
  margin: 0 0 18px;
}

.project__summary {
  font-size: 17px;
  line-height: 1.64;
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0 0 20px;
}

.project__metrics {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 0 0 10px;
}

.project__stack {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 26px;
}

/* Блок медиа — светлая бумага, заметная рамка, мягкая тень */
.project__media {
  transition: transform .35s ease, box-shadow .35s ease;
}

.project__media-inner {
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transform-style: preserve-3d;
  will-change: transform;
}

.project:hover .project__media {
  transform: translateY(-2px);
  box-shadow: var(--shadow-paper);
}

/* Галерея внутри полосы */

.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.shot-grid__item:first-child { grid-column: span 2; }

.shot { margin: 0; display: block; }

.shot img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--line-2);
  background: var(--paper-2);
}
.shot-grid__item:first-child .shot img { aspect-ratio: 16 / 11; }
.shot-grid__item:not(:first-child) .shot img { aspect-ratio: 4 / 5; }

/* Подпись — сразу под рамкой снимка */
.shot__caption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: .05em;
  color: var(--muted);
}

/* Таблица внутри полосы */

.table-scroll { overflow-x: auto; max-width: 100%; }

.table-preview {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

.table-preview th {
  text-align: left;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  padding: 0 18px 12px 0;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}

.table-preview td {
  padding: 10px 18px 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
}

.table-preview td.is-code { color: var(--accent); }
.table-preview td.is-num { color: var(--muted); }
.table-preview td.is-name { color: var(--ink); }

/* Подпись — под линией */
.table-preview__caption {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: .05em;
  color: var(--muted);
}

/* Чат внутри полосы */

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat__row { display: flex; }
.chat__row--user { justify-content: flex-end; }

.chat__bubble {
  max-width: 82%;
  padding: 10px 13px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  border-radius: 3px;
}
.chat__row--user .chat__bubble {
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.chat__row--bot .chat__bubble {
  background: var(--paper);
  border: 1px solid var(--line-2);
  color: var(--ink);
}

.chat__caption {
  margin: 16px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: .05em;
  color: var(--muted);
}

/* Заглушка, если у проекта нет медиа */

.media-fallback {
  background: var(--paper-3);
  border: 1px dashed var(--line-2);
  border-radius: 2px;
  padding: 28px 20px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  text-align: center;
}

/* ==========================================================================
   Как работаю
   ========================================================================== */

.process {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.process::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 9px;
  height: 1px;
  background: var(--line);
}

.process-step { position: relative; padding-top: 32px; }

.process-step::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
}

.process-step__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  margin-bottom: 10px;
}

.process-step__title {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 8px;
}

.process-step__text {
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--ink-2);
  margin: 0;
  max-width: 34ch;
}

/* ==========================================================================
   Стек — спецификация
   ========================================================================== */

.stack__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: clamp(28px, 5vw, 64px);
  row-gap: 38px;
}

.stack-group {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.stack-group__title {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 12px;
}

.stack-group__items {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
}

/* ==========================================================================
   FAQ
   ========================================================================== */

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

.faq__item { border-bottom: 1px solid var(--line); }

.faq__q {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 26px;
  width: 100%;
  background: none;
  border: 0;
  padding: 22px 0;
  text-align: left;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
  transition: color .2s ease;
}
.faq__q:hover { color: var(--accent); }

.faq__sign {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  display: inline-flex;
  gap: 8px;
}
.faq__sign .sign-minus { display: none; }
.faq__item.is-open .faq__sign .sign-plus { display: none; }
.faq__item.is-open .faq__sign .sign-minus { display: inline; }

.faq__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s ease;
}

.faq__answer {
  padding: 0 60px 26px 0;
  font-size: 16.5px;
  line-height: 1.64;
  color: var(--ink-2);
  max-width: 68ch;
}

/* ==========================================================================
   Контакты
   ========================================================================== */

.section--contact {
  background: var(--paper-2);
}

.contact__grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(30px, 5vw, 72px);
  align-items: start;
}

.contact__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0 0 18px;
}

.contact__note {
  font-size: 17px;
  line-height: 1.64;
  color: var(--ink-2);
  max-width: 48ch;
  margin: 0 0 36px;
}

.contact__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.contact__link {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.25;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--line-2);
  transition: color .2s ease, text-decoration-color .2s ease, text-decoration-thickness .2s ease;
  overflow-wrap: anywhere;
}
.contact__link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

.contact__meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 26px 0 0;
}

.contact__next { margin: 0; }

.contact__next-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 4px;
}

.contact__next-list li {
  border-top: 1px solid var(--line);
  padding: 13px 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
}
.contact__next-list li:last-child { border-bottom: 1px solid var(--line); }

.contact__copy {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0 0;
}

/* ==========================================================================
   Подвал
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line-2);
  padding: 30px 0 36px;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 30px;
}

.site-footer p {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--muted);
}

/* ==========================================================================
   Кнопка «наверх»
   ========================================================================== */

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
.to-top.is-visible { opacity: 1; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ==========================================================================
   Модальное окно кейса
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 4vh, 56px) 16px;
  overflow-y: auto;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 24, 26, .46);
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 980px;
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  box-shadow: var(--shadow-paper);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .28s ease, transform .28s ease;
}
.modal.is-open .modal__dialog { opacity: 1; transform: none; }

.modal__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 24px clamp(20px, 3vw, 36px) 20px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--line-2);
}

.modal__head { min-width: 0; }

.modal__meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 10px;
}

.modal__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0;
}

.modal__subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink-2);
  margin: 8px 0 0;
}

.modal__metrics {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .05em;
  color: var(--muted);
  margin-top: 12px;
}

.modal__close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.modal__close:hover { color: var(--accent); border-color: var(--accent); }

.modal__body { padding: 0 clamp(20px, 3vw, 36px) 44px; }

/* Блоки кейса */

.case-lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 26px 0 0;
  max-width: 62ch;
}

.case-block {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.case-block__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 16px;
}

.case-block__text {
  font-size: 17px;
  line-height: 1.64;
  color: var(--ink-2);
  margin: 0;
  max-width: 74ch;
}

.case-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 11px;
  font-size: 16.5px;
  line-height: 1.64;
  color: var(--ink-2);
  max-width: 76ch;
}
.case-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 10px;
  height: 1px;
  background: var(--line-2);
}

.case-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 34px;
}

.case-feature {
  border-top: 1px solid var(--line);
  padding: 16px 0 18px;
}

.case-feature__title {
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 6px;
}

.case-feature__text {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.case-shot { margin: 0; }

.case-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-2);
  background: var(--paper-2);
}

.case-shot__caption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: .05em;
  color: var(--muted);
}

.case-table-wrap { overflow-x: auto; }

.case-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

.case-table th {
  text-align: left;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  padding: 0 20px 12px 0;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}

.case-table td {
  padding: 10px 20px 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
}

.case-table td.is-code { color: var(--accent); }
.case-table td.is-num { color: var(--muted); }
.case-table td.is-name { color: var(--ink); }

.case-table__caption {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: .05em;
  color: var(--muted);
}

.case-table__download { margin-top: 16px; }

.case-download {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
  transition: color .2s ease, text-decoration-color .2s ease, text-decoration-thickness .2s ease;
}
.case-download:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 2px;
}

/* Блок кода — бумага чуть темнее, рамка заметнее */
.case-code {
  background: var(--paper-code);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 16px 18px 18px;
}

.case-code__file {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 12px;
}

.case-code__pre {
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.68;
  color: var(--ink-2);
  white-space: pre;
}

.code-comment { color: var(--accent); }
.code-string { color: var(--accent-2); }

.case-code__caption {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 74ch;
}

.case-stack {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
}

.case-links { display: flex; flex-wrap: wrap; gap: 22px; }

/* ==========================================================================
   Появление секций
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Адаптив
   ========================================================================== */

@media (max-width: 1080px) {
  .hero__title { max-width: none; }
}

@media (max-width: 980px) {
  .nav { display: none; }
  .burger { display: flex; }
  .header-cta { display: none; }

  .hero__inner { grid-template-columns: 1fr; gap: 46px; }
  .hero__visual { order: 2; }

  .facts__grid { grid-template-columns: repeat(2, 1fr); row-gap: 34px; }
  .fact:nth-child(odd) { border-left: 0; padding-left: 0; }
  .fact:nth-child(3) { border-left: 0; padding-left: 0; }

  .services__list { grid-template-columns: 1fr; }
  .services__lead { grid-template-columns: 1fr; }
  .services__lead li {
    border-left: 0;
    padding: 14px 0;
    border-top: 1px solid var(--line);
  }
  .services__lead li:first-child { border-top: 0; padding-top: 0; }

  .project { grid-template-columns: 1fr; }

  .process { grid-template-columns: 1fr; gap: 0; }
  .process::before {
    left: 4px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 1px;
    height: auto;
  }
  .process-step { padding: 0 0 32px 34px; }
  .process-step::before { top: 8px; left: 0; }
  .process-step__text { max-width: 52ch; }

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

  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  :root { --gutter: 20px; }

  .section--hero { padding-bottom: 72px; }

  .facts__grid { grid-template-columns: 1fr; row-gap: 26px; }
  .fact { border-left: 0; padding: 0; }

  .shot-grid { grid-template-columns: 1fr; }
  .shot-grid__item:first-child { grid-column: span 1; }

  .stack__grid { grid-template-columns: 1fr; row-gap: 30px; }

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

  .faq__answer { padding-right: 0; }
}

@media (max-width: 420px) {
  .hero__title { font-size: 34px; }
  .hero__lead { font-size: 17px; }
  .contact__link { font-size: 21px; }
  .project__subtitle { font-size: 18px; }
  .fact__value { font-size: 36px; }
  .faq__q { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
