/* Лендинг brookinsight.com и его служебные страницы (вход, ранний доступ, privacy, terms).
   Стиль сайтов Airy: кремовая бумага, Literata в заголовках и тексте, системный шрифт в кнопках,
   меню, подписях и в том, что повторяет интерфейс (выбор Константина 2026-11-20, «Кремовая +
   тёплый»). Цвета и шрифт — public/brand/tokens.css, копия из uwindi-crm (site/public/brand) без
   правок: при смене бренда файл заменяется целиком, здесь только имена ролей.
   Отступы — шкала 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 96 / 144. */

:root {
  --bg: var(--paper);
  --surface: var(--paper-band);
  --inverse: var(--ink-band);
  --title: var(--ink);
  --body: var(--ink-soft);
  --muted: var(--ink-muted);
  --line: var(--rule);
  --line-strong: rgb(31 29 26 / 0.42);
  --primary: var(--accent);
  --primary-hover: var(--accent-hover);
  --secondary: var(--accent-light);
  --on-inverse: var(--on-ink);
  --on-inverse-body: #d8d1c4;
  --on-inverse-muted: var(--on-ink-muted);
  --on-inverse-line: rgb(255 255 255 / 0.12);
  --good: #087a08;
  --watch: #9e6a00;
  --down: #c0392b;
  --good-dark: #0ca30c;
  --watch-dark: #fab219;
  --down-dark: #e0574a;
  --font-display: var(--serif);
  --font-text: var(--serif);
  --font-ui: var(--sans);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: var(--margin);
  --max: 1440px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 84px;
}

/* Подвал внизу экрана и на короткой странице: вход, ранний доступ, 404. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 18px/1.6 var(--font-text);
  font-optical-sizing: auto;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--title);
  font-family: var(--font-display);
  font-weight: 500;
  text-wrap: balance;
}

p,
li,
dd {
  text-wrap: pretty;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--primary);
}

:focus-visible:not(input, select, textarea) {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 3px;
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  padding: 8px 12px;
  background: var(--title);
  color: var(--bg);
  font: 500 14px/1 var(--font-ui);
  z-index: 50;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Шапка --- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.top.is-scrolled {
  border-bottom-color: var(--line);
}

.top .wrap {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
  font: 400 15px/1 var(--font-ui);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--title);
  text-decoration: none;
}

.brand:hover {
  color: var(--title);
}

.brand-name {
  font: 500 21px/1 var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-name span {
  color: var(--muted);
}

.menu {
  display: flex;
  gap: 28px;
  margin-left: 16px;
}

.menu a,
.quiet {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}

.menu a:hover,
.quiet:hover,
.menu a[aria-current="page"],
.quiet[aria-current="page"] {
  color: var(--title);
}

.actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

/* Тонкая линия под шапкой, как разделители в приложении. */
.top-rule {
  border-top: 1px solid var(--line);
}

/* Кнопка в шапке: на главной появляется, когда кнопка первого экрана ушла с экрана. Пока её нет,
   она не занимает места, и Sign in стоит у правого края. Без скриптов видна всегда. */
.js .top[data-cta="after-hero"] .button {
  max-width: 0;
  margin-left: -20px;
  padding-inline: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition:
    max-width 0.3s var(--ease),
    margin-left 0.3s var(--ease),
    padding 0.3s var(--ease),
    opacity 0.25s var(--ease),
    visibility 0.3s,
    background-color 0.2s var(--ease);
}

.js .top[data-cta="after-hero"].show-cta .button {
  max-width: 260px;
  margin-left: 0;
  padding-inline: 14px;
  opacity: 1;
  visibility: visible;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font: 500 16px/1 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    transform 0.15s var(--ease);
  white-space: nowrap;
}

.button:hover {
  background: var(--primary-hover);
  color: #fff;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  opacity: 0.55;
  cursor: default;
}

.top .button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

.on-dark .button {
  background: var(--secondary);
  color: #0f2730;
}

.on-dark .button:hover {
  background: #a6d0dc;
  color: #0f2730;
}

.on-dark :focus-visible {
  outline-color: var(--secondary);
}

/* --- Первый экран --- */

/* Заголовок на восемь колонок, рядом — подзаголовок и кнопка, ниже — панель в окне. */
.hero {
  padding: clamp(36px, 4.4vw, 60px) 0 clamp(96px, 10vw, 144px);
}

.hero-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  align-items: end;
}

.hero h1 {
  grid-column: 1 / span 8;
  font-size: clamp(2.6rem, 1.2rem + 4vw, 5rem);
  font-weight: 460;
  line-height: 1.02;
  letter-spacing: -0.026em;
}

/* Вторая часть заголовка всегда с новой строки, и на телефоне тоже. */
.hero h1 em {
  display: block;
  font-weight: 400;
}

.hero-lead {
  grid-column: 9 / -1;
  padding-bottom: 4px;
}

.hero .lead {
  color: var(--body);
}

.hero .act {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 24px;
  font: 400 15px/1.4 var(--font-ui);
}

.hero .act a:not(.button) {
  color: var(--muted);
}

.hero .act a:not(.button):hover {
  color: var(--title);
}

.proof {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 15.5px;
  font-style: italic;
  color: var(--muted);
}

/* Панель — в окне с тонкой рамкой, как экраны продукта на airycrm.com. */
.shot {
  margin: clamp(40px, 4.4vw, 64px) 0 0;
}

.shot img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ui-bg);
}

.shot figcaption {
  margin-top: 12px;
  font: 400 14px/1.4 var(--font-ui);
  color: var(--muted);
}

/* --- Секции --- */

.section {
  padding: 144px 0;
}

.section--tight {
  padding: 96px 0;
}

.section--surface {
  background: var(--surface);
}

.on-dark {
  background: var(--inverse);
  color: var(--on-inverse-body);
}

.on-dark h2,
.on-dark h3 {
  color: var(--on-inverse);
}

.on-dark a:hover {
  color: var(--secondary);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.span-5 {
  grid-column: span 5;
}

.span-7 {
  grid-column: span 7;
}

.span-6 {
  grid-column: span 6;
}

.start-7 {
  grid-column: 7 / span 6;
}

h2 {
  font-size: var(--h2);
  line-height: 1.1;
  letter-spacing: -0.018em;
}

.intro {
  margin-top: 24px;
  max-width: 30em;
  font-size: 18px;
}

.on-dark .intro {
  color: var(--on-inverse-body);
}

/* --- Письма-тревоги --- */

.alerts {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--on-inverse-line);
}

.alerts li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 4px 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--on-inverse-line);
}

.alerts .dot {
  margin-top: 8px;
}

.alerts .subject {
  color: var(--on-inverse);
  font: 600 16px/1.45 var(--font-ui);
  overflow-wrap: anywhere;
}

.alerts .why {
  grid-column: 2;
  color: var(--on-inverse-muted);
  font-size: 16px;
}

.aside {
  margin-top: 32px;
  font-size: 16px;
  color: var(--on-inverse-muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--none, #888);
  flex: none;
}

.dot--good {
  background: var(--good);
}

.dot--watch {
  background: var(--watch);
}

.dot--down {
  background: var(--down);
}

.on-dark .dot--good {
  background: var(--good-dark);
}

.on-dark .dot--watch {
  background: var(--watch-dark);
}

.on-dark .dot--down {
  background: var(--down-dark);
}

/* --- Сигналы (как в панели) --- */

/* Сигналы и легенда повторяют панель — системным шрифтом, как всё внутри интерфейса. */
.signals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  margin-top: 8px;
  font-family: var(--font-ui);
}

.signals > div {
  padding: 20px 20px 24px 0;
}

.signals > div + div {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.signals .state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.signals .state--good {
  color: var(--good);
}

.signals .state--watch {
  color: var(--watch);
}

.signals .name {
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
}

.signals .value {
  margin-top: 4px;
  color: var(--title);
  font-size: 40px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.signals .note {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.legend {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  margin: 48px 0 0;
  font: 400 15px/1.5 var(--font-ui);
}

.legend dt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--title);
  font-weight: 600;
}

.legend dd {
  margin: 0;
}

.said {
  margin-top: 48px;
  padding-left: 16px;
  border-left: 2px solid var(--primary);
  color: var(--title);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.35;
}

.said span {
  display: block;
  margin-top: 8px;
  font: italic 400 15px/1.4 var(--font-text);
  color: var(--muted);
}

/* --- Что внутри --- */

.parts {
  margin: 64px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  border-top: 1px solid var(--line-strong);
}

.parts div {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.parts dt {
  color: var(--title);
  font-weight: 600;
}

.parts dd {
  margin: 0;
  font-size: 16px;
}

.periods {
  margin-top: 32px;
  font-size: 16px;
  color: var(--muted);
}

/* --- Без cookie --- */

.statement {
  max-width: 22em;
  color: var(--title);
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.facts {
  padding-top: 8px;
}

.facts p + p {
  margin-top: 16px;
}

.code {
  margin: 0;
  padding: 24px;
  background: var(--inverse);
  color: var(--on-inverse);
  border-radius: 8px;
  font: 14px/1.6 var(--font-mono);
  overflow-x: auto;
}

.code-note {
  margin-top: 12px;
  font: 400 14px/1.4 var(--font-ui);
  color: var(--muted);
}

/* --- Шаги --- */

.steps {
  list-style: none;
  margin: 64px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 24px;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
}

.steps h3 {
  font-size: 24px;
  line-height: 1.25;
}

.steps p {
  margin-top: 12px;
  font-size: 16px;
}

/* --- О нас --- */

.story p + p {
  margin-top: 20px;
}

.story p {
  font-size: 18px;
}

/* --- FAQ --- */

.faq {
  border-top: 1px solid var(--line-strong);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  color: var(--title);
  font-size: 19px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  transition: transform 0.3s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq .answer {
  padding: 0 0 24px;
  max-width: 40em;
  font-size: 16px;
}

.faq .answer p + p {
  margin-top: 12px;
}

/* --- Финальный призыв --- */

.final {
  padding: clamp(96px, 10vw, 144px) 0;
  text-align: center;
}

.final h2 {
  max-width: 16em;
  margin-inline: auto;
  font-size: clamp(2.25rem, 1.3rem + 2.7vw, 3.75rem);
  font-weight: 460;
  line-height: 1.05;
  letter-spacing: -0.022em;
}

.final h2 span {
  display: block;
  font-weight: 400;
  font-style: italic;
  color: var(--on-inverse-muted);
}

.final p {
  max-width: 32em;
  margin: 16px auto 0;
  color: var(--on-inverse-muted);
}

.final .button {
  margin-top: 32px;
}

/* --- Подвал --- */

.foot {
  padding: 26px 0 34px;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  background: var(--inverse);
  color: var(--on-inverse-muted);
  font: 400 14px/1.4 var(--font-ui);
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.foot .brand,
.foot .brand:hover {
  color: var(--on-inverse);
}

.foot .brand-name {
  font-size: 18px;
}

.foot .brand-name span {
  color: var(--on-inverse-muted);
}

.foot a {
  color: var(--on-inverse-muted);
}

.foot a:hover {
  color: var(--on-inverse);
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  margin-left: auto;
}

.foot nav a {
  text-decoration: none;
}

.foot :focus-visible {
  outline-color: var(--secondary);
}

/* --- Служебные страницы: форма, вход, документы --- */

.page {
  padding: clamp(48px, 6vw, 96px) 0 144px;
}

.page h1 {
  font-size: clamp(36px, 4.4vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.015em;
  max-width: 14em;
}

.page .lead {
  margin-top: 24px;
  max-width: 32em;
  font-size: 19px;
}

.form {
  display: grid;
  gap: 24px;
  max-width: 560px;
  margin-top: 48px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--title);
  font: 600 15px/1.4 var(--font-ui);
}

.field .opt {
  color: var(--muted);
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--ui-input);
  border-radius: 6px;
  background: var(--ui-bg);
  color: var(--title);
  font: 400 16px/1.4 var(--font-ui);
  transition: border-color 0.2s var(--ease);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--title);
  box-shadow: inset 0 0 0 1px var(--title);
}

.field [aria-invalid="true"] {
  border-color: var(--down);
}

.field .error {
  margin-top: 8px;
  color: var(--down);
  font: 400 14px/1.4 var(--font-ui);
}

.form .small {
  font: 400 14px/1.4 var(--font-ui);
  color: var(--muted);
}

.done {
  margin-top: 48px;
  max-width: 34em;
  padding: 24px;
  border-left: 2px solid var(--good);
  background: var(--surface);
}

.doc {
  max-width: 44em;
  margin-top: 48px;
}

.doc h2 {
  margin-top: 48px;
  font-size: 28px;
}

.doc p,
.doc li {
  font-size: 17px;
}

.doc p + p,
.doc ul {
  margin-top: 12px;
}

.doc h2 + p {
  margin-top: 16px;
}

.updated {
  margin-top: 16px;
  color: var(--muted);
  font: 400 15px/1.4 var(--font-ui);
}

.code-wrap {
  margin-top: 48px;
}

/* --- Мобильные --- */

@media (max-width: 1023px) {
  .hero h1,
  .hero-lead {
    grid-column: 1 / -1;
  }

  .hero-lead {
    margin-top: 8px;
  }

  .span-5,
  .span-7,
  .span-6,
  .start-7 {
    grid-column: 1 / -1;
  }

  .parts {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .section {
    padding: 96px 0;
  }

  .facts {
    padding-top: 0;
    margin-top: 32px;
  }
}

@media (max-width: 960px) {
  .menu {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 17px;
  }

  .top .wrap {
    gap: 12px;
    height: 60px;
  }

  .actions {
    gap: 14px;
  }

  .brand-name {
    font-size: 19px;
  }

  .top .button {
    min-height: 32px;
    padding: 0 12px;
    font-size: 13.5px;
  }

  .js .top[data-cta="after-hero"] .button {
    margin-left: -14px;
  }

  .js .top[data-cta="after-hero"].show-cta .button {
    margin-left: 0;
    padding-inline: 12px;
  }

  .signals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signals > div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .signals > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .signals .value {
    font-size: 32px;
  }

  .parts div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .foot nav {
    margin-left: 0;
  }
}

/* На самых узких телефонах кнопке в шапке не хватает места: Sign in остаётся в подвале. */
@media (max-width: 400px) {
  .js .top.show-cta .quiet {
    display: none;
  }
}

/* «Brook Insight» шире прежнего «Airy Data»: на самых узких экранах с кнопкой в шапке
   остаётся знак без надписи. */
@media (max-width: 369px) {
  .js .top.show-cta .brand-name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Ранний доступ письмом */
.mail-box {
  max-width: 560px;
  margin-top: 48px;
  padding: 32px;
  background: var(--surface);
  border-radius: 8px;
}

.mail-box ul {
  margin: 12px 0 32px;
  padding-left: 20px;
}

.mail-box li + li {
  margin-top: 4px;
}

.mail-alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 24px;
  font: 400 15px/1.4 var(--font-ui);
  color: var(--muted);
}

.mail-alt span {
  color: var(--title);
  font-weight: 600;
}

.copy {
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--title);
  font: 500 14px/1.4 var(--font-ui);
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}

.copy:hover {
  border-color: var(--title);
}
