/*
  Тема привязана к языку, а не выбирается отдельно.

  Снимки существуют в двух вариантах: английские сняты с тёмного
  приложения, русские со светлого. Тема страницы обязана совпадать
  с темой снимков, иначе кадры выглядят наклейками — светлые
  прямоугольники на тёмной странице или наоборот.

  Отсюда одна кнопка вместо двух: она переключает язык, а вместе с ним
  и оформление. Два независимых переключателя дали бы четыре сочетания,
  из которых два выглядят сломанными.

  По умолчанию английский и тёмная — так и открывается страница.

  Без внешних шрифтов и библиотек. Страница вшита в бинарь и должна
  открываться там, где интернета может не быть — например, в переговорной
  через локальную сеть.
*/

:root {
  /* Тёмная: значение по умолчанию, под английские снимки. */
  --bg: #08080a;
  --bg-alt: #121216;
  --card: #16161c;
  --line: #26262e;
  --text: #f4f4f7;
  --muted: #8e8e9c;
  --soft: #b4b4c2;
  --accent: #6c63ee;
  --warn: #e8994a;
  --shadow: rgba(0, 0, 0, 0.45);
}

/* Светлая: под русские снимки. */
html[lang="ru"] {
  --bg: #ffffff;
  --bg-alt: #f2f2f7;
  --card: #ffffff;
  --line: #e2e2e9;
  --text: #14141a;
  --muted: #6b6b78;
  --soft: #4a4a56;
  --accent: #5850d8;
  --warn: #c8600f;
  --shadow: rgba(20, 20, 26, 0.1);
  --gutter: 24px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  /* Горизонтальная прокрутка на телефоне: любой элемент шире экрана
     сдвигает всю страницу, и содержимое уезжает за левый край. */
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* Переключатель языка прячет неактивную ветку целиком: оба языка
   в разметке рядом, а не в двух файлах — так они не разъезжаются. */
/* По умолчанию английский: русская ветка прячется, а не наоборот. */
[data-ru] { display: none; }
html[lang="ru"] [data-ru] { display: inline; }
html[lang="ru"] [data-en] { display: none; }

/* Шапка */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.top__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  font-size: 14px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.lang {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lang:hover { border-color: var(--accent); }

/* Обложка */

.hero {
  padding: 88px 0 64px;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-bottom: 1px solid var(--line);
}


h1 {
  margin: 0 0 28px;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 66ch;
  margin: 0 0 18px;
  font-size: 18px;
  color: var(--soft);
}

/* Разделы */

.section { padding: 72px 0; }
.section--alt { background: var(--bg-alt); }

h2 {
  margin: 0 0 32px;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.01em;
}

h3 {
  margin: 0 0 14px;
  font-size: 21px;
}

/* Сюжет: текст и кадры рядом на широком экране, друг под другом на узком */

.story {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 40px;
  align-items: start;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}

.story:first-of-type { border-top: 0; padding-top: 0; }

/* Один кадр во всю ширину — тексту не нужна узкая колонка. */
.story--wide { grid-template-columns: 1fr; gap: 32px; }
.story--wide .story__text { max-width: 72ch; }

.story__text p {
  color: var(--soft);
  margin: 0 0 14px;
}

.shots {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/*
  Заглушка кадра: пропорции заданы заранее, чтобы вёрстка не прыгала,
  когда снимки появятся. Подпись остаётся частью разметки — она объясняет
  кадр, а не подписывает картинку.
*/
.shot {
  margin: 0;
  flex: 1 1 200px;
  min-width: 0;
}

.shot::before {
  content: attr(data-shot);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 8px;
  text-align: center;
}

.shot--phone::before { aspect-ratio: 9 / 19.5; }
.shot--wide::before { aspect-ratio: 16 / 11; }

.shot--wide { flex-basis: 100%; }

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px var(--shadow);
}

/* Снимок появился — заглушка не нужна. */
.shot:has(img)::before { display: none; }

figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

/* Список возможностей рядом со снимком */

.split {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  align-items: start;
}

.ticks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding: 13px 0 13px 30px;
  border-bottom: 1px solid var(--line);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 21px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Карточки схем */

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 2px 12px var(--shadow);
}

.card h3 { font-size: 17px; margin-bottom: 10px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* Допущения */

.limits { margin: 0; }

.limits dt {
  margin-top: 28px;
  padding-left: 16px;
  border-left: 3px solid var(--warn);
  font-weight: 600;
}

.limits dd {
  margin: 10px 0 0 19px;
  color: var(--soft);
  max-width: 72ch;
}

/* Контакты */

.contacts__line {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 28px 0;
  font-size: 20px;
}

.contacts__line a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.contacts__line a:hover { border-bottom-color: var(--accent); }

.muted { color: var(--muted); font-size: 14px; max-width: 72ch; }

/* Подвал */

.foot {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* Узкий экран: страницу открывают с телефона не реже, чем с ноутбука */

@media (max-width: 860px) {
  .story, .split { grid-template-columns: 1fr; gap: 28px; }
  .nav { display: none; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 56px 0; }
}

/*
  Телефон.

  Три снимка в ряд не помещаются: при ширине основы в двести точек
  строка получается шире экрана, и страница уезжает вбок вместе
  с заголовком. Кадры выстраиваются в колонку и ограничиваются
  по ширине — телефонный снимок во весь экран занимал бы четыре
  прокрутки.
*/
@media (max-width: 560px) {
  :root { --gutter: 20px; }

  h1 { font-size: 32px; line-height: 1.15; }
  h2 { font-size: 24px; margin-bottom: 24px; }
  h3 { font-size: 19px; }

  .lead { font-size: 17px; }

  .hero { padding: 40px 0 36px; }
  .section { padding: 44px 0; }

  .story { padding: 32px 0; gap: 24px; }

  .shots { flex-direction: column; align-items: center; gap: 24px; }
  .shot { flex: none; width: 100%; max-width: 280px; }
  .shot--wide { max-width: 100%; }

  .limits dt { margin-top: 24px; }
  .contacts__line { gap: 16px; font-size: 18px; }
}
