/*
Theme Name: RuCaptcha Ru
Theme URI: https://rucaptcha.info/
Description: Тема сайта RuCaptcha Ru. Направление «Две стороны стойки»: несущая форма — строка обмена с вертикальной осью. Оформление блоков снято кодом с rucaptcha.com (радиус 5px, волосяная рамка 1px, теней нет), полотно — глубокая бирюза.
Version: 1.0.0
Author: RuCaptcha Ru
Text Domain: rucaptcha-info
*/

/* ============================================================
   ТОКЕНЫ
   Палитра и геометрия сняты кодом с rucaptcha.com, полотно
   выбрано владельцем. Пороги контраста замерены: белый текст на
   полотне 4,92; белая плита отделяется от полотна на 4,92;
   рамка #e1eaf6 на полотне 4,06; подпись ink на лайме 12,34.
   ⚠️ Приглушённый серый живёт ТОЛЬКО на плитах (5,52). На полотне
   он даёт 3,15 и туда не ставится ни при каких условиях.
   ⚠️ Подпись на бирюзовой заливке — тёмная (5,68). Белая дала бы
   3,11: так сделано на офсайте, и этот дефект мы не копируем.
   ============================================================ */

:root {
  --field:      #0b7c8a;
  --field-deep: #08616c;
  --plate:      #ffffff;
  --plate-2:    #f8f9fb;
  --line:       #e1eaf6;
  --line-deep:  #cbd7e6;

  --ink:        #111923;
  --ink-2:      #33404f;
  --muted:      #5b6a7d;

  --brand:      #00a1b3;
  --brand-deep: #008a9a;
  --pale:       #cbf0e9;

  --lime:       #cbe417;
  --lime-deep:  #deed74;
  --ok:         #42c52c;
  --no:         #ff6464;

  --r:    5px;
  --r-2:  10px;
  --r-3:  3px;

  --hull: 1140px;
  --gut:  20px;

  --t: .38s ease;

  /* Оба семейства хостятся в теме, субсет свой — по списку кодовых точек.
     Гротеска в паре нет намеренно: свободных кириллических гротесков на
     Google Fonts не осталось (проверено сканом 248 семейств, занятых сеткой),
     а два серифа разного класса — дисплейный высококонтрастный и книжный
     наборный — в сетке не встречались ни разу. */
  --f-text:    'Gentium Book Plus', Georgia, 'Times New Roman', serif;
  --f-display: 'Cormorant', Georgia, 'Times New Roman', serif;
}

/* ============================================================
   БАЗА
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; }
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  background: var(--field);
  color: #ffffff;
  font-family: var(--f-text);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  margin: 0;
  line-height: 1.14;
  letter-spacing: -.015em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

h1 { font-size: clamp(1.95rem, 1.25rem + 2.9vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2.05rem); font-weight: 700; }
h3 { font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem); font-weight: 700; }

p { margin: 0; }

.floor { width: min(100% - calc(var(--gut) * 2), var(--hull)); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--plate); color: var(--ink); padding: 10px 15px; z-index: 60;
}
.skip:focus { left: 10px; top: 10px; }

:where(a, button, summary):focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}

/* Цифры везде табличные и прописные: у Cormorant по умолчанию
   минускульные, и в колонке цен они прыгают по высоте. */
.figure, .sheet td, .sheet th, .stat__n, .rate__n {
  font-variant-numeric: lining-nums tabular-nums;
}

/* ============================================================
   ШАПКА
   ============================================================ */

.till {
  position: sticky; top: 0; z-index: 50;
  background: var(--field);
  border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.till__in {
  display: flex; align-items: center; gap: 15px;
  min-height: 64px;
}

.brandmark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; flex: 0 0 auto;
}
.brandmark__sign { display: block; line-height: 0; }
.brandmark__sign svg { width: 32px; height: 32px; display: block; }
.brandmark__word { font-weight: 700; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brandmark__ru { color: var(--lime); }

.lanes { display: flex; align-items: center; gap: 20px; margin-left: 10px; min-width: 0; }

.lane {
  text-decoration: none; font-size: 15px; white-space: nowrap;
  padding: 4px 0; border-bottom: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
}
.lane:hover { border-bottom-color: var(--lime); }
.lane.is-here { border-bottom-color: var(--lime); font-weight: 600; }

.knock {
  display: none; margin-left: auto;
  width: 42px; height: 42px; padding: 0;
  background: transparent; border: 1px solid rgba(255, 255, 255, .32);
  border-radius: var(--r); cursor: pointer;
}
.knock span { display: block; width: 18px; height: 2px; margin: 3px auto; background: #fff; }

.drawer { background: var(--field-deep); border-top: 1px solid rgba(255, 255, 255, .16); }
.drawer__in {
  display: flex; flex-direction: column;
  padding: 10px 0 20px;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.drawer__link {
  text-decoration: none; padding: 11px 0; font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.drawer__link.is-here { color: var(--lime); font-weight: 600; }

/* ============================================================
   КНОПКА
   Заливка лаймовая, подпись тёмная. На бирюзовой заливке белая
   подпись даёт 3,11 — ниже порога, поэтому её здесь нет.
   ============================================================ */

.deal {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--lime); color: var(--ink);
  font-weight: 700; font-size: 16px; line-height: 1.2;
  text-decoration: none; text-align: center;
  padding: 12px 22px; border-radius: var(--r);
  border: 1px solid transparent;
  transition: background var(--t), color var(--t);
}
.deal:hover { background: var(--lime-deep); }
.deal--till { flex: 0 0 auto; margin-left: auto; padding: 9px 18px; font-size: 15px; }
.deal--ledge { margin-top: 0; }
.deal__short { display: none; }

.deal--ghost {
  background: transparent; color: #ffffff;
  border-color: rgba(255, 255, 255, .55);
}
.deal--ghost:hover { background: rgba(255, 255, 255, .12); color: #ffffff; }

.deal--ink { background: var(--ink); color: #ffffff; }
.deal--ink:hover { background: #000000; color: #ffffff; }

/* ============================================================
   РИТМ СЕКЦИЙ
   Тонированных полос вразбивку нет. Ритм задаёт светлая плита на
   ярком полотне и смена её ширины.
   ============================================================ */

.board { padding: 40px 0; }
.board--hero { padding: 40px 0 30px; }
.board--tight { padding: 30px 0; }

.slab {
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  color: var(--ink);
}
.slab--2 { background: var(--plate-2); }
.slab--pad { padding: 30px; }

.slab p { color: var(--ink-2); }
.slab .muted, .slab figcaption, .slab .note { color: var(--muted); }

.column { max-width: 68ch; }

.lead {
  font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem);
  line-height: 1.55;
  margin-top: 15px;
}

.board > .floor > h2 { margin-bottom: 20px; }
.board > .floor > h2 + .lead { margin-top: -5px; margin-bottom: 20px; }

/* ============================================================
   СТРОКА ОБМЕНА — несущая форма
   ============================================================ */

.swap {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.swap__spine { background: var(--line-deep); }

.swap__side {
  padding: 20px;
  display: flex; flex-direction: column; gap: 5px;
  background: var(--plate);
  transition: background var(--t);
}
.swap__side--earn { text-align: right; }

/* Ховер офсайтной механики — смена фона, без подъёма и тени.
   Подсвечивается только та сторона оси, где курсор. */
.swap__side:hover { background: var(--plate-2); }

.swap__role {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 700; color: var(--muted);
}
.swap__sum {
  font-family: var(--f-display);
  font-size: clamp(2rem, 1.3rem + 2.4vw, 2.9rem);
  font-weight: 600; line-height: 1.02; color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}
.swap__side--earn .swap__sum { color: var(--brand-deep); }
.swap__unit { font-size: 13px; color: var(--muted); }

.swap__strip {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 30px;
  padding: 15px 20px;
  background: var(--plate-2);
}
.swap__fact { font-size: 13px; color: var(--muted); }
.swap__fact b {
  color: var(--ink); font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
}

.acts { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 30px; }

/* ============================================================
   СЕТКИ И КАРТОЧКИ
   auto-fit требует настоящего минимума: minmax(0, 1fr) внутри
   auto-fit — невалидная запись, браузер отбрасывает объявление
   целиком, и страница едет вбок на узких экранах.
   ============================================================ */

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card h3 { color: var(--ink); }
.card__text { min-width: 0; }

/* Числовая плитка */
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat__n {
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.5rem);
  font-weight: 600; line-height: 1.05; color: var(--ink);
}
.stat__k { font-size: 13px; color: var(--muted); }

/* ============================================================
   ТАБЛИЦЫ
   ============================================================ */

.sheet-wrap { overflow-x: auto; }

.sheet {
  width: 100%; border-collapse: collapse;
  background: var(--plate); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  font-size: 15px;
}
.sheet th, .sheet td {
  text-align: left; padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.sheet thead th {
  background: var(--plate-2); color: var(--muted);
  font-size: 12px; letter-spacing: .07em; text-transform: uppercase; font-weight: 700;
  white-space: nowrap;
}
.sheet tbody tr:last-child td { border-bottom: 0; }
.sheet tbody tr { transition: background var(--t); }
.sheet tbody tr:hover { background: var(--plate-2); }
.sheet .num { white-space: nowrap; font-weight: 600; }
.sheet .hint { color: var(--muted); font-size: 13.5px; }

/* ============================================================
   ВОПРОСЫ
   ============================================================ */

.riddle { display: flex; flex-direction: column; gap: 10px; }

.riddle__item {
  background: var(--plate); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.riddle__q {
  width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 0;
  font-family: inherit; font-size: 16px; font-weight: 700; color: var(--ink);
  padding: 15px 20px;
  display: flex; align-items: baseline; gap: 15px;
  transition: background var(--t);
}
.riddle__q:hover { background: var(--plate-2); }
.riddle__q::after {
  content: '+'; margin-left: auto; color: var(--brand);
  font-size: 20px; line-height: 1; flex: 0 0 auto;
}
.riddle__q[aria-expanded="true"]::after { content: '−'; }

.riddle__a {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows var(--t);
}
.riddle__a.is-open { grid-template-rows: 1fr; }
.riddle__a > div { overflow: hidden; }
.riddle__a p { padding: 0 20px 15px; color: var(--ink-2); }

/* ============================================================
   ОТЗЫВЫ И ОЦЕНКА
   ============================================================ */

.stars { position: relative; display: inline-flex; line-height: 0; }
.stars__bg, .stars__fg { display: flex; gap: 2px; }
.stars__fg { position: absolute; top: 0; left: 0; bottom: 0; overflow: hidden; white-space: nowrap; }
.stars__bg { opacity: .28; }
.star {
  width: 16px; height: 16px; flex: 0 0 auto;
  background: var(--brand);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.voice { display: flex; flex-direction: column; gap: 10px; }
.voice__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.voice__name { font-weight: 700; color: var(--ink); }
.voice__role {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.voice__date { font-size: 13px; color: var(--muted); margin-left: auto; }

.rate { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 20px; }
.rate__n {
  font-family: var(--f-display); font-size: 3rem; font-weight: 600;
  line-height: 1; color: var(--ink);
}
.rate__of { color: var(--muted); font-size: 15px; }

.crit { display: flex; flex-direction: column; gap: 10px; }
.crit__row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px 15px; align-items: baseline; }
.crit__t { color: var(--ink); min-width: 0; }
.crit__v { font-weight: 700; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.crit__why { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); margin-top: -5px; }

/* ============================================================
   МЕЛКАЯ ТИПОГРАФИКА И ОТСТУПЫ
   Отступы задаются классами, а не инлайновым style=: инлайн из CSS
   не переопределить, и на узких ширинах он схлопывал воздух.
   ============================================================ */

.mt     { margin-top: 20px; }
.pad-t  { margin-top: 15px; }

.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.steps li { color: var(--ink-2); }
.steps li::marker { color: var(--brand); font-weight: 700; }

/* Пояснение внутри плиты — приглушённый серый допустим только здесь. */
.note { color: var(--muted); font-size: 14px; margin-top: 15px; }

/* Пояснение НА ПОЛОТНЕ.
   ⚠️ Замер живой страницы: rgba(255,255,255,.86) даёт 4,08 — ниже порога 4,5
   при кегле 14px. Приглушить этот текст прозрачностью нельзя вовсе: на этом
   полотне не проходят ни серый (3,15), ни пастельные офсайта — #cbf0e9 даёт
   4,03, #d5eeff даёт 4,10. Потолок задаёт полотно, поэтому текст остаётся
   чистым белым (4,92), а второстепенность держится кеглем, а не цветом. */
.note-field {
  color: #ffffff;
  font-size: 14px; margin-top: 15px; max-width: 78ch;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
  background: var(--plate-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 1px 5px;
}
.slab code { background: #f1f4f9; }

.prose > * + * { margin-top: 15px; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; }

/* Кнопка внутри ячейки таблицы и карточки: подпись не ломается. */
.deal--xs {
  padding: 7px 13px; font-size: 14px; white-space: nowrap;
  margin-top: 5px; margin-right: 5px;
}

.rate + .crit { margin-top: 20px; }
.crit + p, .voice p { margin-top: 10px; }

/* ============================================================
   СМЕЖНЫЕ РАЗДЕЛЫ
   ============================================================ */

.nearby { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.nearby__link {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--plate); border: 1px solid var(--line);
  border-radius: var(--r); padding: 15px 20px;
  text-decoration: none; transition: background var(--t);
}
.nearby__link:hover { background: var(--plate-2); }
.nearby__t { color: var(--ink); font-weight: 700; }
.nearby__d { color: var(--muted); font-size: 13.5px; }

.trail { font-size: 13.5px; padding-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.trail a { text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .45); }
.trail a:hover { border-bottom-color: var(--lime); }
.trail__sep { opacity: .6; }

/* ============================================================
   ПОДВАЛ
   ============================================================ */

.ledge {
  background: var(--ink); color: #ffffff;
  padding: 40px 0 30px; margin-top: 40px;
}
.ledge__top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; }
.ledge__word p { margin-top: 15px; color: #c7cfda; max-width: 46ch; }

/* Воздух над кнопкой — классом, не инлайном. */
.ledge__act { margin-top: 30px; }

.ledge__lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 20px; align-content: start; }

/* Селектор сужен: правило подвала не должно перекрашивать кнопку
   по специфичности — типовой дефект сетки, где .foot a побеждал
   класс кнопки и подпись сливалась с фоном. */
.ledge a:not(.deal) {
  color: #d7dee7; text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--t), border-color var(--t);
}
.ledge a:not(.deal):hover { color: #ffffff; border-bottom-color: var(--lime); }

.ledge__base {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  display: flex; gap: 20px; flex-wrap: wrap; align-items: baseline;
}
.ledge__note { color: #aab4c1; font-size: 13.5px; max-width: 78ch; }
.ledge__year { color: #aab4c1; font-size: 13.5px; margin-left: auto; }

/* ============================================================
   ПОЯВЛЕНИЕ БЛОКОВ
   Скрытое состояние — только под .js. Без скрипта текст виден.
   ============================================================ */

.js .rise { opacity: 0; transform: translateY(14px); }
.js .rise.is-in {
  opacity: 1; transform: none;
  transition: opacity .5s ease, transform .5s ease;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .js .rise { opacity: 1; transform: none; }
}

/* ============================================================
   БРЕЙКПОИНТЫ
   Своя лестница: 1180 / 1040 / 980 / 820 / 640 / 520 / 430 / 360.
   Порог бургера 980 совпадает с BURGER_AT в scripts.js — если
   развести значения, класс остаётся висеть после поворота экрана.
   ============================================================ */

@media (max-width: 1180px) {
  .lanes { gap: 15px; }
  .lane { font-size: 14px; }
}

@media (max-width: 1040px) {
  :root { --gut: 15px; }
  .ledge__top { gap: 30px; }
}

@media (max-width: 980px) {
  .lanes { display: none; }
  .knock { display: block; }
  .deal--till { margin-left: auto; }
  .board { padding: 30px 0; }
}

@media (max-width: 820px) {
  .ledge__top { grid-template-columns: minmax(0, 1fr); }
  .swap { grid-template-columns: minmax(0, 1fr); }
  .swap__spine { height: 1px; width: auto; }
  .swap__side--earn { text-align: left; }
}

@media (max-width: 640px) {
  .slab, .slab--pad { padding: 15px; }
  .board { padding: 25px 0; }
  .crit__row { grid-template-columns: 1fr auto; }

  /* Таблица становится стопкой карточек: горизонтальной прокрутки
     на телефоне быть не должно. */
  .sheet, .sheet tbody, .sheet tr, .sheet td { display: block; width: 100%; }
  .sheet thead { display: none; }
  .sheet tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .sheet tr:last-child { border-bottom: 0; }
  .sheet td { border: 0; padding: 4px 15px; }
  .sheet td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
    color: var(--muted); font-weight: 700;
  }
}

@media (max-width: 520px) {
  .swap__strip { gap: 10px 20px; }
  .ledge__base { flex-direction: column; }
  .ledge__year { margin-left: 0; }
}

/* Порядок жертв канонический: сначала сокращается подпись кнопки,
   подпись знака гаснет последней и только если иначе не сходится. */
@media (max-width: 430px) {
  .deal__full { display: none; }
  .deal__short { display: inline; }
  .till__in { gap: 10px; min-height: 58px; }
  .brandmark__word { font-size: 16px; }
}

@media (max-width: 360px) {
  .brandmark__ru { display: none; }
  .deal--till { padding: 9px 14px; }
}
