/*
  Speed Money — дизайн-система «Ночь».
  Графит и тёплый янтарь, шрифт Commissioner. Тема тёмная у всех;
  светлая есть в токенах, но включается только явно (data-theme="light").
  Порядок: токены → база → каркас → компоненты (по блокам) → адаптив.
*/

/* ---------- Шрифт: Commissioner, переменный 300-800, свой хостинг ---------- */

@font-face {
  font-family: 'Commissioner';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/assets/fonts/commissioner-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Commissioner';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/assets/fonts/commissioner-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Из latin-ext нужен только знак рубля: файл грузится лишь на страницах, где есть ₽. */
@font-face {
  font-family: 'Commissioner';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/assets/fonts/commissioner-latin-ext.woff2') format('woff2');
  unicode-range: U+20BD;
}

/* ---------- Токены ---------- */

:root {
  color-scheme: dark;

  --bg: #0c0e11;
  --surface: #15181d;
  --surface-2: #1d2128;
  --ink: #eef0f3;
  --ink-2: #9aa1ad;
  --ink-body: #c9cdd4;
  --line: #262b33;
  --amber: #ffb547;
  --amber-deep: #ff9f1c;
  --amber-ink: #1a1207;
  --amber-wash: rgb(255 181 71 / 0.12);
  --glow: rgb(255 181 71 / 0.12);
  --card-from: #262b33;
  --card-to: #101317;
  --shadow: 0 40px 80px -30px rgb(0 0 0 / 0.8);
  --tint-warm: #2a2216;
  --tint-cool: #1b2430;

  --font: 'Commissioner', system-ui, sans-serif;
  --r-lg: 24px;
  --r-md: 18px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shell: 1200px;
  --gutter: 24px;
}

/* Светлая тема: включается только явно, атрибутом data-theme="light" на <html>.
   По системной настройке не переключаем: фирменный вид сайта тёмный. */
:root[data-theme='light'] {
  color-scheme: light;

  --bg: #f2f1ee;
  --surface: #ffffff;
  --surface-2: #ebe9e4;
  --ink: #14161a;
  --ink-2: #5b606a;
  --ink-body: #2c3038;
  --line: #dedbd4;
  --amber: #b86a00;
  --amber-wash: rgb(255 181 71 / 0.18);
  --glow: rgb(255 181 71 / 0.25);
  --card-from: #2a2f37;
  --card-to: #14171c;
  --shadow: 0 40px 80px -40px rgb(20 22 26 / 0.45);
  --tint-warm: #fbecd2;
  --tint-cool: #e2e9f2;
}

/* ---------- База ---------- */

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(60% 40% at 80% 0%, var(--glow), transparent 70%) no-repeat,
    var(--bg);
}

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

a {
  color: inherit;
}

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

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

.skip-link:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--amber);
  color: var(--amber-ink);
}

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

/* ---------- Шапка ---------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* Логотип: русское название первым и крупнее латиницы (закон о русском языке:
   иноязычное обозначение дублируется на русском, русский текст не меньше по размеру). */
.site-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
}

.site-logo-ru {
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.site-logo-ru b {
  color: var(--amber);
}

.site-logo-en {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--ink-2);
}

.site-nav {
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(12px);
}

.site-nav a {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 14px;
  text-decoration: none;
  color: var(--ink-2);
}

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

.site-nav a[aria-current='page'] {
  background: var(--surface-2);
  color: var(--ink);
}

/* ---------- Типографика страниц ---------- */

.display {
  margin: 0 0 20px;
  font-weight: 300;
  font-size: clamp(38px, 5.4vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.display b {
  font-weight: 800;
}

.lead {
  max-width: 30em;
  margin: 0 0 28px;
  font-size: 19px;
  color: var(--ink-2);
}

.byline {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.section-title {
  margin: 0 0 20px;
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* ---------- Первый экран с картой ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: min(calc(100dvh - 72px), 780px);
  padding: 16px 0 48px;
}

.hero-crumbs {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--ink-2);
}

.hero-crumbs a {
  text-decoration: none;
}

.hero-crumbs a:hover {
  color: var(--ink);
}

/* Квиз-чипы */

.quiz-step + .quiz-step {
  margin-top: 22px;
}

.quiz-q {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 18px;
}

.quiz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  line-height: normal;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.2s var(--ease);
}

.chip:hover {
  border-color: var(--ink-2);
}

.chip:active {
  transform: scale(0.97);
}

.chip[aria-pressed='true'] {
  border-color: var(--amber);
  background: var(--amber-wash);
}

/* Карта: фирменный элемент */

.stage {
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.flipcard {
  position: relative;
  width: min(460px, 100%);
  aspect-ratio: 1.586;
  transform-style: preserve-3d;
  transition: transform 0.9s var(--ease);
}

.flipcard.is-flipped {
  transform: rotateY(180deg);
}

.flipcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  border-radius: var(--r-lg);
  backface-visibility: hidden;
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgb(255 255 255 / 0.14);
}

.flipcard-front {
  background:
    radial-gradient(90% 120% at 100% 0%, rgb(255 181 71 / 0.35), transparent 55%),
    linear-gradient(150deg, var(--card-from), var(--card-to) 70%);
  color: #eef0f3;
}

.flipcard-front::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.1) 45%, transparent 60%);
  background-size: 250% 100%;
  background-position: var(--sheen, 100%) 0;
  pointer-events: none;
}

.flipcard-back {
  transform: rotateY(180deg);
  background: linear-gradient(150deg, #ffc56b, var(--amber-deep));
  color: var(--amber-ink);
}

.flipcard-brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.flipcard-chip {
  width: 50px;
  height: 38px;
  margin-top: 6px;
  border-radius: 9px;
  background: linear-gradient(135deg, #f1e6c4, #b49a5c);
}

.flipcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flipcard-contactless {
  color: rgb(238 240 243 / 0.75);
}

/* Номер и подписи как на тиснёной карте */
.flipcard-number {
  margin: 0;
  font-weight: 500;
  font-size: clamp(18px, 2.2vw, 24px);
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow:
    0 1px 0 rgb(0 0 0 / 0.5),
    0 -1px 0 rgb(255 255 255 / 0.08);
}

.flipcard-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.flipcard-bottom div {
  display: grid;
  gap: 2px;
}

.flipcard-bottom div:last-child {
  text-align: right;
}

.flipcard-bottom small {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(238 240 243 / 0.55);
}

.flipcard-bottom span {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.5);
}

.stage {
  gap: 18px;
}

.stage-hint {
  margin: 0;
  max-width: 460px;
  font-size: 15px;
  color: var(--ink-2);
  text-align: center;
}

.flipcard-result {
  margin: 0;
  font-weight: 800;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.flipcard-why {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.flipcard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.flipcard-cta {
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: var(--amber-ink);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.flipcard-reset {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Прямой ответ ---------- */

.answer {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 32px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.answer-verdict {
  margin: 0;
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--amber);
}

.answer-text {
  margin: 0;
  font-size: 19px;
  line-height: 1.55;
}

/* ---------- Калькулятор ---------- */

.calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.calc-label {
  margin: 0;
  font-weight: 500;
  color: var(--ink-2);
}

.calc-big {
  margin: 4px 0 6px;
  font-weight: 800;
  font-size: clamp(52px, 6.4vw, 84px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.calc-over {
  margin: 0 0 22px;
  font-weight: 600;
  color: var(--amber);
}

.calc-bar {
  display: flex;
  height: 12px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface-2);
}

.calc-bar-body {
  background: var(--ink);
  transition: flex-grow 0.5s var(--ease);
}

.calc-bar-fee {
  background: var(--amber);
  transition: flex-grow 0.5s var(--ease);
}

.calc-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.calc-field + .calc-field {
  margin-top: 20px;
}

.calc-field label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}

.calc-field output {
  font-variant-numeric: tabular-nums;
}

.calc input[type='range'] {
  width: 100%;
  height: 32px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.calc input[type='range']::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--line);
}

.calc input[type='range']::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border: 6px solid var(--amber);
  border-radius: 50%;
  appearance: none;
  background: var(--bg);
}

.calc input[type='range']::-moz-range-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--line);
}

.calc input[type='range']::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 6px solid var(--amber);
  border-radius: 50%;
  background: var(--bg);
}

.calc-zero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--amber-wash);
  font-weight: 500;
  cursor: pointer;
}

.calc-zero input {
  width: 22px;
  height: 22px;
  accent-color: var(--amber-deep);
}

/* ---------- Условия: плитки ---------- */

.terms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.term {
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.term:first-child {
  background: linear-gradient(160deg, var(--tint-warm), var(--surface) 75%);
}

.term-label {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--ink-2);
}

.term-value {
  margin: 0;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.term-note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- Текст статьи ---------- */

.prose {
  max-width: 720px;
}

/* Основной текст статьи — на плашке, как и остальные блоки страницы. Ширина та же, что у
   обложки, поэтому колонка текста встаёт ровно под картинку. */
article.prose {
  max-width: 880px;
  margin: 40px 0;
  padding: 8px 56px 48px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

article.prose > :last-child {
  margin-bottom: 0;
}

@media (max-width: 700px) {
  article.prose {
    margin: 24px calc(-1 * var(--gutter) / 2);
    padding: 4px 20px 32px;
  }
}

.prose h2 {
  margin: 48px 0 14px;
  font-weight: 800;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.prose h3 {
  margin: 32px 0 10px;
  font-weight: 700;
  font-size: 22px;
}

.prose p,
.prose li {
  color: var(--ink-body);
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li + li {
  margin-top: 6px;
}

.prose a {
  color: var(--amber);
  text-underline-offset: 3px;
}

.prose table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 15px;
}

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

.prose th {
  font-weight: 600;
  color: var(--ink-2);
}

/* На телефоне широкая таблица прокручивается сама, а не растягивает страницу. */
@media (max-width: 700px) {
  .prose table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    font-size: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .prose th,
  .prose td {
    min-width: 120px;
  }
}

/* ---------- FAQ ---------- */

.faq {
  max-width: 820px;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  font-weight: 700;
  font-size: 20px;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  flex: none;
  font-weight: 400;
  font-size: 26px;
  line-height: 1;
  color: var(--amber);
  transition: transform 0.3s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  margin: 0 0 22px;
  color: var(--ink-body);
}

/* ---------- Автор ---------- */

.author {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 820px;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.author-photo {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
}

.author-name {
  margin: 0;
  font-weight: 700;
}

.author-name a {
  color: inherit;
  text-decoration: none;
}

.author-name a:hover {
  color: var(--amber);
}

img.author-photo {
  padding: 12px;
  object-fit: contain;
}

.author-role {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- Ленты ситуаций и статей ---------- */

.track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 340px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.scene {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  scroll-snap-align: start;
  text-decoration: none;
  transition: transform 0.4s var(--ease);
}

.scene:hover {
  transform: translateY(-4px);
}

.scene:nth-child(3n + 2) {
  background: linear-gradient(160deg, var(--tint-warm), var(--surface) 70%);
}

.scene:nth-child(3n + 3) {
  background: linear-gradient(160deg, var(--tint-cool), var(--surface) 70%);
}

.scene-big {
  font-weight: 800;
  font-size: 48px;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.scene-big small {
  display: block;
  margin-top: 8px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--ink-2);
}

.scene h3 {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 21px;
}

.scene p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.list-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  text-decoration: none;
  transition: background 0.2s;
}

.list-item:hover {
  background: var(--surface-2);
}

.list-item h3 {
  margin: 0;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
}

.list-item p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

/* ---------- Кнопки ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border-radius: var(--r-pill);
  background: var(--amber-deep);
  color: var(--amber-ink);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s var(--ease);
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: scale(0.98);
}

/* ---------- Ритм секций ---------- */

.section {
  padding: 40px 0;
}

.section-lg {
  padding: 72px 0;
}

/* ---------- Футер ---------- */

.site-foot {
  margin-top: 56px;
  padding: 36px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}

.site-foot-grid {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 1.6fr) minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 32px;
}

.site-foot-about p {
  max-width: 28ch;
  margin: 12px 0 0;
}

.site-foot h2 {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.site-foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Разделов много — две колонки вместо длинного столбика. */
.site-foot-sections ul {
  columns: 2;
  column-gap: 24px;
}

.site-foot li {
  margin-bottom: 7px;
  break-inside: avoid;
}

.site-foot a {
  text-decoration: none;
}

.site-foot a:hover {
  color: var(--ink);
}

.site-foot-legal {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  max-width: 60em;
  font-size: 12px;
  line-height: 1.5;
}

/* ---------- Появление при прокрутке ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity 0.7s var(--ease),
      transform 0.7s var(--ease);
  }

  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Адаптив ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .stage {
    order: -1;
  }

  .site-nav {
    display: none;
  }

  .answer,
  .calc {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px;
  }

  .site-foot-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }

  .site-foot-about,
  .site-foot-sections {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Главная: ставка и курсы ---------- */

.market {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.market-item {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.market-key {
  border-color: transparent;
  background: linear-gradient(150deg, #ffc56b, var(--amber-deep));
  color: var(--amber-ink);
}

.market-label {
  margin: 0;
  font-size: 14px;
  opacity: 0.75;
}

.market-value {
  margin: 4px 0;
  font-weight: 800;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.market-note {
  margin: 0;
  font-size: 14px;
  opacity: 0.75;
}

.market-note.is-up {
  color: #5fd08a;
  opacity: 1;
}

.market-note.is-down {
  color: #ff7a6b;
  opacity: 1;
}

/* ---------- Главная: разделы ---------- */

.sections {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.sections-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-decoration: none;
  transition:
    transform 0.4s var(--ease),
    border-color 0.2s;
}

.sections-item:hover {
  transform: translateY(-4px);
  border-color: var(--ink-2);
}

.sections-item:first-child {
  grid-column: span 2;
}

.sections-item:first-child h3 {
  font-size: 34px;
}

.sections-item.is-warm {
  background: linear-gradient(160deg, var(--tint-warm), var(--surface) 70%);
}

.sections-item.is-cool {
  background: linear-gradient(160deg, var(--tint-cool), var(--surface) 70%);
}

.sections-item h3 {
  margin: 0;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.sections-item p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.sections-count {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--amber);
}

.list-section {
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
}

@media (max-width: 900px) {
  .sections {
    grid-template-columns: 1fr 1fr;
  }

  .sections-item:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .market {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .market-item {
    padding: 16px 18px;
  }

  .market-value {
    font-size: 26px;
  }

  .sections {
    grid-template-columns: 1fr;
  }

  .sections-item:first-child {
    grid-column: auto;
  }
}

/* ---------- Калькуляторы ---------- */

.tool-hero {
  padding: 24px 0 8px;
}

.tool-hero .display {
  font-size: clamp(36px, 4.6vw, 60px);
}

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

.tool-fields,
.tool-result {
  padding: 32px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.tool-result {
  border: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 100% 0%, var(--amber-wash), transparent 70%), var(--surface);
}

.tool-field + .tool-field {
  margin-top: 22px;
}

.tool-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.tool-input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.tool-input:focus-within {
  border-color: var(--amber);
}

.tool-input input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.tool-unit {
  color: var(--ink-2);
  font-size: 15px;
  white-space: nowrap;
}

.tool input[type='range'] {
  width: 100%;
  height: 28px;
  margin: 6px 0 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.tool input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line);
}

.tool input[type='range']::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -9px;
  border: 5px solid var(--amber);
  border-radius: 50%;
  appearance: none;
  background: var(--bg);
}

.tool input[type='range']::-moz-range-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line);
}

.tool input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 5px solid var(--amber);
  border-radius: 50%;
  background: var(--bg);
}

.tool-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 26px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--bg);
}

.tool-toggle input {
  position: absolute;
  opacity: 0;
}

.tool-toggle span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: center;
}

.tool-toggle input:checked + span {
  background: var(--surface-2);
  color: var(--ink);
}

.tool-toggle input:focus-visible + span {
  outline: 2px solid var(--amber);
}

.tool-main-label {
  margin: 0;
  font-weight: 500;
  color: var(--ink-2);
}

.tool-main {
  margin: 4px 0 20px;
  font-weight: 800;
  font-size: clamp(44px, 5.6vw, 72px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.tool-split {
  display: flex;
  height: 12px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface-2);
}

.tool-split span:first-child {
  background: var(--ink);
  transition: flex-grow 0.5s var(--ease);
}

.tool-split span:last-child {
  background: var(--amber);
  transition: flex-grow 0.5s var(--ease);
}

.tool-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 12px 0 24px;
  font-size: 14px;
  color: var(--ink-2);
}

.tool-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}

.tool-legend .is-a {
  background: var(--ink);
}

.tool-legend .is-b {
  background: var(--amber);
}

.tool-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
}

.tool-metrics div {
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--bg);
}

.tool-metrics dt {
  font-size: 13px;
  color: var(--ink-2);
}

.tool-metrics dd {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.tool-table {
  margin-top: 20px;
}

.tool-table summary {
  font-weight: 600;
  color: var(--amber);
  cursor: pointer;
}

.tool-table-scroll {
  margin-top: 12px;
  overflow-x: auto;
}

.tool-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tool-table th,
.tool-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.tool-table th:first-child,
.tool-table td:first-child {
  text-align: left;
}

.tool-table th {
  font-weight: 500;
  color: var(--ink-2);
}

@media (max-width: 900px) {
  .tool {
    /* minmax(0, …): иначе таблица платежей внутри распирает колонку шире экрана. */
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-fields,
  .tool-result {
    padding: 22px;
  }

  .tool-metrics {
    grid-template-columns: 1fr;
  }
}

/* ---------- Обзор банка / МФО ---------- */

.review-hero {
  padding: 24px 0 8px;
}

.review-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.review-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(150deg, var(--card-from), var(--card-to));
  color: var(--amber);
  font-weight: 800;
  font-size: 28px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12);
}

.review-title {
  margin: 0 0 6px;
  font-size: clamp(32px, 4.4vw, 56px);
}

.review-summary {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px 32px;
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.review-score-value {
  margin: 0;
  font-weight: 800;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--amber);
}

.review-score-label {
  margin: 6px 0 10px;
  font-size: 14px;
  color: var(--ink-2);
}

.review-score-how {
  font-size: 14px;
  color: var(--ink-2);
}

.review-criteria {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
  margin: 0;
  align-content: center;
}

.review-criteria div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.review-criteria dt {
  color: var(--ink-body);
}

.review-criteria dd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Пять сегментов вместо полосы с фоном: заполнены по оценке */
.meter {
  width: 70px;
  height: 6px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--amber) calc(var(--v) * 100%), transparent 0);
  mask: repeating-linear-gradient(90deg, #000 0 12px, transparent 12px 14.5px);
  outline: 1px solid var(--line);
  outline-offset: 1px;
}

.review-verdict {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 19px;
  font-weight: 500;
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pros,
.cons {
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.pros {
  background: linear-gradient(160deg, var(--tint-warm), var(--surface) 70%);
}

.pros h2,
.cons h2 {
  margin: 0 0 12px;
  font-weight: 800;
  font-size: 22px;
}

.pros ul,
.cons ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pros li,
.cons li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-body);
}

.pros li + li,
.cons li + li {
  margin-top: 10px;
}

.pros li::before,
.cons li::before {
  position: absolute;
  left: 0;
  font-weight: 800;
}

.pros li::before {
  content: '+';
  color: var(--amber);
}

.cons li::before {
  content: '−';
  color: var(--ink-2);
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.product {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.product h3 {
  margin: 0 0 14px;
  font-weight: 800;
  font-size: 21px;
}

.product dl {
  margin: 0;
}

.product dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
}

.product dt {
  color: var(--ink-2);
}

.product dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.product-note {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

.reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.review-quote {
  margin: 0;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.review-quote blockquote {
  margin: 0 0 12px;
  color: var(--ink-body);
}

.review-quote figcaption {
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- Рейтинг ---------- */

.ranking {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.rank {
  display: grid;
  grid-template-columns: 64px 1fr 200px;
  gap: 24px;
  align-items: start;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.rank:first-child {
  border-color: transparent;
  background:
    radial-gradient(70% 90% at 100% 0%, var(--amber-wash), transparent 70%), var(--surface);
}

.rank-place {
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
  color: var(--ink-2);
}

.rank:first-child .rank-place {
  color: var(--amber);
}

.rank-name {
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.15;
}

.rank-name span {
  font-weight: 500;
  color: var(--ink-2);
}

.rank-best {
  display: inline-block;
  margin: 4px 0 10px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--amber-wash);
  font-size: 14px;
  font-weight: 600;
  color: var(--amber);
}

.rank-why {
  margin: 0 0 14px;
  color: var(--ink-body);
}

.rank-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
}

.rank-terms dt {
  font-size: 13px;
  color: var(--ink-2);
}

.rank-terms dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.rank-side {
  display: grid;
  gap: 10px;
  justify-items: end;
  text-align: right;
}

.rank-score {
  margin: 0;
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
}

.rank-review {
  font-size: 14px;
  color: var(--ink-2);
}

.method {
  max-width: 820px;
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.method p {
  margin: 0 0 16px;
  color: var(--ink-body);
}

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

.method li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.method li:last-child {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .review-summary,
  .pros-cons {
    grid-template-columns: 1fr;
  }

  .review-criteria {
    grid-template-columns: 1fr;
  }

  .rank {
    grid-template-columns: 44px 1fr;
    gap: 16px;
  }

  .rank-place {
    font-size: 32px;
  }

  .rank-side {
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    justify-items: start;
    text-align: left;
  }
}

.site-foot .site-logo {
  color: var(--ink);
}

@media (max-width: 560px) {
  .flipcard-face {
    padding: 20px 22px;
  }

  .flipcard-chip {
    width: 42px;
    height: 32px;
    margin-top: 0;
  }

  .flipcard-bottom span {
    font-size: 13px;
  }
}

/* ---------- Обложка статьи ---------- */

.cover {
  max-width: 880px;
  margin: 0 auto 48px;
  overflow: hidden;
  aspect-ratio: 11 / 5;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 55%;
}

/* Обложка и короткий ответ в одном ряду: картинка слева, ответ справа во всю её высоту. */
.cover-row {
  display: grid;
  grid-template-columns: minmax(0, 880px) minmax(280px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.cover-row .cover {
  max-width: none;
  min-height: 380px;
  margin: 0;
  /* Высоту задаёт ряд (ответ может быть выше): пропорция тут растянула бы картинку вширь. */
  aspect-ratio: auto;
}

.cover-row--solo {
  grid-template-columns: minmax(0, 880px);
  justify-content: center;
}

.answer--side {
  grid-template-columns: 1fr;
  align-content: center;
  gap: 18px;
}

.answer--side .answer-text {
  font-size: 17px;
}

@media (max-width: 1000px) {
  .cover-row {
    grid-template-columns: 1fr;
  }

  .cover-row .cover {
    min-height: 0;
    aspect-ratio: 11 / 5;
  }
}

@media (max-width: 700px) {
  .cover,
  .cover-row .cover {
    max-width: none;
    margin: 0 calc(-1 * var(--gutter)) 32px;
    aspect-ratio: 16 / 10;
    border-radius: 0;
  }

  .cover-row .cover {
    min-height: 0;
    margin-bottom: 0;
  }
}

/* ---------- Оглавление статьи ---------- */

.read {
  display: grid;
  grid-template-columns: minmax(0, 880px) minmax(220px, 1fr);
  gap: 24px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 96px;
  margin: 40px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.toc-title {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

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

.toc li + li {
  margin-top: 4px;
}

.toc a {
  display: block;
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--line);
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink-2);
  text-decoration: none;
  transition:
    color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.toc a:hover,
.toc a.is-current {
  border-left-color: var(--amber);
  color: var(--ink);
}

.prose h2,
.faq {
  scroll-margin-top: 96px;
}

@media (max-width: 1100px) {
  .read {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

/* ---------- Страница раздела ---------- */

/* Шапка раздела ниже, чем на главной: под ней сразу список материалов. */
.section-hero {
  min-height: 0;
  padding: 32px 0 24px;
}

.list-cover {
  display: block;
  width: calc(100% + 48px);
  max-width: none;
  height: auto;
  margin: -24px -24px 8px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.lead a {
  color: var(--amber);
}

.list-cover--empty {
  background:
    radial-gradient(70% 90% at 85% 0%, var(--amber-wash), transparent 70%),
    linear-gradient(160deg, var(--surface-2), var(--surface) 80%);
}

@media (max-width: 900px) {
  /* В разделе сначала заголовок и вопросы, карта с ответом — под ними. */
  .section-hero .stage {
    order: 0;
  }
}

/* ---------- Источники ---------- */

.sources {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.prose .sources-title {
  margin: 0 0 12px;
  font-size: 20px;
}

.sources ol {
  margin: 0;
  padding-left: 22px;
  font-size: 15px;
  color: var(--ink-2);
}

.sources a {
  overflow-wrap: anywhere;
}

.sources-note {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- Плашка cookie ---------- */

.consent {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  gap: 16px;
  max-width: 460px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.consent[hidden] {
  display: none;
}

.consent-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-body);
}

.consent-text a {
  color: var(--amber);
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.consent .button {
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  line-height: normal;
  border: 0;
  cursor: pointer;
}

.consent .button-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

/* Ссылка-кнопка в подвале выглядит как остальные ссылки документов. */
.site-foot-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.site-foot-link:hover {
  color: var(--ink);
}

@media (max-width: 560px) {
  .consent {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}
