/* Прототип «Нуклео», 06.10. Не production: для согласования движения и структуры. */
@font-face { font-family: 'Bounded'; src: url('fonts/bounded-300.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('fonts/manrope-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('fonts/manrope-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --blue: #1F3AA8;
  --blue-deep: #142877;
  --pearl: #F3EDEA;
  --pearl-2: #EAE2DE;
  --ink: #2F3142;
  --ink-2: #5B5E6E;
  --pink: #F7B4D0;
  --line: #C9CDD3;
  --white: #FFFFFF;
  --display: 'Bounded', system-ui, sans-serif;
  --text: 'Manrope', system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --header-h: clamp(68px, 7.2vw, 104px);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; overscroll-behavior-x: none; }
/* Меню блокирует прокрутку (overflow: hidden): место под полосу прокрутки держим, иначе на компьютере
   с обычной полосой страница при открытии меню прыгает вбок. */
html { scrollbar-gutter: stable; }
body { background: var(--pearl); color: var(--ink); font: 400 16px/1.55 var(--text); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nw { white-space: nowrap; }

/* ── переходы между страницами (View Transitions) ── */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
.header { view-transition-name: header; }
::view-transition-group(dir-renewal), ::view-transition-group(dir-niti),
::view-transition-group(dir-contour), ::view-transition-group(dir-telo) {
  animation-duration: .75s; animation-timing-function: cubic-bezier(.7, 0, .2, 1);
}
::view-transition-old(dir-renewal), ::view-transition-new(dir-renewal),
::view-transition-old(dir-niti), ::view-transition-new(dir-niti),
::view-transition-old(dir-contour), ::view-transition-new(dir-contour),
::view-transition-old(dir-telo), ::view-transition-new(dir-telo) { height: 100%; object-fit: cover; overflow: clip; }

/* ── кнопки ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 30px;
  border-radius: 999px; font: 500 17px/1 var(--text); border: 1.5px solid transparent; white-space: nowrap; cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s, color .2s, border-color .2s; }
.btn:active { transform: scale(.97); }
.btn--sm { min-height: 46px; padding: 0 22px; font-size: 15px; }
.btn--blue { background: var(--blue); color: var(--white); }
.btn--blue:hover { background: var(--blue-deep); }
.btn--light { background: var(--white); color: var(--blue); }
.btn--ghost { border-color: var(--line); background: rgba(255,255,255,.55); }
.btn--ghost:hover { border-color: var(--ink-2); }
.btn--ghost-light { border-color: rgba(255,255,255,.7); color: var(--white); }
.btn--ghost-light:hover { background: rgba(255,255,255,.12); }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ── шапка ── */
.header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h); padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 32px; color: var(--ink); transition: color .35s, background-color .35s; }
.header.is-light { color: var(--white); }
.header.is-solid { background: rgba(243,237,234,.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.header__logo { position: relative; display: block; height: clamp(36px, 3.2vw, 46px); aspect-ratio: 2169 / 704; }
.header__logo img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .35s; }
.header__logo .on-blue { opacity: 0; }
.header.is-light .header__logo .on-blue { opacity: 1; }
.header.is-light .header__logo .on-pearl { opacity: 0; }
.nav { display: flex; gap: clamp(18px, 2.4vw, 36px); margin-left: auto; font-size: 16px; font-weight: 500; }
.nav a { white-space: nowrap; padding: 6px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .3s var(--ease-out); }
.nav a:hover, .nav a[aria-current] { background-size: 100% 1.5px; }
.drawer__link[aria-current] { color: var(--blue); }
.header__cta.btn--blue { transition: background-color .35s, color .35s; }
.header.is-light .header__cta { background: var(--white); color: var(--blue); }
.header__tel { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px;
  font-weight: 600; font-size: 16px; white-space: nowrap; }
.header__tg { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border: 1.5px solid currentColor; border-radius: 999px; margin-right: -18px; transition: background-color .25s, color .25s; }
.header__tg svg { margin-left: -2px; flex: none; }
.header__tel svg { flex: none; }
.header__tg:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }
.header__tel:hover span { text-decoration: underline; text-underline-offset: 4px; }
.burger { display: inline-flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 6px 0 16px; border-radius: 999px;
  border: 1.5px solid currentColor; background: none; cursor: pointer; font-weight: 500; font-size: 15px; }
.burger__lines { width: 34px; height: 34px; display: grid; place-content: center; gap: 5px; }
.burger__lines i { display: block; width: 16px; height: 1.5px; background: currentColor; border-radius: 2px; }

/* ── боковое меню ── */
/* Меню: панель выезжает мягко (кривая как у системных шторок iOS) и так же мягко уезжает.
   visibility выключается только после окончания движения — иначе панель исчезает рывком. */
.drawer { position: fixed; inset: 0; z-index: 80; visibility: hidden; overflow: hidden; overflow: clip; contain: paint; transition: visibility 0s .5s; }
/* Закрытое меню убрано из раскладки целиком: в WebKit (iPhone) панель за правым краем иначе расширяет
   страницу, и её можно сдвинуть пальцем вбок вместе с меню. */
.drawer[hidden] { display: none !important; }
.drawer.is-open { visibility: visible; transition: none; }
.drawer, .drawer__backdrop { touch-action: pan-y; } /* меню не тянется пальцем вбок */
.drawer__backdrop { position: absolute; inset: 0; background: rgba(20,40,119,.38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .45s ease; }
.drawer__panel { position: absolute; inset: 0 0 0 auto; width: min(480px, 86vw); background: var(--pearl); display: flex; flex-direction: column;
  padding: 22px clamp(22px, 4vw, 44px) 32px; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 28px 0 0 28px; transform: translate3d(100%, 0, 0);
  transition: transform .45s cubic-bezier(.4, 0, .2, 1); box-shadow: -40px 0 80px -40px rgba(20,40,119,.35); will-change: transform; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; transition: transform .65s cubic-bezier(.32, .72, 0, 1); }
.drawer__top { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.drawer__close { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); display: grid; place-items: center; cursor: pointer; }
.drawer__nav { margin-top: 28px; }
.drawer__nav > ul { list-style: none; }
.drawer__nav > ul > li { border-bottom: 1px solid #E2DAD6; }
.drawer__link { display: block; padding: 16px 0; font: 300 30px/1.1 var(--display); letter-spacing: -0.02em; }
.drawer__sub { list-style: none; padding: 0 0 16px; display: grid; gap: 4px; }
.drawer__sub a { display: block; padding: 6px 0; color: var(--ink-2); font-size: 17px; }
.drawer__sub a:hover, .drawer__link:hover { color: var(--blue); }
.drawer__foot { margin-top: auto; padding-top: 32px; display: grid; gap: 14px; font-size: 15px; color: var(--ink-2); }
.drawer__foot .btn { width: 100%; }
.drawer__foot a:not(.btn) { color: var(--ink); font-weight: 500; }
/* связь с администратором: звонок, Max, Telegram */
.reach__title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.reach__list { list-style: none; display: grid; gap: 6px; }
.reach__a { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--ink); font-weight: 500; }
.reach__i { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--blue);
  box-shadow: 0 8px 20px -12px rgba(47,49,66,.45); transition: background-color .2s, color .2s, transform .2s var(--ease-out); }
.reach__a:hover .reach__i, .reach__a:focus-visible .reach__i { background: var(--blue); color: var(--white); transform: translateY(-1px); }
.foot .reach { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.foot .reach__title { margin: 0; }
.foot .reach__list { display: flex; flex-wrap: wrap; gap: 4px 22px; }
@media (max-width: 700px) { .foot .reach, .foot .reach__list { flex-direction: column; align-items: flex-start; } } /* телефон: столбцом */
.drawer.is-open .drawer__nav > ul > li { animation: drawerIn .6s .06s var(--ease-out) both; }
.drawer.is-open .drawer__nav > ul > li:nth-child(2) { animation-delay: .1s; }
.drawer.is-open .drawer__nav > ul > li:nth-child(3) { animation-delay: .14s; }
.drawer.is-open .drawer__nav > ul > li:nth-child(4) { animation-delay: .18s; }
.drawer.is-open .drawer__nav > ul > li:nth-child(5) { animation-delay: .22s; }
@keyframes drawerIn { from { opacity: 0; transform: translateX(32px); } }
.drawer.is-open .drawer__foot { animation: drawerIn .6s .16s var(--ease-out) both; }

/* ── плавающая кнопка ── */
.dock { position: fixed; z-index: 40; right: var(--gutter); bottom: max(20px, env(safe-area-inset-bottom)); box-shadow: 0 14px 40px -12px rgba(20,40,119,.55);
  transform: translateY(140%); transition: transform .45s var(--ease-out); }
.dock.is-on { transform: none; }

/* ── форма заявки ── */
.lead { position: relative; background: var(--pearl-2); padding: clamp(64px, 9vw, 120px) var(--gutter); scroll-margin-top: var(--header-h); }
.lead__grid { max-width: 1296px; margin: 0 auto; display: grid; grid-template-columns: 1fr minmax(0, 560px); gap: clamp(32px, 6vw, 96px); align-items: start; }
.lead h2 { font: 300 clamp(32px, 8.4vw, 72px)/1.04 var(--display); letter-spacing: -0.03em; }
.lead__text { margin-top: 22px; max-width: 440px; font-size: 17px; color: var(--ink-2); }
.lead__contacts { margin-top: 32px; display: grid; gap: 10px; font-size: 16px; }
.lead__contacts a { font-weight: 500; }
.form { background: var(--white); border-radius: 28px; padding: clamp(24px, 3vw, 40px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; box-shadow: 0 30px 60px -45px rgba(47,49,66,.4); }
/* поля не шире карточки: выпадающий список иначе растягивает форму под самое длинное название услуги (телефон, 14.10) */
.form > *, .field { min-width: 0; }
.field__input { width: 100%; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.field { display: grid; gap: 7px; }
.field__label { font-size: 14px; font-weight: 500; }
.field__input { height: 56px; padding: 0 18px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--white); font-size: 17px; transition: border-color .2s; }
.field__input:focus { outline: none; border-color: var(--blue); }
.field__input[aria-invalid="true"] { border-color: #C0365F; }
.field__error { color: #B02A55; font-size: 13.5px; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; font-size: 14px; color: var(--ink-2); align-items: start; }
.check input { width: 22px; height: 22px; accent-color: var(--blue); margin-top: 1px; }
.check a { text-decoration: underline; text-underline-offset: 3px; }
.form .btn { width: 100%; }
.form__status { border-radius: 16px; padding: 14px 16px; font-size: 15px; background: #EEF1FB; color: var(--blue-deep); }
.form__status[data-kind="error"] { background: #FCEEF3; color: #9C1F52; }
.form__hint { font-size: 13px; color: var(--ink-2); }
.form__hint a { text-decoration: underline; text-underline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form { position: relative; }
.btn:disabled { opacity: .7; cursor: progress; }

/* ── подвал ── */
.foot { background: var(--pearl); padding: 40px var(--gutter) max(40px, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 16px 40px;
  font-size: 15px; color: var(--ink-2); border-top: 1px solid #E2DAD6; }
.foot a { color: var(--ink); font-weight: 500; }
.foot__right { margin-left: auto; display: flex; flex-wrap: wrap; gap: 12px 28px; }

/* ── «Жемчужное раскрытие» между страницами (chrome.js) ── */
@property --hole { syntax: '<length>'; inherits: false; initial-value: 0px; }
.veil { position: fixed; inset: 0; z-index: 300; pointer-events: none; display: grid; place-items: center; --x: 50vw; --y: 50vh;
  background: radial-gradient(90vmax 70vmax at 50% 42%, #6C86E0 0%, var(--blue) 42%, var(--blue-deep) 100%); }
.veil__glow { position: absolute; width: min(70vmin, 560px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.5) 0%, rgba(247,180,208,.18) 40%, rgba(255,255,255,0) 70%); }
.veil__mark { position: relative; width: min(30vmin, 210px); height: auto; filter: drop-shadow(0 18px 40px rgba(10,20,80,.45)); }
/* уход: круг из точки касания, жемчужина проявляется */
.veil-out .veil { animation: veilGrow .56s cubic-bezier(.7, 0, .3, 1) both; }
.veil-out .veil__mark, .veil-out .veil__glow { animation: veilMarkIn .5s .14s var(--ease-out) both; }
@keyframes veilGrow { from { clip-path: circle(0 at var(--x) var(--y)); } to { clip-path: circle(150vmax at var(--x) var(--y)); } }
@keyframes veilMarkIn { from { opacity: 0; transform: scale(.72) rotate(-10deg); filter: blur(8px); } }
/* приход: жемчужина раскрывается, страница проступает из центра */
.veil-open .veil { animation: veilOpen .95s cubic-bezier(.65, 0, .35, 1) forwards;
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent var(--hole), rgba(0,0,0,.55) calc(var(--hole) + 40px), #000 calc(var(--hole) + 110px));
  mask: radial-gradient(circle at 50% 50%, transparent var(--hole), rgba(0,0,0,.55) calc(var(--hole) + 40px), #000 calc(var(--hole) + 110px)); }
.veil-open .veil__mark, .veil-open .veil__glow { animation: veilMarkOut .5s ease-in forwards; }
@keyframes veilOpen { to { --hole: 160vmax; } }
@keyframes veilMarkOut { to { opacity: 0; transform: scale(1.6); filter: blur(6px); } }
.veil-in .phero__img, .veil-in .dhero__media img { animation-delay: .3s; }

/* ── стыки блоков: фон перетекает, первый блок наезжает «листом» (chrome.js) ── */
html.tones body { background: var(--tone, var(--pearl)); transition: background-color 1.1s cubic-bezier(.4, 0, .2, 1); }
html.tones .works, html.tones .lead, html.tones .foot { background: transparent; }
.sheet { position: relative; z-index: 2; margin-top: calc(-1 * var(--sheet, 48px)); padding-top: calc(var(--sheet, 48px) + clamp(48px, 7vw, 96px)) !important;
  max-width: none !important; padding-left: max(var(--gutter), calc((100% - 1296px) / 2 + var(--gutter))) !important;
  padding-right: max(var(--gutter), calc((100% - 1296px) / 2 + var(--gutter))) !important;
  background: var(--tone, var(--pearl)); transition: background-color 1.1s cubic-bezier(.4, 0, .2, 1);
  border-radius: calc(var(--sheet, 48px) * var(--r, 1)) calc(var(--sheet, 48px) * var(--r, 1)) 0 0;
  box-shadow: 0 -30px 60px -36px rgba(20,40,119,.55); clip-path: inset(-90px 0 0 0); }
.sheet::before { content: ''; position: absolute; left: 50%; top: 14px; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px;
  background: rgba(47,49,66,.14); opacity: var(--r, 1); }
.dhero::after, .phero--scene::after { content: ''; position: absolute; inset: 0; background: var(--blue-deep); opacity: calc(var(--fade, 0) * .55); pointer-events: none; }
@media (max-width: 700px) { .sheet { --sheet: 30px; } }

/* ── заголовки: слова из размытия по очереди ── */
.split { animation: none !important; }
.split .w { display: inline-block; opacity: 0; }
.split.in .w { animation: wordIn .9s var(--ease-out) both; animation-delay: calc(var(--d, 0s) + var(--i) * 70ms); }
@keyframes wordIn { from { opacity: 0; filter: blur(14px); transform: translateY(.32em); } to { opacity: 1; filter: none; transform: none; } }

/* ── появление при прокрутке ── */
[data-reveal="up"] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
[data-reveal="up"].in { opacity: 1; transform: none; }
[data-reveal="img"] { overflow: hidden; clip-path: inset(0 0 100% 0 round 28px); transition: clip-path 1.1s cubic-bezier(.65, 0, .25, 1); }
[data-reveal="img"] img { transform: scale(1.14); transition: transform 1.4s var(--ease-out); }
[data-reveal="img"].in { clip-path: inset(0 0 0 0 round 28px); }
[data-reveal="img"].in img { transform: none; }
[data-reveal="list"] > * { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms); }
[data-reveal="list"].in > * { opacity: 1; transform: none; }

/* ── пометки прототипа ── */
.proto-note { font: 500 13px/1.4 var(--text); color: #9C1F52; background: rgba(255,255,255,.9); border: 1.5px dashed #E0447F; border-radius: 10px; padding: 8px 12px; }
.clean .proto-note { display: none; }

@media (max-width: 1360px) { .header__cta { display: none; } } /* заявка — плавающая кнопка внизу экрана; место в шапке — пунктам меню */
@media (max-width: 1200px) { .header { gap: 20px; } .header__tg { margin-right: -10px; } }
@media (max-width: 1020px) { .nav [data-nav="home"] { display: none; } } /* совсем узко — «Главная» в меню-шторке и на логотипе */
/* телефон в шапке: номер текстом, на узком экране — круглая кнопка «позвонить» */
@media (max-width: 1560px) {
  .header__tel { border: 1.5px solid currentColor; border-radius: 999px; }
  .header__tel span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (max-width: 960px) {
  .nav { display: none; }
  .header__cta { display: none; }
  .header { gap: 10px; }
  .header__tg { margin-left: auto; margin-right: 0; }
  .lead__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .burger__text { display: none; }
  .burger { padding: 0 6px; border-color: transparent; }
  .dock { left: var(--gutter); right: var(--gutter); }
  .dock.btn { width: auto; }
  .foot__right { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .veil { display: none; }
  [data-reveal], [data-reveal] > *, [data-reveal] img, .split .w { opacity: 1 !important; transform: none !important; clip-path: none !important; filter: none !important; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
