/* ТерраГрандэ: dark chocolate + luminous gold */
:root {
  color-scheme: dark;
  --bg: #0c0806;
  --surface: #1a120e;
  --surface-2: #2e1e15;
  --ink: #faf2e6;
  --muted: #ccb592;
  --line: rgba(224, 186, 118, .24);
  --line-soft: rgba(224, 186, 118, .08);
  --glass: rgba(16, 11, 8, .84);
  --accent: #e0ba76;
  --accent-2: #f2dcb0;
  --dark-ink: #0c0806;
  --button-bg: #e0ba76;
  --button-hover: #ebc98c;
  --button-ink: #140d09;
  --marquee-bg: #5a321c;
  --marquee-ink: #faf2e6;
  --danger: #e0968e;
  --header-bg: rgba(14, 9, 7, .94);
  --panel-bg: #140e0a;
  --card-bg: rgba(26, 18, 14, .97);
  --card-hover: #3a261c;
  --field-bg: rgba(247,239,228,.05);
  --footer-bg: #080504;
  --hero-shade: linear-gradient(180deg, rgba(8,5,3,.76) 0%, rgba(8,5,3,.18) 42%, rgba(8,5,3,.98) 100%), linear-gradient(90deg, rgba(8,5,3,.86), transparent 70%);
  --image-shade: linear-gradient(90deg, rgba(8,5,3,.98), rgba(8,5,3,.66));
  --image-treatment: saturate(.74) sepia(.1) contrast(1.05);
  --shadow: rgba(0,0,0,.62);
  --hero-ink: #fff7ec;
  --hero-chip-bg: rgba(12, 8, 5, .78);
  --hero-chip-ink: #fff7ec;
  --footer-ink: #f7efe4;
  --footer-muted: #b49a7c;
  --header: 4.75rem; /* 76px @ 16px root; scales with html font-size */
  --max: 77.5rem; /* 1240px @ 16px root */
  --display: "Unbounded", "Arial Narrow", sans-serif;
  --text: "Inter", system-ui, sans-serif;
  --gutter: 2.5rem;
  --gutter-sm: 1.5rem;
  --gutter-xs: 1.125rem;
}

*, *::before, *::after { box-sizing: border-box; }
/*
  Default visual scale ≈ browser zoom 110%.
  rem-based chrome + rem media queries keep layout zooming out cleanly
  (unlike transform: scale on body, which breaks fixed/sticky/scroll).
*/
html {
  font-size: 110%;
  scroll-behavior: auto;
  background: var(--bg);
}
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), var(--line-soft) calc(25% - 1px), var(--line-soft) 25%);
}
body.menu-open { overflow: hidden; }
img { display: block; width: 100%; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.container {
  width: min(100% - var(--gutter) * 2, var(--max));
  margin-inline: auto;
}
.section { position: relative; padding: 96px 0; border-top: 1px solid var(--line-soft); }
.section--surface { background: var(--surface); }
.section--image { overflow: hidden; isolation: isolate; }
.section--image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--image-shade), var(--section-image) center/cover;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--accent);
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .18em;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.kicker::before { content: ""; width: 48px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }
.section-title {
  max-width: 900px;
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: clamp(1.85rem, 4.2vw, 3.6rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -.025em;
  text-transform: uppercase;
  text-wrap: balance;
}
.section-lead { max-width: 680px; margin: 0 0 42px; color: var(--muted); }
.technical-label { font-size: .65rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--field-bg);
  color: var(--ink);
  cursor: pointer;
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
  transition: .2s ease;
}
.btn:hover, .btn:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); outline: 0; }
.btn--accent {
  border-color: transparent;
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-hover) 55%, #fff) 0%, var(--button-bg) 42%, color-mix(in srgb, var(--button-bg) 82%, #000) 100%);
  color: var(--button-ink);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 28%, transparent), 0 10px 28px color-mix(in srgb, var(--button-bg) 28%, transparent);
  letter-spacing: .12em;
}
.btn--accent:hover, .btn--accent:focus-visible {
  border-color: transparent;
  background: linear-gradient(180deg, color-mix(in srgb, var(--button-hover) 70%, #fff) 0%, var(--button-hover) 48%, var(--button-bg) 100%);
  color: var(--button-ink);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 34%, transparent), 0 14px 34px color-mix(in srgb, var(--button-bg) 36%, transparent);
}
.btn--wide { width: 100%; }

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(1.12);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 26px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-width: max-content;
  color: var(--ink);
}
.brand__mark,
.brand__logo,
.brand img {
  display: block;
  width: auto;
  height: 42px;
  flex-shrink: 0;
  object-fit: contain;
  /* White-on-black mark → accent gold (#e0ba76); black bg stays dark */
  filter: sepia(1) saturate(2.8) hue-rotate(6deg) brightness(1.05);
}
.brand__text {
  font-family: var(--display);
  font-size: clamp(.68rem, .95vw, .82rem);
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.site-footer .brand__text { font-size: .72rem; letter-spacing: .07em; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.main-nav a { padding: 10px 12px; color: var(--muted); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); }
.header-contact { display: flex; align-items: center; gap: 12px; }
.header-phone { color: var(--accent); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}
.menu-toggle span { display: block; width: 20px; height: 1px; margin: 5px auto; background: var(--ink); }

/* Hero */
.hero {
  position: relative;
  min-height: min(940px, 100svh);
  padding: calc(var(--header) + 22px) 0 34px;
  overflow: hidden;
  isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -3; }
.hero__media img { height: 100%; object-fit: cover; filter: var(--image-treatment); }
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-shade);
}
.hero__gridlines { position: absolute; inset: var(--header) 0 0; z-index: -1; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), var(--line) calc(25% - 1px), var(--line) 25%); }
.hero__inner { min-height: calc(min(940px, 100svh) - var(--header) - 56px); display: grid; grid-template-rows: auto 1fr auto; }
.hero__topline { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.hero__topline > :only-child { margin-left: auto; }
.hero__content { align-self: center; padding: 38px 0; }
.hero__topline, .hero__content { color: var(--hero-ink); }
.hero__eyebrow { margin: 0 0 12px; color: var(--accent-2); font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; }
.hero h1 {
  max-width: 1050px;
  min-width: 0;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 6.2vw, 5.8rem);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -.03em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero--long h1 {
  max-width: 1180px;
  font-size: clamp(2.1rem, 4.6vw, 4.5rem);
  line-height: 1.24;
  letter-spacing: -.03em;
}
.hero h1 small {
  display: block;
  margin-top: clamp(26px, 3.4vw, 40px);
  font-family: var(--text);
  font-size: .28em;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: .01em;
  text-transform: none;
  color: color-mix(in srgb, var(--hero-ink) 76%, transparent);
}
.hero__content--offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(22px, 3vw, 34px);
  max-width: none;
}
.hero--offer .hero-offer,
.hero--offer h1 {
  max-width: none;
  width: 100%;
}
.hero--offer h1 {
  font-size: clamp(1.7rem, 3.7vw, 3.45rem);
  line-height: 1.26;
  letter-spacing: -.025em;
}
.hero--offer h1 small {
  max-width: min(52ch, 50%);
  margin-top: clamp(22px, 2.8vw, 34px);
  font-size: clamp(.8rem, 1.1vw, .94rem);
  line-height: 1.58;
  letter-spacing: .01em;
  text-transform: none;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 920px);
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}
.hero-metric {
  min-height: 96px;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--hero-chip-bg);
  backdrop-filter: blur(14px);
}
.hero-metric strong {
  color: var(--accent);
  font: 400 clamp(1.45rem, 2.3vw, 2.35rem)/1.05 var(--display);
  white-space: nowrap;
}
.hero-metric span {
  min-width: 0;
  color: var(--hero-chip-ink);
  font-size: .62rem;
  line-height: 1.4;
  letter-spacing: .05em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.hero__bottom {
  display: flex;
  align-items: stretch;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}
.hero-chip {
  flex: 1 1 0;
  min-width: 0;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
  border: 0;
  background: var(--hero-chip-bg);
  backdrop-filter: blur(14px);
  color: var(--hero-chip-ink);
  font-size: .72rem;
  line-height: 1.45;
}
.hero-chip strong { display: block; margin-bottom: 4px; color: var(--hero-chip-ink); font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; }
.hero__cta {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  min-height: 82px;
  height: auto;
  align-self: stretch;
  border: 0;
  border-radius: 0;
}
.home-page .hero__inner { grid-template-rows: 1fr auto; }
.home-page .hero__content { padding-block: clamp(22px, 4vh, 38px); }
.home-page .section { padding-block: clamp(52px, 7vh, 76px); }

/* Lead form */
.lead-panel { padding: 38px 0; border-block: 1px solid var(--line); background: var(--panel-bg); }
.lead-panel__grid {
  display: grid;
  grid-template-columns: minmax(15.5rem, 18rem) minmax(0, 1fr);
  gap: clamp(36px, 4.5vw, 64px);
  align-items: start;
}
.lead-panel h2 {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  font-family: var(--display);
  font-size: clamp(.95rem, 1.1vw, 1.06rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -.01em;
  text-transform: uppercase;
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}
.lead-panel h2 span { display: block; margin-bottom: 10px; color: var(--accent); font: 600 .62rem/1.4 var(--text); letter-spacing: .15em; text-transform: uppercase; }
.lead-form__fields {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr) minmax(180px, 1.35fr) minmax(168px, .95fr);
  gap: 14px 12px;
  align-items: end;
}
.field { min-width: 0; }
.field--object { min-width: 0; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
.field input, .field select {
  width: 100%;
  height: 48px;
  min-width: 0;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: var(--field-bg);
  color: var(--ink);
}
.field select {
  padding-right: 2rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field input::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
.field select option { background: var(--surface); color: var(--ink); white-space: normal; }
.field input:focus, .field select:focus { border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.lead-form__submit {
  min-height: 48px;
  padding-inline: 18px;
  white-space: nowrap;
}
.consent {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.45;
}
.consent input { flex: 0 0 auto; margin-top: 3px; accent-color: var(--accent); }
.consent a { color: var(--accent); text-decoration: underline; }
.form-status { display: none; grid-column: 1 / -1; margin: 0; padding: 13px; border: 1px solid var(--line); font-size: .78rem; }
.form-status.is-visible { display: block; }
.form-status--error { border-color: rgba(226,123,114,.55); color: #f0a19a; }
.form-status--success { border-color: rgba(129,190,132,.5); color: #a8d8aa; }
.form-status--pending { color: var(--muted, #9aa3ad); }
.form-status a { color: var(--accent); text-decoration: underline; }
.form-submit-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: .72rem;
  line-height: 1.45;
  color: var(--muted, #9aa3ad);
}
.form-submit-hint a { color: var(--accent); text-decoration: underline; }
.final-form .form-submit-hint { grid-column: 1 / -1; }

/* Direction hub */
.direction-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 36px; }
.direction-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.direction-card {
  position: relative;
  min-height: 570px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  isolation: isolate;
  cursor: pointer;
  transition: border-color .28s ease, box-shadow .28s ease, background-color .28s ease;
}
.direction-card img, .pain-visual img, .solution-shot img, .case-card img { filter: var(--image-treatment); }
.direction-card img {
  position: absolute;
  inset: 0 0 auto;
  z-index: -2;
  height: 52%;
  object-fit: cover;
  transition: transform .45s ease, filter .35s ease;
}
.direction-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 5;
  width: 0;
  background: var(--accent);
  pointer-events: none;
  transition: width .28s ease;
}
.direction-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--surface) 42%, transparent 78%); }
.direction-card__num {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  min-width: 42px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--hero-ink) 35%, transparent);
  background: color-mix(in srgb, var(--dark-ink) 62%, transparent);
  color: var(--hero-ink);
  font-family: var(--display);
  font-size: .72rem;
  letter-spacing: .14em;
  text-align: center;
}
.direction-card__body { position: absolute; inset: auto 0 0; z-index: 1; width: 100%; min-height: 52%; display: flex; flex-direction: column; padding: 26px; }
.direction-card__tag {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 2px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 58%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-2);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.direction-card h3 {
  margin: 10px 0 10px;
  min-height: 3.6em;
  font-family: var(--display);
  font-size: clamp(1.12rem, 2vw, 1.55rem);
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  transition: color .28s ease;
}
.direction-card p { min-height: 3.2em; margin: 0 0 20px; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.direction-card .btn {
  margin-top: auto;
  transition: border-color .28s ease, background-color .28s ease, color .28s ease;
}
.direction-card__link { position: absolute; inset: 0; z-index: 4; }
.direction-card:hover,
.direction-card:has(.direction-card__link:focus-visible) {
  border-color: color-mix(in srgb, var(--accent) 78%, var(--line));
  background: var(--card-hover);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent), 0 18px 40px var(--shadow);
}
.direction-card:hover::before,
.direction-card:has(.direction-card__link:focus-visible)::before { width: 4px; }
.direction-card:hover img,
.direction-card:has(.direction-card__link:focus-visible) img {
  transform: scale(1.045);
  filter: saturate(.95) sepia(.02) brightness(1.08);
}
.direction-card:hover h3,
.direction-card:has(.direction-card__link:focus-visible) h3 { color: var(--accent-2); }
.direction-card:hover .direction-card__tag,
.direction-card:has(.direction-card__link:focus-visible) .direction-card__tag {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent-2);
}
.direction-card:hover .btn,
.direction-card:has(.direction-card__link:focus-visible) .btn {
  border-color: var(--button-hover);
  background: var(--button-hover);
  color: var(--button-ink);
}
.direction-card__link:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

@media (hover: hover) and (pointer: fine) {
  .direction-card .btn {
    border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
    background: transparent;
    color: var(--ink);
  }
  .direction-card:hover .btn,
  .direction-card:has(.direction-card__link:focus-visible) .btn {
    border-color: var(--button-bg);
    background: var(--button-bg);
    color: var(--button-ink);
  }
}
.home-page .direction-intro { margin-bottom: 22px; }
.home-page .direction-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.home-page .direction-card { min-height: 340px; }
.home-page .direction-card img { height: 46%; }
.home-page .direction-card::after { background: linear-gradient(0deg, var(--surface) 52%, transparent 86%); }
.home-page .direction-card__body { min-height: 60%; padding: 15px; }
.home-page .direction-card__tag { padding: 5px 8px; font-size: .52rem; }
.home-page .direction-card h3 { min-height: 2.4em; margin: 7px 0; font-size: clamp(.82rem, 1.25vw, 1.05rem); }
.home-page .direction-card p { min-height: 2.8em; margin-bottom: 10px; font-size: .62rem; line-height: 1.4; }
.home-page .direction-card .btn { min-height: 38px; padding: 8px 10px; font-size: .55rem; }
.home-page .pain-layout { min-height: min(680px, calc(100svh - var(--header))); }
.home-page .pain-grid { padding: 28px; }
.home-page .review-card { min-height: 240px; }
.home-page .service-card { min-height: 190px; }
.home-page .faq { margin-top: 32px; }
.home-page .final-cta { padding-block: clamp(52px, 7vh, 72px); }

/* Pain reference block */
.pain-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 700px; }
.pain-visual { position: relative; min-height: 520px; overflow: hidden; }
.pain-visual img { height: 100%; object-fit: cover; }
.pain-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7,7,6,.9), rgba(7,7,6,.08) 65%); }
.pain-visual h2 { position: absolute; z-index: 1; left: clamp(20px,5vw,64px); bottom: 48px; max-width: 10ch; margin: 0; color: var(--hero-ink); font-family: var(--display); font-size: clamp(1.9rem,4.2vw,3.8rem); font-weight: 400; line-height: 1.16; text-transform: uppercase; }
.pain-grid { position: relative; display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; padding: 48px; background: var(--line-soft); }
.pain-grid::before { content: attr(data-mark); position: absolute; top: 0; right: 3%; color: color-mix(in srgb, var(--ink) 3.5%, transparent); font-family: var(--display); font-size: 16rem; line-height: 1; pointer-events: none; }
.pain-card { position: relative; z-index: 1; min-height: 170px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; border: 1px solid var(--line); background: var(--card-bg); backdrop-filter: blur(10px); }
.pain-card__plus { font-size: 1.2rem; font-weight: 300; }
.pain-card h3 { margin: 20px 0 7px; font-size: .76rem; line-height: 1.35; letter-spacing: .08em; text-transform: uppercase; }
.pain-card p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }

/* Solution */
.solution-head { max-width: 640px; margin-bottom: 50px; }
.solution-head h2 { margin: 0; font-family: var(--display); font-size: clamp(2rem,5vw,4.4rem); font-weight: 400; line-height: 1.12; text-transform: uppercase; }
.solution-head .bracket { margin: 10px 0 0 90px; color: var(--muted); font-family: var(--display); font-size: clamp(1.1rem,2.5vw,2rem); letter-spacing: .14em; text-transform: uppercase; }
.approach-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--line);
}
.approach-rail > div {
  min-height: 102px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
}
.approach-rail b {
  color: var(--accent);
  font: 400 1.45rem/1 var(--display);
}
.approach-rail span {
  max-width: 220px;
  font-size: .68rem;
  line-height: 1.45;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.solution-layout {
  position: relative;
  display: grid;
  /* 1/3 + 2/3 — совпадает с вертикалями approach-rail */
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1px;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--line);
  overflow: hidden;
}
.solution-layout::after {
  content: "TG";
  position: absolute;
  right: -2%;
  bottom: -12%;
  z-index: 0;
  color: color-mix(in srgb, var(--ink) 3.5%, transparent);
  font: 400 clamp(8rem, 20vw, 18rem)/1 var(--display);
  pointer-events: none;
}
.solution-layout > * { position: relative; z-index: 1; min-width: 0; }
.solution-layout > div:first-child {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--panel-bg);
}
.solution-shot { display: block; margin: 0; border: 0; flex: 1 1 auto; min-height: 0; }
.solution-shot img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}
.solution-badge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--glass);
}
.solution-badge strong { font-family: var(--display); font-size: 1.5rem; font-weight: 400; color: var(--accent); }
.solution-badge span { color: var(--muted); font-size: .67rem; line-height: 1.4; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  height: 100%;
  background: var(--line);
}
.feature {
  min-height: 190px;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-content: center;
  gap: 11px;
  padding: 28px;
  border: 0;
  background: var(--card-bg);
  transition: background .25s ease;
}
.feature:hover { background: var(--card-hover); }
.feature__plus { color: var(--accent); }
.feature h3 { margin: 0 0 8px; font-size: .73rem; letter-spacing: .1em; text-transform: uppercase; }
.feature p { margin: 0; color: var(--muted); font-size: .77rem; line-height: 1.55; }

/* Бегущая инженерная дорожка — бесшовный цикл */
.marquee {
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent), inset 0 -1px 0 color-mix(in srgb, #000 28%, transparent);
  border-bottom: 1px solid var(--line);
  background: var(--marquee-bg);
  color: var(--marquee-ink);
}
.marquee::before,
.marquee::after {
  content: "";
  position: absolute;
  inset-block: 0;
  z-index: 2;
  width: 72px;
  pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--marquee-bg), transparent); }
.marquee::after { right: 0; background: linear-gradient(-90deg, var(--marquee-bg), transparent); }
.marquee__track {
  display: flex;
  width: max-content;
  min-height: 50px;
  align-items: center;
  animation: marqueeRun var(--marquee-duration, 42s) linear infinite;
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}
.marquee__group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 32px;
  padding-right: 32px;
  white-space: nowrap;
}
.marquee__group span {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee__group i {
  flex: 0 0 auto;
  font-style: normal;
  opacity: .55;
  color: color-mix(in srgb, var(--marquee-ink) 80%, var(--accent));
}
@keyframes marqueeRun {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* Архитектурное движение */
.hero__media img { animation: heroDrift 18s ease-in-out infinite alternate; }
@keyframes heroDrift {
  from { transform: scale(1.01); }
  to { transform: scale(1.055) translate3d(-.6%, -.3%, 0); }
}
.hero__gridlines { animation: gridPulse 5s ease-in-out infinite alternate; }
@keyframes gridPulse { to { opacity: .55; } }
.motion-ready .motion-reveal {
  opacity: 1;
  transform: none;
}
.motion-ready .motion-reveal.is-revealed {
  animation: revealIn .75s cubic-bezier(.2,.7,.2,1) both;
  animation-delay: calc(var(--delay, 0) * 70ms);
}
@keyframes revealIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

/* Cases — exact 1/3 columns, leftovers centered; no container fill (avoids yellow empty tracks) */
.cases-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  margin: 0;
  border: none;
  background: transparent;
}
.case-card {
  flex: 0 0 calc(100% / 3);
  width: calc(100% / 3);
  max-width: calc(100% / 3);
  min-width: 0;
  margin: 0;
  border: none;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.case-card img { aspect-ratio: 16/10; object-fit: cover; }
.case-card,
.project-card,
.project-page-card {
  position: relative;
  transition: border-color .28s ease, box-shadow .28s ease, background-color .28s ease, transform .28s ease;
}
.case-card__media { position: relative; display: block; overflow: hidden; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.case-card__media { appearance: none; }
.case-card__media img { transition: transform .5s cubic-bezier(.2,.7,.2,1), filter .35s ease; }
.case-card__media > span {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  background: var(--button-bg);
  color: var(--button-ink);
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
  opacity: 1;
  transform: none;
  transition: opacity .3s ease, transform .3s ease;
}
.case-card__media:hover img,
.case-card__media:focus-visible img { transform: scale(1.035); filter: brightness(.72); }
.case-card__media:hover > span,
.case-card__media:focus-visible > span { opacity: 1; transform: none; }
.case-card__media:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.case-card__body { min-height: 190px; min-width: 0; padding: 24px; }
.case-card__meta { display: block; color: var(--accent); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; }
.case-card__tep {
  margin: 12px 0 0;
  color: var(--accent-2);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.4;
}
.case-card h3 {
  margin: 10px 0;
  font-family: var(--display);
  font-size: clamp(.88rem, 1.15vw, 1rem);
  font-weight: 400;
  line-height: 1.38;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.case-card p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.58; text-wrap: pretty; overflow-wrap: break-word; }
.cases-grid--flagship { grid-auto-rows: auto; }
.cases-grid--flagship .case-card { height: auto; }
.cases-grid--flagship .case-card__media img {
  height: clamp(180px, 20vw, 250px);
  aspect-ratio: auto;
}
.cases-grid--flagship .case-card__body { min-height: 150px; padding: 18px; }
.cases-grid--flagship .case-card h3 { margin: 7px 0; font-size: .86rem; }
.cases-grid--flagship .case-card p { font-size: .68rem; line-height: 1.45; }
.project-card {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.project-card .case-card__body::after {
  content: "Открыть ТЭПы  ↗";
  display: block;
  margin-top: 16px;
  color: var(--accent);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.project-page-card { display: block; }
.project-page-card .case-card__body::after {
  content: "Открыть страницу объекта  ↗";
  display: block;
  margin-top: 16px;
  color: var(--accent);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.project-page-card:hover img,
.project-page-card:focus-visible img { filter: brightness(.78); transform: scale(1.025); }
.project-page-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.project-card:hover img,
.project-card:focus-visible img { filter: brightness(.78); transform: scale(1.025); }
.project-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

body.project-modal-open { overflow: hidden; }
.project-modal[hidden] { display: none; }
.project-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; }
.project-modal__backdrop { position: absolute; inset: 0; background: rgba(5, 3, 2, .84); backdrop-filter: blur(8px); }
.project-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(72.5rem, 100%);
  height: min(47.5rem, calc(100svh - 3rem));
  max-height: min(47.5rem, calc(100svh - 3rem));
  display: grid;
  grid-template-columns: minmax(20.625rem, .82fr) minmax(0, 1.18fr);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
}
.project-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(10, 7, 5, .72);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.project-modal__info {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: clamp(28px, 4vw, 52px);
}
.project-modal__info-body { min-height: 0; overflow-y: auto; padding-right: 4px; }
.project-modal__info-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.project-modal__info h2 {
  margin: 8px 0 14px;
  padding-right: 42px;
  font-family: var(--display);
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  font-size: clamp(1.4rem, 2vw, 2.15rem);
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
}
.project-modal__description { margin: 0 0 24px; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.project-modal__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 26px; border: 1px solid var(--line); }
.project-modal__facts > div { min-width: 0; padding: 13px; border: 1px solid var(--line-soft); }
.project-modal__facts dt { color: var(--muted); font-size: .52rem; letter-spacing: .1em; text-transform: uppercase; }
.project-modal__facts dd { margin: 7px 0 0; color: var(--accent); font-size: .72rem; line-height: 1.45; overflow-wrap: break-word; }
.project-modal__info h3 { margin: 0 0 10px; font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; }
.project-modal__scope { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.project-modal__scope li { color: var(--muted); font-size: .7rem; line-height: 1.4; }
.project-modal__scope li::before { content: "+"; margin-right: 8px; color: var(--accent); }
.project-modal__note { margin: 0 0 20px; color: var(--muted); font-size: .58rem; line-height: 1.5; }
.project-modal__gallery { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #080605; }
.project-modal__stage { position: relative; min-height: 0; overflow: hidden; }
.project-modal__stage > img { width: 100%; height: 100%; object-fit: cover; }
.project-modal__stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 60%, rgba(5, 3, 2, .58)); }
.project-modal__visual-label {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  max-width: calc(100% - 130px);
  color: rgba(255,255,255,.86);
  font-size: .52rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.project-modal__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.34);
  background: rgba(10,7,5,.68);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
}
.project-modal__arrow--prev { left: 14px; }
.project-modal__arrow--next { right: 14px; }
.project-modal__count { position: absolute; right: 18px; bottom: 18px; z-index: 2; color: #fff; font-size: .62rem; }

/* Horizontal card rails — prev/next (mobile) */
.scroll-rail {
  position: relative;
}
.scroll-rail__btn {
  display: none;
  position: absolute;
  top: 50%;
  z-index: 5;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(224, 186, 118, .38);
  background: rgba(10, 7, 5, .78);
  color: var(--accent-2);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity .2s ease, border-color .2s ease, background-color .2s ease;
}
.scroll-rail__btn--prev { left: 2px; }
.scroll-rail__btn--next { right: 2px; }
.scroll-rail__btn:hover,
.scroll-rail__btn:focus-visible {
  border-color: rgba(224, 186, 118, .72);
  background: rgba(26, 18, 14, .9);
  outline: 0;
}
.scroll-rail__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.scroll-rail__btn:disabled {
  opacity: .28;
  cursor: default;
  pointer-events: none;
}
@media (max-width: 767px) {
  .scroll-rail.is-scrollable .scroll-rail__btn { display: grid; }
}
.project-modal__thumbs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(100px, 1fr); gap: 1px; padding-top: 1px; background: var(--line); }
.project-modal__thumbs button { height: 92px; padding: 0; border: 0; background: #080605; cursor: pointer; opacity: .55; }
.project-modal__thumbs button[aria-current="true"] { opacity: 1; box-shadow: inset 0 -3px var(--accent); }
.project-modal__thumbs img { width: 100%; height: 100%; object-fit: cover; }

@media (hover: none) {
  .case-card__media > span { opacity: 1; transform: none; }
}

/* Trust */
.trust-grid { display: grid; grid-template-columns: repeat(3,1fr); grid-auto-rows: 1fr; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.review-card { min-height: 290px; display: flex; flex-direction: column; padding: 26px; background: var(--surface); }
.review-card__top { display: flex; align-items: center; gap: 12px; }
.review-card__logo { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--accent); font: 500 .65rem/1.1 var(--display); text-align: center; }
.stars { color: var(--accent); letter-spacing: .16em; font-size: .67rem; }
.review-card h3 { margin: 4px 0 0; font-size: .74rem; text-transform: uppercase; }
.review-card blockquote { margin: 22px 0 18px; color: var(--muted); font-size: .83rem; }
.review-card__actions {
  margin-top: auto;
  margin-bottom: 12px;
}
.review-card__site {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 38px 10px 14px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
}
.review-card__site.partner--link::after {
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  font-size: .62rem;
}
.review-card__site.partner--link:hover::after,
.review-card__site.partner--link:focus-visible::after {
  transform: translate(2px, calc(-50% - 2px));
}
.document-note {
  margin-top: 0;
  color: var(--muted);
  font-size: .62rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.trust-partners { margin-top: 28px; }
.trust-partners__label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.credential-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin-top: 30px; border: 1px solid var(--line); background: var(--line); }
.credential { min-height: 130px; padding: 22px; background: var(--panel-bg); }
.credential strong { display: block; margin-bottom: 10px; font-family: var(--display); font-size: .95rem; font-weight: 400; text-transform: uppercase; }
.credential span { color: var(--muted); font-size: .72rem; }
.partner-row { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 1px; background: var(--line); }
.partner { flex: 1 1 160px; min-height: 72px; display: grid; place-items: center; padding: 12px; background: var(--card-bg); color: var(--muted); font-size: .66rem; font-weight: 600; text-align: center; filter: none; }
.partner--link {
  position: relative;
  background:
    linear-gradient(135deg, rgba(224, 186, 118, .13), transparent 58%),
    var(--card-bg);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(224, 186, 118, .42),
    inset 0 -3px 0 var(--accent);
  cursor: pointer;
  font-weight: 700;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.partner--link::after {
  content: "↗";
  position: absolute;
  top: 8px;
  right: 9px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--dark-ink);
  font-size: .72rem;
  opacity: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  transition: transform .25s ease;
}
.partner--link:hover,
.partner--link:focus-visible {
  z-index: 1;
  background: var(--button-bg);
  color: var(--button-ink);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .32);
  outline: 0;
  transform: translateY(-3px);
}
.partner--link:hover::after,
.partner--link:focus-visible::after {
  background: var(--dark-ink);
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* Services / FAQ */
.services-grid { display: grid; grid-template-columns: repeat(4,1fr); grid-auto-rows: 1fr; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.service-card { min-height: 220px; height: 100%; display: flex; flex-direction: column; padding: 24px; background: var(--surface); }
.service-card__num { color: var(--accent); font: 400 .73rem/1 var(--display); }
.service-card h3 { margin: 30px 0 9px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.service-card p { margin: 0; color: var(--muted); font-size: .73rem; }
.service-card--surveys p { font-size: .65rem; line-height: 1.55; }
.service-card .technical-label { margin-top: auto; padding-top: 18px; color: var(--accent); }
.advantages { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin-top: 34px; background: var(--line); }
.advantage { min-height: 86px; display: flex; align-items: center; gap: 12px; padding: 18px; background: var(--bg); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.advantage::before { content: "+"; color: var(--accent); font-size: 1.1rem; }
/* JS upgrades .advantages → continuous marquee (avoids gold empty rail on mobile) */
.advantages.advantages--marquee {
  display: block;
  margin-top: 34px;
  border: 0;
  background: var(--bg);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent), inset 0 -1px 0 color-mix(in srgb, #000 35%, transparent);
}
.advantages.advantages--marquee .marquee__group span {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
}
.direction-card h3, .pain-card h3, .feature h3, .case-card h3, .review-card h3, .service-card h3 { text-wrap: balance; }
.faq { max-width: 900px; margin-top: 52px; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-question { width: 100%; display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; border: 0; background: transparent; cursor: pointer; text-align: left; font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; }
.faq-question::after { content: "+"; color: var(--accent); font-size: 1.2rem; transition: transform .3s; }
.faq-item.is-open .faq-question::after { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-answer p { max-width: 720px; margin: 0; padding: 0 0 22px; color: var(--muted); font-size: .82rem; }

/* Footer CTA */
.final-cta,
#contacts,
#lead-form { scroll-margin-top: calc(var(--header) + 12px); }
.final-cta { padding: 84px 0; background: var(--surface-2); }
.final-cta__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 60px; }
.final-cta h2 {
  margin: 0 0 20px;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.4vw, 3.2rem);
  font-weight: 400;
  line-height: 1.22;
  text-transform: uppercase;
  hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}
.contact-list { display: grid; gap: 8px; color: var(--muted); font-size: .82rem; }
.contact-list a { color: var(--accent); }
.final-form .lead-form__fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
.final-form .consent, .final-form .form-status { grid-column: 1/-1; }
.site-footer { padding: 50px 0 90px; border-top: 1px solid var(--line); background: var(--footer-bg); color: var(--footer-ink); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1.15fr .9fr 1.2fr; gap: 34px; }
.footer-col h3 { margin: 0 0 14px; color: var(--footer-ink); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; }
.footer-col p, .footer-col a { margin: 0 0 7px; color: var(--footer-muted); font-size: .72rem; display: block; }
.footer-col a:hover, .footer-col a:focus-visible { color: var(--accent); outline: 0; }
.footer-meta { margin-top: 14px; display: grid; gap: 4px; }
.footer-meta span { color: var(--footer-muted); font-size: .66rem; letter-spacing: .04em; }
.footer-address { max-width: 28ch; line-height: 1.45; }
.footer-map {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  aspect-ratio: 16 / 11;
  min-height: 160px;
}
.footer-map iframe { display: block; width: 100%; height: 100%; border: 0; filter: grayscale(.15) contrast(1.05); }
.footer-legal { display: flex; justify-content: space-between; gap: 20px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--footer-muted); font-size: .63rem; }
.footer-legal a { color: var(--accent); }

/* Legal */
.legal-main { min-height: 80vh; padding: calc(var(--header) + 60px) 0 80px; }
.legal-wrap { max-width: 820px; }
.legal-main h1 { font-family: var(--display); font-size: clamp(1.85rem,4.2vw,3.4rem); font-weight: 400; line-height: 1.16; text-transform: uppercase; }
.legal-main h2 { margin-top: 38px; font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; }
.legal-main p, .legal-main li { color: var(--muted); font-size: .84rem; }
.legal-main a { color: var(--accent); }

.cookie-banner {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100% - 36px));
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  box-shadow: 0 18px 60px var(--shadow);
  pointer-events: auto;
  isolation: isolate;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0 0 12px; color: var(--muted); font-size: .72rem; }
.cookie-actions { position: relative; z-index: 2; display: flex; gap: 8px; }
.cookie-actions .btn { pointer-events: auto; }
.mobile-call {
  display: none;
  position: fixed;
  z-index: 90;
  inset: auto 12px 12px;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  background: var(--button-bg);
  color: var(--button-ink);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Render below-the-fold blocks only near the viewport. */
@supports (content-visibility: auto) {
  main > .section, .final-cta, .site-footer { content-visibility: auto; contain-intrinsic-size: auto 760px; }
}

/* Automatic low-resource mode (Save-Data / very weak devices). Marquees stay alive. */
.perf-lite *, .perf-lite *::before, .perf-lite *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}
.perf-lite .site-header,
.perf-lite .hero-chip,
.perf-lite .pain-card,
.perf-lite .approach-rail > div { backdrop-filter: none; }
.perf-lite .hero__media img,
.perf-lite .direction-card img,
.perf-lite .pain-visual img,
.perf-lite .solution-shot img,
.perf-lite .case-card img,
.perf-lite .partner { filter: none; }
.perf-lite .direction-card,
.perf-lite .direction-card img,
.perf-lite .direction-card::before,
.perf-lite .direction-card h3,
.perf-lite .direction-card .btn,
.perf-lite .direction-card__tag { transition: none; }
.perf-lite .direction-card:hover img,
.perf-lite .direction-card:has(.direction-card__link:focus-visible) img { transform: none; filter: none; }
.perf-lite .direction-card:hover,
.perf-lite .direction-card:has(.direction-card__link:focus-visible) { box-shadow: none; }
/* Intentional tickers must keep running on mobile/low-resource */
.perf-lite .marquee__track {
  animation-name: marqueeRun !important;
  animation-duration: var(--marquee-duration, 42s) !important;
  animation-timing-function: linear !important;
  animation-iteration-count: infinite !important;
  animation-delay: 0s !important;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.perf-lite .marquee { overflow: hidden; }
.perf-lite body::before { display: none; }

@media (max-width: 1200px) {
  .lead-panel__grid { grid-template-columns: 1fr; gap: 22px; align-items: start; }
  .lead-panel h2 { max-width: 36ch; }
  .lead-form__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-form__submit { grid-column: 1 / -1; justify-self: stretch; }
}

@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-col--map { grid-column: 1 / -1; }
  .main-nav { position: fixed; inset: var(--header) 0 auto; display: none; flex-direction: column; align-items: stretch; padding: 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 14px; border-bottom: 1px solid var(--line-soft); }
  .menu-toggle { display: block; }
  .header-contact .btn { display: none; }
  .hero__bottom { flex-wrap: wrap; }
  .hero-chip, .hero__cta { flex: 1 1 calc(50% - 1px); }
  .hero__content--offer { grid-template-columns: 1fr; gap: 22px; }
  .hero-metrics { grid-template-columns: repeat(3, 1fr); }
  .hero-metric { min-height: 88px; grid-template-columns: 1fr; gap: 8px; padding: 14px 12px; }
  .pain-layout { grid-template-columns: 1fr; }
  .pain-visual { min-height: 560px; }
  .services-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 960px) {
  .section { padding: 80px 0; }
  .section-title { font-size: clamp(1.65rem, 5.2vw, 2.6rem); line-height: 1.2; }
  .direction-intro { grid-template-columns: 1fr; gap: 6px; }
  .case-card {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
  }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .review-card:last-child { grid-column: 1 / -1; }
  .solution-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { min-height: 145px; }
  .approach-rail span { font-size: .62rem; }
}

@media (max-width: 767px) {
  :root { --header: 4.125rem; }
  .container { width: min(100% - var(--gutter-sm) * 2, var(--max)); }
  .section { padding: 68px 0; }
  .brand__mark,
  .brand__logo,
  .brand img { height: 32px; }
  .brand__text { font-size: .62rem; letter-spacing: .06em; }
  .brand { gap: .55rem; }
  .header-phone { display: none; }
  .hero { min-height: 72svh; padding-bottom: 14px; }
  .hero__inner { min-height: calc(72svh - var(--header) - 36px); }
  .hero__topline { font-size: .55rem; }
  .hero__content { min-width: 0; padding: 20px 0; }
  .hero h1 {
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    font-size: clamp(1.45rem, 6.2vw, 2.2rem);
    line-height: 1.2;
  }
  .hero--long h1 {
    font-size: clamp(1.05rem, 4.2vw, 1.35rem);
    line-height: 1.22;
    letter-spacing: -.03em;
  }
  .hero--long h1 br { display: none; }
  .hero--offer h1 {
    max-width: none;
    width: 100%;
    font-size: clamp(1.28rem, 5.2vw, 1.9rem);
    line-height: 1.28;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }
  .hero--offer h1 small {
    width: 100%;
    max-width: none;
    font-size: clamp(.78rem, 3.4vw, .9rem);
    margin-top: 1.15rem;
    line-height: 1.58;
    text-transform: none;
  }
  .hero h1 small { font-size: .25em; margin-top: 22px; line-height: 1.55; text-transform: none; }
  .hero__content--offer { gap: 18px; }
  .hero-metrics { width: 100%; }
  .hero-metric { min-height: 76px; padding: 12px 10px; gap: 8px; }
  .hero-metric strong { font-size: clamp(1.15rem, 5vw, 1.6rem); }
  .hero-metric span { font-size: .52rem; line-height: 1.35; letter-spacing: .04em; }
  .lead-panel h2 {
    max-width: none;
    font-size: 1.08rem;
    line-height: 1.35;
    hyphens: none;
    -webkit-hyphens: none;
    word-break: normal;
    overflow-wrap: normal;
  }
  .lead-form__submit { min-height: 52px; padding-inline: 20px; }
  .section-title { font-size: clamp(1.45rem, 6vw, 2.1rem); line-height: 1.22; }
  .final-cta h2 { font-size: clamp(1.45rem, 6vw, 2.1rem); line-height: 1.22; }
  .pain-visual h2 { font-size: clamp(1.55rem, 7vw, 2.4rem); line-height: 1.18; }
  .solution-head h2 { font-size: clamp(1.55rem, 7vw, 2.5rem); line-height: 1.16; }
  .hero__bottom { flex-wrap: wrap; }
  .hero-chip { flex: 1 1 calc(50% - 1px); min-height: 66px; padding: 10px; font-size: .58rem; }
  .hero-chip strong { font-size: .53rem; }
  .hero__cta { flex: 1 1 100%; min-height: 54px; }
  .lead-panel { padding: 26px 0; }
  .lead-form__fields, .final-form .lead-form__fields { grid-template-columns: 1fr; }
  .consent, .final-form .consent { grid-column: 1; }
  .direction-intro { grid-template-columns: 1fr; gap: 4px; }
  .direction-grid { grid-template-columns: 1fr; gap: 10px; }
  .direction-card { min-height: 500px; }
  .direction-card img { height: 50%; }
  .direction-card__body { min-height: 54%; padding: 18px 16px; }
  .direction-card__num { top: 8px; right: 8px; min-width: 34px; padding: 5px 7px; font-size: .58rem; }
  .direction-card__tag { padding: 5px 7px; font-size: .48rem; letter-spacing: .1em; }
  .direction-card h3 { min-height: 2.6em; font-size: 1.05rem; }
  .direction-card p { min-height: 3em; font-size: .68rem; line-height: 1.45; }
  .direction-card .btn { min-height: 40px; padding: 8px; font-size: .52rem; }
  .direction-card:hover,
  .direction-card:has(.direction-card__link:focus-visible) { box-shadow: none; }
  .home-page .section { padding-block: 48px; }
  .home-page .direction-intro { margin-bottom: 18px; }
  .home-page .direction-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .home-page .direction-grid::-webkit-scrollbar { display: none; }
  .home-page .direction-card { flex: 0 0 86%; min-height: 410px; scroll-snap-align: start; }
  .home-page .direction-card img { height: 48%; }
  .home-page .direction-card__body { min-height: 56%; padding: 16px; }
  .home-page .direction-card h3 { min-height: 2.4em; font-size: 1rem; }
  .home-page .direction-card p { min-height: 2.8em; font-size: .66rem; }
  .pain-visual { min-height: 430px; }
  .home-page .pain-layout { min-height: 0; }
  .home-page .pain-visual { min-height: 320px; }
  .home-page .pain-grid { padding: 10px; }
  .home-page .pain-card { min-height: 120px; }
  .pain-grid { padding: 12px; }
  .pain-card { min-height: 145px; padding: 14px; }
  .pain-card h3 { font-size: .62rem; }
  .pain-card p { font-size: .57rem; }
  .approach-rail { grid-template-columns: 1fr; }
  .approach-rail > div { min-height: 72px; }
  .home-page .approach-rail {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .home-page .approach-rail::-webkit-scrollbar { display: none; }
  .home-page .approach-rail > div { flex: 0 0 78%; scroll-snap-align: start; }
  .solution-layout { grid-template-columns: 1fr; }
  .solution-shot img { min-height: 250px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature { min-height: 130px; padding: 20px; }
  .home-page .solution-shot img { min-height: 200px; height: 200px; }
  .home-page .feature-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .home-page .feature-grid::-webkit-scrollbar { display: none; }
  .home-page .feature { flex: 0 0 78%; min-height: 145px; scroll-snap-align: start; }
  .cases-grid, .trust-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border: 0;
    background: transparent;
  }
  .cases-grid::-webkit-scrollbar, .trust-grid::-webkit-scrollbar { display: none; }
  .case-card, .review-card {
    flex: 0 0 82%;
    width: 82%;
    max-width: 82%;
    scroll-snap-align: start;
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .home-page #cases .cases-grid { margin-inline: 0; }
  .project-modal { padding: .625rem; }
  .project-modal__dialog {
    height: calc(100svh - 1.25rem);
    max-height: calc(100svh - 1.25rem);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(12.5rem, 38svh) minmax(0, 1fr);
    overflow: hidden;
  }
  .project-modal__gallery { grid-row: 1; min-height: 0; }
  .project-modal__stage { min-height: 0; }
  .project-modal__thumbs button { height: 58px; }
  .project-modal__info { overflow: hidden; padding: 24px 18px 20px; }
  .project-modal__info h2 { padding-right: 34px; font-size: 1.12rem; line-height: 1.2; }
  .project-modal__facts { grid-template-columns: 1fr 1fr; }
  .project-modal__close { width: 38px; height: 38px; }
  .credential-grid { grid-template-columns: 1fr; }
  .home-page .credential-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .home-page .credential-grid::-webkit-scrollbar { display: none; }
  .home-page .credential { flex: 0 0 78%; scroll-snap-align: start; }
  .home-page .partner-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .home-page .partner-row::-webkit-scrollbar { display: none; }
  .home-page .partner { flex: 0 0 55%; }
  .services-grid { grid-template-columns: repeat(2,1fr); }
  .service-card { min-height: 190px; padding: 16px; }
  .service-card h3 { margin-top: 20px; font-size: .69rem; }
  .service-card p { font-size: .62rem; }
  .home-page #services .services-grid {
    display: flex;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border: 0;
    background: transparent; /* no gold empty filler under short cards */
  }
  .home-page #services .services-grid::-webkit-scrollbar { display: none; }
  .home-page #services .service-card {
    flex: 0 0 78%;
    height: auto;
    min-height: 190px;
    scroll-snap-align: start;
    border: 1px solid var(--line);
  }
  .advantages { grid-template-columns: 1fr; }
  .home-page .advantages.advantages--marquee,
  .advantages.advantages--marquee {
    display: block;
    overflow: hidden;
    margin-top: 28px;
    background: var(--bg);
  }
  .home-page .faq { margin-top: 24px; }
  .home-page .faq-question { padding-block: 16px; }
  .final-cta__grid { grid-template-columns: 1fr; gap: 34px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-map { min-height: 200px; }
  .footer-legal { flex-direction: column; }
  .mobile-call {
    display: flex;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  /* Room so sticky «Позвонить» doesn’t clip carousels / last cards */
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .home-page .direction-grid,
  .home-page #cases .cases-grid,
  .home-page .approach-rail,
  .home-page .feature-grid,
  .home-page .trust-grid,
  .home-page .credential-grid,
  .home-page .partner-row {
    background: transparent;
  }
  .home-page .approach-rail,
  .home-page .feature-grid,
  .home-page .trust-grid,
  .home-page .credential-grid {
    gap: 10px;
    border: 0;
  }
  .home-page .approach-rail > div,
  .home-page .feature,
  .home-page .review-card,
  .home-page .credential {
    border: 1px solid var(--line);
  }
}

@media (max-width: 28.875rem) {
  .container { width: min(100% - var(--gutter-xs) * 2, var(--max)); }
  .hero__topline { gap: 8px; }
  .hero__topline .technical-label:last-child { text-align: right; }
  .hero-chip { font-size: .54rem; }
  .direction-card { min-height: 500px; }
  .pain-card { min-height: 135px; }
  .cookie-banner { right: 9px; bottom: 70px; width: calc(100% - 18px); padding: 14px; }
  .cookie-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cookie-actions .btn { min-width: 0; padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .hero__media img, .hero__gridlines, .marquee__track { animation: none !important; transform: none !important; }
  .perf-lite .marquee__track { animation: none !important; transform: none !important; }
  .motion-ready .motion-reveal { opacity: 1; transform: none; }
}

