
/* tgAtlas — журнал наблюдений.
   Опорная метафора: не лендинг SaaS, а запись замера. Атлас — лист с
   каталогом, снятым в известную неделю: бумага, чернила и ровно столько
   цвета, сколько несёт смысл. Зелёный здесь — измеренное значение
   (доля, полоса, растущий ряд), охра — вторая величина там, где их две
   и их нужно различать. Всё остальное — чернила по бумаге.
   Шкала серого разнесена так, чтобы каждая её текстовая ступень проходила
   AA на ЛЮБОЙ из трёх подложек — --paper, --paper-2 (фон inline <code>) и
   --card (строка под курсором): --ink-2 10.2, --muted 6.1, --faint 4.6 в
   худшем случае. --rule и --rule-soft — только линейки, текстом не бывают. */

:root {
  --paper: #eef1f6;
  --paper-2: #e4e9f1;
  --card: #f7f9fc;
  --ink: #131a2b;
  --ink-2: #2b344a;
  --muted: #4b556a;
  --faint: #5d687e;
  --rule: #c3ccdb;
  --rule-soft: #d8dfe9;
  --cite: #1d6b52;
  --cite-bg: #dceee6;
  --rank: #8a5d14;
  --rank-bg: #f3e8d2;

  --wrap: 1180px;
  --rail: 172px;
  --prose: 64ch;
  --step: 8px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Public Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: Spectral, ui-serif, Georgia, serif;
  font-weight: 600;
  line-height: 1.18;
  /* Один интерлиньяж на три уровня не работает: h1 у нас до 46px, а h2 в шапке
     секции — 20–24px и регулярно переносится. Дисплейному размеру 1.18 идёт,
     почти текстовому — тесно, поэтому ниже размеры разведены. */
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.14; }
h2 { font-size: clamp(23px, 2.7vw, 30px); line-height: 1.3; }
h3 { font-size: 19px; line-height: 1.3; }

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

a { color: var(--ink); text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--cite); }

/* ── Поверхности браузера ──────────────────────────────────────────── */
/* Выделение, каретка, чекбоксы и полосы прокрутки браузер рисует своей
   палитрой. Здесь они переведены на нашу. */
::selection { background: var(--cite-bg); color: var(--ink); }
html { caret-color: var(--cite); accent-color: var(--cite); scrollbar-color: var(--rule) var(--paper); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: var(--prose); }
.prose h2 { font-size: 23px; margin: 34px 0 10px; }
.prose h2:first-child { margin-top: 0; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper);
  padding: 10px 16px; z-index: 20;
}
.skip:focus { left: 8px; top: 8px; }

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

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

.preview {
  background: var(--rank-bg);
  border-bottom: 1px solid var(--rank);
  color: var(--rank);
  padding: 10px 24px;
  font-size: 13.5px;
  text-align: center;
}
.preview b { font-weight: 700; }

/* ── Шапка ─────────────────────────────────────────────────────────── */

.top { border-bottom: 1px solid var(--rule); background: var(--paper); }
.top-in {
  display: flex; align-items: center; gap: 22px;
  min-height: 62px; flex-wrap: wrap;
}
.logo {
  font-family: Spectral, serif; font-size: 21px; font-weight: 600;
  letter-spacing: -0.02em; text-decoration: none; display: inline-block; white-space: nowrap;
}
.logo b { font-weight: 600; color: var(--cite); }
.nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.nav a { font-size: 14.5px; text-decoration: none; color: var(--muted); padding: 4px 0; }
.nav a:hover { color: var(--ink); }
.top-cta {
  font-size: 14.5px; font-weight: 500; text-decoration: none;
  border: 1px solid var(--ink); padding: 7px 14px; color: var(--ink);
}
.top-cta:hover { background: var(--ink); color: var(--paper); }

/* ── Строка наблюдения ─────────────────────────────────────────────── */
/* Единственный громкий элемент сайта. Всё остальное держится тихо. */

.readout {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  padding: 26px 0 24px;
  margin-bottom: 40px;
}
.readout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 22px 30px;
  align-items: end;
}
.ro-k { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.ro-v {
  font-family: Spectral, serif; font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 400; line-height: 1; letter-spacing: -0.02em;
}
.ro-s { font-size: 12.5px; color: var(--faint); margin-top: 5px; }
.ro-spark { grid-column: span 2; min-width: 200px; }
.spark { display: block; width: 100%; height: 46px; }
.spark path { fill: none; stroke: var(--cite); stroke-width: 1.6; }
.spark .area { fill: var(--cite-bg); stroke: none; }
.spark circle { fill: var(--cite); }

.week {
  font-size: 12.5px; letter-spacing: 0.02em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── Секции ────────────────────────────────────────────────────────── */

.section { display: grid; grid-template-columns: var(--rail) 1fr; gap: 30px; padding: 34px 0; border-top: 1px solid var(--rule-soft); }
.section:first-of-type { border-top: 0; }
.section-h { position: sticky; top: 18px; align-self: start; min-width: 0; }
.section-h h2 { font-size: clamp(20px, 1.9vw, 24px); overflow-wrap: break-word; }
.section-h .mark { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 6px; }
.section-b { min-width: 0; }
.lede { font-family: Spectral, serif; font-size: 19px; line-height: 1.5; color: var(--ink); max-width: var(--prose); }
.note { font-size: 13.5px; color: var(--muted); max-width: var(--prose); }

.page-head { padding-top: 30px; padding-bottom: 22px; }
.crumbs { font-size: 13px; color: var(--muted); padding: 16px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); padding: 3px 0; }
.crumbs span[aria-hidden] { color: var(--faint); }

/* ── Данные ────────────────────────────────────────────────────────── */

.tw::-webkit-scrollbar { height: 9px; }
.tw::-webkit-scrollbar-track { background: var(--paper-2); }
.tw::-webkit-scrollbar-thumb { background: var(--rule); }
.tw::-webkit-scrollbar-thumb:hover { background: var(--faint); }

.tw {
  overflow-x: auto; margin: 0 0 4px; overscroll-behavior-x: contain;
  scrollbar-color: var(--rule) var(--paper-2);
  background:
    linear-gradient(to right, var(--paper) 30%, rgba(238, 241, 246, 0)) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--paper) 30%, rgba(238, 241, 246, 0)) right center / 28px 100% no-repeat local,
    linear-gradient(to right, rgba(19, 26, 43, 0.14), rgba(19, 26, 43, 0)) left center / 12px 100% no-repeat scroll,
    linear-gradient(to left, rgba(19, 26, 43, 0.14), rgba(19, 26, 43, 0)) right center / 12px 100% no-repeat scroll;
}
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: baseline; }
th { font-size: 12.5px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--rule); white-space: nowrap; }
th + th, td + td { padding-left: 16px; }
/* Ссылка в ячейке — 17px в высоту; 4px сверху и снизу дают 25px и остаются
   внутри собственной отбивки ячейки, поэтому строки не разъезжаются. */
td a { padding: 4px 0; }
tr > :last-child { padding-right: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--card); }

.pill {
  display: inline-block; font-size: 12.5px; padding: 2px 8px;
  border: 1px solid var(--rule); color: var(--muted); margin: 0 4px 4px 0;
}
.pill-on { border-color: var(--cite); color: var(--cite); background: var(--cite-bg); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 18px 26px; margin: 0 0 6px; }
.fact-k { font-size: 12.5px; color: var(--muted); }
.fact-v { font-family: Spectral, serif; font-size: 27px; line-height: 1.1; }
.fact-s { font-size: 12.5px; color: var(--faint); }

/* Полоса доли. Ширина — это и есть значение, поэтому подпись всегда рядом. */
.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: minmax(96px, 1.4fr) 52px 2.2fr; gap: 12px; align-items: center; font-size: 14px; }
.bar a { padding: 4px 0; }
.bar-v { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.bar-t { height: 9px; background: var(--paper-2); }
.bar-f {
  display: block; height: 100%; background: var(--cite);
  transform-origin: left center;
  animation: bar-in 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* Небольшая лестница задержек: полосы читаются сверху вниз, и так же
   приходят. Дальше восьмой разница уже не видна — там задержки нет. */
.bars > .bar:nth-child(2) .bar-f { animation-delay: 45ms; }
.bars > .bar:nth-child(3) .bar-f { animation-delay: 90ms; }
.bars > .bar:nth-child(4) .bar-f { animation-delay: 135ms; }
.bars > .bar:nth-child(5) .bar-f { animation-delay: 180ms; }
.bars > .bar:nth-child(6) .bar-f { animation-delay: 225ms; }
.bars > .bar:nth-child(7) .bar-f { animation-delay: 270ms; }
.bars > .bar:nth-child(n+8) .bar-f { animation-delay: 300ms; }
@keyframes bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar-f[data-kind="rank"] { background: var(--rank); }

/* Подпись под спарклайном: первая и последняя неделя ряда. */
.weeks-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-top: 5px; max-width: 220px; }

.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 2px 20px; }
.links a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; padding: 5px 0; font-size: 14.5px; text-decoration: none; border-bottom: 1px solid var(--rule-soft); }
.links a:hover { color: var(--cite); }
.links .l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links .c { flex: none; color: var(--faint); font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--rule-soft); padding: 20px 22px; }

pre {
  background: var(--ink); color: #d9e2f0; padding: 16px 18px; overflow-x: auto;
  font-size: 13px; line-height: 1.6; margin: 0 0 14px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
pre b { color: #7fd3ae; font-weight: 400; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.92em; }
:not(pre) > code { background: var(--paper-2); padding: 1px 5px; }

.btn {
  display: inline-block; background: var(--ink); color: var(--paper);
  padding: 11px 20px; text-decoration: none; font-size: 15px; font-weight: 500; border: 1px solid var(--ink);
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-2 { background: transparent; color: var(--ink); }
.btn-2:hover { background: var(--ink); color: var(--paper); }

.cta {
  border: 1px solid var(--ink); padding: 24px 26px; display: flex; gap: 24px;
  align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 8px 0 0;
}
.cta p { margin: 0; }
.cta-h { font-family: Spectral, serif; font-size: 20px; }
.cta-s { font-size: 14px; color: var(--muted); max-width: 52ch; }

.watch { border-top: 1px solid var(--rule); padding-top: 20px; margin-top: 26px; display: grid; gap: 14px; }
.watch input[type=email] { border: 1px solid var(--rule); background: var(--card); padding: 10px 12px; font: inherit; font-size: 15px; min-width: 220px; flex: 1; }
.watch-in { display: flex; gap: 8px; flex-wrap: wrap; }
.watch button { font: inherit; cursor: pointer; }

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

.foot { border-top: 1px solid var(--rule); margin-top: 56px; padding: 36px 0 46px; font-size: 14px; }
.foot-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 26px; }
.foot-g h2 { margin: 0 0 9px; color: var(--muted); font-family: 'Public Sans', ui-sans-serif, sans-serif; font-size: 12.5px; font-weight: 500; letter-spacing: 0; }
.foot-g a { display: block; padding: 3px 0; text-decoration: none; color: var(--ink); }
.foot-g a:hover { color: var(--cite); }
.foot-b { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--rule-soft); color: var(--muted); font-size: 13px; display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }

/* ── Узкий экран ───────────────────────────────────────────────────── */

@media (max-width: 860px) {
  /* 1.14 — интерлиньяж дисплейного размера: на 46px он верен. На телефоне тот
     же h1 садится до 30px и переносится в три строки, и там он уже тесен. */
  h1 { line-height: 1.22; }
  .section { grid-template-columns: 1fr; gap: 12px; }
  .section-h { position: static; }
  .top-in { gap: 14px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 4px; }
  .top-cta { margin-left: auto; }
  .ro-spark { grid-column: span 1; }
}

/* Отклик на наведение — один общий переход на всё, что нажимается. */
.nav a, .crumbs a, .top-cta, .btn, .links a, .foot-g a, .bar a, td a, a {
  transition: color 120ms ease-out, background-color 120ms ease-out,
              border-color 120ms ease-out, text-decoration-color 120ms ease-out;
}

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