/* ============================================================
   lp-avatar-bitrix-b · «Вечерняя смена» — шампань-люкс над продуктом
   ДНК 11-shampan-lyuks · линза stitch-design-taste · commercial
   Токены и численный контраст — см. манифест.md (WCAG AA, все пары)
   ============================================================ */

@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-display-cyrillic-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/playfair-display-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Commissioner";
  src: url("fonts/commissioner-var-cyrillic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Commissioner";
  src: url("fonts/commissioner-var-latin.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

/* ---------- Токены ---------- */
:root {
  --night: #14110C;          /* фон 60% */
  --coal: #211C15;           /* поверхности 30% */
  --coal-2: #2A241B;         /* поверхности: hover/верх панелей */
  --champ: #C8A66A;          /* шампань, S=46%: линии, крупные цифры */
  --champ-hi: #DCC08C;       /* шампань яркая: фокус, hover */
  --ivory: #F2EDE3;          /* текст на тёмном, заливка primary */
  --fog: #BDB3A3;            /* вторичный текст на тёмном */
  --paper: #F7F3EA;          /* светлая тёплая секция */
  --paper-card: #FCFAF4;     /* карточки на светлом */
  --paper-gold: #F1E7D2;     /* изюминка: карточка «Экономия» */
  --p-ink: #26211A;          /* текст на светлом */
  --p-fog: #6B6255;          /* вторичный на светлом */
  --bronze: #8F7038;         /* состаренное золото на светлом, S=44% */

  --hairline: rgba(200, 166, 106, 0.28);
  --hairline-paper: rgba(143, 112, 56, 0.30);

  /* тени: на тёмной теме — никогда чёрные, подтон согласован (§6.3) */
  --shadow-frame: 0 24px 48px -16px rgba(200, 166, 106, 0.14), 0 2px 6px rgba(200, 166, 106, 0.08);
  --shadow-pop: 0 32px 64px -24px rgba(200, 166, 106, 0.16), 0 2px 8px rgba(200, 166, 106, 0.08);

  --font-display: "Playfair Display", "Times New Roman", serif;
  --font-body: "Commissioner", "PT Sans", system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 160ms;
  --t-mid: 240ms;

  --container: 1200px;
  --radius-frame: 12px;
  --radius-card: 8px;
  --radius-btn: 6px;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--night);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* фактура: лёгкий тёплый шум + виньетка 3% (L9, «премиум бесплатно») */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(200, 166, 106, 0.05), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.78 0 0 0 0 0.65 0 0 0 0 0.42 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

header, main, footer, .mobile-menu, .modal { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; display: block; }

::selection { background: rgba(200, 166, 106, 0.32); color: var(--ivory); }

a { color: inherit; }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--champ-hi);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--ivory);
  color: var(--night);
  font-weight: 500;
  border-radius: var(--radius-btn);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Кикер ---------- */
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog);
}
.kicker-line {
  width: 40px;
  height: 1px;
  background: var(--champ);
  flex: none;
}
.kicker-line-bronze { background: var(--bronze); }
.kicker-paper { color: var(--p-fog); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  border: 0;
  border-radius: var(--radius-btn);
  cursor: pointer;
}
.btn-primary {
  background: var(--ivory);
  color: var(--night);
  transition: background-color 200ms var(--ease), transform 100ms var(--ease);
}
.btn-primary:hover { background: var(--champ); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--ivory);
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: box-shadow 200ms var(--ease);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--champ); }
.btn-block { width: 100%; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 17, 12, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200, 166, 106, 0.14);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: 1.375rem;
  letter-spacing: 0.01em;
  color: var(--ivory);
}
.brand-sep {
  width: 1px;
  height: 14px;
  background: var(--champ);
  align-self: center;
}
.brand-sub {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog);
}
.site-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fog);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.site-nav a:hover { color: var(--ivory); }
.site-nav a[aria-current="page"] { color: var(--ivory); }
.site-nav a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 2px;
  background: var(--champ);
}
.btn-login { min-height: 40px; padding: 8px 20px; font-size: 0.9375rem; }

/* ---------- Бургер ---------- */
.burger {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ivory);
  place-items: center;
}
.burger-box { display: block; position: relative; width: 24px; height: 16px; }
.burger-box::before, .burger-box::after, .burger-line {
  content: "";
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--t-mid) var(--ease), opacity var(--t-fast) var(--ease), top var(--t-mid) var(--ease);
}
.burger-box::before { top: 0; }
.burger-line { top: 7px; }
.burger-box::after { top: 14px; }
.burger[aria-expanded="true"] .burger-box::before { top: 7px; transform: rotate(45deg); }
.burger[aria-expanded="true"] .burger-line { opacity: 0; }
.burger[aria-expanded="true"] .burger-box::after { top: 7px; transform: rotate(-45deg); }

/* ---------- Мобильное меню ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: var(--coal);
  padding: 96px 24px 40px;
  overflow-y: auto;
}
.mobile-menu nav { display: flex; flex-direction: column; gap: 8px; max-width: 480px; margin: 0 auto; }
.mobile-menu ul { list-style: none; margin: 0 0 24px; padding: 0; }
.mobile-menu li + li { border-top: 1px solid rgba(200, 166, 106, 0.14); }
.mobile-menu a {
  display: block;
  padding: 16px 4px;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ivory);
  text-decoration: none;
}
.mobile-menu a[aria-current="page"] { color: var(--champ-hi); }
.mobile-menu .btn-login { align-self: flex-start; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 88px;
  background:
    radial-gradient(90% 70% at 78% 18%, rgba(200, 166, 106, 0.06), transparent 60%),
    var(--night);
}
.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  gap: 48px;
}
.hero-copy h1 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-weight: 620;
  /* минимум 2.1rem: при 2.5rem слово «администратором» (≈348px) шире контента 375px-вьюпорта (327px) */
  font-size: clamp(2.1rem, 1.2rem + 4.2vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ivory);
  text-wrap: balance;
}
.hero-lead {
  margin: 0 0 24px;
  max-width: 34em;
  font-size: 1.1875rem;
  line-height: 1.65;
  color: var(--ivory);
}
.hero-solutions {
  margin: 0 0 48px;
  max-width: 34em;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--fog);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }

/* Кадр в рамке браузера */
.hero-frame {
  margin: 0;
  align-self: start;
  background: var(--coal);
  border-radius: var(--radius-frame);
  box-shadow: var(--shadow-frame);
  overflow: hidden;
  transition: box-shadow var(--t-mid) var(--ease);
}
.hero-frame:hover { box-shadow: 0 32px 64px -20px rgba(200, 166, 106, 0.18), 0 2px 8px rgba(200, 166, 106, 0.10); }
.frame-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--coal-2);
  border-bottom: 1px solid rgba(200, 166, 106, 0.14);
}
.frame-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(242, 237, 227, 0.22);
}
.frame-address {
  margin-left: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--fog);
}
.hero-frame img {
  width: 100%;
  aspect-ratio: 1840 / 1150;
  object-fit: cover;
  object-position: top;
  background: #F1F4F8; /* семя продукта: подложка на время загрузки */
  outline: 1px solid rgba(200, 166, 106, 0.10);
  outline-offset: -1px;
}
.frame-caption {
  padding: 12px 16px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--fog);
  border-top: 1px solid rgba(200, 166, 106, 0.14);
}

/* ---------- S2 · Воронка ---------- */
.funnel {
  background: var(--paper);
  color: var(--p-ink);
  padding: 96px 0 104px;
  border-top: 1px solid var(--champ); /* шампань-шов между ночью и бумагой */
}
.funnel-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.section-head { margin-bottom: 48px; }
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 620;
  font-size: clamp(2rem, 1.1rem + 2.8vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--p-ink);
}

.funnel-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 24px;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--paper-card);
  border-radius: var(--radius-card);
  padding: 32px 28px 28px;
}
.step-accent { background: var(--paper-gold); }
.step-num {
  position: absolute;
  top: 24px;
  right: 28px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--bronze);
  opacity: 0.85;
}
.step-name {
  margin: 0 0 16px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p-fog);
}
.step-price { margin: 0 0 16px; }
.step-amount {
  display: block;
  font-family: var(--font-display);
  font-weight: 640;
  font-size: clamp(2.25rem, 1.4rem + 2.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--bronze);
}
.step-term {
  display: block;
  margin-top: 8px;
  font-size: 0.9375rem;
  color: var(--p-fog);
}
.step-facts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.step-facts li {
  padding: 8px 0;
  font-size: 1rem;
  line-height: 1.5;
}
.step-facts li + li { border-top: 1px solid var(--hairline-paper); }

.funnel-more { margin: 40px 0 0; }
.funnel-more a {
  display: inline-flex;
  align-items: center;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--p-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--bronze);
  padding-bottom: 4px;
  transition: color var(--t-fast) var(--ease);
}
.funnel-more a:hover { color: var(--bronze); }

.ai-note {
  margin: 40px 0 0;
  max-width: 46em;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--p-fog);
}

/* ---------- Подвал ---------- */
.site-footer {
  background: var(--night);
  border-top: 1px solid rgba(200, 166, 106, 0.14);
  padding: 40px 0;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 32px;
}
.footer-copy { margin: 0; font-size: 0.875rem; color: var(--ivory); }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
.footer-nav a {
  font-size: 0.875rem;
  color: var(--fog);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--ivory); }
.footer-note { margin: 0 0 0 auto; font-size: 0.8125rem; color: var(--fog); }

/* ---------- Модалка M1 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 13, 10, 0.72); }
.modal-panel {
  position: relative;
  width: min(440px, 100%);
  background: var(--coal);
  border-radius: var(--radius-frame);
  box-shadow: var(--shadow-pop);
  padding: 40px 32px 32px;
}
.modal-panel h2 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-weight: 620;
  font-size: 1.75rem;
  line-height: 1.15;
  color: var(--ivory);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--fog);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}
.modal-close:hover { color: var(--ivory); }
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fog);
}
.form-row input[type="text"],
.form-row input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ivory);
  background: var(--night);
  border: 1px solid rgba(200, 166, 106, 0.28);
  border-radius: var(--radius-btn);
}
.form-row input:focus-visible {
  outline: 2px solid var(--champ-hi);
  outline-offset: 1px;
}
.form-check { display: flex; gap: 12px; align-items: flex-start; }
.form-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--champ);
  flex: none;
}
.form-check label { margin: 0; font-size: 0.875rem; line-height: 1.55; }
.form-check a { color: var(--champ-hi); }
.modal-panel .btn-block { margin-top: 8px; }

body.no-scroll { overflow: hidden; }

/* ---------- Reveal: единая система (1 момент бюджета) ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 28%;
    }
    @keyframes rise {
      from { opacity: 0; transform: translateY(16px); }
      to { opacity: 1; transform: none; }
    }
  }
}

/* Межстраничные переходы (многостраничник, бюджет не расходуют) */
@view-transition { navigation: auto; }

/* ---------- Адаптив ---------- */
@media (max-width: 1023px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); } /* гвардия: длинное слово H1 не растягивает трек */
  .site-nav { display: none; }
  .header-inner .btn-login { display: none; }
  .burger { display: grid; }
  .header-inner { gap: 16px; }
}

@media (min-width: 768px) {
  .hero { padding: 88px 0; }
  .hero-inner { gap: 64px; }
  .funnel-steps { grid-template-columns: repeat(3, 1fr); }
  .step { padding: 40px 32px 36px; }
}

@media (min-width: 1024px) {
  .hero-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; }
  .funnel { padding: 104px 0 112px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { animation: none; }
  .btn-primary, .btn-ghost, .hero-frame, .site-nav a, .funnel-more a { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .burger-box::before, .burger-box::after, .burger-line { transition: none; }
}
