/*
 * Общие стили страниц лендинга, кроме утилит Tailwind.
 *
 * Палитра — из приложения (frontend/app/globals.css), чтобы человек из
 * рекламы попадал в тот же продукт, что видел на странице. Радиусы: карточки
 * и чат 20px, поля и кнопки 10px, метки — полностью скруглённые, листы
 * документов 6px.
 */

:root {
  --bg: #FCFAF8;
  --soft: #F6F3EE;
  --paper: #FFFFFF;
  --ink: #2A2725;
  --ink-2: #5C554F;
  --ink-3: #8A837C;
  --border: #EBE6E0;
  --border-2: #F2EEE9;
  --pine: #1A4731;
  --pine-2: #265E42;
  --pine-soft: #E8EFEA;
  --mint: #C6D9C9;
  --mint-text: #3F6B51;
  --ochre: #D9B97A;
  --ochre-bg: #F5ECD6;
  --ochre-text: #8A6A2B;
  --ivory: #F6F3EE;
  --shadow-card: 0 1px 2px rgba(42, 39, 37, 0.04), 0 18px 40px -24px rgba(42, 39, 37, 0.22);
  --shadow-paper: 0 1px 1px rgba(42, 39, 37, 0.05), 0 12px 32px -12px rgba(42, 39, 37, 0.18);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  /* Стекло и сияние — светлая тема дашборда приложения (frontend/app/globals.css). */
  --glass-fill: rgba(255, 255, 255, 0.52);
  --glass-fill-strong: rgba(255, 255, 255, 0.78);
  --glass-inset: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-edge: rgba(42, 39, 37, 0.07);
  --glass-highlight: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 1px 2px rgba(42, 39, 37, 0.04), 0 24px 48px -32px rgba(42, 39, 37, 0.3);
  --glass-sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.1) 55%, rgba(232, 239, 234, 0.45) 100%);
  --glass-glow: rgba(26, 71, 49, 0.16);
  --aurora-a: rgba(168, 204, 179, 0.8);
  --aurora-b: rgba(238, 214, 165, 0.72);
  --aurora-c: rgba(193, 212, 232, 0.7);
}

html, body { overflow-x: hidden; width: 100%; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
::selection { background: #E5D8C5; color: var(--ink); }
.tabular-nums { font-variant-numeric: tabular-nums; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

/* Бумажное зерно — в тон иллюстрациям. Неподвижный слой, не на прокрутке. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  background-image: 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%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 120ms var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-pine { background: var(--pine); color: var(--ivory); }
.btn-pine:hover { background: var(--pine-2); }
.btn-ivory { background: var(--ivory); color: var(--pine); }
.btn-ivory:hover { background: #FFFFFF; }
.btn-ghost { border: 1px solid var(--border); background: var(--paper); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }

/* ── Общая навигация ──────────────────────────────────────────────────── */

.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.site-nav { display: flex; align-items: center; justify-content: center; gap: 28px; margin-left: auto; }
.site-nav__link {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 15px;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
}
.site-nav__link:hover, .site-nav [aria-current="page"],
.site-nav__features[data-current-feature] > summary { color: var(--pine); }
.site-nav [aria-current="page"] { font-weight: 600; }
.site-nav__features { position: relative; }
.site-nav__features > summary { list-style: none; }
.site-nav__features > summary::-webkit-details-marker { display: none; }
.site-nav__features[open] .site-nav__chevron { transform: rotate(180deg); }
.site-nav__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: -16px;
  width: 260px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
}
.site-nav__dropdown a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.site-nav__dropdown a:hover, .site-nav__dropdown a[aria-current="page"] { background: var(--pine-soft); color: var(--pine); }
.site-header__cta { flex: none; margin-left: auto; padding: 11px 16px; font-size: 14px; }
.site-header__toggle { display: none; }
.site-header__close-icon { display: none; }

@media (max-width: 767px) {
  .site-header__inner { flex-wrap: wrap; gap: 8px; padding-inline: 12px; }
  .site-header__inner > a[aria-label] { gap: 6px; }
  .site-header__inner > a[aria-label] > svg { width: 28px; height: 28px; }
  .site-header__inner > a[aria-label] > span { font-size: 19px; }
  .site-header__cta { padding: 11px; font-size: 13px; }
  .js .site-header__toggle { display: grid; place-items: center; flex: none; width: 36px; height: 44px; border-radius: 8px; color: var(--ink); }
  .site-header__toggle:hover { background: var(--pine-soft); }
  .site-header__toggle[aria-expanded="true"] .site-header__menu-icon { display: none; }
  .site-header__toggle[aria-expanded="true"] .site-header__close-icon { display: block; }
  .site-nav { order: 3; flex-direction: column; align-items: stretch; gap: 0; width: 100%; margin: 0; padding: 12px; border-top: 1px solid var(--border); }
  .js .site-nav { display: none; position: absolute; top: 100%; left: 0; max-height: calc(100dvh - 64px); overflow-y: auto; background: var(--bg); box-shadow: var(--shadow-card); }
  .js .site-nav[data-open] { display: flex; }
  .site-nav__link { padding: 8px 12px; }
  .site-nav__features > summary { justify-content: space-between; }
  .site-nav__dropdown { position: static; width: auto; margin: 4px 12px 8px; padding: 4px; box-shadow: none; }
}

/* ── Чат ГосПилота ────────────────────────────────────────────────────── */

.gp-chat {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  padding: 18px;
}
.gp-chat__log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 260px;
  overflow-y: auto;
}
.gp-msg { display: flex; gap: 10px; align-items: flex-start; animation: gp-msg-in 260ms var(--ease-out) both; }
.gp-msg--lead { animation: none; }
.gp-msg__orb { flex: none; margin-top: 1px; }
.gp-msg--pilot .gp-msg__orb[data-orb-size="20"] { margin-top: 2px; }
.gp-msg__name { font-size: 13px; font-weight: 600; color: var(--pine); }
.gp-msg__status { font-weight: 500; color: var(--ink-2); }
.gp-msg__status:not(:empty)::before { content: '·'; margin: 0 6px; color: var(--ink-3); }
.gp-msg__text { font-size: 15px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.gp-msg--user { justify-content: flex-end; }
.gp-msg--user .gp-msg__text {
  max-width: 85%;
  border-radius: 14px 14px 4px 14px;
  background: var(--pine-soft);
  padding: 8px 12px;
  overflow-wrap: anywhere;
}
@keyframes gp-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.gp-chat__composer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  padding: 6px 6px 6px 14px;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.gp-chat__composer:focus-within { border-color: var(--pine); box-shadow: 0 0 0 3px rgba(26, 71, 49, 0.12); }
.gp-chat__composer input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 0;
  font-size: 16px;
  color: var(--ink);
  outline: none;
}
.gp-chat__composer input::placeholder { color: var(--ink-3); }
.gp-chat__send {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--pine);
  color: var(--ivory);
  transition: background-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.gp-chat__send:hover { background: var(--pine-2); }
.gp-chat__send:active { transform: scale(0.96); }
.gp-chat[aria-busy="true"] .gp-chat__composer { opacity: 0.55; pointer-events: none; }
.gp-chat[aria-busy="true"] .gp-chat__actions { opacity: 0.55; pointer-events: none; }

.gp-chat__hint { margin-top: 8px; font-size: 13px; color: var(--ochre-text); }
.gp-chat__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--paper);
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.gp-chip:hover { border-color: var(--ink-3); }
.gp-chip--primary { border-color: var(--pine); background: var(--pine); color: var(--ivory); }
.gp-chip--primary:hover { background: var(--pine-2); border-color: var(--pine-2); }
.gp-chat__note { margin-top: 12px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }

/* Переход в приложение: чат раскрывается на весь экран цветом приложения. */
.gp-handoff {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: clip-path 560ms var(--ease-out);
}
.gp-handoff.is-open { clip-path: inset(0 0 0 0 round 0) !important; }
.gp-handoff__inner { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 0 24px; }
.gp-handoff__title { font-family: 'Literata', Georgia, serif; font-size: 26px; color: var(--ink); }
.gp-handoff__note { font-size: 14px; color: var(--ink-2); }

/* ── Сцена: анкета заполняется ───────────────────────────────────────── */

.scene { position: relative; }
/* Рамка — то же стекло, что у чата (glass-panel + glass-hero дашборда). */
.scene-doc {
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background: var(--glass-sheen), var(--glass-fill);
  padding: 14px;
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 1px var(--glass-edge), var(--glass-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}
.scene-doc__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 6px 12px;
  font-size: 13px;
  color: var(--ink-2);
}
.scene-doc__file { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; color: var(--ink); }
.scene-doc__file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-doc__page {
  position: relative;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-paper);
  padding: 28px 28px 24px 52px;
  font-family: 'Times New Roman', Times, serif;
  color: #1F1D1B;
}
.scene-doc__title { text-align: center; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.scene-doc__sub { margin-top: 2px; text-align: center; font-size: 12px; color: #5F5A55; }
.scene-doc__table { width: 100%; margin-top: 18px; border-collapse: collapse; table-layout: fixed; font-size: 13px; line-height: 1.35; }
.scene-doc__table td { overflow-wrap: anywhere; }
.scene-doc__table th,
.scene-doc__table td { border: 1px solid #D9D3CC; padding: 7px 9px; text-align: left; vertical-align: top; }
.scene-doc__table th { width: 42%; font-weight: 400; }
.scene-val { display: block; min-height: 1.35em; transition: color 300ms var(--ease-out), background-color 600ms var(--ease-out); border-radius: 2px; }
.scene-src {
  display: inline-block;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--pine-soft);
  padding: 1px 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--mint-text);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
}
.scene-src--answer { background: #EEF0EC; color: var(--ink-2); }
.scene-src--ask { background: var(--ochre-bg); color: var(--ochre-text); }

/* JS «взводит» сцену: без скрипта видна заполненная анкета. */
.scene.is-armed [data-scene-row]:not(.is-filled) .scene-val { color: transparent; background: repeating-linear-gradient(90deg, #CFC8C0 0 6px, transparent 6px 9px) left 1.15em / 100% 1px no-repeat; }
.scene.is-armed [data-scene-row]:not(.is-filled) .scene-src { opacity: 0; transform: translateY(4px); }
.scene [data-scene-row].is-flash .scene-val { background-color: var(--pine-soft); }

/* Сцены-результаты (паспорт, досье, сверка, лента): строки появляются. */
.scene-step { transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out); }
.scene.is-armed .scene-step:not(.is-filled) { opacity: 0; transform: translateY(6px); }
.scene.is-armed tr.scene-step:not(.is-filled) { transform: none; }

.scene-doc__page--ui { padding: 22px 22px 22px 52px; font-family: 'Inter', system-ui, sans-serif; color: var(--ink); }
.scene-k { font-size: 12px; line-height: 1.4; color: var(--ink-2); }
.scene-k--section { margin-top: 18px; }
.scene-step--section { margin-top: 16px; }
.scene-title { margin: 2px 0 4px; font-family: 'Literata', Georgia, serif; font-size: 19px; font-weight: 500; line-height: 1.25; color: var(--ink); }

.scene-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border);
}
.scene-kv > div { background: var(--paper); padding: 9px 12px; }
.scene-kv dt { font-size: 12px; color: var(--ink-2); }
.scene-kv dd { margin-top: 1px; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

.scene-finding {
  margin-top: 8px;
  border-left: 3px solid var(--ochre);
  border-radius: 4px 10px 10px 4px;
  background: var(--bg);
  padding: 9px 12px;
  font-size: 14px;
  line-height: 1.4;
}
.scene-finding--ok { border-left-color: var(--mint); }
.scene-quote {
  margin-top: 8px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  background: var(--paper);
  padding: 8px 10px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 13px;
  line-height: 1.4;
  color: #3A3632;
}
.scene-quote mark { border-radius: 2px; background: var(--pine-soft); padding: 0 2px; color: inherit; }

.scene-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.scene-stat { border-radius: 10px; background: var(--pine-soft); padding: 9px 12px; }
.scene-stat--plain { background: var(--bg); }
.scene-stat b { display: block; font-family: 'Literata', Georgia, serif; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.scene-stat span { font-size: 12px; color: var(--ink-2); }

.scene-bars { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.scene-bars > div { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 4px; }
.scene-bars i { width: 100%; max-width: 34px; height: var(--h); border-radius: 4px 4px 0 0; background: var(--pine); opacity: 0.85; transform-origin: bottom; transition: transform 640ms var(--ease-out); }
.scene.is-armed .scene-step:not(.is-filled) .scene-bars i { transform: scaleY(0); }
.scene-bars span { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.scene-list { margin-top: 4px; font-size: 14px; }
.scene-list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border-2); padding: 6px 0; }
.scene-list b { font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.scene-matrix { width: 100%; margin-top: 10px; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; line-height: 1.35; }
.scene-matrix__label { width: 31%; }
.scene-matrix th,
.scene-matrix td { border-bottom: 1px solid var(--border-2); padding: 8px 8px 8px 0; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.scene-matrix .scene-verdict { white-space: normal; }
.scene-matrix thead th { font-size: 12px; font-weight: 600; color: var(--ink); }
.scene-matrix tbody th { font-weight: 400; color: var(--ink-2); }
.scene-matrix__total th, .scene-matrix__total td { border-bottom: 0; padding-top: 10px; }
.scene-mark { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.scene-mark--ok { color: var(--pine); }
.scene-mark--no { color: #8A3E2B; }
.scene-mark--ask { color: var(--ochre-text); }

.scene-verdict { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.scene-verdict--fit { background: var(--pine-soft); color: var(--mint-text); }
.scene-verdict--near { background: var(--ochre-bg); color: var(--ochre-text); }
.scene-verdict--no { background: #F0EDE9; color: var(--ink-2); }

.scene-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.scene-chip { border-radius: 999px; background: var(--pine-soft); padding: 3px 10px; font-size: 12px; font-weight: 500; color: var(--mint-text); }
.scene-chip--plain { border: 1px solid var(--border); background: var(--bg); color: var(--ink-2); }
.scene-feed { margin-top: 14px; }
.scene-feed li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; border-top: 1px solid var(--border-2); padding: 10px 0; }
.scene-feed__title { font-size: 14px; font-weight: 500; line-height: 1.35; }
.scene-feed__meta { grid-column: 1 / -1; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.scene-feed__reason { grid-column: 1 / -1; font-size: 12px; color: var(--mint-text); }

.scene-orb {
  position: absolute;
  left: 40px;
  top: 0;
  transform: translate(-50%, var(--orb-y, 120px));
  transition: transform 420ms var(--ease-out), opacity 300ms var(--ease-out);
}
.scene:not(.is-armed) .scene-orb { opacity: 0; }

.scene-ask {
  position: absolute;
  top: calc(100% - 16px);
  right: -12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 310px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass-fill-strong);
  padding: 10px 14px 11px 10px;
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 1px var(--glass-edge), 0 2px 4px rgba(42, 39, 37, 0.04), 0 28px 48px -28px rgba(42, 39, 37, 0.38);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  font-size: 14px;
  line-height: 1.4;
  transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out);
}
.scene-ask .gp-msg__avatar { width: 40px; height: 40px; }
.scene.is-armed:not(.is-done) .scene-ask { opacity: 0; transform: translateY(8px); }
.scene-ask__name { display: block; font-size: 12px; font-weight: 600; color: var(--pine); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .scene-doc { background: var(--glass-sheen), var(--soft); }
  .scene-ask { background: var(--paper); }
}

.scene-replay {
  position: absolute;
  left: 22px;
  bottom: -40px;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.scene-replay:hover { color: var(--ink); }
.scene-replay[hidden] { display: none; }

@media (max-width: 640px) {
  .scene-doc { border-radius: 22px; padding: 10px; }
  .scene-doc__page { border-radius: 12px; padding: 20px 14px 18px 38px; }
  .scene-doc__page--ui { padding: 18px 14px 18px 38px; }
  .scene-doc__table th { width: 38%; }
  .scene-matrix { font-size: 12px; }
  .scene-matrix .scene-verdict { padding: 2px 6px; font-size: 11px; overflow-wrap: normal; }
  .scene-orb { left: 29px; }
  .scene-ask { position: relative; top: auto; right: auto; margin: 12px 0 0 auto; }
  .scene-replay { position: static; display: inline-block; margin-top: 10px; }
}

/* ── Прочее ───────────────────────────────────────────────────────────── */

/* Линия, соединяющая шаги «Как начать» на главной. */
.steps-line::before { content: ''; position: absolute; left: 20px; top: 20px; bottom: 20px; width: 1px; background: var(--border); }
@media (min-width: 768px) {
  .steps-line::before { right: 20px; bottom: auto; width: auto; height: 1px; }
}

.feature-card__body { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.feature-card__action { margin-top: auto; padding-top: 24px; }
.feature-card__action .btn { max-width: 100%; min-height: 44px; white-space: normal; text-align: left; }

.art-card img { transition: transform 500ms var(--ease-out); }
.art-card:hover img { transform: scale(1.025); }

/* Класс .js ставит скрипт в <head>: без него секции видны сразу. */
[data-reveal], [data-stagger] > * { transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out); transition-delay: var(--reveal-delay, 0ms); }
.reveal-pending { opacity: 0; transform: translateY(12px); }
.is-visible { opacity: 1; }

/* Орб — знак ГосПилота за работой, как в приложении: он стоит только там, где
   ГосПилот что-то делает (чат, сцена, переход), и рядом всегда текст о том,
   что именно. Украшением иллюстраций и карточек орб не бывает. */
canvas[data-orb] { flex-shrink: 0; }
.twin-visual { min-width: 0; }
.twin-visual__caption { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 10px; text-align: center; font-size: 13px; color: var(--mint-text); }
.calc-card { gap: 8px; }
.calc-card__art { width: 100%; max-height: 170px; object-fit: contain; }
.art-card { transition: transform 320ms var(--ease-out), border-color 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  a.art-card:hover { transform: translateY(-4px); }
  .btn:hover svg, a.group:hover svg { transform: translateX(2px); }
}
.btn svg, a.group svg { transition: transform 180ms var(--ease-out); }

@media (max-width: 1023px) {
  .twin-visual { max-width: 600px; margin: 0 auto; }
}

/* ── Первый экран главной ─────────────────────────────────────────────── */

/* Светлое стекло, как на дашборде приложения: сияние под стеклом и токены
   --glass-* / --aurora-* в :root. У предков чата нет transform, opacity и
   filter: иначе стекло размывало бы пустой слой. */
.home-hero { position: relative; }
.hero-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.hero-aurora::before {
  content: '';
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(46rem 30rem at 8% 6%, var(--aurora-a), transparent 70%),
    radial-gradient(40rem 28rem at 90% 16%, var(--aurora-b), transparent 70%),
    radial-gradient(36rem 26rem at 72% 68%, var(--aurora-c), transparent 72%);
}
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.hero-inner {
  position: relative;
  display: grid;
  align-content: center;
  gap: 28px;
  min-height: clamp(560px, calc(100svh - 64px), 860px);
  padding-top: 48px;
  padding-bottom: 72px;
}
.hero-head { min-width: 0; container-type: inline-size; }
.hero-copy { min-width: 0; max-width: 560px; }
.hero-eyebrow { font-size: 14px; font-weight: 500; color: var(--pine); }
/* Первая строка — 10,5 кегля: 9cqi кладёт её в ширину блока. */
.hero-title {
  margin-top: 14px;
  font-family: 'Literata', Georgia, serif;
  font-size: clamp(40px, 9cqi, 88px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
}
/* Строка выезжает из-под маски; запас снизу — для «у» и «д». */
.hero-line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.hero-line > * { display: inline-block; }
.hero-title em { padding-right: 0.04em; font-style: italic; color: var(--pine); }
.hero-lead { max-width: 52ch; font-size: 17px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.hero-chat { margin-top: 28px; }

/* Пока чат в середине экрана, заголовок и подзаголовок уступают ему место. */
.hero-fade { transition: opacity 420ms var(--ease-out), transform 560ms var(--ease-out), filter 420ms var(--ease-out); }
.home-hero.is-chatting .hero-fade { opacity: 0; transform: translateY(-14px); filter: blur(6px); pointer-events: none; }

/* Появление: только со скриптом (.js в <head>), без него всё видно сразу.
   Стеклу не анимируем filter: с ним стекло размывало бы пустоту. */
.js .hero-in { animation: hero-rise 900ms var(--ease-out) var(--d, 0ms) both; }
.js .hero-line > * { animation: hero-line-in 1000ms var(--ease-out) var(--d, 0ms) both; }
.js .hero-lead.hero-in { animation-name: hero-rise-blur; }
.js .hero-aurora::before { animation: hero-bg-in 1600ms var(--ease-out) both, hero-drift 28s ease-in-out 1600ms infinite alternate; }
@keyframes hero-rise { from { opacity: 0; transform: translateY(16px) scale(0.985); } }
@keyframes hero-rise-blur { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } }
@keyframes hero-line-in { from { transform: translateY(105%); } }
@keyframes hero-bg-in { from { opacity: 0; transform: scale(1.06); } }
@keyframes hero-drift { to { transform: translate3d(-2%, 1.5%, 0) scale(1.03); } }

/* ── Стеклянный чат первого экрана ─────────────────────────────────────── */

/* Та же карточка, что «ГосПилот» на дашборде: glass-panel + glass-hero. */
.gp-chat--glass {
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background: var(--glass-sheen), var(--glass-fill);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 1px var(--glass-edge), var(--glass-shadow);
  padding: 18px;
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
}
/* Мягкое свечение за знаком ГосПилота; содержимое — над ним. */
.gp-chat--glass::before {
  content: '';
  position: absolute;
  top: -9rem;
  left: -6rem;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  background: radial-gradient(closest-side, var(--glass-glow), transparent);
  pointer-events: none;
}
.gp-chat--glass > :not(.gp-chat__close) { position: relative; }
/* После появления анимация снимается, иначе её transform перебил бы переезд. */
.js .gp-chat--glass.is-settled { animation: none; }
/* Подсветка — только у раскрывающегося чата главной: нажатие в любом месте
   плашки ведёт в поле (chat.js). */
@media (hover: hover) and (pointer: fine) {
  .gp-chat--glass[data-chat-expand]:not(.is-open):hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 1px var(--glass-edge), 0 2px 4px rgba(42, 39, 37, 0.04), 0 32px 56px -32px rgba(42, 39, 37, 0.38);
    cursor: text;
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gp-chat--glass { background: var(--glass-sheen), var(--paper); }
}

.gp-msg__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-inset);
  box-shadow: 0 0 0 1px var(--glass-edge);
}
/* Свёрнутый чат главной — одна строка рядом со знаком, по центру. */
.gp-chat--glass[data-chat-expand]:not(.is-open) .gp-msg--lead { align-items: center; }
.gp-chat--glass.is-open .gp-msg--lead { padding-right: 36px; }
.gp-chat--glass .gp-msg__name { font-size: 12.5px; }
.gp-chat--glass .gp-msg__text { margin-top: 2px; }
.gp-chat__rotator { overflow: hidden; margin-top: 1px; font-size: 15px; line-height: 1.45; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; }

.gp-chat--glass .gp-chat__composer {
  margin-top: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: var(--glass-fill-strong);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 1px var(--glass-edge);
}
.gp-chat--glass .gp-chat__composer:focus-within { border-color: rgba(26, 71, 49, 0.32); box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 3px rgba(26, 71, 49, 0.12); }
.gp-chat--glass .gp-chat__composer input { background: transparent; }
.gp-chat--glass .gp-chat__send { border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 24px -14px rgba(26, 71, 49, 0.85); }

.gp-chat__close {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-fill-strong);
  box-shadow: 0 0 0 1px var(--glass-edge);
  color: var(--ink-2);
  visibility: hidden;
  opacity: 0;
  transition: opacity 200ms var(--ease-out), visibility 0s 200ms, background-color 150ms var(--ease-out);
}
.gp-chat__close:hover { background: var(--paper); color: var(--ink); }
.gp-chat--glass.is-open .gp-chat__close { visibility: visible; opacity: 1; transition-delay: 0s; }

/* Складные части: высота плавно идёт от 0 до содержимого. Без скрипта
   раскрыто всё, кроме бегущей строки. */
.gp-fold { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 460ms var(--ease-out), opacity 320ms var(--ease-out); }
.gp-fold > * { min-height: 0; overflow: hidden; }
.gp-fold--rotator { grid-template-rows: 0fr; opacity: 0; }
.js .gp-chat--glass:not(.is-open) .gp-fold--rotator { grid-template-rows: 1fr; opacity: 1; }
.js .gp-chat--glass:not(.is-open) .gp-fold--open,
.js .gp-chat--glass.has-conversation .gp-fold--options { grid-template-rows: 0fr; opacity: 0; }

/* Что можно сделать — лёгкие кнопки под полем, как glass-button дашборда. */
.gp-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 1px 2px; }
.gp-suggest__chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-fill-strong);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 1px var(--glass-edge);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  transition: background-color 150ms var(--ease-out), opacity 360ms var(--ease-out), transform 360ms var(--ease-out);
}
.gp-suggest__chip:hover { background: var(--paper); }
/* Появляются по очереди после раскрытия, исчезают сразу. */
.js .gp-suggest__chip { opacity: 0; transform: translateY(6px); }
.js .gp-chat--glass.is-open .gp-suggest__chip { opacity: 1; transform: none; transition-delay: 0ms, calc(160ms + var(--i, 0) * 55ms), calc(160ms + var(--i, 0) * 55ms); }
.gp-chat--glass .gp-chat__note { margin-top: 10px; }

/* Переезд в середину первого экрана (от 768 px). Место в первом экране
   держит пустая ячейка, сама плашка плывёт внутри .hero-inner: начальные
   top/left/width и высоту середины (--chat-y) ставит chat.js. Затемнения и
   всплывающего окна нет — меняется только первый экран. */
.gp-chat--glass.is-floating {
  position: absolute;
  z-index: 5;
  transition: top 640ms var(--ease-out), left 640ms var(--ease-out), width 640ms var(--ease-out),
    transform 640ms var(--ease-out), box-shadow 640ms var(--ease-out);
}
.gp-chat--glass.is-floating.is-open {
  top: var(--chat-y, 50%);
  left: 50%;
  width: min(640px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 1px var(--glass-edge), 0 2px 4px rgba(42, 39, 37, 0.04), 0 40px 80px -40px rgba(42, 39, 37, 0.42);
}

/* ── Первый экран страниц задач ───────────────────────────────────────── */

/* Сияние, заголовок строками и стеклянный чат — те же классы hero-*, что на
   главной, но в две колонки: справа пример работы. Чат здесь не переезжает:
   он сразу раскрыт и говорит, что прислать на этой странице. */
.task-hero { position: relative; }
.task-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  padding-top: 56px;
  padding-bottom: 88px;
}
@media (min-width: 1024px) {
  .task-hero__inner { grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); gap: 56px; padding-top: 72px; padding-bottom: 104px; }
}
.task-hero__title { font-size: clamp(34px, 9.4cqi, 56px); line-height: 1.04; }
.task-hero__title .hero-line > * { text-wrap: balance; }
.task-hero__lead { margin-top: 22px; }
.task-hero__chat { max-width: 560px; }
.task-hero__example { position: relative; min-width: 0; padding-bottom: 64px; }
.task-hero__example figcaption { margin: 0 0 12px 8px; font-size: 13px; color: var(--ink-2); }

@media (max-width: 640px) {
  .task-hero__inner { gap: 40px; padding-top: 40px; padding-bottom: 56px; }
  .task-hero__example { padding-bottom: 0; }
}

@media (max-width: 640px) {
  .hero-inner { min-height: 0; align-content: start; gap: 24px; padding-top: 40px; padding-bottom: 56px; }
  .hero-lead { font-size: 16px; }
  .hero-chat { margin-top: 24px; }
  .gp-chat--glass { border-radius: 24px; padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal-pending { opacity: 1; transform: none; }
}
