/* ==========================================================================
   Компоненты: кнопки, навигация, меню, диалоги, формы, списки
   ========================================================================== */

/* ---------- Кнопки ---------- */

.btn {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  --btn-bg-hover: var(--accent-hover);
  --btn-icon-bg: #fff;
  --btn-icon-fg: var(--accent);
  --btn-h: 52px;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: var(--btn-h);
  padding: 6px 6px 6px 24px;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease), transform var(--t-fast) var(--ease),
              translate 0.7s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }

.btn__label {
  display: block;
  height: 1.3em;
  line-height: 1.3;
  overflow: hidden;
}
.btn__roll {
  display: flex;
  flex-direction: column;
  transition: transform var(--t-base) var(--ease);
}

.btn__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: calc(var(--btn-h) - 14px);
  height: calc(var(--btn-h) - 14px);
  border-radius: 50%;
  background: var(--btn-icon-bg);
  color: var(--btn-icon-fg);
  transition: transform var(--t-base) var(--ease), background-color var(--t-base) var(--ease);
}
.btn__icon svg { width: 16px; height: 16px; }

/* Кнопка без иконки: симметричные отступы */
.btn:not(:has(.btn__icon)) { padding-inline: 22px; justify-content: center; }

@media (hover: hover) {
  .btn:hover { background: var(--btn-bg-hover); }
  .btn:hover .btn__roll { transform: translateY(-50%); }
  .btn:hover .btn__icon { transform: rotate(-45deg); }
}

.btn:focus-visible { outline-offset: 4px; border-radius: var(--r-pill); }

.btn--dark {
  --btn-bg: var(--ink);
  --btn-bg-hover: #23252b;
  --btn-icon-bg: #fff;
  --btn-icon-fg: var(--ink);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bg-hover: rgba(14, 15, 18, 0.05);
  --btn-icon-bg: var(--ink);
  --btn-icon-fg: #fff;
  border-color: var(--line-strong);
}

.btn--ghost-light {
  --btn-bg: transparent;
  --btn-fg: #fff;
  --btn-bg-hover: rgba(255, 255, 255, 0.08);
  --btn-icon-bg: #fff;
  --btn-icon-fg: var(--ink);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn--sm { --btn-h: 44px; font-size: 0.875rem; padding-left: 20px; }
.btn--lg { --btn-h: 64px; font-size: 1.0625rem; padding-left: 30px; }
.btn--block { width: 100%; }

.btn[disabled], .btn.is-loading { opacity: 0.6; pointer-events: none; }
.btn.is-loading .btn__icon svg { animation: spin 0.9s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.btn--primary:focus-visible, .btn--dark:focus-visible { outline-color: var(--accent); }
.section--pricing .btn:focus-visible,
.footer .btn:focus-visible { outline-color: var(--accent-on-dark); }

/* ---------- Кнопка-ссылка и иконочная ---------- */

.link-btn {
  display: inline;
  padding: 0;
  text-align: left;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity var(--t-fast) var(--ease);
}
@media (hover: hover) { .link-btn:hover { opacity: 0.65; } }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn svg { width: 16px; height: 16px; }
@media (hover: hover) { .icon-btn:hover { background: var(--surface-2); } }
.icon-btn:active { transform: scale(0.94); }

/* ---------- Шапка и навигация ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  padding: 10px 10px 0;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.7s var(--ease-out);
}
/* Шапка уезжает вверх при прокрутке вниз и возвращается при движении вверх */
.site-header.is-hidden { transform: translate3d(0, -120%, 0); }
.site-header__inner {
  max-width: calc(var(--container) - 24px);
  margin-inline: auto;
}

.nav-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border-radius: var(--r-pill);
  box-shadow: 0 0 0 1px rgba(10, 11, 16, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: box-shadow var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.site-header.is-scrolled .nav-pill { box-shadow: var(--shadow-2), 0 0 0 1px rgba(14, 15, 18, 0.05); }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.logo__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
}
.logo__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.logo__word { font-size: 0.9375rem; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.nav-links { display: none; align-items: center; gap: 28px; margin-left: 8px; margin-right: auto; }
.nav-links a {
  position: relative;
  padding-block: 6px;
  font-size: 0.875rem;
  color: var(--ink);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform 0.6s var(--ease-out);
}
.nav-links a[aria-current="true"]::after,
.nav-links a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }

.nav-links .roll { display: inline-block; overflow: hidden; vertical-align: top; padding-block: 0.12em; margin-block: -0.12em; }
.nav-links .roll__t { position: relative; display: block; transition: transform 0.55s var(--ease-out); }
.nav-links .roll__t::after { content: attr(data-t); content: attr(data-t) / ""; position: absolute; left: 0; top: 100%; padding-top: 0.12em; color: var(--accent); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover .roll__t { transform: translateY(-100%); } }

.nav-right { display: none; align-items: center; gap: 16px; }

.status {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.status i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(31, 138, 76, 0.5);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 138, 76, 0.45); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(31, 138, 76, 0); }
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px 0 18px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
}
.menu-toggle__icon { position: relative; width: 14px; height: 10px; }
.menu-toggle__icon i {
  position: absolute; left: 0; width: 100%; height: 1.6px;
  background: currentColor; border-radius: 2px;
  transition: transform var(--t-base) var(--ease), top var(--t-base) var(--ease);
}
.menu-toggle__icon i:nth-child(1) { top: 1px; }
.menu-toggle__icon i:nth-child(2) { top: 8px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:nth-child(1) { top: 4.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:nth-child(2) { top: 4.5px; transform: rotate(-45deg); }

@media (min-width: 768px) {
  .logo__word { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .nav-links { display: flex; }
  .nav-right { display: flex; }
  .menu-toggle { display: none; }
}
@media (min-width: 1100px) {
  .status { display: inline-flex; }
}

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

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  display: flex;
  align-items: flex-end;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear var(--t-slow);
}
.mobile-menu.is-open {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.mobile-menu__backdrop {
  position: absolute; inset: 0;
  background: rgba(14, 15, 18, 0.6);
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-sheet);
}
.mobile-menu.is-open .mobile-menu__backdrop { opacity: 1; }

.mobile-menu__sheet {
  position: relative;
  width: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  margin: 0 12px calc(12px + env(safe-area-inset-bottom));
  overflow-y: auto;
  padding: 20px 20px 20px;
  background: #fff;
  border-radius: var(--r-lg);
  transform: translateY(calc(100% + 24px));
  transition: transform var(--t-slow) var(--ease-sheet);
}
.mobile-menu.is-open .mobile-menu__sheet { transform: translateY(0); }

.mobile-menu__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mobile-menu__title { font-weight: 600; letter-spacing: 0.04em; font-size: 0.9375rem; }

.mobile-menu__links a {
  display: block;
  padding: 10px 0;
  font-size: clamp(1.75rem, 8vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  border-bottom: 1px solid var(--line);
}
.mobile-menu__links li:last-child a { border-bottom: 0; }
.mobile-menu__contact { margin-top: 20px; display: grid; gap: 12px; }
.mobile-menu__note { font-size: var(--fs-small); color: var(--ink-soft); text-align: center; }

/* ---------- Метка секции ---------- */

/* Метка раздела: «зеркальная» стеклянная таблетка с точкой.
   Размытие, светлая кромка сверху, внутренняя тень снизу и блик, который пробегает по стеклу. */
.section-label {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: clamp(24px, 4vw, 44px);
  padding: 10px 18px 10px 15px;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-pill);
  font-size: 0.8125rem; font-weight: 500; line-height: 1; letter-spacing: 0.01em;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.4) 46%, rgba(255, 255, 255, 0.72) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
  box-shadow:
    0 0 0 1px rgba(10, 11, 16, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(10, 11, 16, 0.08),
    0 10px 24px -12px rgba(10, 11, 16, 0.3);
}
.section-label::before { content: ""; flex: none; width: 11px; height: 11px; background: var(--accent); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
/* Блик */
.section-label::after {
  content: ""; position: absolute; z-index: -1; inset: -2px auto -2px 0; width: 55%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.95) 50%, transparent);
  transform: translateX(-140%) skewX(-18deg);
}
.js .section-label.is-visible::after { animation: label-sheen 1.8s var(--ease-out) 0.5s 1 both; }
@media (hover: hover) { .section-label:hover::after { animation: label-sheen 1.4s var(--ease-out) 1 both; } }
@keyframes label-sheen { from { transform: translateX(-140%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }

.section-label--light {
  color: var(--on-dark);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.05) 48%, rgba(255, 255, 255, 0.16) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 12px 28px -12px rgba(0, 0, 0, 0.6);
}
.section-label--light::before { background: var(--sky); }
.section-label--light::after { background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5) 50%, transparent); }
@media (prefers-reduced-motion: reduce) { .section-label::after { display: none; } }

/* ---------- Списки ---------- */

.dash-list li, .check-list li, .minus-list li {
  position: relative;
  padding-left: 22px;
  line-height: 1.5;
}
.dash-list li + li, .check-list li + li, .minus-list li + li { margin-top: 10px; }

.dash-list li::before {
  content: ""; position: absolute; left: 0; top: 0.75em;
  width: 10px; height: 1.5px; background: currentColor; opacity: 0.5;
}
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.35em;
  width: 12px; height: 8px;
  border-left: 1.8px solid var(--accent-on-dark);
  border-bottom: 1.8px solid var(--accent-on-dark);
  transform: rotate(-45deg) scale(0.9);
}
.minus-list li { color: var(--on-dark-soft); }
.minus-list li::before {
  content: ""; position: absolute; left: 0; top: 0.75em;
  width: 10px; height: 1.5px; background: currentColor;
}

/* ---------- Формы ---------- */

.form { display: grid; gap: 18px; }
.form__row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 8px; }
.field__label { font-size: 0.8125rem; font-weight: 500; }
.field__label em { font-style: normal; font-weight: 400; color: var(--ink-soft); margin-left: 6px; }

.field__input {
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fff;
  font-size: 1rem; /* 16px: без автозума в iOS */
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field__input::placeholder { color: #8a8d95; }
.field__input:hover { border-color: var(--ink-soft); }
.field__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* Длинный placeholder сам «прокручивается», если не помещается в поле */
.ph-wrap { position: relative; display: block; }
.ph-marquee { position: absolute; inset: 0 14px 0 19px; display: flex; align-items: center; visibility: hidden; overflow: hidden; pointer-events: none; color: #8a8d95; font-size: 1rem; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent); }
.ph-marquee span { display: block; white-space: nowrap; animation: ph-scroll 7s ease-in-out infinite alternate; animation-play-state: paused; }
.ph-wrap.is-marquee .field__input::placeholder { color: transparent; }
.ph-wrap.is-marquee .ph-marquee { visibility: visible; }
.ph-wrap.is-marquee .ph-marquee span { animation-play-state: running; will-change: transform; }
.ph-wrap.is-marquee .field__input:not(:placeholder-shown) + .ph-marquee { visibility: hidden; }
@keyframes ph-scroll { 0%, 22% { transform: none; } 78%, 100% { transform: translate3d(var(--shift, 0), 0, 0); } }
@media (prefers-reduced-motion: reduce) { .ph-marquee span { animation: none; } }

.field__textarea { min-height: 120px; resize: vertical; }
.field__input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(200, 53, 47, 0.12); }

.field__error { min-height: 0; font-size: 0.8125rem; color: var(--error); }
.field__error:empty { display: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.check__box {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: transparent;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.check__box svg { width: 14px; height: 14px; }
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); color: #fff; }
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check__text { font-size: 0.8125rem; line-height: 1.5; color: var(--ink-soft); }
.check__text a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.form__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.form__status { min-height: 1.4em; font-size: 0.9375rem; }
.form__status.is-error { color: var(--error); }
.form__status.is-success { color: var(--success); }

/* ---------- Диалоги ---------- */

.dialog {
  width: min(560px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: #fff;
  color: var(--ink);
  overflow: visible;
}
.dialog--project { width: min(1080px, calc(100% - 24px)); }
.dialog::backdrop { background: rgba(14, 15, 18, 0.6); }
.dialog[open] { animation: dialog-in var(--t-base) var(--ease-sheet); }
.dialog[open]::backdrop { animation: fade-in var(--t-base) var(--ease); }

@keyframes dialog-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.dialog__panel {
  position: relative;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 28px 24px 24px;
  border-radius: var(--r-lg);
}
.dialog__panel--wide { padding: 0; }
.dialog__close { position: absolute; top: 14px; right: 14px; z-index: 2; background: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-1); }
.dialog__title { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; padding-right: 48px; }
.dialog__lead { margin: 10px 0 24px; color: var(--ink-soft); }

@media (min-width: 640px) { .dialog__panel { padding: 36px 36px 32px; } .dialog__panel--wide { padding: 0; } }

@media (max-width: 639px) {
  .dialog { margin: auto 12px 12px; width: calc(100% - 24px); }
}

/* ---------- FAQ (details) ---------- */

.faq__item { border-top: 1px solid var(--line-dark); }
.faq__item:last-child { border-bottom: 1px solid var(--line-dark); }
.faq__item summary {
  position: relative;
  padding: 20px 40px 20px 0;
  font-size: 1.0625rem;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "";
  position: absolute; right: 4px; top: 50%;
  width: 10px; height: 10px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform var(--t-base) var(--ease);
}
.faq__item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq__item p { padding: 0 40px 22px 0; color: var(--on-dark-soft); max-width: 70ch; }

/* ---------- Cookie ---------- */

.cookie {
  position: fixed;
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: var(--z-cookie);
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin-inline: auto;
  padding: 18px 20px;
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  animation: dialog-in var(--t-slow) var(--ease-sheet);
}
.cookie__text { font-size: 0.875rem; line-height: 1.5; }
.cookie__text a { text-decoration: underline; text-underline-offset: 2px; }
.cookie__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie .btn--ghost { --btn-fg: #fff; border-color: rgba(255, 255, 255, 0.3); --btn-bg-hover: rgba(255, 255, 255, 0.08); }
@media (min-width: 720px) { .cookie { grid-template-columns: 1fr auto; align-items: center; } }
