/* ============================================
   Klarti Landing Page — Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font-ui);
  color: var(--color-text);
  background: var(--color-bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--duration-normal) var(--ease),
              color var(--duration-normal) var(--ease);
}

body { min-height: 100dvh; overflow-x: hidden; min-width: 320px; }

a { color: var(--color-cta); text-decoration: none; }
a:hover { color: var(--color-cta-hover); }

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

/* ================================================
   Image Theme Toggle
   Steps showcase: два <picture> — light и dark.
   Переключаются через CSS display на data-theme.
   НЕ используем media="(prefers-color-scheme)" —
   он конфликтует с data-theme атрибутом.
   ================================================ */
html[data-theme="dark"]  .steps__showcase-light { display: none; }
html:not([data-theme="dark"]) .steps__showcase-dark  { display: none; }
/* Общие img-light/img-dark классы для других элементов */
html[data-theme="dark"] .img-light { display: none; }
html:not([data-theme="dark"]) .img-dark { display: none; }

/* === Container === */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* === CTA Google Hint === */
.cta-google-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
  font: 400 0.8125rem/1 var(--font-ui);
  color: var(--color-text-tertiary);
  letter-spacing: 0.01em;
  transition: color var(--duration-fast) var(--ease);
}

.cta-google-hint__icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: 0.75;
}

/* Group: primary CTA + hint stacked vertically */
.hero__cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tablet+ (768px): prevent secondary button stretch & wrap */
@media (min-width: 768px) {
  .hero__actions {
    align-items: flex-start;
  }

  .hero__actions .btn--secondary {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@media (min-width: 1024px) {
  .hero__cta-group {
    align-items: center; /* center hint under button */
  }

  /* Compact hero buttons so both fit in one row (RU is longer) */
  .hero__actions .btn {
    padding: 14px 24px;
  }
}

/* On mobile, CTA inside group should match standalone btn width */
@media (max-width: 767px) {
  .hero__cta-group {
    width: 100%;
    max-width: 320px;
  }
  .hero__cta-group .btn {
    width: 100%;
  }
}

/* In final-cta section — block-level to sit below button */
.final-cta .cta-google-hint {
  display: flex;
  justify-content: center;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font: 600 1rem/1 var(--font-ui);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  text-decoration: none;
}

.btn--primary {
  background: var(--color-cta);
  color: var(--color-cta-text);
  box-shadow: var(--shadow-md);
}
.btn--primary:hover {
  background: var(--color-cta-hover);
  color: var(--color-cta-text);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.btn--primary:active { transform: translateY(0); }

.btn--secondary {
  background: transparent;
  color: var(--color-cta);
  border: 1.5px solid var(--color-border);
}
.btn--secondary:hover {
  border-color: var(--color-cta);
  background: rgba(75, 96, 127, 0.05);
  color: var(--color-cta);
}

/* === Header / Nav === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background var(--duration-normal) var(--ease),
              box-shadow var(--duration-normal) var(--ease),
              opacity var(--duration-fast) var(--ease);
}

/* T1: Hide header when mobile nav is open to avoid overlap */
.header.header--hidden {
  opacity: 0;
  pointer-events: none;
}

.header.scrolled {
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .header.scrolled {
  background: rgba(37, 33, 32, 0.92);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font: 700 1.375rem/1 var(--font-ui);
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.logo span { color: var(--color-primary); }

.nav { display: flex; align-items: center; gap: 32px; }

.nav a {
  font: 500 0.875rem/1 var(--font-ui);
  color: var(--color-text-secondary);
  transition: color var(--duration-fast) var(--ease);
}
.nav a:hover { color: var(--color-text); }

.nav .btn { padding: 10px 24px; font-size: 0.875rem; }
.nav .btn--primary { color: var(--color-cta-text); }
.nav .btn--primary:hover { color: var(--color-cta-text); }

/* === Header Controls (theme + lang toggles) === */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.header-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--color-text-secondary);
  font: 500 0.8125rem/1 var(--font-ui);
  transition: all var(--duration-fast) var(--ease);
}

.header-control:hover {
  color: var(--color-text);
  border-color: var(--color-border);
  background: var(--color-surface);
}

.header-control svg {
  width: 16px;
  height: 16px;
}

.lang-label {
  font: 600 0.75rem/1 var(--font-ui);
  letter-spacing: 0.04em;
}

/* Theme icon visibility */
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger svg { width: 24px; height: 24px; color: var(--color-text); }

/* === Header-right-mobile (theme+lang next to burger) === */
.header-right-mobile {
  display: none; /* shown on mobile via media query */
  align-items: center;
  gap: 4px;
}

.header-control--mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 6px;
  cursor: pointer;
  color: var(--color-text-secondary);
  font: 500 0.8125rem/1 var(--font-ui);
  transition: all var(--duration-fast) var(--ease);
}

.header-control--mobile:hover {
  color: var(--color-text);
  border-color: var(--color-border);
}

.header-control--mobile svg {
  width: 16px;
  height: 16px;
}

/* === Mobile Nav === */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200; /* T1: above header (z-index 100) */
  background: rgba(250, 250, 247, 0.98);
  backdrop-filter: blur(16px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

[data-theme="dark"] .mobile-nav {
  background: rgba(26, 22, 20, 0.98);
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  font: 600 1.25rem/1 var(--font-ui);
  color: var(--color-text);
}

/* T2: Ensure CTA button in mobile nav has proper contrast */
.mobile-nav .btn { font-size: 1.125rem; padding: 16px 40px; }
.mobile-nav .btn--primary {
  color: var(--color-cta-text) !important;
  background: var(--color-cta);
}
.mobile-nav .btn--primary:hover {
  color: var(--color-cta-text) !important;
  background: var(--color-cta-hover);
}

/* Mobile controls (theme + lang in mobile nav) */
.mobile-nav__controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.mobile-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease);
}

.mobile-close:hover {
  background: var(--color-surface-raised);
}

.mobile-close svg { width: 20px; height: 20px; color: var(--color-text); }

/* === HERO === */
.hero {
  padding: calc(80px + var(--space-section)) 0 var(--space-section);
  /* На mobile: centered, на desktop: split (см. ниже) */
  text-align: center;
  overflow: hidden; /* для halo glow */
}

/* Split wrapper: mobile = single column centered */
.hero__split {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xl);
  position: relative;
}

/* Halo: radial gradient glow — на всём split блоке */
.hero__split::before {
  content: '';
  position: absolute;
  inset: -60px -80px;
  z-index: -1;
  background: radial-gradient(ellipse 70% 60% at 65% 50%,
    rgba(51, 72, 102, 0.10) 0%,
    rgba(173, 50, 38, 0.04) 40%,
    transparent 70%);
  pointer-events: none;
}

.hero__content {
  /* mobile: centered */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--color-success-bg);
  color: var(--color-success);
  font: 500 0.8125rem/1 var(--font-ui);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
}

.hero__eyebrow svg { width: 14px; height: 14px; }

.hero h1 {
  font: var(--text-hero);
  letter-spacing: -0.03em;
  max-width: 720px;
  margin: 0 auto var(--space-lg);
}

.hero h1 em {
  font-style: normal;
  color: var(--color-primary);
}

.hero__subtitle {
  font: var(--text-body);
  color: var(--color-text-secondary);
  max-width: 520px;
  margin: 0 auto var(--space-xl);
}

.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__visual {
  width: 100%;
  position: relative;
}

.hero__screenshot {
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  background: var(--color-surface);
  overflow: hidden;
  border: 1px solid rgba(51, 72, 102, 0.12);
}

.hero__screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

/* ================================================
   Desktop split-hero: asymmetric 2-column grid (xl: 1024px+)
   LEFT: text col — min 460px, grows up to ~45% of container
   RIGHT: image col — takes the rest, always bigger
   ================================================ */
@media (min-width: 1024px) {
  .hero {
    padding: calc(100px + var(--space-section)) 0 var(--space-section);
    text-align: left;
  }

  .hero__split {
    display: grid;
    /* Текст: минимум 460px, максимум 45% контейнера.
       Картинка: берёт всё оставшееся — всегда крупнее */
    grid-template-columns: minmax(min(460px, 45%), 1fr) 1fr;
    align-items: center;
    gap: clamp(40px, 4vw, 64px);
  }

  .hero__content {
    align-items: flex-start;
  }

  .hero h1 {
    margin: 0 0 var(--space-lg) 0;
    max-width: none;
  }

  .hero__subtitle {
    margin: 0 0 var(--space-xl) 0;
    max-width: 460px;
  }

  .hero__actions {
    justify-content: flex-start;
  }

  .hero__visual {
    width: 100%;
  }

  .hero__screenshot {
    max-width: none;
    margin: 0;
    transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
    transition: transform var(--duration-slow) var(--ease);
  }

  .hero__screenshot:hover {
    transform: perspective(1200px) rotateY(-1deg) rotateX(1deg);
  }
}

/* На широких экранах (≥1440px) — image bleed:
   Картинка чуть выходит за правый край контейнера.
   Эффект как у Linear, Vercel: скриншот «уходит» в правый обрез */
@media (min-width: 1440px) {
  .hero__split {
    /* Фиксируем текст ~440px, дальше картинке — всё пространство */
    grid-template-columns: minmax(440px, 5fr) 7fr;
    gap: 56px;
  }

  .hero__visual {
    /* «Кровотечение» вправо на ширину gutter */
    margin-right: calc(-1 * var(--gutter));
    overflow: visible;
  }

  .hero__screenshot {
    /* Убираем скругление только с правой стороны — картинка «вырезана» краем экрана */
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    /* Тень усилена, чтобы компенсировать потерю правого закругления */
    box-shadow: var(--shadow-xl), -8px 0 32px rgba(51, 72, 102, 0.06);
    transform: perspective(1400px) rotateY(-3deg) rotateX(1.5deg);
  }

  .hero__screenshot:hover {
    transform: perspective(1400px) rotateY(-0.5deg) rotateX(0.5deg);
  }
}

/* === Trust Bar === */
.trust {
  padding: var(--space-xl) 0;
  background: var(--color-surface-inset);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.trust .container {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 3vw, 32px);
  flex-wrap: wrap;
}

/* Pill-card badges (Stitch-style) */
.trust__badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 0.875rem/1.3 var(--font-ui);
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 10px 18px 10px 10px;
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
}

.trust__badge:hover {
  border-color: var(--color-cta);
  box-shadow: var(--shadow-sm);
}

.trust__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trust__icon svg { width: 16px; height: 16px; color: var(--color-success); }

/* === Section common === */
.section {
  padding: var(--space-section) 0;
}

.section__header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
}

.section__label {
  font: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-cta);
  margin-bottom: var(--space-sm);
}

.section__title {
  font: var(--text-h2);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.section__desc {
  font: var(--text-body);
  color: var(--color-text-secondary);
}

/* === How It Works (2-column: showcase + steps) === */
.steps-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (min-width: 768px) {
  .steps-layout {
    grid-template-columns: 5fr 7fr;
    gap: 40px;
  }
}
@media (min-width: 1024px) {
  .steps-layout {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

/* Showcase image column */
.steps__showcase {
  display: flex;
  justify-content: center;
}

/* Sticky only on desktop where 2 columns are side by side */
@media (min-width: 768px) {
  .steps__showcase {
    position: sticky;
    top: 100px;
  }
}

/* On mobile, limit image width so it doesn't overwhelm */
@media (max-width: 767px) {
  .steps__showcase {
    max-width: 340px;
    margin: 0 auto;
  }
}

.steps__showcase picture { display: block; }
.steps__showcase img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

/* Dark theme image toggling */
.steps__showcase-dark { display: none; }
[data-theme="dark"] .steps__showcase > picture:first-child { display: none; }
[data-theme="dark"] .steps__showcase-dark { display: block; }

/* Steps list column */
.steps__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.steps__extra {
  text-align: left;
  font: var(--text-small);
  color: var(--color-text-secondary);
  padding-top: var(--space-sm);
  line-height: 1.7;
}
.steps__extra a { color: var(--color-cta); font-weight: 500; }

/* Individual step card */
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: transform var(--duration-normal) var(--ease),
              box-shadow var(--duration-normal) var(--ease),
              border-color var(--duration-normal) var(--ease);
}

.step:hover {
  transform: translateY(-2px);
  border-color: var(--color-cta);
  box-shadow: var(--shadow-lg);
}

/* Active state via IntersectionObserver scroll-highlight */
.step--active {
  border-color: var(--color-cta);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.step__number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-cta);
  color: var(--color-cta-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 0.875rem/1 var(--font-ui);
  flex-shrink: 0;
  transition: background var(--duration-normal) var(--ease);
}

/* Active step badge turns brick red */
.step--active .step__number {
  background: var(--color-primary);
}

.step__body { flex: 1; min-width: 0; }

.step__title {
  font: var(--text-h3);
  margin-bottom: var(--space-xs);
}

.step__desc {
  font: var(--text-small);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* === Features === */
.features-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile: single column */
  gap: 24px;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px; /* Stitch standard: увеличен с 24px */
  transition: transform var(--duration-normal) var(--ease),
              box-shadow var(--duration-normal) var(--ease),
              border-color var(--duration-normal) var(--ease);
  position: relative;
  overflow: hidden;
}

/* Subtle diagonal gradient overlay on hover */
.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    transparent 60%,
    rgba(51, 72, 102, 0.03) 100%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease);
  pointer-events: none;
  border-radius: var(--radius-lg);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-cta);
  box-shadow: var(--shadow-lg);
}

.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(173, 50, 38, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  transition: background var(--duration-normal) var(--ease);
}

.feature-card__icon svg {
  width: 22px;
  height: 22px;
  color: var(--color-primary);
  transition: color var(--duration-normal) var(--ease);
}

.feature-card:hover .feature-card__icon {
  background: var(--color-primary);
}

.feature-card:hover .feature-card__icon svg {
  color: var(--color-primary-text);
}

.feature-card h3 {
  font: var(--text-h3);
  margin-bottom: var(--space-sm);
}

.feature-card p {
  font: var(--text-small);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* === Security === */
.security { background: var(--color-surface); }

.security-point__note {
  font: var(--text-small);
  color: var(--color-text-tertiary);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.5;
}

.security-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.security-points { list-style: none; display: flex; flex-direction: column; gap: 20px; }

.security-point {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.security-point__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.security-point__icon svg { width: 18px; height: 18px; color: var(--color-success); }

.security-point h4 {
  font: 600 1rem/1.3 var(--font-ui);
  margin-bottom: 4px;
}

.security-point p {
  font: var(--text-small);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.security-visual {
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
}

.security-visual__diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.security-visual__node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font: 500 0.875rem/1 var(--font-ui);
  width: 100%;
  max-width: 280px;
}

.security-visual__node svg { width: 20px; height: 20px; flex-shrink: 0; }

.security-visual__arrow {
  color: var(--color-text-tertiary);
  font-size: 1.25rem;
}

.security-visual__node--highlight {
  border-color: var(--color-success);
  background: var(--color-success-bg);
  color: var(--color-success);
}

/* === FAQ === */
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  font: 500 1rem/1.4 var(--font-ui);
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--duration-fast) var(--ease);
}

.faq-question:hover { background: rgba(0,0,0,0.02); }

.faq-question svg {
  width: 20px;
  height: 20px;
  color: var(--color-text-tertiary);
  transition: transform var(--duration-normal) var(--ease);
  flex-shrink: 0;
}

.faq-item.open .faq-question svg { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--ease-out);
}

.faq-answer__inner {
  padding: 0 20px 18px;
  font: var(--text-small);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 300px;
}

/* === Founder === */
.founder {
  background: var(--color-surface);
}

.founder-content {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 640px;
  margin: 0 auto;
}

.founder__photo {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-full);
  background: var(--color-surface-inset);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.founder__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

.founder__photo svg { width: 40px; height: 40px; color: var(--color-text-tertiary); }

.founder blockquote {
  font: 400 1rem/1.7 var(--font-ui);
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: var(--space-sm);
}

.founder__name {
  font: 600 0.875rem/1 var(--font-ui);
  color: var(--color-text);
}

/* === Final CTA — Tonal Surface (гармонирует с обеими темами) === */
/*
  Принцип: секция должна выделяться, но НЕ ломать цветовую гамму.
  Light: чуть тонированный slate-bg, border сверху и снизу.
  Dark: поднятая surface без яркого синего.
*/
.final-cta {
  text-align: center;
  padding: var(--space-section) 0;
  background: linear-gradient(
    180deg,
    rgba(51, 72, 102, 0.06) 0%,
    rgba(51, 72, 102, 0.10) 100%
  );
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.final-cta h2 {
  font: var(--text-h2);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.final-cta p {
  font: var(--text-body);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
}

/* Primary CTA — стандартный slate blue */
.final-cta .btn--primary {
  background: var(--color-cta);
  color: var(--color-cta-text);
  box-shadow: var(--shadow-md);
}

.final-cta .btn--primary:hover {
  background: var(--color-cta-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Dark mode: slate-blue тинт — выделяется, но не кричит */
/* #293545 = примерно 18% #334866 + 82% #2E2926 */
[data-theme="dark"] .final-cta {
  background: #293545;
  background: color-mix(in srgb, #334866 18%, #2E2926);
  border-top-color: rgba(107, 131, 158, 0.25);
  border-bottom-color: rgba(107, 131, 158, 0.25);
}

/* === Footer === */
.footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-border);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__copy {
  font: var(--text-small);
  color: var(--color-text-tertiary);
}

.footer__links {
  display: flex;
  gap: 24px;
}

.footer__links a {
  font: var(--text-small);
  color: var(--color-text-secondary);
}
.footer__links a:hover { color: var(--color-text); }

/* === Scroll Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal:nth-child(2) { transition-delay: 80ms; }
.reveal:nth-child(3) { transition-delay: 160ms; }
.reveal:nth-child(4) { transition-delay: 240ms; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================
   Mobile-first. Breakpoints:
     xs  < 480px  — узкий мобильный (iPhone SE, Galaxy A)
     sm  ≥ 480px  — стандартный мобильный
     md  ≥ 640px  — планшет портрет / крупный телефон
     lg  ≥ 768px  — планшет альбом
     xl  ≥ 1024px — десктоп
     2xl ≥ 1280px — широкий десктоп
   ============================================================ */

/* --- md (640px+): Планшет портрет --- */
@media (min-width: 640px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- lg (768px+): Планшет альбом --- */
/* steps-layout 2-column already handled in .steps-layout block above */

/* --- xl (1024px+): Десктоп --- */
@media (min-width: 1024px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- ≤ lg (до 1023px): скрываем десктоп-nav, показываем бургер --- */
@media (max-width: 1023px) {
  .nav { display: none; }
  .header-controls { display: none; }
  .header-right-mobile { display: flex; }
  .hamburger { display: block; }

  .security-content { grid-template-columns: 1fr; }
}

/* --- md (640–1023px): Планшет — security в 2 колонки --- */
@media (min-width: 640px) and (max-width: 1023px) {
  .security-content {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
  }
}

/* --- sm (до 767px): Мобильный --- */
@media (max-width: 767px) {
  .hero { padding: calc(80px + var(--space-xl)) 0 var(--space-xl); }
  .hero h1 { letter-spacing: -0.02em; }
  .hero__actions { flex-direction: column; align-items: center; }
  .hero__actions .btn { width: 100%; max-width: 320px; }

  /* Trust bar: wrap по центру, пилюли не сжимаются и не уезжают */
  .trust .container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .trust__badge {
    flex: 0 1 auto;      /* не растягивать, но можно чуть сжать */
    max-width: calc(100% - 16px); /* не шире экрана */
    white-space: nowrap;
    padding: 8px 14px 8px 8px;
    font-size: 0.8125rem;
  }
  .trust__icon { width: 28px; height: 28px; }
  .trust__icon svg { width: 14px; height: 14px; }

  .founder-content { flex-direction: column; text-align: center; }
  .footer .container { flex-direction: column; text-align: center; }
}

/* --- xs (до 479px): Очень узкий мобильный --- */
@media (max-width: 479px) {
  .hero__actions .btn { font-size: 0.9375rem; padding: 12px 24px; }
  .section__header { margin-bottom: var(--space-xl); }
}

/* === Scroll-to-top === */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--duration-normal) var(--ease),
              transform var(--duration-normal) var(--ease),
              background var(--duration-fast) var(--ease);
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-lg);
}

.scroll-top svg {
  width: 20px;
  height: 20px;
  color: var(--color-text-secondary);
}

/* === Cookie Consent Banner === */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  padding: 16px var(--gutter);
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(100%);
  opacity: 0;
  transition: transform var(--duration-slow) var(--ease-out),
              opacity var(--duration-normal) var(--ease);
  pointer-events: none;
}

.cookie-banner.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

[data-theme="dark"] .cookie-banner {
  background: rgba(37, 33, 32, 0.95);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}

.cookie-banner__content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-banner__text {
  flex: 1;
  min-width: 240px;
  font: var(--text-small);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.cookie-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 10px 20px;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.cookie-banner__link {
  font: var(--text-small);
  color: var(--color-text-tertiary);
  text-decoration: underline;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .cookie-banner__content {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .cookie-banner__actions {
    width: 100%;
    justify-content: center;
  }
  .cookie-btn {
    flex: 1;
    max-width: 160px;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
