/* ============================================================
   Направление B «Собеседница» · ДНК 16-okruglyy-gumanist
   cold · light · humanist-rounded · editorial-rail
   Все токены — из manifest.json (залочены)
   ============================================================ */

@import url("fonts/fonts.css");

:root {
  --bg: #F2F5F3;
  --surface: #E8EEEA;
  --panel: #113E2D;
  --panel-text: #E9F2EC;
  --ink: #17211C;
  --ink-soft: #4A5A51;
  --green: #146B4B;
  --coral: #D65438;
  --coral-text: #B23E24;
  --cta-text: #F4FAF6;
  --tint-mint: #E3EFE7;
  --tint-sage: #DCE9E0;
  --tint-coral: #F6E4DC;
  --line: #D5DFD8;

  --font-display: 'Rubik', 'Trebuchet MS', sans-serif;
  --font-body: 'Nunito Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(23,33,28,.05), 0 12px 24px -12px rgba(23,33,28,.14);
  --ease: cubic-bezier(.25,.6,.3,1);

  /* шкала ×1.25, база 18px */
  --fs-0: 1rem;        /* 18px при html 112.5% */
  --fs-1: 1.25rem;
  --fs-2: 1.563rem;
  --fs-3: 1.953rem;
  --fs-4: 2.441rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 112.5%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

::selection { background: var(--green); color: var(--cta-text); }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}

.num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 20px; }

/* ---------- skip-link ---------- */
.skip-link {
  position: absolute; left: 16px; top: -80px;
  background: var(--green); color: var(--cta-text);
  padding: 12px 16px; border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none; z-index: 60;
  transition: top .2s var(--ease);
}
.skip-link:focus-visible { top: 0; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-body); font-weight: 700; font-size: var(--fs-0);
  text-decoration: none;
  transition: transform .15s var(--ease), background-color .15s var(--ease);
}
.btn-solid { background: var(--green); color: var(--cta-text); }
.btn-solid:hover { background: #0F5A3E; }
.btn-solid:active { transform: translateY(1px); }
.btn-lg { padding: 16px 32px; }

/* ---------- шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-size: var(--fs-1);
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand-name b { font-weight: 700; color: var(--green); }
.brand-mark { display: inline-flex; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 44px; min-height: 44px; padding: 8px 12px;
  background: var(--surface); border: 0; border-radius: 999px;
  font-family: var(--font-body); font-weight: 700; font-size: .89rem;
  color: var(--ink); cursor: pointer;
}
.nav-toggle-icon { display: inline-flex; flex-direction: column; gap: 4px; width: 18px; }
.nav-toggle-icon i {
  display: block; height: 2px; border-radius: 999px; background: var(--ink);
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* мобильная панель меню (по умолчанию закрыта, но не display:none-без-замены — открывается бургером) */
.site-nav {
  position: fixed; inset: 64px 0 auto 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 16px 20px 24px;
  display: none;
  z-index: 49;
}
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.site-nav a:not(.btn) {
  display: block; padding: 12px 8px; min-height: 44px;
  color: var(--ink); text-decoration: none;
  font-weight: 600; border-radius: 999px;
}
.site-nav a:not(.btn):hover { color: #0F5A3E; background: var(--surface); }
.btn-login { margin-top: 16px; width: 100%; }

/* ---------- рельс (editorial-rail) — только ≥920px ---------- */
.rail { display: none; }

/* ---------- reveal: единая система (момент движения №1) ---------- */
section[id] { scroll-margin-top: 88px; }

/* канон фермы (assets/оживление.md): CSS scroll-driven, 0 КБ, без JS;
   браузер без поддержки animation-timeline просто показывает секцию статично */
@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 24%;
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- hero ---------- */
.hero { padding: 48px 0 64px; }

.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: .78rem;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
}
.kicker-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral);
}

.hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.3rem);
  font-weight: 700;
  margin-bottom: 20px;
  max-width: 14ch;
}
.lead {
  font-size: var(--fs-1); line-height: 1.55;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 32px;
}

.hero-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }
.cta-note { font-size: .89rem; color: var(--ink-soft); max-width: 24ch; line-height: 1.45; }

.fact-chips {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.fact-chips li {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: .89rem; font-weight: 600;
  color: var(--ink);
}
.fact-chips .num { color: var(--green); font-size: 1rem; }

/* сцена-слот персонажа */
.hero-media { margin-top: 40px; position: relative; }
.scene {
  position: relative;
  background:
    radial-gradient(120% 90% at 85% 12%, rgba(233,242,236,.07), transparent 55%),
    var(--panel);
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  max-width: 420px;
  margin-inline: auto;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid; place-items: center;
  color: var(--panel-text);
}
.scene-inner { text-align: center; padding: 32px; max-width: 32ch; }
.scene-icon { margin-inline: auto; margin-bottom: 16px; opacity: .85; }
.scene-slot { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-1); margin-bottom: 8px; }
.scene-note { font-size: .82rem; line-height: 1.5; opacity: .75; }
.scene-coral {
  position: absolute; right: 24px; bottom: 24px;
  width: 40px; height: 24px; border-radius: 16px 16px 4px 4px;
  background: var(--coral);
}

.chat-chip {
  position: relative;
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  max-width: 340px;
  margin: -48px auto 0;
}
.chip-avatar {
  flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: var(--cta-text);
  font-family: var(--font-display); font-weight: 700;
}
.chip-name { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--green); margin-bottom: 2px; }
.chip-text { display: block; font-size: .89rem; line-height: 1.5; }

/* typing-индикатор (момент движения №2, один фокальный элемент) */
.typing { display: inline-flex; gap: 4px; margin-top: 8px; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); opacity: .25;
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ---------- как это работает ---------- */
.how { padding: 64px 0 80px; background: var(--surface); }
.how .fact-chips li, .how .phone { background: var(--bg); }

.sec-head { margin-bottom: 40px; max-width: 60ch; }
.how h2 { font-size: clamp(1.7rem, 3.6vw, 2.44rem); font-weight: 700; margin-bottom: 16px; }
.sec-lead { color: var(--ink-soft); font-size: var(--fs-1); line-height: 1.55; max-width: 52ch; }

.how-grid { display: grid; gap: 32px; }

/* phone-мокап (нативная вёрстка, не скриншот) */
.phone {
  border-radius: 24px;
  background: var(--bg);
  box-shadow: var(--shadow);
  padding: 16px;
  max-width: 400px;
}
.phone-top {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.phone-ava {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: var(--cta-text);
  font-family: var(--font-display); font-weight: 700; font-size: .89rem;
}
.phone-title { font-weight: 700; font-size: .89rem; margin-right: auto; }
.phone-status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--ink-soft); }
.phone-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.phone-chat { display: flex; flex-direction: column; gap: 8px; }
.msg {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: .89rem; line-height: 1.5;
  max-width: 85%;
}
.msg-fin { background: var(--tint-mint); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg-user { background: var(--panel); color: var(--panel-text); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg-meta { font-size: .78rem; color: var(--ink-soft); padding: 8px 4px 0; }
.msg-meta .num { color: var(--coral-text); font-size: .78rem; }

.mock-note { margin-top: 12px; font-size: .72rem; color: var(--ink-soft); text-align: center; }

/* плитки-шаги (rich-show: тинты + номера + иконки) */
.steps {
  list-style: none;
  display: grid; gap: 16px;
}
.step {
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.step-mint  { background: var(--tint-mint); }
.step-sage  { background: var(--tint-sage); }
.step-coral { background: var(--tint-coral); }

.step-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.step-num { font-size: .89rem; color: var(--green); }
.step-coral .step-num { color: var(--coral-text); }
.step-icon { color: var(--green); }
.step-coral .step-icon { color: var(--coral-text); }
.step h3 { font-size: var(--fs-1); font-weight: 600; margin-bottom: 8px; }
.step p { font-size: .89rem; line-height: 1.5; color: var(--ink-soft); }

/* инверт-плитка результата — ПОСЛЕ общих правил .step (специфичность) */
.step-result { background: var(--panel); }
.step-result h3 { color: var(--panel-text); }
.step-result p { color: #C8DACF; }
.step-result .step-num { color: #A9C4B4; }
.step-result .step-icon { color: var(--panel-text); }

/* ---------- футер ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; }
.footer-row { display: flex; flex-direction: column; gap: 8px; }
.footer-motto { font-family: var(--font-display); font-weight: 600; }
.footer-links a { color: var(--green); font-size: .89rem; }

/* ============================================================
   ≥ 768px
   ============================================================ */
@media (min-width: 768px) {
  .wrap { padding-inline: 32px; }
  .hero { padding: 64px 0 80px; }
  .hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
  .hero-media { margin-top: 0; }
  .chat-chip { margin: -48px 0 0 -24px; }
  .how-grid { grid-template-columns: .9fr 1.1fr; align-items: start; }
  .steps { grid-template-columns: 1fr 1fr; }
  .footer-row { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ============================================================
   ≥ 920px — рельс editorial-rail
   ============================================================ */
@media (min-width: 920px) {
  .rail-grid { display: grid; grid-template-columns: 56px 1fr; gap: 24px; }
  .rail {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding-top: 8px;
  }
  .rail-num { font-family: var(--font-mono); font-size: .78rem; color: var(--green); font-weight: 500; }
  .rail-text {
    writing-mode: vertical-rl;
    font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
    color: var(--ink-soft);
  }
  .rail::after { content: ""; flex: 1; width: 1px; background: var(--line); }
}

/* ============================================================
   ≥ 1024px — десктоп-навигация (бургер скрыт, меню в строку)
   ============================================================ */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static; display: flex; align-items: center; gap: 8px;
    background: transparent; border: 0; box-shadow: none; padding: 0;
  }
  .site-nav ul { flex-direction: row; gap: 4px; }
  .site-nav a:not(.btn) { padding: 8px 12px; min-height: auto; font-size: .89rem; }
  .btn-login { margin: 0 0 0 12px; width: auto; }
  .hero h1 { max-width: 16ch; }
}

/* ============================================================
   prefers-reduced-motion — гасим оба момента
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { animation: none; }
  .typing i { animation: none; opacity: .7; }
  .btn, .skip-link, .nav-toggle-icon i { transition: none; }
}
