/* =========================================================
   OSR - Топ-30 аутстаффинговых компаний 2026
   Аналитический лендинг. Единый файл стилей.
   ========================================================= */

/* ---------- 1. TOKENS ---------- */
:root {
  /* палитра - тёплый оффвайт + графит + ультрамарин + терракота */
  --bg: #f6f4ef;
  --bg-2: #ecebe5;
  --bg-panel: #ffffff;
  --bg-dark: #0e0e10;
  --bg-dark-2: #17171b;

  --ink: #111114;
  --ink-2: #2a2a30;
  --ink-3: #56565e;
  --ink-4: #86868f;
  --ink-5: #b8b8bf;

  --line: #dedbd2;
  --line-2: #c9c6bc;
  --line-dark: #2a2a30;

  --accent: #1f3fbf; /* ультрамарин - OSR, ссылки, бары */
  --accent-hover: #162d8a;
  --accent-soft: #e6ebfa;
  --accent-2: #c8562a; /* терракота - медаль #1, выделение лидера */
  --accent-2-soft: #f5e2d5;

  --success: #0f7a4e;
  --success-soft: #e0efe6;
  --warning: #b57810;
  --danger: #b52a2a;

  --gold: #b8892b;
  --silver: #7d7d7d;
  --bronze: #9c6431;

  /* типографика */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Fraunces', 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* сетка */
  --container: 1240px;
  --container-wide: 1360px;
  --gutter: clamp(20px, 4vw, 48px);

  /* радиусы, тени */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 14px;

  --shadow-1: 0 1px 2px rgba(17, 17, 20, 0.04), 0 1px 1px rgba(17, 17, 20, 0.03);
  --shadow-2: 0 4px 14px rgba(17, 17, 20, 0.06), 0 2px 4px rgba(17, 17, 20, 0.04);
  --shadow-3: 0 12px 40px rgba(17, 17, 20, 0.1), 0 4px 8px rgba(17, 17, 20, 0.04);

  /* transitions */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 240ms cubic-bezier(0.4, 0, 0.2, 1);

  /* header height */
  --header-h: 62px;
  --progress-h: 3px;
}

/* ---------- 2. RESET & BASE ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 1000px 600px at 15% 0%, rgba(31, 63, 191, 0.05), transparent 60%),
    radial-gradient(ellipse 800px 500px at 90% 45%, rgba(200, 86, 42, 0.04), transparent 60%),
    radial-gradient(ellipse 900px 400px at 30% 90%, rgba(31, 63, 191, 0.03), transparent 70%);
  background-attachment: fixed;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* skip link for a11y */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. TYPOGRAPHY ---------- */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
}
h2 {
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
}
h3 {
  font-size: clamp(21px, 2.2vw, 28px);
  letter-spacing: -0.015em;
}
h4 {
  font-size: clamp(16px, 1.4vw, 18px);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 2em 0 0.9em;
}

p {
  margin: 0 0 1em;
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 72ch;
}
p.section-lead {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 78ch;
  margin-bottom: 2em;
}

strong {
  font-weight: 600;
  color: var(--ink);
}
em {
  font-style: italic;
}

/* моно для цифр OSR / кодов критериев */
.mono,
.osr-value,
.rank-medal,
.profile-osr,
.profile-rank-number,
.criterion-code,
.cd-code,
.score-value,
.summary-score,
.metric-value,
.key-fact-value,
.col-rank,
.col-osr,
.trend-number,
.step-number,
.criterion-weight {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum', 'zero';
  letter-spacing: -0.01em;
}

/* ---------- 4. SCROLL PROGRESS BAR ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: var(--progress-h);
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 60%, var(--accent-2) 100%);
  z-index: 100;
  transition: width 80ms linear;
  will-change: width;
}

/* ---------- 5. SITE HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(246, 244, 239, 0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  transition:
    background 240ms cubic-bezier(0.2, 0, 0.38, 0.9),
    border-color 240ms cubic-bezier(0.2, 0, 0.38, 0.9),
    color 240ms cubic-bezier(0.2, 0, 0.38, 0.9);
}
/* Тёмный хедер, когда под ним тёмная секция (hero, подиум, summary-hero, футер).
   Класс проставляется JS-ом через IntersectionObserver - см. script.js. */
.site-header.is-on-dark {
  background: rgba(14, 14, 16, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.site-header.is-on-dark .logo,
.site-header.is-on-dark .logo-mark {
  color: #fff;
}
.site-header.is-on-dark .logo-mark::after {
  background: rgba(255, 255, 255, 0.2);
}
.site-header.is-on-dark .logo-text {
  color: rgba(255, 255, 255, 0.6);
}
.site-header.is-on-dark .header-nav a {
  color: rgba(255, 255, 255, 0.72);
}
.site-header.is-on-dark .header-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.site-header.is-on-dark .header-nav a.is-active {
  color: var(--accent-2);
  background: rgba(200, 86, 42, 0.14);
}
.site-header.is-on-dark .menu-toggle {
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.header-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  min-width: 0;
}
.logo:hover {
  color: var(--ink);
  text-decoration: none;
}
.logo-mark {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  position: relative;
  padding-right: 14px;
}
.logo-mark::after {
  content: '';
  position: absolute;
  right: 0;
  top: 5px;
  bottom: 5px;
  width: 1px;
  background: var(--line-2);
}
.logo-text {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.005em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-nav a {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r-1);
  text-decoration: none;
  transition:
    color var(--t-fast),
    background var(--t-fast);
}

.header-nav a:hover {
  color: var(--ink);
  background: rgba(17, 17, 20, 0.05);
  text-decoration: none;
}
.header-nav a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  gap: 4px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}
.menu-toggle span {
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition:
    transform var(--t-fast),
    opacity var(--t-fast);
}
.menu-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(3px) rotate(45deg);
}
.menu-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-3px) rotate(-45deg);
}
.menu-toggle span {
  display: block;
  margin: 2px 0;
}

/* ---------- 6. SECTION LAYOUT ---------- */
main {
  display: block;
}

.section {
  padding: clamp(56px, 8vw, 120px) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.section:last-of-type {
  border-bottom: none;
}
.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

/* Крупный декоративный номер секции слева - «журнальный» акцент.
   Автоматически берётся из data-section-num атрибута, ставим через JS. */
.section[data-section-num]::before {
  content: attr(data-section-num);
  position: absolute;
  top: clamp(40px, 5vw, 80px);
  left: max(0px, calc(50vw - var(--container) / 2 - 40px));
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(120px, 16vw, 220px);
  line-height: 1;
  color: var(--accent);
  opacity: 0.06;
  letter-spacing: -0.05em;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
@media (max-width: 1100px) {
  .section[data-section-num]::before {
    left: 12px;
    top: clamp(24px, 4vw, 40px);
    font-size: clamp(80px, 14vw, 120px);
    opacity: 0.05;
  }
}

/* Чередование поверхностей - тонкое, чтоб не быть пёстрым */
.section-about,
.section-methodology,
.section-economics,
.section-legal,
.section-industries,
.section-cases,
.section-theses {
  background: var(--bg-panel);
}
.section-sources,
.section-stacks {
  background: linear-gradient(180deg, var(--bg-2) 0%, transparent 100%);
}
/* Хайлайт для «активных» пользовательских секций */
.section-how-to-choose {
  background:
    radial-gradient(ellipse 800px 400px at 100% 0%, rgba(31, 63, 191, 0.05), transparent 60%), var(--bg-panel);
}
.section-trends {
  background:
    radial-gradient(ellipse 800px 400px at 0% 100%, rgba(200, 86, 42, 0.05), transparent 60%), var(--bg-panel);
}
/* FAQ - тёплый оффвайт с точками-паттерном */
.section-faq {
  background:
    radial-gradient(circle at 20% 20%, rgba(31, 63, 191, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 80% 60%, rgba(200, 86, 42, 0.03) 1px, transparent 1px), var(--bg);
  background-size:
    32px 32px,
    48px 48px,
    auto;
}
/* Модели найма - двойная светлая сетка на background */
.section-models {
  background:
    linear-gradient(rgba(17, 17, 20, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 20, 0.025) 1px, transparent 1px), var(--bg-panel);
  background-size: 40px 40px;
}

/* ---------- HERO / SECTION-INTRO - новый, выделяющийся ---------- */
.section-intro {
  padding-top: clamp(60px, 8vw, 120px);
  padding-bottom: clamp(80px, 10vw, 160px);
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  overflow: hidden;
  border-bottom: none;
}
/* фактурная сетка + тонкие горизонтальные линии + мягкое пятно акцента */
.section-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 40%, transparent 90%);
  pointer-events: none;
}
.section-intro::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse at center, rgba(200, 86, 42, 0.14), transparent 60%);
  pointer-events: none;
  filter: blur(20px);
}
.section-intro .section-inner {
  position: relative;
  z-index: 1;
}
.section-intro h1 {
  color: #fff;
  max-width: 18ch;
  margin-bottom: 32px;
  font-size: clamp(38px, 8vw, 96px);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}
.section-intro h1 em {
  font-style: italic;
  color: var(--accent-2);
  font-weight: 400;
}
.section-intro .lead,
.section-intro p.lead {
  color: #f6f4ef !important;
  font-weight: 400;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.section-intro .intro-h2 {
  color: #fff;
}
.section-intro p,
.section-intro .intro-list li {
  color: rgba(255, 255, 255, 0.88);
}
.section-intro .intro-list li {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.section-intro .intro-list li::before {
  color: var(--accent-2);
}
.section-intro strong {
  color: #fff;
}
.section-intro .badge {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
}
.section-intro .key-facts {
  border-top-color: rgba(255, 255, 255, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.section-intro .key-fact {
  border-right-color: rgba(255, 255, 255, 0.08);
}
.section-intro .key-fact-value {
  color: #fff;
}
.section-intro .key-fact-value::first-letter {
  color: var(--accent-2);
}
.section-intro .key-fact-label {
  color: rgba(255, 255, 255, 0.55);
}

/* Hero меточка сверху - «редакционная плашка» */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 28px;
}
.hero-eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(200, 86, 42, 0.25);
  animation: heroPulse 2s ease-in-out infinite;
}
@keyframes heroPulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(200, 86, 42, 0.25);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(200, 86, 42, 0.05);
  }
}
.hero-eyebrow .eyebrow-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- 7. INTRO SECTION ---------- */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-3);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.badge:nth-child(2)::before {
  background: var(--success);
}
.badge:nth-child(3)::before {
  background: var(--accent-2);
}
.badge:nth-child(4)::before {
  background: var(--warning);
}

.section-intro h1 {
  max-width: 18ch;
  margin-bottom: 32px;
}
.section-intro .lead {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 62ch;
  margin-bottom: 48px;
}

.key-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 48px 0;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.key-fact {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
}
.key-fact:last-child {
  border-right: none;
}
.key-fact-value {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.key-fact-label {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.4;
}

.intro-h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  margin-top: 2.5em;
  margin-bottom: 0.6em;
}
.intro-list {
  padding-left: 0;
  list-style: none;
  margin: 1em 0 2em;
}
.intro-list li {
  padding: 14px 0 14px 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  color: var(--ink-2);
}
.intro-list li:last-child {
  border-bottom: none;
}
.intro-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  top: 14px;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ---------- 8. TOC SECTION - новое «навигационное поле» ---------- */
.section-toc {
  background: var(--bg-panel);
  position: relative;
}
.section-toc .section-inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.section-toc .toc-head {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.section-toc h2 {
  font-size: clamp(28px, 3vw, 40px);
  margin-bottom: 12px;
  line-height: 1.05;
}
.toc-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 24px;
}
.toc-hint {
  font-size: 13px;
  color: var(--ink-4);
  line-height: 1.5;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.toc-list li {
  counter-increment: toc;
  padding: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.4;
  position: relative;
  background: var(--bg-panel);
  transition: background 200ms cubic-bezier(0.2, 0, 0.38, 0.9);
}
.toc-list li a {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 16px 18px 18px 14px;
  color: var(--ink);
  text-decoration: none;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.toc-list li a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
  line-height: 1.5;
  padding-top: 2px;
}
.toc-list li a::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 200ms cubic-bezier(0.2, 0, 0.38, 0.9);
}
.toc-list li:hover {
  background: #fdfcf8;
}
.toc-list li:hover a::after {
  transform: scaleY(1);
}
.toc-list li a > span {
  display: block;
  transition: transform 200ms cubic-bezier(0.2, 0, 0.38, 0.9);
}
.toc-list li:hover a > span {
  transform: translateX(2px);
}
.toc-list li a > span > strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  line-height: 1.15;
}
.toc-list li a > span > em {
  display: block;
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-4);
  line-height: 1.4;
}

/* ---------- 9. ABOUT SECTION ---------- */
.principles-list {
  padding-left: 0;
  list-style: none;
  counter-reset: principle;
  margin: 24px 0;
}
.principles-list li {
  counter-increment: principle;
  padding: 24px 0 24px 64px;
  border-top: 1px solid var(--line);
  position: relative;
  color: var(--ink-2);
}
.principles-list li:last-child {
  border-bottom: 1px solid var(--line);
}
.principles-list li::before {
  content: counter(principle, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 24px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.disclaimer-box {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2);
  padding: 24px 28px;
  margin: 24px 0 32px;
}
.disclaimer-box p {
  margin-bottom: 12px;
}
.disclaimer-box p:last-child {
  margin-bottom: 0;
}

/* ---------- 10. METHODOLOGY ---------- */
.formula-box {
  background: var(--bg-dark);
  color: #f0efe9;
  padding: 40px clamp(24px, 4vw, 48px);
  margin: 24px 0 32px;
  position: relative;
  border-radius: var(--r-2);
  overflow: hidden;
}
.formula-box::before {
  content: 'OSR-INDEX FORMULA';
  position: absolute;
  top: 16px;
  left: clamp(24px, 4vw, 48px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
}
.formula {
  font-family: var(--font-mono);
  font-size: clamp(14px, 1.6vw, 20px);
  line-height: 1.7;
  color: #f6f4ef;
  padding-top: 24px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.formula strong {
  color: #fff;
  font-weight: 400;
}
.formula-note {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin-top: 12px;
  margin-bottom: 0;
  font-family: var(--font-sans);
  white-space: normal;
}

/* Сетка критериев: 4 колонки на desktop, 2 на планшете, 1 на моб */
.criteria-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}
@media (max-width: 1100px) {
  .criteria-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .criteria-grid {
    grid-template-columns: 1fr;
  }
}

.criterion-card {
  position: relative;
  padding: 22px 22px 18px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  transition:
    border-color var(--t-base),
    transform var(--t-base),
    box-shadow var(--t-base);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}
.criterion-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms cubic-bezier(0.2, 0, 0.38, 0.9);
}
.criterion-card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(17, 17, 20, 0.06);
}
.criterion-card:hover::before {
  transform: scaleX(1);
}

/* Верхняя строка: код + вес */
.criterion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.criterion-code {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 4px 10px;
  background: var(--accent-soft);
  border-radius: var(--r-1);
}
.criterion-weight {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  padding: 4px 10px;
  background: var(--bg-2);
  border-radius: var(--r-1);
  border: 1px solid var(--line);
}

/* Название */
.criterion-card h4 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.25;
  text-wrap: balance;
}

/* Первый параграф - короткое описание */
.criterion-card > p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 14px;
  flex: 1;
}

/* Раскрывающийся блок «Как считаем · Почему важно» */
.criterion-details {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.criterion-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 0;
  transition: color var(--t-fast);
}
.criterion-details summary::-webkit-details-marker {
  display: none;
}
.criterion-details summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 400;
  color: var(--accent);
  transition: transform var(--t-base);
  line-height: 1;
}
.criterion-details[open] summary::after {
  content: '−';
}
.criterion-details summary:hover {
  color: var(--ink);
}
.criterion-details .cd-close {
  display: none;
}
.criterion-details[open] .cd-open {
  display: none;
}
.criterion-details[open] .cd-close {
  display: inline;
}

.criterion-details-body {
  padding-top: 12px;
  animation: cardReveal 260ms cubic-bezier(0.2, 0, 0.38, 0.9);
}
.criterion-details-body p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 10px;
}
.criterion-details-body p:last-child {
  margin-bottom: 0;
}
.criterion-details-body p strong {
  display: inline-block;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  background: var(--accent-soft);
  border-radius: var(--r-1);
  margin-right: 6px;
  vertical-align: baseline;
}
@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Раскрытая карточка - визуально выделяется */
.criterion-card:has(details[open]) {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(31, 63, 191, 0.08);
}
.criterion-card:has(details[open])::before {
  transform: scaleX(1);
}

.reading-grid {
  margin: 24px 0;
  border-top: 1px solid var(--line);
}
.reading-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-template-areas:
    'range label'
    'range desc';
  gap: 4px 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.reading-range {
  grid-area: range;
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--accent);
  letter-spacing: -0.02em;
  align-self: start;
}
.reading-row .reading-label {
  grid-area: label;
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--ink);
  line-height: 1.2;
}
.reading-row p {
  grid-area: desc;
  font-size: 15px;
  margin: 4px 0 0;
  color: var(--ink-2);
}

h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  margin: 2em 0 0.7em;
}

/* ---------- 11. SOURCES ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-4) transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-panel);
  /* Обеспечиваем, чтобы thead-фон рендерился внутри радиуса без белого зазора сверху */
  overflow-y: hidden;
}
/* Table внутри table-wrap должна плотно прижиматься к верхней границе */
.table-wrap > table {
  display: table;
  margin: 0 !important;
}
.sources-table,
.ranking-table,
.models-table,
.stacks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bg-panel);
  font-variant-numeric: tabular-nums;
  margin: 0; /* убираем «пустоту сверху» - thead уже создаёт визуальный отступ */
}
.sources-table th,
.sources-table td,
.ranking-table th,
.ranking-table td,
.models-table th,
.models-table td,
.stacks-table th,
.stacks-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.5;
}
.sources-table thead th,
.ranking-table thead th,
.models-table thead th,
.stacks-table thead th {
  background: var(--bg-2);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-2);
  padding: 12px 18px;
  /* Убрано `position: sticky` - оставляли белую полосу над таблицей,
     когда таблица оказывалась внизу экрана, и странно ведут себя в
     .table-wrap с overflow-x. Для этих плотных data-таблиц sticky-хедер
     не нужен: таблицы короткие и вмещаются на экран целиком. */
}
.sources-table tbody tr:hover,
.ranking-table tbody tr:hover,
.models-table tbody tr:hover,
.stacks-table tbody tr:hover {
  background: #fafaf5;
}
.sources-table tbody tr:last-child td,
.ranking-table tbody tr:last-child td,
.models-table tbody tr:last-child td,
.stacks-table tbody tr:last-child td {
  border-bottom: none;
}

.excluded-list {
  padding-left: 0;
  list-style: none;
  margin: 24px 0;
}
.excluded-list li {
  padding: 16px 0 16px 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}
.excluded-list li:first-child {
  border-top: 1px solid var(--line);
}
.excluded-list li::before {
  content: '×';
  position: absolute;
  left: 8px;
  top: 15px;
  color: var(--danger);
  font-size: 20px;
  line-height: 1;
}

/* ---------- 12. PODIUM ---------- */
.section-podium {
  background: var(--bg-dark);
  color: #f0efe9;
  border-bottom: none;
}
.section-podium h2 {
  color: #fff;
}
.section-podium .section-lead {
  color: rgba(255, 255, 255, 0.7);
  max-width: 78ch;
}
.section-podium h3 {
  color: #fff;
}

.podium-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  margin-top: 48px;
}
.podium-card {
  padding: 32px 32px 28px;
  background: var(--bg-dark-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-2);
  display: flex;
  flex-direction: column;
  position: relative;
  transition:
    border-color var(--t-base),
    transform var(--t-base);
}
.podium-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}
.podium-1 {
  grid-column: 1;
  grid-row: 1 / span 2;
  padding: 44px clamp(24px, 3vw, 44px);
  background: linear-gradient(160deg, #1a1a1f 0%, #0e0e10 100%);
  border-color: rgba(200, 86, 42, 0.3);
}
.podium-1::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-2) 0%, var(--accent) 100%);
  border-radius: var(--r-2) var(--r-2) 0 0;
}
.podium-2 {
  grid-column: 2;
  grid-row: 1;
}
.podium-3 {
  grid-column: 2;
  grid-row: 2;
}

.podium-rank {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0;
}
.podium-1 .rank-medal {
  width: 60px;
  height: 60px;
  font-size: 32px;
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(200, 86, 42, 0.15);
}
.podium-2 .rank-medal {
  color: #d4d4d4;
}
.podium-3 .rank-medal {
  color: #c19a6b;
}
.rank-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.podium-1 .rank-label {
  color: var(--accent-2);
  font-weight: 500;
}

.podium-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}
.podium-name {
  font-size: clamp(28px, 3.2vw, 44px);
  margin: 0;
  font-weight: 400;
  color: #fff;
  line-height: 1;
}
.podium-1 .podium-name {
  font-size: clamp(36px, 4.4vw, 64px);
}

/* Кнопка «Перейти на сайт» в шапке карточки подиума */
.podium-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  text-decoration: none;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast),
    transform var(--t-fast);
  white-space: nowrap;
}
.podium-cta:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  text-decoration: none;
}
.podium-cta:hover .podium-cta-arrow {
  transform: translateX(3px);
}
.podium-cta-arrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  transition: transform var(--t-fast);
}
/* Primary CTA - только для лидера #1 (терракотовая) */
.podium-cta-primary {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
  padding: 11px 18px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(200, 86, 42, 0.35);
}
.podium-cta-primary:hover {
  background: #a44422;
  border-color: #a44422;
  color: #fff;
  box-shadow: 0 6px 24px rgba(200, 86, 42, 0.45);
}

.podium-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.score-value {
  font-size: clamp(30px, 3.6vw, 48px);
  font-weight: 500;
  color: #fff;
  line-height: 1;
}
.podium-1 .score-value {
  font-size: clamp(48px, 6vw, 84px);
  color: var(--accent-2);
}
.score-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.podium-summary {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 24px;
  max-width: none;
}
.podium-1 .podium-summary {
  font-size: 16px;
}
.podium-2 .podium-summary,
.podium-3 .podium-summary {
  display: none;
}

.podium-criteria {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}
.criteria-row {
  display: grid;
  grid-template-columns: 44px 1fr 40px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-family: var(--font-mono);
}
.criteria-row > span:first-child {
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.05em;
}
.criteria-row > span:last-child {
  color: #fff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.criteria-bar {
  display: block;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.criteria-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--accent) 0%, #4a6eea 100%);
  border-radius: 999px;
  transition: width 1000ms cubic-bezier(0.2, 0.6, 0.2, 1);
}
.criteria-bar.is-animated::after {
  width: var(--v);
}
.podium-1 .criteria-bar::after {
  background: linear-gradient(90deg, var(--accent-2) 0%, #f0916a 100%);
}

.podium-highlights {
  padding-left: 0;
  list-style: none;
  margin: 0 0 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
}
.podium-highlights li {
  padding: 6px 0 6px 18px;
  position: relative;
}
.podium-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 8px;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
}
.podium-2 .podium-highlights,
.podium-3 .podium-highlights {
  display: none;
}

.podium-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding: 10px 16px 10px 18px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  text-decoration: none;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast);
}
.podium-more:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  text-decoration: none;
}
.podium-more:hover .podium-more-arrow {
  transform: translateY(2px);
}
.podium-more-arrow {
  font-family: var(--font-mono);
  font-size: 13px;
  transition: transform var(--t-fast);
}
.podium-1 .podium-more {
  border-color: rgba(200, 86, 42, 0.4);
  color: var(--accent-2);
}
.podium-1 .podium-more:hover {
  background: rgba(200, 86, 42, 0.1);
  border-color: var(--accent-2);
  color: #fff;
}

/* ---------- 13. RANKING TABLE ---------- */
.section-main-ranking .table-wrap,
.section-lower-ranking .table-wrap {
  margin-top: 32px;
}
.ranking-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
  justify-content: space-between;
}
.ranking-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 340px;
}
.ranking-search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  background: var(--bg-panel);
  color: var(--ink);
  transition:
    border-color var(--t-fast),
    box-shadow var(--t-fast);
}
.ranking-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ranking-search::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--ink-4);
  border-radius: 50%;
}
.ranking-search::after {
  content: '';
  position: absolute;
  left: 24px;
  top: 60%;
  width: 6px;
  height: 1.5px;
  background: var(--ink-4);
  transform: rotate(45deg);
}
.ranking-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.ranking-table th {
  cursor: pointer;
  user-select: none;
  padding-right: 26px !important;
  position: relative;
}
.ranking-table th[data-sort]::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink-5);
  border-bottom: 1.5px solid var(--ink-5);
  transform: translateY(-70%) rotate(45deg);
  opacity: 0.5;
  transition:
    opacity var(--t-fast),
    transform var(--t-fast);
}
.ranking-table th[data-sort]:hover::after {
  opacity: 1;
}
.ranking-table th[aria-sort='ascending']::after {
  transform: translateY(-20%) rotate(-135deg);
  opacity: 1;
  border-color: var(--accent);
}
.ranking-table th[aria-sort='descending']::after {
  transform: translateY(-70%) rotate(45deg);
  opacity: 1;
  border-color: var(--accent);
}

.ranking-table td.col-rank {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-4);
  width: 48px;
  font-variant-numeric: tabular-nums;
}
.ranking-table td.col-name {
  font-size: 15px;
  min-width: 140px;
}
.ranking-table td.col-osr {
  width: 200px;
}
.ranking-table td.col-strength {
  color: var(--ink-3);
  font-size: 14px;
  min-width: 240px;
}
.ranking-table td.col-site {
  width: 160px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.ranking-table td.col-site a {
  color: var(--ink-3);
}
.ranking-table td.col-site a:hover {
  color: var(--accent);
}

.osr-value {
  display: inline-block;
  min-width: 42px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-1);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  position: relative;
}
/* hybrid mini-bar next to value */
.col-osr {
  position: relative;
}
.col-osr .osr-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.col-osr .osr-mini-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-2);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  min-width: 60px;
  max-width: 100px;
}
.col-osr .osr-mini-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--v, 0%);
  background: var(--accent);
  border-radius: 999px;
  transition: width 800ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

.ranking-table tr.is-hidden {
  display: none;
}

/* Ranking divider - узкая подсекция между позициями 15 и 16 */
.ranking-table tr.ranking-divider td {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-panel) 100%);
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.ranking-table tr.ranking-divider:hover td {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-panel) 100%);
}

/* Первая строка после thead - тонкая линия сверху, чтобы визуально
   разделить шапку и данные (пользователь просил разделитель) */
.ranking-table tbody tr:first-child td {
  border-top: 1px solid var(--line);
}

/* ---------- 14. PROFILES ---------- */
.profile-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: clamp(28px, 3vw, 48px);
  margin: 32px 0;
  transition:
    border-color var(--t-base),
    box-shadow var(--t-base);
  position: relative;
}
.profile-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-2);
}
.profile-leader {
  border-color: var(--accent-2);
  background: linear-gradient(180deg, #fdfaf5 0%, #ffffff 40%);
  position: relative;
}
.profile-leader::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-2) 0%, var(--accent) 100%);
  border-radius: var(--r-3) var(--r-3) 0 0;
}

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.profile-rank-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.profile-rank-number {
  font-family: var(--font-serif);
  font-size: clamp(56px, 6vw, 96px);
  font-weight: 400;
  color: var(--ink);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.profile-leader .profile-rank-number {
  color: var(--accent-2);
}
.profile-rank-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding: 4px 10px;
  background: var(--accent-2-soft);
  border-radius: 999px;
}
.profile-title-block h3 {
  font-size: clamp(24px, 2.8vw, 36px);
  margin: 0 0 6px;
}
.profile-url {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
  margin: 0;
}
.profile-score-block {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.profile-osr {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}
.profile-leader .profile-osr {
  color: var(--accent-2);
}
.profile-osr-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}

.profile-tagline {
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.55;
  color: var(--ink-2);
  padding: 20px 24px;
  background: var(--bg-2);
  border-radius: var(--r-2);
  border-left: 3px solid var(--accent);
  margin: 20px 0 8px;
  max-width: none;
}
.profile-leader .profile-tagline {
  border-left-color: var(--accent-2);
  background: #fef6f0;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin: 20px 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.metric-tile {
  padding: 20px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric-value {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.metric-label {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
}

.profile-criteria-detail {
  display: grid;
  gap: 0;
  margin: 20px 0;
  border-top: 1px solid var(--line);
}
.criterion-detail {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.criterion-detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.cd-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 3px 8px;
  background: var(--accent-soft);
  border-radius: var(--r-1);
}
.cd-name {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink);
  font-weight: 400;
}
.cd-score {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.criterion-detail p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  color: var(--ink-2);
}

.profile-pros,
.profile-cons {
  padding-left: 0;
  list-style: none;
  margin: 12px 0 24px;
}
.profile-pros li,
.profile-cons li {
  padding: 12px 0 12px 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}
.profile-pros li::before {
  content: '+';
  position: absolute;
  left: 8px;
  top: 12px;
  color: var(--success);
  font-family: var(--font-mono);
  font-weight: 500;
}
.profile-cons li::before {
  content: '−';
  position: absolute;
  left: 8px;
  top: 12px;
  color: var(--warning);
  font-family: var(--font-mono);
  font-weight: 500;
}

.profile-verdict {
  margin-top: 20px;
  padding: 20px 24px;
  background: var(--bg-2);
  border-left: 3px solid var(--ink);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}
.profile-leader .profile-verdict {
  border-left-color: var(--accent-2);
}

/* Сворачиваемый разбор по критериям (для профилей 4+) */
.criteria-collapse {
  margin: 20px 0 0;
  border-top: 1px solid var(--line);
  padding: 0;
}
.criteria-collapse summary {
  list-style: none;
  padding: 16px 40px 16px 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  position: relative;
  transition: color var(--t-fast);
}
.criteria-collapse summary::-webkit-details-marker {
  display: none;
}
.criteria-collapse summary::after {
  content: '';
  position: absolute;
  right: 4px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
  transition:
    transform var(--t-base),
    border-color var(--t-fast);
}
.criteria-collapse[open] summary::after {
  transform: translateY(-20%) rotate(-135deg);
  border-color: var(--accent);
}
.criteria-collapse summary:hover {
  color: var(--ink);
}
.criteria-collapse summary:hover::after {
  border-color: var(--ink);
}
.criteria-collapse summary .cc-hint {
  color: var(--ink-4);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  margin-left: 10px;
}
.criteria-collapse[open] summary .cc-hint {
  display: none;
}
.criteria-collapse .profile-criteria-detail {
  margin-top: 0;
  border-top: 1px solid var(--line);
  animation: faqReveal 300ms ease-out;
}

/* ---------- 15. TRENDS ---------- */
.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.trend-card {
  padding: 32px 28px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  transition:
    border-color var(--t-fast),
    transform var(--t-base);
}
.trend-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.trend-number {
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  opacity: 0.9;
}
.trend-card h3 {
  font-size: 19px;
  line-height: 1.25;
  margin: 0 0 12px;
}
.trend-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  max-width: none;
}

/* ---------- 16. ECONOMICS ---------- */
.economics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.economics-card {
  padding: 28px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.economics-card h3 {
  font-size: 20px;
  margin: 0 0 14px;
}
.economics-card p {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 10px;
}

.cost-list {
  padding-left: 0;
  list-style: none;
  margin: 24px 0;
}
.cost-list li {
  padding: 16px 0 16px 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  color: var(--ink-2);
  line-height: 1.55;
}
.cost-list li:first-child {
  border-top: 1px solid var(--line);
}
.cost-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 22px;
  width: 12px;
  height: 1px;
  background: var(--accent);
}

/* ---------- 17. STEPS ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0;
  margin: 24px 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.step-card {
  padding: 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}
.step-card-accent {
  background: linear-gradient(180deg, #fff8f2 0%, #fff 100%);
  position: relative;
}
.step-card-accent::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 100%);
}
.step-card-accent .step-number {
  color: var(--accent-2);
  background: #f8e5d8;
}
.step-number {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  background: var(--accent-soft);
  border-radius: var(--r-1);
  display: inline-block;
  margin-bottom: 14px;
}
.step-card h3 {
  font-size: 19px;
  margin: 0 0 10px;
}
.step-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

/* ---------- 18. LEGAL LIST ---------- */
.legal-list,
.legal-warnings {
  padding-left: 0;
  list-style: none;
  margin: 20px 0;
}
.legal-list li {
  padding: 16px 0 16px 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  color: var(--ink-2);
  line-height: 1.55;
}
.legal-list li:first-child {
  border-top: 1px solid var(--line);
}
.legal-list li::before {
  content: '§';
  position: absolute;
  left: 4px;
  top: 15px;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1;
}

.legal-warnings li {
  padding: 16px 20px 16px 44px;
  background: #fdf5ec;
  border: 1px solid #f0dcc0;
  margin-bottom: 8px;
  position: relative;
  border-radius: var(--r-1);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}
.legal-warnings li::before {
  content: '!';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 18px;
  height: 18px;
  background: var(--warning);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  line-height: 18px;
}

/* ---------- 19. STACKS TABLE ---------- */
.stacks-table td:not(:first-child) {
  text-align: center;
  font-family: var(--font-mono);
  color: var(--success);
  font-size: 16px;
  font-weight: 500;
}
.stacks-table td:not(:first-child):empty::after,
.stacks-table td {
}
.stacks-note {
  font-size: 14px;
  color: var(--ink-3);
  font-style: italic;
  margin-top: 16px;
}

/* ---------- 20. INDUSTRIES + CASES ---------- */
.industries-grid,
.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.industry-block,
.case-item {
  padding: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  transition: border-color var(--t-fast);
}
.industry-block:hover,
.case-item:hover {
  border-color: var(--line-2);
}
.industry-block h3,
.case-item h3 {
  font-size: 18px;
  margin: 0 0 10px;
}
.industry-block p,
.case-item p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

/* ---------- 21. FAQ ---------- */
.faq-list {
  margin: 24px 0;
  border-top: 1px solid var(--line);
}
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 0;
  transition: background var(--t-fast);
}
.faq-item[open] {
  background: var(--bg-2);
}
.faq-item summary {
  padding: 22px 48px 22px 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 400;
  color: var(--ink);
  position: relative;
  transition: color var(--t-fast);
  line-height: 1.35;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  transition: transform var(--t-base);
}
.faq-item[open] summary::after {
  transform: translateY(-20%) rotate(-135deg);
}
.faq-item summary:hover {
  color: var(--accent);
}
.faq-item p {
  padding: 0 60px 24px 0;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  animation: faqReveal 300ms ease-out;
}
@keyframes faqReveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 22. THESES ---------- */
.theses-list {
  padding-left: 0;
  list-style: none;
  counter-reset: thesis;
  margin: 24px 0;
}
.theses-list li {
  counter-increment: thesis;
  padding: 24px 0 24px 72px;
  border-top: 1px solid var(--line);
  position: relative;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.6;
}
.theses-list li:last-child {
  border-bottom: 1px solid var(--line);
}
.theses-list li::before {
  content: counter(thesis, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 24px;
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--accent);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ---------- 23. SUMMARY ---------- */
.section-summary {
  background: var(--bg-panel);
  border-bottom: none;
}
.summary-hero {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 48px;
  margin: 40px 0;
  padding: 40px;
  background: var(--bg-dark);
  color: #f0efe9;
  border-radius: var(--r-3);
  position: relative;
  overflow: hidden;
}
.summary-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-2) 0%, var(--accent) 100%);
}
.summary-badge {
  padding: 32px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-2);
  text-align: center;
  align-self: start;
}
.summary-badge-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  display: block;
  margin-bottom: 16px;
}
.summary-badge h3 {
  font-size: 36px;
  margin: 0 0 16px;
  color: #fff;
}
.summary-badge h3 a {
  color: #fff;
  text-decoration: none;
}
.summary-badge h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.summary-score {
  font-size: 72px;
  font-weight: 400;
  color: var(--accent-2);
  line-height: 1;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}
.summary-score-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  margin-top: 6px;
}

.summary-explanation h3 {
  color: #fff;
  margin-top: 0;
}
.summary-explanation p,
.summary-explanation li {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  max-width: none;
}
.summary-explanation ul {
  padding-left: 0;
  list-style: none;
  margin: 16px 0;
}
.summary-explanation ul li {
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  position: relative;
}
.summary-explanation ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  width: 10px;
  height: 1px;
  background: var(--accent-2);
}
.summary-explanation strong {
  color: #fff;
}
.summary-cta {
  margin-top: 24px;
}
.cta-link {
  display: inline-block;
  padding: 14px 24px;
  background: var(--accent-2);
  color: #fff;
  font-weight: 500;
  border-radius: var(--r-1);
  transition: background var(--t-fast);
}
.cta-link:hover {
  background: #a44422;
  color: #fff;
  text-decoration: none;
}

.summary-podium {
  list-style: none;
  padding: 0;
  counter-reset: sp;
  margin: 24px 0;
  border-top: 1px solid var(--line);
}
.summary-podium li {
  counter-increment: sp;
  padding: 18px 0 18px 60px;
  border-bottom: 1px solid var(--line);
  position: relative;
  font-size: 17px;
  color: var(--ink-2);
}
.summary-podium li::before {
  content: counter(sp);
  position: absolute;
  left: 0;
  top: 14px;
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--accent);
  line-height: 1;
}
.summary-podium li:first-child::before {
  color: var(--accent-2);
}

.summary-closing {
  font-size: 15px;
  color: var(--ink-3);
  margin-top: 24px;
  max-width: none;
}

/* ---------- 24. FOOTER ---------- */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 64px 0 32px;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-col h4 {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col ul li {
  padding: 6px 0;
}
.footer-col ul li a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  text-decoration: none;
  transition: color var(--t-fast);
}
.footer-col ul li a:hover {
  color: #fff;
  text-decoration: none;
}
.footer-col p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 12px;
  max-width: none;
}
.footer-col p strong,
.footer-col p a strong {
  color: #fff;
}
.footer-cta {
  display: inline-block;
  color: var(--accent-2);
  font-weight: 500;
  font-size: 14px;
  margin-top: 8px;
}
.footer-cta:hover {
  color: #f0916a;
  text-decoration: none;
}

.footer-disclaimer {
  padding-top: 32px;
}
.footer-disclaimer p {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.45);
  max-width: none;
  margin-bottom: 12px;
}
.footer-disclaimer p:last-child {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
}

/* ---------- 25. BACK TO TOP ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity var(--t-base),
    transform var(--t-base),
    visibility var(--t-base),
    background var(--t-fast);
  z-index: 80;
  box-shadow: var(--shadow-2);
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent);
}
.back-to-top::before {
  content: '';
  width: 10px;
  height: 10px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: rotate(45deg) translate(1px, 1px);
}

/* ---------- 26. REVEAL ANIMATION ---------- */
/* Reveal on scroll - only for smaller inner elements, never for full sections.
   Sections stay fully visible by default so a stuck IntersectionObserver
   can never blank out large parts of the page. */
section.reveal,
.section.reveal {
  opacity: 1 !important;
  transform: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 600ms cubic-bezier(0.2, 0.6, 0.2, 1),
    transform 600ms cubic-bezier(0.2, 0.6, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* JS-disabled fallback: no reveal, all visible */
.no-js .reveal {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
  .criteria-bar::after {
    transition: none;
  }
}

/* ---------- 27. RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .header-nav a {
    padding: 8px 8px;
    font-size: 13px;
  }
  .logo-text {
    display: none;
  }
  .toc-list {
    grid-template-columns: 1fr;
  }
  .toc-list li:nth-child(odd) {
    border-right: none;
    padding-right: 0;
  }
  .toc-list li:nth-child(even) {
    padding-left: 0;
  }
  .key-facts {
    grid-template-columns: repeat(2, 1fr);
  }
  .key-fact:nth-child(2) {
    border-right: none;
  }
  .key-fact:nth-child(1),
  .key-fact:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 860px) {
  .header-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-panel);
    flex-direction: column;
    align-items: stretch;
    padding: 12px var(--gutter) 20px;
    border-bottom: 1px solid var(--line);
    gap: 0;
    transform: translateY(-120%);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-2);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .header-nav.is-open {
    transform: translateY(0);
  }
  .header-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    text-align: left;
    color: var(--ink) !important; /* всегда тёмные ссылки на светлой панели */
    background: transparent !important;
  }
  .header-nav a:hover {
    background: var(--bg-2) !important;
  }
  .header-nav a.is-active {
    color: var(--accent) !important;
    background: var(--accent-soft) !important;
  }
  .header-nav a:last-child {
    border-bottom: none;
  }
  .menu-toggle {
    display: flex;
  }

  /* При тёмном header (hero) - только КНОПКА бургера белая, а само открытое меню всегда светлое */
  .site-header.is-on-dark.has-open-menu {
    background: var(--bg-panel);
    border-bottom-color: var(--line);
  }
  .site-header.is-on-dark.has-open-menu .logo,
  .site-header.is-on-dark.has-open-menu .logo-mark {
    color: var(--ink);
  }
  .site-header.is-on-dark.has-open-menu .logo-text {
    color: var(--ink-3);
  }
  .site-header.is-on-dark.has-open-menu .menu-toggle {
    border-color: var(--line-2);
    color: var(--ink);
  }
}

/* Menu-toggle - стабильная 3-полосная иконка, аккуратный X при активации */
.menu-toggle {
  position: relative;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 1.8px;
  background: currentColor;
  margin: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition:
    transform 220ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 180ms;
  transform-origin: center;
}
.menu-toggle span:nth-child(1) {
  top: 12px;
}
.menu-toggle span:nth-child(2) {
  top: 50%;
  margin-top: -1px;
}
.menu-toggle span:nth-child(3) {
  bottom: 12px;
}
.menu-toggle[aria-expanded='true'] span:nth-child(1) {
  top: 50%;
  margin-top: -1px;
  transform: translateX(-50%) rotate(45deg);
}
.menu-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded='true'] span:nth-child(3) {
  bottom: auto;
  top: 50%;
  margin-top: -1px;
  transform: translateX(-50%) rotate(-45deg);
}

@media (max-width: 860px) {
  .podium-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .podium-1,
  .podium-2,
  .podium-3 {
    grid-column: 1;
    grid-row: auto;
  }
  .podium-2 .podium-summary,
  .podium-3 .podium-summary,
  .podium-2 .podium-highlights,
  .podium-3 .podium-highlights {
    display: block;
  }

  .profile-header {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      'rank score'
      'title title';
    gap: 20px;
  }
  .profile-rank-block {
    grid-area: rank;
  }
  .profile-title-block {
    grid-area: title;
  }
  .profile-score-block {
    grid-area: score;
  }

  .summary-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 24px;
  }

  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .reading-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      'range'
      'label'
      'desc';
    gap: 8px;
  }
}

@media (max-width: 860px) {
  /* Все таблицы становятся скроллящимися по горизонтали и получают
     минимальную ширину, чтобы колонки не сжимались до нечитаемого состояния. */
  .sources-table {
    min-width: 640px;
  }
  .ranking-table {
    min-width: 620px;
  }
  .models-table {
    min-width: 720px;
  }
  .stacks-table {
    min-width: 720px;
  }
  .sources-table th,
  .sources-table td {
    padding: 12px 14px;
    font-size: 13px;
  }
  .ranking-table th,
  .ranking-table td {
    padding: 12px 14px;
    font-size: 13px;
  }
  .models-table th,
  .models-table td {
    padding: 12px 14px;
    font-size: 13px;
  }
  .stacks-table th,
  .stacks-table td {
    padding: 12px 10px;
    font-size: 12.5px;
  }
  .table-wrap {
    border-radius: var(--r-1);
    position: relative;
  }
  /* Тень справа-снизу - намёк на скролл */
  .table-wrap::after {
    content: '';
    position: sticky;
    right: 0;
    display: none; /* держим просто; можно включить когда tab .can-scroll */
  }
  /* TOC на мобе - одна колонка, скрываем sticky head */
  .section-toc .section-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .section-toc .toc-head {
    position: static;
  }
  .toc-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 18px;
  }
  .key-facts {
    grid-template-columns: 1fr;
  }
  .key-fact {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .key-fact:last-child {
    border-bottom: none;
  }
  .footer-columns {
    grid-template-columns: 1fr;
  }
  .section-intro h1 {
    font-size: clamp(36px, 10vw, 56px);
  }
  .criteria-grid {
    grid-template-columns: 1fr;
  }
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .profile-metrics {
    grid-template-columns: 1fr;
  }
  .metric-tile {
    border-right: none;
  }
  .badge {
    font-size: 11px;
    padding: 4px 10px;
  }
  .header-inner {
    gap: 12px;
  }
  .back-to-top {
    bottom: 16px;
    right: 16px;
  }
  /* Ещё компактнее для мобильных таблиц */
  .sources-table th,
  .sources-table td {
    padding: 10px 12px;
  }
  .ranking-table th,
  .ranking-table td {
    padding: 10px 12px;
  }
  .ranking-table td.col-name {
    min-width: 100px;
  }
  .ranking-table td.col-strength {
    min-width: 180px;
  }
}

/* focus visibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus-visible,
a:focus-visible {
  outline-offset: 3px;
}

/* =========================================================
   28. NAV DROPDOWN - «Отраслевые рейтинги» в шапке
   ========================================================= */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r-1);
  transition:
    color var(--t-fast),
    background var(--t-fast);
  white-space: nowrap;
}
.nav-dropdown-trigger:hover {
  color: var(--ink);
  background: rgba(17, 17, 20, 0.05);
}
.nav-dropdown-trigger[aria-expanded='true'] {
  color: var(--accent);
  background: var(--accent-soft);
}
.nav-dropdown-caret {
  width: 9px;
  height: 9px;
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.75;
}
.nav-dropdown-trigger[aria-expanded='true'] .nav-dropdown-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.site-header.is-on-dark .nav-dropdown-trigger {
  color: rgba(255, 255, 255, 0.72);
}
.site-header.is-on-dark .nav-dropdown-trigger:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.site-header.is-on-dark .nav-dropdown-trigger[aria-expanded='true'] {
  color: var(--accent-2);
  background: rgba(200, 86, 42, 0.14);
}

/* Панель дропдауна */
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 360px;
  padding: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--r-2, 12px);
  box-shadow:
    0 20px 40px -12px rgba(14, 14, 16, 0.18),
    0 4px 12px -4px rgba(14, 14, 16, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 200ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 200ms;
  z-index: 100;
}
.nav-dropdown-trigger[aria-expanded='true'] + .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 6px 12px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.nav-vertical-link {
  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 2px;
  align-items: baseline;
  padding: 12px 12px;
  border-radius: var(--r-1);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: background var(--t-fast);
}
.nav-vertical-link:hover {
  background: var(--bg-2);
  text-decoration: none;
  color: var(--ink);
}
.nav-vertical-link:hover .nav-vertical-tag {
  color: #fff;
  background: var(--nvl-accent, var(--accent));
  border-color: transparent;
}
.nav-vertical-tag {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--nvl-accent, var(--accent));
  background: var(--bg-panel);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 4px;
  min-width: 100px;
  text-align: center;
  transition:
    color var(--t-fast),
    background var(--t-fast),
    border-color var(--t-fast);
}
.nav-vertical-title {
  grid-column: 2;
  grid-row: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}
.nav-vertical-hint {
  grid-column: 2;
  grid-row: 2;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* Мобильная адаптация - раскрывающийся блок в мобильном меню */
@media (max-width: 860px) {
  .nav-dropdown {
    width: 100%;
    display: block;
  }
  .nav-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 14px 0 !important;
    border-bottom: 1px solid var(--line) !important;
    color: var(--ink) !important;
    background: transparent !important;
    font-size: 15px;
    border-radius: 0;
  }
  .nav-dropdown-trigger[aria-expanded='true'] {
    color: var(--accent) !important;
    background: transparent !important;
  }
  .nav-dropdown-panel {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    width: 100%;
    padding: 8px 0 12px;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .nav-dropdown-trigger[aria-expanded='true'] + .nav-dropdown-panel {
    display: block;
  }
  .nav-vertical-link {
    padding: 10px 8px;
  }
}

/* =========================================================
   29. VERTICALS - секция «Шесть отраслевых индексов»
   ========================================================= */
.section-verticals {
  background: var(--bg-panel);
  position: relative;
  overflow: hidden;
}
.section-verticals::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 88% 0%, rgba(31, 63, 191, 0.05), transparent 70%),
    radial-gradient(500px 260px at 8% 100%, rgba(200, 86, 42, 0.04), transparent 70%);
  pointer-events: none;
}
.verticals-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 780px;
  margin-bottom: 48px;
}
.verticals-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 12px 6px 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
  margin-bottom: 4px;
}
.verticals-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(200, 86, 42, 0.18);
}
.verticals-h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.verticals-h2 em {
  font-style: italic;
  color: var(--accent);
}
.verticals-lead {
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 6px 0 0;
}

.verticals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-2, 12px);
  overflow: hidden;
  position: relative;
}
.vertical-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px 22px;
  background: var(--bg-panel);
  color: var(--ink);
  text-decoration: none;
  transition:
    background 240ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 240px;
  overflow: hidden;
}
.vertical-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--vc-accent, var(--accent));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
.vertical-card::after {
  content: '';
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 180px;
  height: 180px;
  background: var(--vc-accent, var(--accent));
  opacity: 0;
  border-radius: 50%;
  filter: blur(60px);
  transition: opacity 380ms ease;
  pointer-events: none;
}
.vertical-card:hover {
  background: var(--bg);
  text-decoration: none;
  color: var(--ink);
}
.vertical-card:hover::before {
  transform: scaleX(1);
}
.vertical-card:hover::after {
  opacity: 0.08;
}
.vertical-card:hover .vertical-card-arrow {
  transform: translateX(6px);
  color: var(--vc-accent, var(--accent));
}
.vertical-card:hover .vertical-card-tag {
  color: #fff;
  background: var(--vc-accent, var(--accent));
  border-color: transparent;
}
.vertical-card:hover .vertical-card-num {
  color: var(--vc-accent, var(--accent));
  opacity: 0.6;
}

.vertical-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vertical-card-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--vc-accent, var(--accent));
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 5px 12px;
  transition:
    color var(--t-fast),
    background var(--t-fast),
    border-color var(--t-fast);
}
.vertical-card-num {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  color: var(--ink-4);
  opacity: 0.5;
  letter-spacing: -0.02em;
  transition:
    color var(--t-fast),
    opacity var(--t-fast);
}
.vertical-card-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}
.vertical-card-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 0;
  flex: 1;
}
.vertical-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  margin-top: auto;
}
.vertical-card-arrow {
  font-size: 18px;
  color: var(--ink-4);
  transition:
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    color 240ms;
  font-family: var(--font-mono);
}

.verticals-foot {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}
.verticals-foot-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 0.01em;
  max-width: 60ch;
  text-align: right;
}

@media (max-width: 1100px) {
  .verticals-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .verticals-grid {
    grid-template-columns: 1fr;
  }
  .vertical-card {
    min-height: 0;
    padding: 22px 20px 18px;
  }
  .verticals-foot-mono {
    text-align: left;
  }
  .verticals-foot {
    justify-content: flex-start;
  }
}
