/* Сантехник IL: один мотив, круг (сечение трубы). Цвета: море, небо, песок. */

:root {
  --bg: #f5f9fc;
  --sky: #cfe5f3;
  --sand: #f1e3b5;
  --sand-soft: #f8efd2;
  --sea: #1e4f9c;
  --sea-deep: #173e7c;
  --ink: #0e1a26;
  --muted: #3a5264;
  --on-sea: #ffffff;
  --on-sea-soft: #d6e6f6;
  --wa: #15803d;
  --wa-press: #116a32;
  --navy: #0f2238;

  --font: "Rubik", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* пять размеров: мелкий, текст, вводный, заголовок, главный */
  --step-small: 0.9375rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --step-head: clamp(2rem, 1.3rem + 3vw, 3.75rem);
  --step-display: min(4.8vw, 9vh, 5.25rem);

  --m: clamp(16px, 4vw, 64px);
  --section: clamp(96px, 12vw, 200px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--sky); color: var(--ink); }

h1, h2 {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  text-wrap: balance;
}
h2 { font-size: var(--step-head); }
h3 { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }

.ic { width: 1.15em; height: 1.15em; flex: none; }

.skip {
  position: absolute; inset-inline-start: var(--m); top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Кнопки: круг, вытянутый в капсулу ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px;
  border-radius: 999px;
  font: 500 var(--step-body)/1 var(--font);
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-press); }
.btn--call { background: #fff; color: var(--ink); }
.btn--call:hover { background: var(--sky); }

/* ---------- Первый экран ---------- */
.hero {
  --d: min(118svh, 62vw);
  --cx: 82%;
  position: relative;
  min-height: max(640px, min(100svh, 940px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg);
}
.bar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--m);
}
.wordmark { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.03em; text-decoration: none; }
.bar__nav { display: flex; align-items: center; gap: 32px; font-size: var(--step-small); }
.bar__nav a { text-decoration: none; }
.bar__nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.bar__tel {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 500;
}
.bar__tel:hover { text-decoration: none !important; background: var(--sea); }
.bar__call { display: none; }

.hero__text {
  position: relative; z-index: 2;
  align-self: center;
  padding-inline-start: var(--m);
  padding-block: 24px 72px;
  max-width: calc(var(--cx) - var(--d) / 2 - 24px);
}
.hero h1 { font-size: var(--step-display); }
.hero__lead { margin-top: 32px; font-size: var(--step-lead); line-height: 1.4; max-width: 30ch; }
.hero__cities { display: flex; align-items: center; gap: 10px; margin-top: 20px; font-weight: 500; }
.hero__cities .ic { color: var(--sea); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__alt { margin-top: 20px; font-size: var(--step-small); color: var(--muted); }
.hero__alt a { color: var(--ink); font-weight: 500; text-underline-offset: 3px; }

.hero__stage { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero__circle {
  position: absolute;
  width: var(--d); aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sea);
  left: calc(var(--cx) - var(--d) / 2);
  top: 96px;
}
.hero__man {
  position: absolute;
  right: 0; bottom: 0;
  height: min(88%, 820px);
  width: auto;
  max-width: none;
}

/* ---------- Услуги: образцы на цветных плитках ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  padding: var(--section) var(--m) 0;
}
.services__head { grid-column: 1 / span 3; }
.services__head p { margin-top: 24px; max-width: 30ch; }
.tiles {
  grid-column: 4 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 12px;
}
.tile--wide { grid-column: span 2; }
.tile__face {
  aspect-ratio: 1;
  display: grid; place-items: center;
  background: var(--sky); color: var(--sea);
}
.tile--wide .tile__face { aspect-ratio: 2 / 1; }
.tile--sand .tile__face { background: var(--sand); color: var(--ink); }
.tile--sea .tile__face { background: var(--sea); color: var(--on-sea); }
.tile__face svg { width: 36%; height: auto; aspect-ratio: 1; }
.tile--wide .tile__face svg { width: 18%; }
.tile h3 { margin-top: 16px; }
.tile p { margin-top: 6px; font-size: var(--step-small); color: var(--muted); max-width: 28ch; }

/* ---------- Как заказать: брызги собираются в трубу ---------- */
.how {
  margin-top: var(--section);
  padding: clamp(72px, 9vw, 140px) var(--m);
  background: var(--sky);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
}
.how__head { grid-column: 1 / span 6; }
.how__head p { margin-top: 24px; max-width: 36ch; }

/* шаги стоят на трубе: круг-соединение, между ними отрезок трубы */
.steps {
  --mark: 72px;
  --pipe: 10px;
  --gap: 40px;
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap);
  margin-top: 64px;
}
.step { position: relative; }
.step__mark {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: var(--mark); height: var(--mark);
  border-radius: 50%;
  background: var(--sea); color: #fff;
}
.step__mark svg { width: 44%; height: 44%; }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--mark) / 2 - var(--pipe) / 2);
  left: var(--mark);
  right: calc(var(--gap) * -1);
  height: var(--pipe);
  background: #9ec3de;
  transform-origin: left center;
}
.step h3 { margin-top: 28px; font-weight: 600; }
.step p { margin-top: 10px; max-width: 32ch; }
.how__cta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 64px; }
.how__cta p a { font-weight: 500; text-underline-offset: 3px; }

/* ---------- Районы: список с круглыми фото ---------- */
.areas { padding: var(--section) var(--m) 0; }
.areas__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.areas__count { font-size: var(--step-lead); color: var(--muted); }
.cities {
  margin-top: 56px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 64px;
}
.city { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); }
.city img {
  width: clamp(96px, 15vw, 220px); aspect-ratio: 1; height: auto;
  border-radius: 50%; object-fit: cover; flex: none;
  background: var(--sky);
}
.city h3 { font-size: var(--step-head); font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.city p { margin-top: 8px; font-size: var(--step-lead); color: var(--muted); }
.city p span { unicode-bidi: isolate; }
.areas__note { margin-top: 64px; font-size: var(--step-lead); max-width: 40ch; }
.areas__note a { color: var(--sea); font-weight: 500; text-underline-offset: 4px; }

/* ---------- Обо мне: тёмная панель, круглый портрет ---------- */
.about { padding: var(--section) 0 0; }
.about__panel {
  --pad: clamp(56px, 6vw, 96px);
  position: relative;
  margin-inline: 20px;
  background: var(--sea-deep);
  color: var(--on-sea);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(40px, 5vw, 96px);
  align-items: center;
  padding: var(--pad) max(clamp(24px, 4vw, 64px), calc((100% - 1280px) / 2)) 0;
}
.about__body { padding-bottom: var(--pad); }
.about__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; margin-top: 48px; }
.about__cols h3 { font-weight: 600; }
.about__cols p { margin-top: 12px; color: var(--on-sea-soft); }
.about__body .btn { margin-top: 40px; }
.ph { background: var(--sand); color: var(--ink); padding: 0 6px; border-radius: 4px; white-space: nowrap; }
.about__portrait {
  --p: min(34vw, 500px);
  position: relative;
  align-self: end;
  justify-self: center;
  margin-bottom: calc(var(--p) * -0.18);
  width: var(--p); aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sky);
  overflow: hidden;
}
.about__portrait img {
  position: absolute; left: 50%; top: 10%;
  width: 92%; max-width: none; height: auto;
  transform: translateX(-46%);
}

/* ---------- Заявка: купон с вырезами ---------- */
.contact { padding: var(--section) var(--m); }
.coupon {
  --notch: 28px;
  --cut-x: 50%;
  position: relative;
  max-width: 1240px; margin-inline: auto;
  background: var(--sand);
  display: grid;
  grid-template-columns: 1fr 1fr;
  -webkit-mask:
    radial-gradient(circle var(--notch) at var(--cut-x) 0, transparent 98%, #000) top / 100% 51% no-repeat, /* taste-skill-ignore: маска вырезов купона, не заливка */
    radial-gradient(circle var(--notch) at var(--cut-x) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat; /* taste-skill-ignore: маска вырезов купона, не заливка */
          mask:
    radial-gradient(circle var(--notch) at var(--cut-x) 0, transparent 98%, #000) top / 100% 51% no-repeat, /* taste-skill-ignore: маска вырезов купона, не заливка */
    radial-gradient(circle var(--notch) at var(--cut-x) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat; /* taste-skill-ignore: маска вырезов купона, не заливка */
}
.coupon__left {
  padding: 56px 48px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  border-inline-end: 6px dotted var(--bg);
}
.coupon__left p { max-width: 32ch; }
.coupon__right { padding: 48px; display: grid; gap: 24px; align-content: start; }
legend { font-weight: 500; margin-bottom: 12px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--sand-soft);
  transition: background-color 140ms ease, color 140ms ease, transform 140ms var(--ease-out);
}
.chip:hover span { background: #fff8e2; }
.chip input:checked + span { background: var(--sea); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--sea); outline-offset: 2px; }
.chip input:active + span { transform: scale(0.96); }
.field { display: grid; gap: 10px; }
.field__label { font-weight: 500; }
.field input {
  width: 100%; height: 52px; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--sand-soft); color: var(--ink); font: 400 var(--step-body) var(--font);
}
.field input::placeholder { color: #6b6450; }
.field input:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.coupon__send {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 58px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--wa); color: #fff; font: 500 var(--step-body) var(--font);
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.coupon__send:hover { background: var(--wa-press); }
.coupon__send:active { transform: scale(0.98); }
.coupon__alt a { font-weight: 500; text-underline-offset: 3px; }

/* ---------- Подвал: номер крупно ---------- */
.foot { background: var(--navy); color: #fff; padding: clamp(64px, 8vw, 120px) var(--m) 40px; }
.foot__title { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.01em; color: var(--on-sea-soft); }
.foot__number {
  display: block; margin-top: 12px;
  font-size: calc((100vw - 2 * var(--m)) / 6.9);
  font-weight: 600; letter-spacing: -0.05em; line-height: 1.15;
  text-decoration: none; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.foot__number:hover { color: var(--sky); }
.foot__row { margin-top: 56px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.foot__links a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font-weight: 500; }
.foot__links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot__where { color: var(--on-sea-soft); max-width: 44ch; }
.foot__credits { margin-top: 56px; font-size: var(--step-small); color: #b7c7d8; max-width: 90ch; }
.foot__credits a { color: inherit; }
.foot__copy { margin-top: 16px; font-size: var(--step-small); color: #b7c7d8; }

/* ---------- Нижняя панель на телефоне ---------- */
.dock { display: none; }

/* ---------- Движение ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); transition-delay: var(--delay, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero__circle { clip-path: circle(0% at 60% 60%); animation: open-circle 1100ms var(--ease-out) 80ms forwards; }
.js .hero__man { opacity: 0; transform: translateY(28px) scale(1.04); transform-origin: 70% 100%; animation: man-in 900ms var(--ease-out) 380ms forwards; }
.js .hero__text > * { opacity: 0; transform: translateY(18px); animation: rise 700ms var(--ease-out) forwards; }
.js .hero__text > :nth-child(1) { animation-delay: 60ms; }
.js .hero__text > :nth-child(2) { animation-delay: 140ms; }
.js .hero__text > :nth-child(3) { animation-delay: 220ms; }
.js .hero__text > :nth-child(4) { animation-delay: 300ms; }
.js .hero__text > :nth-child(5) { animation-delay: 380ms; }
.js .step:not(:last-child)::after { transform: scaleX(0); transition: transform 700ms var(--ease-out) 250ms; }
.js .step.in:not(:last-child)::after { transform: none; }
@keyframes open-circle { to { clip-path: circle(75% at 60% 60%); } }
@keyframes man-in { to { opacity: 1; transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .hero__text > *, .js .hero__man { opacity: 1; transform: none; animation: none; transition: none; }
  .js .hero__circle { clip-path: none; animation: none; }
  .js .step:not(:last-child)::after { transform: none; transition: none; }
}

/* ---------- Планшет ---------- */
@media (max-width: 1100px) {
  .services__head { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; }
  .services__head p { margin-top: 0; }
  .tiles { grid-column: 1 / -1; margin-top: 48px; }
  .bar__nav a:not(.bar__tel) { display: none; }
  .about__cols { grid-template-columns: 1fr; gap: 32px; margin-top: 40px; }
}

/* ---------- Телефон и узкий планшет: главная версия ---------- */
@media (max-width: 860px) {
  :root { --step-display: clamp(2.25rem, 9.4vw, 4.5rem); }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .hero { display: block; min-height: 0; }
  .bar { padding: 14px var(--m); }
  .bar__nav { display: none; }
  .bar__call {
    display: inline-flex; align-items: center; min-height: 44px;
    font-weight: 500; color: var(--sea); text-decoration: underline; text-underline-offset: 4px;
  }
  .hero__text { max-width: 640px; padding: 20px var(--m) 0; }
  .hero__lead { margin-top: 18px; }
  .hero__cities { margin-top: 14px; }
  .hero__actions { margin-top: 24px; display: grid; grid-template-columns: 1fr; gap: 10px; }
  .hero__actions .btn { width: 100%; }
  .btn--call { background: var(--sky); }
  .hero__alt { margin-top: 14px; }
  .hero__stage { --h: min(108vw, 560px); position: relative; inset: auto; height: var(--h); margin-top: 16px; }
  .hero__circle { width: calc(var(--h) * 1.1); left: calc(100% - var(--h) * 0.85); top: 0; }
  .hero__man { height: 92%; }

  .services { display: block; }
  .services__head { display: block; }
  .services__head p { margin-top: 16px; }
  .tiles { margin-top: 32px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 8px; }
  .tile--wide { grid-column: 1 / -1; order: -1; }
  .tile h3 { font-size: var(--step-body); margin-top: 12px; }

  .how { display: block; }
  .steps { --mark: 60px; --gap: 24px; margin-top: 40px; }
  .step h3 { margin-top: 20px; }
  .how__cta { margin-top: 40px; }

  .cities { gap: 28px 24px; margin-top: 32px; }
  .city img { width: clamp(88px, 16vw, 120px); }
  .city h3 { font-size: 2rem; }
  .areas__note { margin-top: 40px; }

  .about__panel { margin-inline: 10px; display: flex; flex-direction: column; padding: 40px var(--m) 0; }
  .about__body { padding-bottom: 0; max-width: 560px; }
  .about__cols { margin-top: 32px; }
  .about__body .btn { margin-top: 32px; }
  .about__portrait {
    order: 2;
    --p: min(86vw, 480px);
    align-self: center;
    margin: 48px auto calc(var(--p) * -0.25);
  }

  .contact { padding: var(--section) 12px; }
  .coupon {
    --cut-y: 240px;
    grid-template-columns: 1fr;
    -webkit-mask:
      radial-gradient(circle var(--notch) at 0 var(--cut-y), transparent 98%, #000) left / 51% 100% no-repeat, /* taste-skill-ignore: маска вырезов купона, не заливка */
      radial-gradient(circle var(--notch) at 100% var(--cut-y), transparent 98%, #000) right / 51% 100% no-repeat; /* taste-skill-ignore: маска вырезов купона, не заливка */
            mask:
      radial-gradient(circle var(--notch) at 0 var(--cut-y), transparent 98%, #000) left / 51% 100% no-repeat, /* taste-skill-ignore: маска вырезов купона, не заливка */
      radial-gradient(circle var(--notch) at 100% var(--cut-y), transparent 98%, #000) right / 51% 100% no-repeat; /* taste-skill-ignore: маска вырезов купона, не заливка */
  }
  .coupon__left { padding: 36px 24px 32px; border-inline-end: 0; border-bottom: 6px dotted var(--bg); }
  .coupon__right { padding: 32px 20px 28px; }

  .foot { padding-bottom: 32px; }

  .dock {
    display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--bg);
    box-shadow: 0 -1px 0 rgba(14, 26, 38, 0.08); /* taste-skill-ignore: закреплённая панель */
    transform: translateY(110%);
    transition: transform 260ms var(--ease-out);
  }
  .dock.on { transform: none; }
  .dock .btn { min-height: 52px; padding: 0 12px; }
  .dock .btn--call { background: var(--sky); }
  html:not(.js) .dock { transform: none; }
}

/* ---------- Телефон ---------- */
@media (max-width: 560px) {
  .steps { --mark: 56px; --gap: 32px; grid-template-columns: 1fr; row-gap: var(--gap); }
  .step { display: grid; grid-template-columns: var(--mark) minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .step__mark { grid-row: 1 / span 2; }
  .step h3 { grid-column: 2; margin-top: 14px; }
  .step p { grid-column: 2; }
  .step:not(:last-child)::after {
    top: var(--mark); bottom: calc(var(--gap) * -1);
    left: calc(var(--mark) / 2 - var(--pipe) / 2); right: auto;
    width: var(--pipe); height: auto;
    transform-origin: center top;
  }
  .js .step:not(:last-child)::after { transform: scaleY(0); }
  .js .step.in:not(:last-child)::after { transform: none; }
  .how__cta .btn { width: 100%; }
  .cities { grid-template-columns: 1fr; gap: 24px; }
  .about h2 { font-size: 1.875rem; }
  .chip span { padding: 0 15px; }
}
