/* Справочник нотариуса — лендинг.
   Все значения взяты из скилла landing-page-design: размеры шрифта — шкала Tailwind,
   отступы — таблица B2, скругления — значения Tailwind, движение — кривая B7.
   Цвета — палитра самого справочника (server/page/common/common.css). */

:root {
  color-scheme: light;

  /* Цвета */
  --bg: #ffffff;
  --surface: #f2f2f2;
  --soft: #eaeaea;
  --line: #e0e0e0;
  --text: #262626;
  --muted: #5c5c5c;
  --brand: #234177;
  --brand-hover: #1b3360;
  --brand-tint: #eef1f7;
  --gold: #f7b500;
  --gold-tint: #fff7e0;
  --heading: #9c1b38;
  --error: #9c1b38;
  --error-tint: #f9edf0;

  /* Отступы B2 */
  --s-25: 2px;
  --s-50: 4px;
  --s-75: 8px;
  --s-100: 12px;
  --s-200: 16px;
  --s-300: 24px;
  --s-400: 32px;
  --s-500: 40px;
  --s-600: 48px;
  --s-700: 64px;
  --s-800: 80px;
  --s-900: 96px;

  /* Скругления Tailwind */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --r-3xl: 24px;
  --r-full: 9999px;

  /* Движение B7 */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --move: 500ms;
  --fade: 300ms;

  --font: "Manrope", system-ui, sans-serif;
}

/* Основа */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--s-900); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p, li, dd, dt, blockquote, figcaption { text-wrap: pretty; }
p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--brand); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--s-200); }
.container--narrow { max-width: 800px; }
@media (min-width: 768px) { .container { padding: 0 var(--s-300); } }

/* Пропуск к содержанию */
.skip {
  position: fixed; top: var(--s-200); left: var(--s-200); z-index: 100;
  padding: var(--s-75) var(--s-100); border-radius: var(--r-lg);
  background: var(--brand); color: #fff; font-weight: 600; text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--move) var(--ease);
}
.skip:focus { transform: none; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-75);
  min-height: 40px; padding: var(--s-75) var(--s-100);
  border: 1px solid var(--brand); border-radius: var(--r-lg);
  background: var(--brand); color: #fff;
  font: inherit; font-size: 16px; line-height: 24px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background-color var(--fade) var(--ease), transform var(--move) var(--ease);
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:hover .ph-arrow-right { transform: translateX(var(--s-50)); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.btn .ph { font-size: 20px; transition: transform var(--move) var(--ease); }
.btn--sm { font-size: 14px; line-height: 20px; min-height: 36px; padding: var(--s-75) var(--s-100); }
.btn--lg { padding: var(--s-100) var(--s-300); }

/* Меню: плавающая капсула */
.nav {
  position: fixed; top: var(--s-200); left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; padding: 0 var(--s-200);
  pointer-events: none;
}
.nav__bar {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--s-300);
  padding: var(--s-75) var(--s-75) var(--s-75) var(--s-200);
  border: 1px solid rgba(0, 0, 0, 0.08); border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(35, 65, 119, 0.08);
}
.nav__links { display: none; gap: var(--s-50); }
.nav__links a, .menu__list a:not(.btn) {
  display: block; color: var(--text); text-decoration: none; font-weight: 500;
  transition: background-color var(--fade) var(--ease), color var(--fade) var(--ease);
}
.nav__links a { font-size: 14px; line-height: 20px; padding: var(--s-75) var(--s-100); border-radius: var(--r-full); }
.nav__links a:hover { background: var(--soft); }
.nav__links a[aria-current="true"] { background: var(--brand-tint); color: var(--brand); }
.nav__cta { display: none; border-radius: var(--r-full); }

.brand { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; font-weight: 700; }
.brand__name { font-size: 18px; line-height: 28px; letter-spacing: -0.025em; white-space: nowrap; }

.nav__toggle {
  display: grid; place-content: center; gap: var(--s-75);
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--r-full);
  background: var(--soft); cursor: pointer;
  transition: background-color var(--fade) var(--ease), transform var(--move) var(--ease);
}
.nav__toggle:active { transform: scale(0.98); }
.nav__line {
  display: block; width: 16px; height: 2px; border-radius: var(--r-full); background: var(--text);
  transition: transform var(--move) var(--ease);
}
.nav__toggle[aria-expanded="true"] .nav__line:first-child { transform: translateY(5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__line:last-child { transform: translateY(-5px) rotate(-45deg); }

@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__cta { display: inline-flex; }
  .nav__toggle { display: none; }
}

/* Меню на телефоне: панель на весь экран */
.menu {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  opacity: 0; transition: opacity var(--fade) var(--ease);
}
.menu.is-open { opacity: 1; }
.menu__list { display: grid; gap: var(--s-300); text-align: center; }
.menu__list li { opacity: 0; transform: translateY(var(--s-300)); transition: opacity var(--move) var(--ease), transform var(--move) var(--ease); }
.menu.is-open .menu__list li { opacity: 1; transform: none; }
.menu.is-open .menu__list li:nth-child(2) { transition-delay: 60ms; }
.menu.is-open .menu__list li:nth-child(3) { transition-delay: 120ms; }
.menu.is-open .menu__list li:nth-child(4) { transition-delay: 180ms; }
.menu__list a:not(.btn) { font-size: 24px; line-height: 32px; font-weight: 600; padding: var(--s-75) var(--s-200); border-radius: var(--r-lg); }
.menu__list a[aria-current="true"] { color: var(--brand); background: var(--brand-tint); }
@media (min-width: 900px) { .menu { display: none !important; } }

/* Общие блоки */
.section { padding: var(--s-700) 0; }
.section--surface { background: var(--surface); }
@media (min-width: 768px) { .section { padding: var(--s-900) 0; } }

.section__head { max-width: 680px; margin-bottom: var(--s-500); }
.eyebrow { margin-bottom: var(--s-100); color: var(--brand); font-size: 14px; line-height: 20px; font-weight: 600; }
.section__title { font-size: 30px; line-height: 36px; letter-spacing: -0.025em; }
@media (min-width: 768px) { .section__title { font-size: 36px; line-height: 40px; } }
.section__lead { margin-top: var(--s-200); color: var(--muted); font-size: 18px; line-height: 28px; }

.card {
  padding: var(--s-300);
  border: 1px solid var(--line); border-radius: var(--r-2xl);
  background: var(--bg);
}
@media (min-width: 768px) { .card { padding: var(--s-400); } }
.card__title { font-size: 20px; line-height: 28px; }
.card__text { margin-top: var(--s-75); color: var(--muted); }

.icon-tile {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: var(--s-200);
  border-radius: var(--r-lg); background: var(--brand-tint); color: var(--brand); font-size: 24px;
}

.tag {
  display: inline-block; margin-right: var(--s-75); padding: var(--s-25) var(--s-75);
  border-radius: var(--r-sm); background: var(--gold); color: var(--text);
  font-size: 12px; line-height: 16px; font-weight: 700; vertical-align: 2px;
}

.list { display: grid; gap: var(--s-100); margin-top: var(--s-200); }
.list li { display: flex; gap: var(--s-100); align-items: flex-start; }
.list .ph { flex: none; margin-top: var(--s-50); font-size: 16px; }
.list--bad .ph { color: var(--error); }
.list--good .ph { color: var(--brand); }
.list--bad li { color: var(--muted); }

/* Первый экран */
.hero { padding: var(--s-900) 0 var(--s-700); text-align: center; }
@media (min-width: 768px) { .hero { padding-bottom: var(--s-900); } }
.hero__inner { display: flex; flex-direction: column; align-items: center; padding-top: var(--s-400); }
@media (min-width: 768px) { .hero__inner { padding-top: var(--s-600); } }
.product {
  display: inline-flex; align-items: center; gap: var(--s-75);
  margin-bottom: var(--s-300); padding: var(--s-50) var(--s-100) var(--s-50) var(--s-50);
  border: 1px solid var(--line); border-radius: var(--r-full);
  font-size: 14px; line-height: 20px; font-weight: 600;
}
.product__mark {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-full);
  background: var(--brand); color: var(--gold); font-size: 14px; line-height: 20px;
}
.hero__title {
  max-width: 680px;
  font-size: 30px; line-height: 36px; letter-spacing: -0.025em; font-weight: 700;
  background: linear-gradient(90deg, #000000, #666666);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (min-width: 768px) { .hero__title { font-size: 48px; line-height: 1; padding-bottom: var(--s-50); } }
.hero__lead { max-width: 680px; margin-top: var(--s-300); color: var(--muted); font-size: 18px; line-height: 28px; }
.hero__actions { display: flex; flex-direction: column; align-items: center; gap: var(--s-100); margin-top: var(--s-400); }

/* Первый экран: звезда, спираль из букв, цитата (hero-swarm.js) */
.hero { position: relative; overflow: hidden; }
.hero__inner, .stage, .hero__stats { position: relative; z-index: 1; }
.swarm { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.stage { display: grid; place-items: center; height: 420px; margin-top: var(--s-400); }
@media (max-width: 767px) { .stage { height: 400px; } }

.star {
  position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px;
  opacity: 0; filter: drop-shadow(0 0 12px rgba(247, 181, 0, 0.9)); pointer-events: none;
}
.star.is-lit { animation: star 1.8s var(--ease) forwards; }
@keyframes star {
  0% { opacity: 0; transform: scale(0) rotate(-45deg); }
  45% { opacity: 1; transform: scale(1) rotate(0deg); }
  70% { opacity: 1; transform: scale(0.8) rotate(10deg); }
  100% { opacity: 0; transform: scale(3) rotate(45deg); }
}

.quote-card {
  position: relative; isolation: isolate;
  max-width: 760px; margin: 0 var(--s-200); padding: var(--s-400);
  border-radius: var(--r-2xl); text-align: left;
}
@media (max-width: 767px) { .quote-card { padding: var(--s-300) var(--s-200); } }
.quote-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border: 1px solid var(--line); border-radius: inherit; background: var(--bg);
  box-shadow: 0 24px 64px rgba(35, 65, 119, 0.12);
  transition: opacity 600ms var(--ease);
}
.quote-card > * { transition: opacity 600ms var(--ease); }
.quote-card .tag { margin-bottom: var(--s-200); }
.quote-card__text { color: var(--text); font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.025em; }
@media (max-width: 767px) { .quote-card__text { font-size: 20px; line-height: 28px; letter-spacing: 0; } }
.quote-card__line { display: block; white-space: nowrap; }
.quote-card mark { position: relative; background: none; color: inherit; }
.quote-card mark::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 4px;
  border-radius: var(--r-full); background: var(--gold);
  transition: transform 800ms var(--ease);
  transform-origin: left;
}
.quote-card__source {
  display: inline-flex; align-items: center; gap: var(--s-50); margin-top: var(--s-200);
  color: var(--brand); font-size: 14px; line-height: 20px; text-decoration: underline; text-underline-offset: 3px;
}
/* Пока буквы не собрались, карточка скрыта */
.js .quote-card::before, .js .quote-card > * { opacity: 0; }
.js .quote-card mark::after { transform: scaleX(0); }
.js .quote-card.is-shown::before, .js .quote-card.is-shown > * { opacity: 1; }
.js .quote-card.is-shown mark::after { transform: scaleX(1); transition-delay: 600ms; }
.quote-card.is-shown .tag { transition-delay: 200ms; }
.quote-card.is-shown .quote-card__source { transition-delay: 900ms; }

/* Цифры на первом экране */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-100); width: 100%; margin-top: var(--s-600); text-align: left; }
@media (min-width: 768px) { .stats { gap: var(--s-300); } }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { display: flex; flex-direction: column; padding: var(--s-200); }
@media (min-width: 768px) { .stat { padding: var(--s-300); } }
.stat__value { order: -1; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.025em; color: var(--brand); white-space: nowrap; }
@media (min-width: 768px) { .stat__value { font-size: 36px; line-height: 40px; } }
.stat__label { margin-top: var(--s-75); font-weight: 500; font-size: 14px; line-height: 20px; }
@media (min-width: 768px) { .stat__label { font-size: 16px; line-height: 24px; } }

/* Ролик */
.video {
  overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-2xl);
  background: var(--bg);
  box-shadow: 0 24px 64px rgba(35, 65, 119, 0.12);
}
.video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* Окно справочника (страница 404) */
.app {
  width: 100%; max-width: 760px; margin-top: var(--s-600);
  border: 1px solid var(--line); border-radius: var(--r-2xl);
  background: var(--bg); text-align: left; overflow: hidden;
  box-shadow: 0 24px 64px rgba(35, 65, 119, 0.12);
}
.app__bar { padding: var(--s-100) var(--s-300); background: var(--brand); color: #fff; box-shadow: inset 0 -4px 0 var(--gold); }
.app__title { display: block; padding-bottom: var(--s-50); font-size: 14px; line-height: 20px; font-weight: 600; }
.app__body { display: grid; gap: var(--s-200); padding: var(--s-300); }
@media (min-width: 768px) { .app__body { padding: var(--s-400); } }

.bubble {
  justify-self: end; max-width: 520px; padding: var(--s-100) var(--s-200);
  border-radius: var(--r-2xl); background: var(--soft);
  font-size: 14px; line-height: 20px;
}
@media (min-width: 768px) { .bubble { font-size: 16px; line-height: 24px; } }

.answer__verdict { font-weight: 600; font-size: 14px; line-height: 20px; }
@media (min-width: 768px) { .answer__verdict { font-size: 16px; line-height: 24px; } }

/* Проблема и решение */
.compare { display: grid; gap: var(--s-200); }
@media (min-width: 768px) { .compare { grid-template-columns: 1fr 1fr; gap: var(--s-300); } }
.compare__card--good { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

/* Большая фраза */
.tagline { padding: var(--s-900) 0; }
.tagline__text {
  max-width: 680px; margin: 0 auto;
  font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance;
}
@media (min-width: 768px) { .tagline__text { font-size: 48px; line-height: 1; } }
.tagline__word { opacity: 0.3; transition: opacity var(--move) var(--ease); }
.tagline__word.is-on { opacity: 1; }

/* Шаги */
.steps { display: grid; gap: var(--s-200); counter-reset: step; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-300); } }
.step__num {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: var(--s-200);
  border-radius: var(--r-full); background: var(--brand); color: #fff; font-weight: 700;
}

/* Заявка */
.request { display: grid; gap: var(--s-500); }
@media (min-width: 1024px) { .request { grid-template-columns: 1fr 1fr; gap: var(--s-700); padding: var(--s-600); } }
.request__text { margin-top: var(--s-200); color: var(--muted); font-size: 18px; line-height: 28px; }
.request .list { margin-top: var(--s-300); }

.form { display: grid; gap: var(--s-200); }
.field { display: grid; gap: var(--s-75); }
.field label { font-weight: 600; font-size: 14px; line-height: 20px; }
.field__optional { color: var(--muted); font-weight: 400; }
.field input:not([type="checkbox"]) {
  width: 100%; min-height: 48px; padding: var(--s-100) var(--s-200);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg); color: var(--text); font: inherit;
  transition: border-color var(--fade) var(--ease);
}
.field input::placeholder { color: #9a9a9a; }
.field input:hover { border-color: #b8b8b8; }
.field input:focus-visible { border-color: var(--brand); outline: 2px solid var(--gold); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field__error, .form__error { color: var(--error); font-size: 14px; line-height: 20px; }
.form__error { padding: var(--s-75) var(--s-100); border: 1px solid #ebc4cd; border-radius: var(--r-lg); background: var(--error-tint); }
.check { display: flex; align-items: flex-start; gap: var(--s-100); font-weight: 400 !important; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: var(--s-25) 0 0; accent-color: var(--brand); }
.form__submit { width: 100%; }

.success { display: grid; align-content: center; justify-items: start; }

/* Подвал */
.footer { padding: var(--s-700) 0 var(--s-400); border-top: 1px solid var(--line); background: var(--surface); }
.footer__inner { display: grid; gap: var(--s-500); }
@media (min-width: 768px) { .footer__inner { grid-template-columns: 2fr 1fr 1fr; gap: var(--s-400); } }
.footer__note { max-width: 360px; margin-top: var(--s-100); color: var(--muted); font-size: 14px; line-height: 20px; }
.footer__label { margin-bottom: var(--s-100); color: var(--muted); font-size: 14px; line-height: 20px; font-weight: 600; }
.footer__list { display: grid; gap: var(--s-75); }
.footer__list a {
  display: inline-flex; align-items: center; gap: var(--s-75);
  color: var(--text); font-weight: 500; text-decoration: none;
  transition: color var(--fade) var(--ease);
}
.footer__list a:hover { color: var(--brand); }
.footer__list .ph { font-size: 20px; color: var(--brand); }
.footer__bottom {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-100) var(--s-300);
  padding-top: var(--s-300); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px; line-height: 20px;
}
.footer__bottom p:first-child { max-width: 680px; }

/* Появление секций при прокрутке */
.js [data-reveal] { opacity: 0; transform: translateY(var(--s-400)); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Меньше движения: только смена прозрачности */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-property: opacity, background-color, color, border-color !important; animation: none !important; }
  .js [data-reveal], .menu__list li { transform: none !important; }
  .star { display: none; }
  .btn:active { transform: none; }
}
