/* Стили сайта sito.alexforge.org.

   Вёрстка повторяет макеты страницы «Landing» в Figma: размеры, отступы и
   типографика — стили `web/*` макета, цвета — токены светлой темы приложения
   (lib/theme/asset/tokens.g.dart, они же переменные коллекции Theme). Имя
   токена стоит в комментарии рядом со значением: расходиться им нельзя, сайт и
   приложение показывают одно и то же. Подвал — тёмная полоса, как в макете:
   там те же токены в тёмной теме. */

@font-face {
  font-family: 'Onest';
  src: url('/font/onest-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Onest';
  src: url('/font/onest-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Onest';
  src: url('/font/onest-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --page: #faf7f0; /* bg/page */
  --card: #ffffff; /* bg/card */
  --inset: #f2ede3; /* bg/inset */
  --text: #1f2326; /* text/primary */
  --text-dim: #5c6266; /* text/secondary */
  --text-faint: #9aa0a4; /* text/tertiary */
  --line: #e6e1d6; /* line/subtle */
  --line-strong: #cfc9bc; /* line/strong */
  --ink: #1f2326; /* action/primary */
  --on-ink: #faf7f0; /* action/on-primary */
  --good: #3e9f70; /* mood/good */
  --good-soft: #ddf1e5; /* mood/good-soft */
  --okay: #e0a030; /* mood/okay */
  --okay-soft: #fbefd0; /* mood/okay-soft */
  --bad: #e0584a; /* mood/bad */
  --bad-soft: #fadfda; /* mood/bad-soft */
  --header: rgba(250, 247, 240, 0.86); /* bg/page под размытием шапки */
  --shell: 1168px;
  --radius-sm: 12px; /* radius/sm */
  --radius-md: 16px; /* radius/md */
  --radius-lg: 20px; /* radius/lg */
}

/* Тёмная тема тех же токенов — для подвала. */
.site-footer {
  --page: #17191b; /* bg/page, Dark */
  --card: #24282c; /* bg/card, Dark */
  --text: #ece8e0; /* text/primary, Dark */
  --text-dim: #a9aeb3; /* text/secondary, Dark */
  --text-faint: #6f757a; /* text/tertiary, Dark */
  --line: #2f3438; /* line/subtle, Dark */
}

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

/* Подсветки нарочно вылезают за края секций, и единственное, что их обрезает, —
   край экрана. `clip` вместо `hidden`: он не делает из страницы прокручиваемый
   блок, и липкая шапка продолжает работать. */
html,
body {
  overflow-x: clip;
}

html {
  scroll-behavior: smooth;
  /* Якорь раздела не должен уезжать под липкую шапку. */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5625;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 24px;
  height: auto;
  flex: none;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  /* Только боковые: вертикальные отступы задают сами секции, а сокращённая
     запись сбросила бы их — в том числе из медиазапроса ниже. */
  padding-left: 24px;
  padding-right: 24px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 24px;
  top: 12px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--card);
  text-decoration: none;
}

/* Типографика — стили `web/*` макета. */
.eyebrow,
.footer-heading {
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* MARK: Шапка */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}

.logo {
  display: flex;
  flex: none;
}

.logo img {
  display: block;
  width: auto;
  height: 32px;
}

.site-nav {
  display: flex;
  gap: 28px;
  margin-right: auto;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-dim);
}

.site-nav a {
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
}

.lang {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.tab {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-faint);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-current='true'] {
  background: var(--inset);
  color: var(--text);
}

/* Кнопка повторяет основную кнопку приложения: чернильная пилюля. */
.button {
  flex: none;
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.button:hover {
  opacity: 0.86;
}

/* MARK: Подсветки */

/* Мягкие пятна в тонах самочувствия за телефонами и под финалом. Радиальный
   градиент гаснет к краю сам — ни размытия, ни рамки, которая бы его срезала. */
.glow {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--glow), transparent);
}

.glow-good {
  --glow: var(--good-soft);
}

.glow-okay {
  --glow: var(--okay-soft);
}

.glow-bad {
  --glow: var(--bad-soft);
}

/* Подсветка — позиционированный слой и рисуется поверх обычного потока, а за
   край своей колонки она выходит нарочно. Текст рядом поднимается над ней,
   иначе край пятна тонирует заголовок. */
.hero-copy,
.show-copy {
  position: relative;
  z-index: 1;
}

/* MARK: Обложка */

.hero {
  padding: 96px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 612fr) minmax(0, 460fr);
  align-items: center;
  gap: 48px;
}

.accent {
  display: flex;
  gap: 6px;
}

.accent i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

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

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

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

.hero h1 {
  font-size: clamp(40px, 4.45vw, 64px);
  line-height: 1.125;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 560px;
  font-size: 20px;
  line-height: 32px;
  color: var(--text-dim);
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
}

.trust li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--good-soft);
  color: var(--good);
}

.check .icon {
  width: 12px;
}

/* Один отступ на все блоки колонки. Правило стоит последним нарочно: у списка
   доверия свой сброс `margin`, и при равной силе селекторов побеждает тот, что
   ниже. */
.hero-copy > * + * {
  margin-top: 24px;
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
}

.shot {
  position: relative;
  z-index: 1;
  display: block;
}

/* Снимок несёт тень рамки: 392 точки по ширине — это телефон 344 и поле под
   тень по бокам. */
.shot-diary {
  width: 392px;
}

.glow-hero {
  top: 50%;
  left: 50%;
  width: 820px;
  height: 640px;
  transform: translate(-50%, -50%);
}

.glow-hero-accent {
  top: -30px;
  left: -170px;
  width: 520px;
  height: 520px;
}

/* MARK: Бейджи магазинов */

/* Изображения бейджей — официальные, их нельзя ни перерисовывать, ни
   перекрашивать; странице остаются только размер и свободное поле вокруг.
   Зазор взят по более строгому правилу из двух: у Apple это десятая доля
   высоты бейджа, у Google — четверть. */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.badges-center {
  justify-content: center;
}

.badge {
  display: inline-flex;
}

.badge img {
  display: block;
  width: auto;
  height: 48px;
}

.status {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-faint);
}

/* MARK: Шаги и возможности */

.section {
  padding: 96px 0;
}

.section-head {
  max-width: 560px;
  margin-bottom: 40px;
}

.section-head-wide {
  max-width: 760px;
}

.section-head .eyebrow {
  margin-bottom: 12px;
}

.section-head h2,
.outro h2 {
  font-size: clamp(32px, 3.1vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

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

.card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.card-text h3 {
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.01em;
}

.card-text p {
  margin-top: 8px;
  color: var(--text-dim);
}

.step-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--inset);
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.icon-chip {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--inset);
  color: var(--text);
}

/* MARK: Витрина экранов */

.showcase {
  padding: 24px 0 96px;
}

.show-row {
  display: grid;
  grid-template-columns: minmax(0, 460fr) minmax(0, 580fr);
  align-items: center;
  gap: 80px;
}

.show-row + .show-row {
  margin-top: 96px;
}

/* Через строку телефон переезжает вправо — страница идёт зигзагом. */
.show-row:nth-of-type(even) {
  grid-template-columns: minmax(0, 580fr) minmax(0, 460fr);
}

.show-row:nth-of-type(even) .show-art {
  order: 2;
}

.show-art {
  position: relative;
  display: grid;
  place-items: center;
}

/* Телефон 300 точек и поле под тень рамки. */
.show-art .shot {
  width: 342px;
}

.glow-row {
  top: 50%;
  left: 50%;
  width: 680px;
  height: 540px;
  transform: translate(-50%, -50%);
}

.show-copy h2 {
  font-size: clamp(28px, 2.5vw, 36px);
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.show-copy p {
  max-width: 520px;
  margin-top: 20px;
  font-size: 18px;
  line-height: 29px;
  color: var(--text-dim);
}

/* MARK: Финал */

.outro {
  position: relative;
  padding: 48px 0 120px;
}

.glow-outro {
  top: 0;
  left: 50%;
  width: 900px;
  height: 520px;
  transform: translateX(-50%);
}

.outro-shell {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 24px;
  text-align: center;
}

.outro-mark {
  width: 96px;
}

.outro h2 {
  max-width: 760px;
}

.outro-note {
  color: var(--text-faint);
}

/* MARK: Документы */

.doc-head {
  padding-top: 48px;
  padding-bottom: 32px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-faint);
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text);
}

.crumb-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
}

.doc-head h1 {
  max-width: 18em;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.doc-meta:empty {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
  line-height: 20px;
  color: var(--text-dim);
}

.chip-icon {
  width: 16px;
}

.doc-head .lead {
  max-width: 44em;
  margin-top: 20px;
  font-size: 18px;
  line-height: 29px;
}

.doc-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  padding-bottom: 96px;
}

.doc-body-plain {
  grid-template-columns: minmax(0, 1fr);
}

.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
}

.toc .eyebrow {
  margin-bottom: 4px;
}

.toc a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.15s ease;
}

.toc a:hover,
.toc a.is-current {
  color: var(--text);
}

.doc-content {
  max-width: 44em;
  line-height: 1.65;
}

.doc-info {
  color: var(--text-faint);
  font-size: 15px;
}

.doc-intro {
  margin-top: 16px;
}

.doc-intro p + p,
.doc-content p + p {
  margin-top: 16px;
}

.callout {
  margin: 32px 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.callout::before {
  content: attr(data-title);
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.doc-section {
  margin-top: 48px;
}

.doc-section h2 {
  margin-bottom: 16px;
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.01em;
  scroll-margin-top: 96px;
}

.doc-section ul {
  margin: 16px 0;
  padding-left: 20px;
}

.doc-section li + li {
  margin-top: 8px;
}

.doc-content a {
  color: var(--text);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.doc-content a:hover {
  text-decoration-color: var(--text);
}

.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 500;
  color: var(--text-faint);
}

tr:last-child td {
  border-bottom: none;
}

/* MARK: Подвал */

.site-footer {
  background: var(--page);
  color: var(--text);
}

.footer-shell {
  padding-top: 56px;
  padding-bottom: 40px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 400fr) minmax(0, 280fr) minmax(0, 360fr);
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.footer-note {
  max-width: 360px;
  margin-top: 16px;
  font-size: 15px;
  line-height: 22px;
  color: var(--text-dim);
}

.footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  line-height: 22px;
}

.footer-heading {
  margin: 0;
}

.footer-column a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-column a:hover {
  color: var(--text);
}

.footer-contact {
  align-items: stretch;
}

.footer-column .tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--card);
}

.tile-icon {
  color: var(--text);
}

.tile-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tile-title {
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text);
}

.tile-note {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-dim);
}

/* Имя и роль — колонкой слева, копирайт прижат к правому краю первой строки. */
.footer-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 24px;
  padding-top: 32px;
  font-size: 14px;
  line-height: 20px;
}

.footer-bottom p:last-child {
  grid-column: 2;
  grid-row: 1;
}

.footer-bottom .dim {
  color: var(--text-faint);
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-faint);
}

.age {
  flex: none;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--card);
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text);
}

/* MARK: Узкие экраны */

/* Ссылки разделов уходят из шапки раньше, чем ломается строка: логотип,
   три ссылки, переключатель и кнопка вместе занимают около 780 точек. */
@media (max-width: 860px) {
  .site-nav {
    display: none;
  }

  .header-bar {
    justify-content: flex-end;
    gap: 12px;
  }

  .logo {
    margin-right: auto;
  }
}

@media (max-width: 900px) {
  /* Как в мобильном макете: сначала текст, под ним телефон. */
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

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

  /* Телефон встаёт над текстом: зигзаг из двух колонок в одну не собрать. */
  .show-row,
  .show-row:nth-of-type(even) {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .show-row:nth-of-type(even) .show-art {
    order: 0;
  }

  .show-row + .show-row {
    margin-top: 64px;
  }

  .doc-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 18px;
  }

  /* Строкой оглавление становится рядом ссылок, и подпись «Содержание» иначе
     встала бы первой ссылкой в этом ряду. */
  .toc .eyebrow {
    flex-basis: 100%;
    margin-bottom: 0;
  }

  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

/* Мобильный макет — 390 точек, стили `web/*-mobile`. */
@media (max-width: 640px) {
  .header-bar {
    height: 64px;
  }

  .logo img {
    height: 28px;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero h1 {
    font-size: 40px;
    line-height: 46px;
  }

  .lead {
    font-size: 17px;
    line-height: 27px;
  }

  .hero .shot-diary {
    width: 342px;
  }

  .glow-hero {
    width: 560px;
    height: 460px;
  }

  .glow-hero-accent {
    top: 10px;
    left: -110px;
    width: 360px;
    height: 360px;
  }

  .section {
    padding: 64px 0;
  }

  .section-head {
    margin-bottom: 32px;
  }

  .section-head h2,
  .outro h2 {
    font-size: 32px;
    line-height: 38px;
  }

  .cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .showcase {
    padding: 8px 0 64px;
  }

  .glow-row {
    width: 520px;
    height: 440px;
  }

  .show-copy h2 {
    font-size: 28px;
    line-height: 34px;
    letter-spacing: -0.015em;
  }

  .show-copy p {
    margin-top: 16px;
    font-size: 16px;
    line-height: 26px;
  }

  .outro {
    padding: 24px 0 72px;
  }

  .outro-shell {
    gap: 20px;
  }

  .outro-mark {
    width: 80px;
  }

  .glow-outro {
    width: 600px;
    height: 420px;
  }

  .footer-shell {
    padding-top: 48px;
    padding-bottom: 32px;
  }

  .footer-bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .footer-bottom p:last-child {
    grid-column: 1;
    grid-row: auto;
    margin-top: 12px;
  }

  .footer-legal {
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .lang .tab {
    padding: 4px 10px;
  }

  .button {
    padding: 10px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
