/* ==========================================================================
   CONTABIL — лендинг бухгалтерии для резидентов Moldova IT Park
   Стиль «IT-тёмный»: тёмно-синий, сетка, моно-акценты, фото в дуотоне
   ========================================================================== */

:root {
  --bg: #042C53;
  --bg-deep: #021E3A;
  --bg-alt: #03264A;
  --line: rgba(133, 183, 235, .16);
  --line-strong: rgba(133, 183, 235, .35);
  --navy: #0C447C;
  --teal: #5DCAA5;
  --teal-hover: #7AD6B7;
  --teal-ink: #04342C;
  --sky: #85B7EB;
  --text: #FFFFFF;
  --muted: #b2d2f1;
  --dim: #5F86AE;
  --accent: #5DCAA5;
  /* акцентный ТЕКСТ (на светлом — темнее) */
  --card: rgba(2, 30, 58, .9);
  /* фон карточек */

  --radius: 12px;
  --radius-sm: 8px;
  --wrap: 1240px;
  --header-h: 84px;

  --font: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

.mono {
  font-family: var(--mono);
}

.section--alt {
  background-color: var(--bg-alt);
}

/* Светлый блок: добавьте класс light секции. Терминал и карточки с фото внутри остаются тёмными.
   Пример: <section class="section light" id="why"> */
.light {
  --text: #0B2540;
  --muted: #4A6480;
  --dim: #7C93AC;
  --sky: #185FA5;
  --line: rgba(12, 68, 124, .12);
  --line-strong: rgba(12, 68, 124, .24);
  --accent: #0F6E56;
  --card: #FFFFFF;
  --bg: #F3F7FB;
  --bg-alt: #E7EFF8;
  --stamp-bg: #FFFFFF;
  color: var(--text);
  background-color: var(--bg);
}

.light.section--alt {
  background-color: var(--bg-alt);
}

.light .service, .light .client, .light .why__item, .light .path {
  box-shadow: 0 1px 2px rgba(4, 44, 83, .06), 0 8px 24px rgba(4, 44, 83, .05);
}

.light .term {
  box-shadow: 0 24px 60px rgba(4, 44, 83, .28);
}

/* Тёмные «острова» внутри светлого блока */
.light .term, .light .photo-bg {
  --text: #FFFFFF;
  --muted: #B5D4F4;
  --dim: #5F86AE;
  --sky: #85B7EB;
  --line: rgba(133, 183, 235, .16);
  --line-strong: rgba(133, 183, 235, .35);
  --accent: #5DCAA5;
  --card: rgba(2, 30, 58, 0.9);
  --bg: #042C53;
  color: var(--text);
}

/* Фото в дуотоне: тонировка → фото в режиме luminosity на синем */
.photo-bg.has-photo {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--tint-dir, 90deg), rgba(4, 44, 83, var(--tint-a, .92)) 0%, rgba(4, 44, 83, var(--tint-b, .55)) 100%),
    var(--photo);
  background-size: 100% 100%, cover;
  background-position: center, var(--photo-pos, center);
  background-repeat: no-repeat, no-repeat;
  background-blend-mode: normal, luminosity;
}

/* Фото «стоит на месте», а блок едет поверх него — эффект окна.
   Добавьте класс photo-fixed блоку с фото. Работает и на телефонах (включая iPhone):
   фото лежит в отдельном слое position: fixed, а блок обрезает его по своим границам (clip-path). */
.photo-bg.has-photo.photo-fixed {
  position: relative;
  isolation: isolate;
  clip-path: inset(0);
  background: var(--bg);
}

.photo-bg.has-photo.photo-fixed::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--tint-dir, 90deg), rgba(4, 44, 83, var(--tint-a, .92)) 0%, rgba(4, 44, 83, var(--tint-b, .55)) 100%),
    var(--photo);
  background-size: 100% 100%, cover;
  background-position: center, var(--photo-pos, center);
  background-repeat: no-repeat, no-repeat;
  background-blend-mode: normal, luminosity;
}

/* ---------- Типографика секций ---------- */
.comment {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 15px;
  margin-bottom: 18px;
}

.section {
  padding: 120px 0;
}

.section__title {
  font-weight: 800;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -.025em;
  max-width: 18em;
}

.section__lead {
  margin-top: 18px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 36em;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--teal {
  background: var(--teal);
  color: var(--teal-ink);
}

.btn--teal:hover {
  background: var(--teal-hover);
}

.btn--outline {
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--block {
  width: 100%;
}

.link-arrow {
  display: inline-block;
  align-self: flex-start;
  margin-top: 18px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}

/* ==========================================================================
   Шапка
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background .2s, border-color .2s;
  border-bottom: 1px solid transparent;
}

.header.is-scrolled {
  background: rgba(2, 30, 58, .96);
  border-bottom-color: var(--line);
}

.header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 24px;
}

.header__logo img {
  height: 40px;
  width: auto;
}

.nav {
  display: flex;
  gap: 2px;
  font-size: 15px;
  font-weight: 500;
}

.nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: background .15s, color .15s;
}

.nav a:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.header__meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.lang {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lang a {
  padding: 6px 10px;
  color: var(--muted);
}

.lang .is-active {
  background: rgba(93, 202, 165, .16);
  color: var(--teal);
}

.header__phone {
  font-weight: 700;
  white-space: nowrap;
}

.burger {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  transition: transform .2s;
}

.burger[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.burger[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* ==========================================================================
   1. Первый экран
   ========================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 40px) 0 80px;
}

.hero__grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.hero__title {
  font-weight: 800;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -.03em;
}

.hero__title span {
  color: var(--teal);
}

.hero__lead {
  margin-top: 26px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 32em;
}

.doors {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 620px;
}

.door {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: rgba(4, 44, 83, .6);
  transition: border-color .15s, transform .15s;
}

.door:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.door small {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--sky);
}

.door strong {
  font-size: 17px;
  font-weight: 700;
}

.door--primary {
  background: var(--teal);
  color: var(--teal-ink);
  border-color: var(--teal);
}

.door--primary small {
  color: var(--teal-ink);
  opacity: .75;
}

.hero__call {
  margin-top: 18px;
  font-size: 15px;
  color: var(--muted);
}

.hero__call a {
  color: #fff;
  font-weight: 600;
  border-bottom: 1px solid var(--teal);
}

/* Терминал */
.term {
  border-radius: 14px;
  background: var(--bg-deep);
  border: 1px solid rgba(133, 183, 235, .3);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.term__bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #1E4E7C;
}

.term__bar span {
  margin-left: 10px;
  font-size: 13px;
  color: var(--sky);
}

.term__body {
  padding: 22px 22px 26px;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.9;
}

#heroTerm {
  min-height: 330px;
}

.term__line {
  white-space: pre-wrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s, transform .25s;
}

.term__line.is-on {
  opacity: 1;
  transform: none;
}

.t-prompt, .t-ok {
  color: var(--teal);
}

.t-key {
  color: var(--sky);
}

.t-dim {
  color: var(--dim);
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 18px;
  background: var(--teal);
  vertical-align: -3px;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(2, 30, 58, .6);
}

.stat {
  padding: 16px 18px;
}

.stat+.stat {
  border-left: 1px solid var(--line);
}

.stat b {
  display: block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.stat span {
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   2. Две двери
   ========================================================================== */
.paths {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.path {
  display: flex;
  flex-direction: column;
  padding: 36px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--card);
}

.path--new {
  border-color: rgba(93, 202, 165, .55);
  box-shadow: inset 0 3px 0 var(--teal);
}

.path__tag {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  padding: 4px 10px;
  border: 1px solid rgba(93, 202, 165, .4);
  border-radius: 6px;
}

.path h3 {
  margin-top: 18px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.path__head p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.steps {
  list-style: none;
  margin: 28px 0 32px;
  display: grid;
  gap: 0;
  flex: 1;
}

.steps li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.steps b {
  color: var(--accent);
  font-size: 14px;
  padding-top: 2px;
}

.steps strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.steps span {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
}

.path .btn {
  align-self: flex-start;
}

/* ==========================================================================
   3. Что входит
   ========================================================================== */
.services {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: stretch;
}

.services__visual {
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.services__visual .section__title {
  font-size: clamp(28px, 3vw, 40px);
}

.services__note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.services__list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.service {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color .15s;
}

.service:hover {
  border-color: var(--teal);
}

.service__icon {
  color: var(--accent);
  font-size: 14px;
}

.service h3 {
  font-size: 18px;
  font-weight: 700;
}

.service p {
  margin-top: 6px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
}

/* ==========================================================================
   4. С кем работаем
   ========================================================================== */
.clients {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
}

.client {
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

.client h3 {
  font-size: 20px;
  font-weight: 700;
  margin-top: 14px;
}

.client p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.client__code {
  color: var(--sky);
  font-size: 14px;
}

.client--featured {
  --tint-dir: 0deg;
  --tint-a: .96;
  --tint-b: .45;
  grid-row: span 2;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px;
  border-color: rgba(93, 202, 165, .55);
}

.client--featured h3 {
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.client--featured p {
  font-size: 16px;
}

.client__badge {
  align-self: flex-start;
  font-size: 12px;
  background: var(--teal);
  color: var(--teal-ink);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
}

.clients .client:nth-child(4) {
  grid-column: 2 / span 2;
}

/* ==========================================================================
   5. Цена
   ========================================================================== */
.price {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.free {
  list-style: none;
  margin-top: 36px;
  border-top: 1px solid var(--line);
  max-width: 480px;
}

.free li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

.free b {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.calc {
  display: grid;
  gap: 14px;
}

.term__body--calc {
  font-family: var(--font);
  line-height: 1.5;
  padding: 26px;
}

.calc__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  font-weight: 600;
}

.calc__count {
  font-size: 28px;
  font-weight: 500;
  color: var(--teal);
}

.calc__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  margin: 18px 0 8px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--teal) var(--fill, 8%), #1E4E7C var(--fill, 8%));
  cursor: pointer;
}

.calc__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--teal);
  box-shadow: 0 0 0 6px rgba(93, 202, 165, .18);
}

.calc__range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--teal);
  box-shadow: 0 0 0 6px rgba(93, 202, 165, .18);
}

.calc__scale {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--dim);
}

.calc__out {
  margin-top: 22px;
  font-size: 15px;
  line-height: 1.9;
}

.calc__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.calc__total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 6px;
}

.calc__total b {
  font-family: var(--font);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
}

.calc__total span {
  color: var(--muted);
}

.calc__note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--dim);
}

/* ==========================================================================
   6. Почему мы
   ========================================================================== */
.why {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.why__item {
  position: relative;
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

.why__num {
  display: block;
  font-size: clamp(34px, 3.4vw, 48px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}

.why__item h3 {
  margin-top: 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}

.why__item p {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

.why__item--accent {
  border-color: rgba(93, 202, 165, .55);
}

.stamp {
  position: absolute;
  right: -14px;
  top: -34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  line-height: 1.35;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
  border: 2px solid var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: -7px;
  background: var(--stamp-bg, var(--bg));
  transform: rotate(-14deg);
}

/* ==========================================================================
   7. FAQ
   ========================================================================== */
.faq {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 56px;
  align-items: start;
}

.faq__intro {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.faq__intro .btn {
  margin-top: 28px;
}

.faq__list {
  border-top: 1px solid var(--line);
}

.qa {
  border-bottom: 1px solid var(--line);
}

.qa summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  font-size: 18px;
  font-weight: 700;
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  transition: transform .2s;
}

.qa[open] summary::after {
  transform: rotate(45deg);
}

.qa p {
  padding: 0 40px 24px 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.qa a {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}

/* ==========================================================================
   8. Контакты
   ========================================================================== */
.contacts {
  --tint-a: .95;
  --tint-b: .7;
  padding: 120px 0;
}

.contacts__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.contacts__phone {
  display: inline-block;
  margin-top: 32px;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: -.02em;
  border-bottom: 3px solid var(--accent);
}

.messengers {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.msg {
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-weight: 600;
  transition: border-color .15s, color .15s;
}

.msg:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.office {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-deep);
}

.office__map {
  position: relative;
  height: 260px;
  background:
    linear-gradient(115deg, transparent 46%, rgba(133, 183, 235, .28) 46.5%, rgba(133, 183, 235, .28) 48.5%, transparent 49%),
    linear-gradient(20deg, transparent 58%, rgba(133, 183, 235, .2) 58.5%, rgba(133, 183, 235, .2) 60%, transparent 60.5%),
    linear-gradient(160deg, transparent 30%, rgba(133, 183, 235, .14) 30.4%, rgba(133, 183, 235, .14) 31.6%, transparent 32%),
    #062F57;
  background-size: 100% 100%, 100% 100%, 100% 100%, auto;
}

.office__pin {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 28px;
  height: 28px;
  margin: -28px 0 0 -14px;
  border-radius: 50% 50% 50% 0;
  background: var(--teal);
  transform: rotate(-45deg);
  box-shadow: 0 0 0 10px rgba(93, 202, 165, .18);
}

.office__pin::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--bg-deep);
}

.office__map-note {
  position: absolute;
  left: 16px;
  bottom: 12px;
  font-size: 12px;
  color: var(--sky);
}

.office__info {
  padding: 24px 28px 28px;
}

.office__info h3 {
  font-size: 22px;
  font-weight: 800;
}

.office__info p {
  margin-top: 6px;
  color: var(--muted);
}

/* ==========================================================================
   Подвал и мобильная кнопка
   ========================================================================== */
.footer {
  padding: 36px 0;
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
}

.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}

.footer img {
  height: 32px;
  width: auto;
}

.footer__demo {
  color: var(--dim);
}

.callbar {
  display: none;
}

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1180px) {
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 12px 20px 24px;
    background: rgba(2, 30, 58, .98);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav a {
    padding: 14px 8px;
    font-size: 18px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .burger {
    display: flex;
  }

  .header {
    background: rgba(2, 30, 58, .96);
  }
}

@media (max-width: 1024px) {
  .hero__grid, .price, .faq, .contacts__grid, .services {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero.has-photo, .section.has-photo {
    --tint-b: .85;
  }

  .clients {
    grid-template-columns: 1fr 1fr;
  }

  .client--featured {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 380px;
  }

  .clients .client:nth-child(4) {
    grid-column: 1 / -1;
  }

  .why {
    grid-template-columns: 1fr 1fr;
  }

  .faq__intro {
    position: static;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 68px;
  }

  .wrap {
    padding: 0 16px;
  }

  .section, .contacts {
    padding: 80px 0;
  }

  .header__logo img {
    height: 32px;
  }

  .header__phone {
    display: none;
  }

  .hero {
    padding: calc(var(--header-h) + 24px) 0 56px;
    min-height: auto;
  }

  .hero__lead {
    font-size: 17px;
  }

  .doors {
    grid-template-columns: 1fr;
  }

  .term__body {
    font-size: 13px;
    padding: 18px;
  }

  #heroTerm {
    min-height: 290px;
  }

  .stat {
    padding: 12px;
  }

  .stat b {
    font-size: 22px;
  }

  .paths {
    grid-template-columns: 1fr;
    margin-top: 36px;
  }

  .path {
    padding: 24px;
  }

  .path .btn {
    align-self: stretch;
  }

  .services__list {
    grid-template-columns: 1fr;
  }

  .services__visual {
    padding: 28px 24px;
  }

  .clients {
    grid-template-columns: 1fr;
  }

  .client--featured {
    padding: 28px 24px;
    min-height: 360px;
  }

  .why {
    grid-template-columns: 1fr;
  }

  .stamp {
    right: 12px;
  }

  .calc__out {
    font-size: 13px;
  }

  .calc__total b {
    font-size: 36px;
  }

  .qa summary {
    font-size: 17px;
  }

  .qa p {
    padding-right: 0;
  }

  .contacts__phone {
    font-size: 30px;
  }

  .footer {
    padding-bottom: 96px;
  }

  .callbar {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 60;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px;
    height: 56px;
    border-radius: 12px;
    background: var(--teal);
    color: var(--teal-ink);
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  }

  .callbar b {
    font-size: 13px;
    font-weight: 500;
    opacity: .75;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .term__line {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cursor {
    animation: none;
  }

  .btn:hover, .door:hover {
    transform: none;
  }
}

/* ==========================================================================
   Декор: фоновые SVG-иконки в светлых блоках (калькулятор, чек, графики, 7%, Σ, монеты)
   Включение: класс has-deco у секции + <div class="deco"> с svg внутри.
   Прозрачность и цвет — переменная --deco-color.
   ========================================================================== */
.has-deco {
  --deco-color: rgba(12, 68, 124, .03);
  position: relative;
  overflow: hidden;
}
.has-deco > .wrap {
  position: relative;
  z-index: 1;
}
.deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  color: var(--deco-color);
}
.deco svg {
  position: absolute;
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.deco svg * { vector-effect: non-scaling-stroke; }

/* 2. С чего начнём */
.deco__calc     { width: 230px; top: 348px;  right: 3%;  transform: rotate(10deg); }
.deco__receipt  { width: 200px; bottom: 10px; left: 30px; transform: rotate(-32deg); }
.deco__equals   { width: 120px; top: 70px;  right: 28%; }

/* 4. С кем работаем */
.deco__pie      { width: 260px; top: 40px;  right: 4%; }
.deco__bars     { width: 300px; bottom: 20px; left: 40px; transform: rotate(-4deg); }

/* 6. Почему мы */
.deco__percent  { width: 340px; top: 36px;  right: 13%; }
.deco__sigma    { width: 160px; bottom: -10px; left: 2%; transform: rotate(-8deg); }
.deco__coins    { width: 170px; bottom: 3px; right: 2%; }

@media (max-width: 1024px) {
  .deco__equals, .deco__coins { display: none; }
  .deco__calc    { width: 170px; right: -30px; }
  .deco__pie     { width: 190px; right: -40px; }
  .deco__percent { width: 240px; right: -40px; }
}
@media (max-width: 760px) {
  .deco__receipt, .deco__bars, .deco__sigma { display: none; }
  .deco__calc    { width: 130px; top: 24px; right: -36px; }
  .deco__pie     { width: 150px; top: 24px; right: -50px; }
  .deco__percent { width: 180px; top: 24px; right: -60px; }
}

/* ==========================================================================
   «Прилёт справа по очереди» (data-fly-in, блок «Что входит»)
   Класс fly-ready ставит main.js — без JS карточки просто видны.
   Анимация slam-in: разгон → удар (вминается и сплющивается, рамка вспыхивает) → отдача.
   ========================================================================== */
#services { overflow-x: clip; } /* улетевшие вправо карточки не создают горизонтальную прокрутку */

.fly-ready > * {
  opacity: 0;
  translate: 70vw 0;
}
.fly-ready > .is-in {
  animation: slam-in 1.22s both;
}
@keyframes slam-in {
  0% {
    opacity: 1;
    translate: 70vw 0;
    scale: 1;
    animation-timing-function: cubic-bezier(.6, 0, 1, .6); /* разгон — летит ускоряясь */
  }
  45% {                                   /* удар: влетела с запасом и сплющилась */
    translate: -8px 0; 
    scale: .93 1.04; 
    box-shadow: 0 0 0 2px rgba(93, 202, 165, .7), -12px 0 30px rgba(93, 202, 165, .3);
    animation-timing-function: cubic-bezier(.2, .8, .3, 1);
  }
  62% {                                   /* отдача */
     translate: 8px 0; 
     scale: 1.02 .99; 
  }
   76% { translate: -3px 0; scale: 1; }
  88% { translate: 1px 0; } 
  100% {
    opacity: 1;
    translate: 0 0;
    scale: 1; 
    box-shadow: 0 0 0 0 rgba(93, 202, 165, 0);
  }
}

/* ==========================================================================
   «Досье» (data-dossier, блок «С кем работаем»)
   Классы dossier-ready / is-stacked / is-dealt ставит main.js — без JS всё просто видно.
   Шторка: clip-path главной карточки (--dossier-clip), фото «отъезжает» (--dossier-zoom),
   текст проявляется в конце (--dossier-content). Раздача: translate/rotate карточек из стопки.
   ========================================================================== */
.dossier-ready .client--featured.has-photo {
  position: relative;
  z-index: 2;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg);
  clip-path: inset(var(--dossier-clip, 0%) 0 var(--dossier-clip, 0%) 0 round 16px);
}
/* фото переносим в отдельный слой, чтобы его можно было масштабировать */
.dossier-ready .client--featured.has-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--tint-dir, 90deg), rgba(4, 44, 83, var(--tint-a, .92)) 0%, rgba(4, 44, 83, var(--tint-b, .55)) 100%),
    var(--photo);
  background-size: 100% 100%, cover;
  background-position: center, center;
  background-repeat: no-repeat;
  background-blend-mode: normal, luminosity;
  scale: var(--dossier-zoom, 1);
}
.dossier-ready .client--featured > * {
  opacity: var(--dossier-content, 1);
  translate: 0 calc((1 - var(--dossier-content, 1)) * 16px);
}

/* Стопка: сначала скрыта, после раскрытия шторки выглядывает из-под главной и раздаётся */
.dossier-ready > .client:not(.client--featured) {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition:
    translate .7s cubic-bezier(.2, .9, .3, 1.12),
    rotate .7s cubic-bezier(.2, .9, .3, 1.12),
    opacity .3s ease,
    box-shadow .3s ease;
}
.dossier-ready.is-stacked > .client:not(.client--featured) {
  opacity: 1;
  box-shadow: 0 10px 30px rgba(4, 44, 83, .18);
}
.dossier-ready.is-dealt > .client:not(.client--featured) {
  box-shadow: 0 1px 2px rgba(4, 44, 83, .06), 0 8px 24px rgba(4, 44, 83, .05);
}

/* ==========================================================================
   «Печать» (блок «Почему мы»): штамп опускается, бьёт и оставляет оттиск
   Классы stamp-ready / is-stamped ставит main.js — без JS печать просто видна.
   Момент удара — 0.52s: в него попадают оттиск, кольцо «брызг» и вздрагивание карточки.
   ========================================================================== */
.why__item--accent { --stamp-right: -14px; }
.stamp {
  right: var(--stamp-right);
  z-index: 2;
  filter: url(#ink-rough);   /* неровные края, как у мастичной печати */
}
@media (max-width: 760px) {
  .why__item--accent { --stamp-right: 12px; }
}

.stamper,
.stamper-shadow {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}
.stamper {
  z-index: 3;
  width: 115px;              /* основание штампа (100 из 120 единиц) = диаметр оттиска 96px */
  right: calc(var(--stamp-right) - 9.5px);
  top: -99px;                /* уточняется скриптом: точка касания подушки — в центре оттиска */
  filter: drop-shadow(0 14px 18px rgba(4, 44, 83, .28));
}
.stamper svg { display: block; width: 100%; height: auto; }
.stamper-shadow {
  z-index: 1;
  width: 96px;
  height: 96px;
  right: var(--stamp-right);
  top: -34px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(4, 44, 83, .35), rgba(4, 44, 83, 0));
}

/* кольцо «брызг» краски в момент удара */
.stamp::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
}

.stamp-ready .stamp { opacity: 0; }

.stamp-ready.is-stamped .stamper        { animation: stamper-drop 1.25s both; }
.stamp-ready.is-stamped .stamper-shadow { animation: stamper-shadow 1.25s both; }
.stamp-ready.is-stamped .stamp          { animation: stamp-imprint .45s .52s both; }
.stamp-ready.is-stamped .stamp::after   { animation: stamp-ring .6s .52s both; }
.stamp-ready.is-stamped                 { animation: card-thud .32s .52s both; }

@keyframes stamper-drop {
  0%   { opacity: 0; translate: 40px -170px; rotate: 14deg; scale: 1.15; }
  14%  { opacity: 1; }
  34%  { translate: 0 -26px; rotate: -4deg; scale: 1.03; animation-timing-function: cubic-bezier(.7, 0, 1, .5); } /* зависает и резко идёт вниз */
  42%  { translate: 0 0; rotate: 0deg; scale: 1.06 .9; }        /* удар: подушка сплющивается */
  56%  { translate: 0 0; scale: 1; }                            /* держит нажатие */
  70%  { opacity: 1; translate: 0 -34px; rotate: -5deg; }
  100% { opacity: 0; translate: 50px -200px; rotate: 12deg; scale: 1.1; }
}
@keyframes stamper-shadow {
  0%   { opacity: 0; scale: 1.9; }
  42%  { opacity: 1; scale: 1; }
  60%  { opacity: .6; scale: 1; }
  100% { opacity: 0; scale: 1.8; }
}
@keyframes stamp-imprint {
  0%   { opacity: 0; scale: 1.1; }
  25%  { opacity: 1; }
  100% { opacity: 1; scale: 1; }
}
@keyframes stamp-ring {
  0%   { opacity: .7; scale: 1; }
  100% { opacity: 0; scale: 1.55; }
}
@keyframes card-thud {
  0%   { translate: 0 0; }
  25%  { translate: 0 4px; }
  55%  { translate: 0 -1px; }
  100% { translate: 0 0; }
}

/* ==========================================================================
   Пульсация кнопок: мягкое бирюзовое кольцо + лёгкий «вдох»
   Цвет кольца — --pulse-color, период — 2.8s. На hover пульсация останавливается.
   ========================================================================== */
.btn,
.door,
.msg,
.callbar {
  --pulse-color: rgba(93, 202, 165, .5);
  animation: btn-pulse 2.8s ease-out infinite;
}
/* соседние кнопки — со сдвигом, чтобы не пульсировали хором */
.door:nth-child(2),
.msg:nth-child(2),
.path--existing .btn { animation-delay: 1.4s; }
.msg:nth-child(3)     { animation-delay: .7s; }

.btn:hover,
.door:hover,
.msg:hover,
.callbar:hover { animation: none; }

@keyframes btn-pulse {
  0%       { box-shadow: 0 0 0 0 var(--pulse-color); scale: 1; }
  12%      { scale: 1.03; }
  30%      { scale: 1; }
  70%,
  100%     { box-shadow: 0 0 0 12px rgba(93, 202, 165, 0); scale: 1; }
}

/* у нижней кнопки звонка есть своя тень — сохраняем её в пульсации */
.callbar { animation-name: callbar-pulse; }
@keyframes callbar-pulse {
  0%       { box-shadow: 0 12px 30px rgba(0, 0, 0, .35), 0 0 0 0 var(--pulse-color); scale: 1; }
  12%      { scale: 1.02; }
  30%      { scale: 1; }
  70%,
  100%     { box-shadow: 0 12px 30px rgba(0, 0, 0, .35), 0 0 0 12px rgba(93, 202, 165, 0); scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .door, .msg, .callbar { animation: none; }
}
