:root {
  --bg-main: #050713;
  --bg-alt: #0b0f1f;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.2);
  --text-main: #f5f7ff;
  --text-muted: #a3adc7;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --radius-md: 12px;
  --transition-fast: 0.2s ease-out;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: radial-gradient(circle at top left, #1b2340 0, #050713 45%, #02030a 100%);
  color: var(--text-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.methodology-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 96px 24px 64px;
}

.methodology-hero {
  margin: 8px 0 18px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid rgba(79, 140, 255, 0.18);
  background:
    radial-gradient(ellipse 80% 70% at 10% 0%, rgba(79, 140, 255, 0.14), transparent 60%),
    linear-gradient(135deg, rgba(30, 58, 100, 0.16), rgba(9, 15, 30, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.methodology-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(180, 205, 245, 0.92);
}

.methodology-content h1 {
  font-size: clamp(1.625rem, 4.2vw, 2.5rem);
  margin: 10px 0 10px;
  letter-spacing: 0.01em;
}

/* Hero main title should be slightly smaller */
.methodology-hero h1 {
  font-size: clamp(1.5rem, 3.6vw, 2.125rem);
  line-height: 1.14;
  margin: 8px 0 8px;
}

/* Hero H1: keep the same "premium" look in both themes */
.methodology-hero h1 {
  font-weight: 900;
  letter-spacing: 0.01em;
  color: rgba(240, 248, 255, 0.98);
  text-shadow:
    0 0 14px rgba(79, 140, 255, 0.22),
    0 0 22px rgba(139, 92, 255, 0.14);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .methodology-hero h1 {
    background: linear-gradient(90deg, #7dd3fc 0%, #60a5fa 35%, #a78bfa 70%, #c4b5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }
}

.methodology-lead {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 1rem;
}

.methodology-hero .methodology-lead {
  margin: 0;
  color: rgba(214, 226, 245, 0.86);
}

.methodology-hero__subtitle {
  margin: 0 0 8px;
  font-size: clamp(1.375rem, 3.1vw, 1.875rem);
  line-height: 1.18;
  font-weight: 700;
  color: rgba(236, 243, 255, 0.96);
  text-wrap: balance;
  letter-spacing: 0.01em;
}

.methodology-hero__tagline {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(214, 226, 245, 0.86);
  text-wrap: balance;
}

/* Tagline: accent first phrase (variant #1) */
.methodology-tagline-accent {
  font-weight: 900;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .methodology-tagline-accent {
    background: linear-gradient(90deg, #7dd3fc 0%, #60a5fa 35%, #a78bfa 70%, #c4b5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* Light theme: slightly darker accent for contrast */
html[data-theme="light"] .methodology-tagline-accent {
  color: rgba(11, 18, 32, 0.92);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  html[data-theme="light"] .methodology-tagline-accent {
    background: linear-gradient(90deg, #0369a1 0%, #1d4ed8 35%, #5b21b6 70%, #6d28d9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.methodology-hero__divider {
  height: 1px;
  margin: 12px 0 14px;
  background: linear-gradient(90deg, transparent, rgba(79, 140, 255, 0.28), rgba(255, 255, 255, 0.10), rgba(139, 92, 255, 0.20), transparent);
}
.methodology-hero__divider--top {
  margin: 4px 0 14px;
}

/* Light theme: keep divider visible on bright background */
html[data-theme="light"] .methodology-hero__divider {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(15, 23, 42, 0.14),
    rgba(37, 99, 235, 0.22),
    rgba(15, 23, 42, 0.14),
    transparent
  );
}

.methodology-hero__lead {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.7;
}

.methodology-hero__lead + .methodology-hero__lead {
  margin-top: 12px;
}

html[data-theme="light"] .methodology-hero__subtitle {
  color: #0f172a;
}
html[data-theme="light"] .methodology-hero__tagline {
  color: rgba(15, 23, 42, 0.78);
}
html[data-theme="light"] .methodology-hero .methodology-lead {
  color: rgba(15, 23, 42, 0.76);
}

.methodology-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 26px;
}
.methodology-toc__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(245, 247, 255, 0.92);
  font-size: 13px;
  text-decoration: none;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.methodology-toc__link:hover {
  border-color: rgba(79, 140, 255, 0.28);
  background: rgba(79, 140, 255, 0.07);
}

.methodology-section {
  scroll-margin-top: 90px;
}

.methodology-content h2 {
  font-size: 1.25rem;
  margin: 34px 0 12px;
  color: var(--accent);
}

.methodology-content p {
  margin: 14px 0;
  font-size: 1rem;
  color: var(--text-muted);
}

/* Красная строка только для основного текста разделов
   (не влияет на вложенные p в карточках/плашках/CTA) */
.methodology-section > p {
  text-indent: 1.6em;
}

.methodology-content ul {
  margin: 14px 0;
  padding-left: 1.35em;
}

/* Списки в тексте должны начинаться правее, чем красная строка абзацев */
.methodology-section > ul {
  padding-left: 3em;
}

.methodology-content li {
  margin: 8px 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.methodology-content hr {
  border: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(79, 140, 255, 0.28),
    rgba(255, 255, 255, 0.10),
    rgba(139, 92, 255, 0.20),
    transparent
  );
  margin: 22px 0;
}

html[data-theme="light"] .methodology-content hr {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(15, 23, 42, 0.14),
    rgba(37, 99, 235, 0.22),
    rgba(15, 23, 42, 0.14),
    transparent
  );
}

/* Optional red line for CTA text */
.methodology-closing-cta .methodology-cta-indent {
  display: inline-block;
  text-indent: 1.6em;
}

.methodology-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.methodology-content a:hover { color: var(--text-main); }

/* Back link is a pill control, not an inline link */
.methodology-content .back-link,
.methodology-content .back-link:hover,
.methodology-content .back-link:focus-visible {
  text-decoration: none;
}

/* Gradient text compatibility (Safari/WebKit) */
.methodology-hero h1,
.methodology-brand-inline {
  text-decoration: none;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .methodology-hero h1,
  .methodology-brand-inline {
    -webkit-text-fill-color: transparent;
  }
}

/* Inline brand label: matches hero H1 premium gradient */
.methodology-brand-inline {
  font-weight: 900;
  letter-spacing: 0.01em;
  color: rgba(240, 248, 255, 0.98);
  text-shadow:
    0 0 14px rgba(79, 140, 255, 0.22),
    0 0 22px rgba(139, 92, 255, 0.14);
  white-space: nowrap;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .methodology-brand-inline {
    background: linear-gradient(90deg, #7dd3fc 0%, #60a5fa 35%, #a78bfa 70%, #c4b5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
  }
}

/* Light theme: same darker palette as other accents */
html[data-theme="light"] .methodology-brand-inline {
  color: rgba(11, 18, 32, 0.92);
  text-shadow: none;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  html[data-theme="light"] .methodology-brand-inline {
    background: linear-gradient(90deg, #0369a1 0%, #1d4ed8 35%, #5b21b6 70%, #6d28d9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

/* Index badges (FS/MS/RS/AS etc.) */
.idx {
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--accent);
}

/* Pill buttons (TOC + bottom actions) should not look like inline links */
.methodology-content .methodology-toc__link,
.methodology-content .methodology-action,
.methodology-toc__link,
.methodology-action {
  text-decoration: none;
}
.methodology-toc__link:hover,
.methodology-action:hover {
  text-decoration: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.back-link:hover,
.back-link:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(79, 140, 255, 0.35);
  outline: none;
}

.methodology-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 18px;
}
.methodology-top-row .back-link {
  margin-bottom: 0;
}

/* Одна линия по высоте: ссылка и кнопка «Фон» */
.methodology-top-row .back-link,
.methodology-top-row .methodology-bg-toggle {
  box-sizing: border-box;
  min-height: 42px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

/* Canvas-фон (плазма): включается кнопкой «Фон» */
.methodology-bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  display: block;
  opacity: 0;
  transition: opacity 0.45s ease;
}
body.methodology-bg-on .methodology-bg-canvas {
  opacity: 1;
}
html[data-theme="light"] body.methodology-bg-on .methodology-bg-canvas {
  opacity: 0.92;
}

.methodology-bg-toggle {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}
.methodology-bg-toggle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(79, 140, 255, 0.35);
}
.methodology-bg-toggle:focus-visible {
  outline: 2px solid rgba(79, 140, 255, 0.65);
  outline-offset: 2px;
}
.methodology-bg-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.methodology-bg-toggle.is-active:not(:disabled) {
  border-color: rgba(79, 140, 255, 0.48);
  background: rgba(79, 140, 255, 0.14);
  color: #f1f5ff;
}

/* Как верхняя плашка (.methodology-hero): тот же «корпус», акцент на тексте тезиса */
.methodology-quote {
  margin: 18px 0 10px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid rgba(79, 140, 255, 0.18);
  background:
    radial-gradient(ellipse 80% 70% at 10% 0%, rgba(79, 140, 255, 0.14), transparent 60%),
    linear-gradient(135deg, rgba(30, 58, 100, 0.16), rgba(9, 15, 30, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: rgba(245, 247, 255, 0.96);
  font-size: clamp(16px, 2.1vw, 18px);
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.methodology-quote strong {
  color: rgba(240, 248, 255, 0.98);
  font-weight: 600;
}

.methodology-actions {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.methodology-action {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(245, 247, 255, 0.92);
  text-decoration: none;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.methodology-action:hover {
  border-color: rgba(79, 140, 255, 0.28);
  background: rgba(79, 140, 255, 0.07);
}

/* ===== Светлая тема: hero читаемый на «стекле», без бледного текста на градиенте ===== */
html[data-theme="light"] .methodology-hero {
  border: 1px solid rgba(15, 23, 42, 0.18);
  background:
    radial-gradient(ellipse 88% 72% at 8% 0%, rgba(37, 99, 235, 0.14), transparent 56%),
    radial-gradient(ellipse 75% 60% at 96% 8%, rgba(124, 58, 237, 0.10), transparent 50%),
    linear-gradient(168deg, #cfd8e8 0%, #c1cde0 46%, #b3c1d7 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 16px 44px rgba(15, 23, 42, 0.11),
    0 1px 0 rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .methodology-hero .methodology-kicker {
  color: #1d4ed8;
  letter-spacing: 0.16em;
  opacity: 0.96;
}

html[data-theme="light"] .methodology-hero h1 {
  text-decoration: none;
  /* Same visual language as dark theme, but with higher contrast */
  text-shadow: none;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  html[data-theme="light"] .methodology-hero h1 {
    background: linear-gradient(90deg, #0369a1 0%, #1d4ed8 35%, #5b21b6 70%, #6d28d9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

html[data-theme="light"] .methodology-hero .methodology-lead {
  margin: 0;
  color: #1a2332;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 500;
  letter-spacing: 0.01em;
  max-width: 52em;
}

html[data-theme="light"] .methodology-quote {
  border: 1px solid rgba(15, 23, 42, 0.18);
  background:
    radial-gradient(ellipse 88% 72% at 8% 0%, rgba(37, 99, 235, 0.14), transparent 56%),
    radial-gradient(ellipse 75% 60% at 96% 8%, rgba(124, 58, 237, 0.10), transparent 50%),
    linear-gradient(168deg, #cfd8e8 0%, #c1cde0 46%, #b3c1d7 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 16px 44px rgba(15, 23, 42, 0.11),
    0 1px 0 rgba(15, 23, 42, 0.08);
  color: #1a2332;
}

html[data-theme="light"] .methodology-quote strong {
  color: #050914;
  font-weight: 600;
}

/* Оглавление и нижние CTA — стекло в светлой теме (видно, блюр, без «невидимых» пилюль) */
html[data-theme="light"] .methodology-toc__link,
html[data-theme="light"] .methodology-action {
  color: rgba(15, 23, 42, 0.92);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0.28) 100%);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  box-shadow:
    0 4px 18px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .methodology-toc__link:hover,
html[data-theme="light"] .methodology-action:hover {
  color: #0b1220;
  border-color: rgba(37, 99, 235, 0.28);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.72) 0%, rgba(239, 246, 255, 0.45) 100%);
  box-shadow:
    0 10px 28px rgba(37, 99, 235, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .methodology-toc__link:focus-visible,
html[data-theme="light"] .methodology-action:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

html[data-theme="light"] .back-link {
  border: 1px solid rgba(255, 255, 255, 0.65);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.22) 100%);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  color: #0f172a;
  box-shadow:
    0 3px 14px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
html[data-theme="light"] .back-link:hover,
html[data-theme="light"] .back-link:focus-visible {
  border-color: rgba(37, 99, 235, 0.28);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.62) 0%, rgba(239, 246, 255, 0.38) 100%);
  color: #0b1220;
}

html[data-theme="light"] .methodology-bg-toggle {
  border: 1px solid rgba(255, 255, 255, 0.65);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.22) 100%);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  color: #0f172a;
  box-shadow:
    0 3px 14px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
html[data-theme="light"] .methodology-bg-toggle:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.28);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.62) 0%, rgba(239, 246, 255, 0.38) 100%);
  color: #0b1220;
}
html[data-theme="light"] .methodology-bg-toggle.is-active:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.42);
  background:
    linear-gradient(155deg, rgba(239, 246, 255, 0.88) 0%, rgba(219, 234, 254, 0.72) 100%);
  color: #0b1220;
  box-shadow:
    0 6px 20px rgba(37, 99, 235, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}
html[data-theme="light"] .methodology-bg-toggle:focus-visible {
  outline-color: rgba(37, 99, 235, 0.45);
}

