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

   Цвета — токены тёмной темы приложения (lib/theme/asset/tokens.g.dart, они же
   переменные коллекции Theme в Figma): расходиться им нельзя, сайт и приложение
   показывают одно и то же. Имя токена стоит в комментарии рядом со значением.
   Светлой темы у сайта нет — её нет и у приложения в нынешнем виде. */

@font-face {
  font-family: 'Roboto';
  src: url('/font/roboto-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('/font/roboto-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('/font/roboto-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('/font/roboto-900.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}

:root {
  --background: #191b35; /* bg/page */
  --surface: #1f2142;
  --surface-soft: rgba(255, 255, 255, 0.04);
  --soft: rgba(255, 255, 255, 0.1); /* bg/soft, border/subtle */
  --border: rgba(255, 255, 255, 0.1);
  --footer: #0f1521; /* bg/surface */
  --brick: #3a4a68; /* brick/bg */
  --brick-done: #1d454e; /* brick/done-bg */
  --text: #ffffff; /* text/primary */
  --text-dim: #dbdbdb; /* text/secondary */
  --text-faint: rgba(255, 255, 255, 0.5); /* text/muted */
  --cyan: #8cf4fd; /* accent/neon */
  --green: #4fcca3; /* accent/success */
  --neon-soft: rgba(140, 244, 253, 0.1); /* button/floating-bg */
  --neon-border: rgba(140, 244, 253, 0.5); /* button/floating-border */
  --neon-text: #ddfcfe; /* button/floating-content */
  --shell: 1168px;
  --radius: 20px;
  --radius-card: 24px;
  --radius-brick: 16px;
  --radius-small: 12px;
}

*,
*::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(--background);
  color: var(--text);
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

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-small);
  background: var(--surface);
  text-decoration: none;
}

/* MARK: Шапка */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(25, 27, 53, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

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

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

.logo-mark {
  width: 36px;
  height: auto;
}

.logo-word {
  width: 74px;
  height: auto;
}

.site-nav {
  display: flex;
  gap: 28px;
  margin-right: auto;
  font-size: 15px;
  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(--border);
  border-radius: 999px;
}

.tab {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  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(--border);
  color: var(--text);
}

/* Кнопка шапки повторяет плавающую кнопку приложения: неоновое стекло с
   мягким свечением. */
.header-cta {
  flex: none;
  padding: 11px 22px;
  border: 1px solid var(--neon-border);
  border-radius: 999px;
  background: var(--neon-soft);
  box-shadow: 0 0 20px rgba(140, 244, 253, 0.2);
  color: var(--neon-text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.header-cta:hover {
  background: rgba(140, 244, 253, 0.18);
}

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

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

/* Свечение под телефоном: в приложении активный кирпич светится тем же
   голубым (`brick/glow`). */
.glow {
  position: absolute;
  border-radius: 50%;
  background: rgba(140, 244, 253, 0.16);
  filter: blur(110px);
  pointer-events: none;
}

.glow-hero {
  top: 50%;
  right: 2%;
  width: 620px;
  height: 480px;
  transform: translateY(-50%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 48px;
}

.accent {
  display: block;
  width: 56px;
  height: 6px;
  border-radius: 100px;
  background: var(--cyan);
}

.accent-small {
  width: 40px;
  height: 5px;
}

.hero h1 {
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.12;
}

.hero .lead {
  max-width: 34em;
}

.lead {
  font-size: 18px;
  color: var(--text-dim);
}

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

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

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

.check .icon {
  width: 11px;
}

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

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

.hero-art img {
  position: relative;
  width: min(100%, 410px);
}

/* 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;
  color: var(--text-faint);
}

/* MARK: Секции */

.section {
  padding: 96px 0;
}

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

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 700;
}

.section-head .lead {
  margin-top: 16px;
}

.eyebrow {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

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

/* Карточка шага — кирпич с доски. Последний шаг о том, что работа сделана, и
   он зелёный, как отмеченный кирпич в приложении. */
.step {
  padding: 28px;
  border-radius: var(--radius-brick);
  background: var(--brick);
}

.step-done {
  background: var(--brick-done);
}

.step-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cyan);
}

.step h3,
.feature h3 {
  font-size: 20px;
  font-weight: 700;
}

.step p,
.feature p {
  margin-top: 10px;
  font-size: 16px;
  color: var(--text-dim);
}

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

/* Отступы меньше, чем между рядами в макете: снимок экрана несёт на себе ещё
   и прозрачное поле под тень телефона. */
.showcase {
  padding: 0 0 72px;
}

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

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

/* Через строку телефон переезжает вправо — страница идёт зигзагом. */
.show-row:nth-of-type(even) .show-art {
  order: 2;
}

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

.show-art img {
  position: relative;
  width: min(100%, 360px);
}

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

.show-copy h2 {
  margin-top: 20px;
  font-size: clamp(24px, 2.6vw, 36px);
  font-weight: 700;
}

.show-copy p {
  max-width: 30em;
  margin-top: 16px;
  font-size: 18px;
  color: var(--text-dim);
}

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

.feature {
  padding: 28px;
  border-radius: var(--radius-card);
  background: var(--soft);
}

.icon-chip {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: var(--radius-small);
  background: var(--neon-soft);
  color: var(--cyan);
}

.icon-chip .icon {
  width: 26px;
  max-height: 26px;
}

/* MARK: Финал */

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

.glow-outro {
  top: 8%;
  left: 50%;
  width: 720px;
  height: 420px;
  transform: translateX(-50%);
}

.outro-shell {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
}

.outro-mark {
  width: 96px;
  margin-bottom: 24px;
}

.outro h2 {
  max-width: 18em;
  font-size: clamp(24px, 3.2vw, 40px);
  font-weight: 700;
}

.outro-note {
  margin-top: 16px;
  margin-bottom: 24px;
  font-size: 15px;
  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, 4vw, 42px);
  font-weight: 700;
}

.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(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 14px;
  color: var(--text-dim);
}

.chip-icon {
  width: 15px;
  color: var(--cyan);
}

.doc-head .lead {
  max-width: 44em;
  margin-top: 20px;
}

.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;
}

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

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

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

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

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

.callout {
  margin: 32px 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

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

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

.doc-section h2 {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 700;
  scroll-margin-top: 96px;
}

.doc-section ul {
  margin: 16px 0;
  padding-left: 20px;
  color: var(--text-dim);
}

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

.doc-content a {
  color: var(--cyan);
}

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

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

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

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

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

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--footer);
}

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

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.footer-note {
  margin-top: 16px;
  max-width: 26em;
  font-size: 15px;
  color: var(--text-faint);
}

.footer-heading {
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
}

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

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

.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface-soft);
}

.tile-icon {
  width: 22px;
  color: var(--cyan);
}

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

.tile-title {
  font-size: 15px;
  color: var(--text);
}

.tile-note {
  font-size: 13px;
  color: var(--text-faint);
}

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

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

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

.footer-legal {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-faint);
}

.age {
  flex: none;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 500;
}

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

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hero-art {
    order: -1;
  }

  .hero-art img {
    width: min(70%, 320px);
  }

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

  /* Телефон встаёт над текстом: зигзаг из двух колонок в одну не собрать. */
  .show-row {
    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;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header-bar {
    gap: 16px;
  }

  /* Разделы главной остаются доступны через подвал: в строке шапки на
     телефоне помещаются только логотип и переключатель языка. */
  .site-nav {
    display: none;
  }

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

  /* Ручные переносы заголовка рассчитаны на широкую колонку. */
  .hero h1 br {
    display: none;
  }

  .section {
    padding: 64px 0;
  }

  .showcase {
    padding-bottom: 64px;
  }

  .outro {
    padding-bottom: 72px;
  }

  .steps,
  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .step,
  .feature {
    padding: 22px;
  }

  .header-cta {
    padding: 9px 16px;
    font-size: 14px;
  }
}

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