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

/* ─── 2. CSS CUSTOM PROPERTIES */
:root {
  --color-primary: #00E5A8;
  --color-primary-hover: #00C892;
  --color-secondary: #5B6CFF;
  --color-accent: #FFB800;
  --color-bg: #0A0F1A;
  --color-surface: #121A2A;
  --color-surface-alt: #182338;
  --color-border: #2A3650;
  --color-text: #F3F7FF;
  --color-text-secondary: #B7C2D9;
  --color-text-muted: #7F8AA3;
  --color-success: #22C55E;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #38BDF8;

  --color-primary-rgb: 0, 229, 168;
  --color-accent-rgb: 255, 184, 0;
  --color-text-rgb: 243, 247, 255;
  --color-success-rgb: 34, 197, 94;
  --color-error-rgb: 239, 68, 68;
  --color-surface-rgb: 18, 26, 42;
  --color-header-bg-rgb: 10, 15, 26;

  --color-footer-bg: #121A2A;
  --color-footer-text: #B7C2D9;
  --color-footer-link: #B7C2D9;
  --color-footer-border: #2A3650;
  --color-star: #FFB800;

  --gradient-hero: linear-gradient(135deg, #0A0F1A 0%, #16213A 55%, #5B6CFF 100%);

  --font-heading: "Sora", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-ui: "JetBrains Mono", monospace;
  --font-label: "JetBrains Mono", monospace;

  --text-h1: 62px;
  --text-h2: 40px;
  --text-h3: 28px;
  --text-body-lg: 20px;
  --text-body: 17px;
  --text-small: 14px;
  --text-label: 14px;

  --lh-heading: 1.15;
  --lh-body: 1.7;

  --container-max: 1240px;
  --container-padding-desktop: 72px;
  --container-padding-tablet: 40px;
  --container-padding-mobile: 20px;
  --grid-gap: 24px;
  --section-gap-desktop: 96px;
  --section-gap-mobile: 56px;
  --section-inner-desktop: 56px;
  --section-inner-mobile: 32px;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-7: 56px;
  --space-8: 64px;
  --space-9: 72px;
  --space-10: 80px;
  --space-11: 88px;
  --space-12: 96px;

  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.35);

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* ─── 3. RESET & BASE */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: var(--lh-body);
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }
::selection { background: rgba(var(--color-primary-rgb), 0.25); color: var(--color-text); }

/* ─── 4. ТИПОГРАФИКА */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--lh-heading);
  color: var(--color-text);
  text-transform: uppercase;
}
h1 { font-size: var(--text-h1); line-height: 1.08; }
h2 { font-size: var(--text-h2); line-height: 1.15; }
h3 { font-size: var(--text-h3); font-weight: 600; line-height: 1.22; }

p { font-size: var(--text-body); line-height: var(--lh-body); color: var(--color-text); }
p + p { margin-top: var(--space-2); }

.text-lg { font-size: var(--text-body-lg); line-height: 1.65; }
.text-sm { font-size: var(--text-small); line-height: 1.5; }
.text-label {
  font-family: var(--font-label);
  font-size: var(--text-label);
  letter-spacing: 0.03em;
}
strong, b { font-weight: 600; }
small { font-size: var(--text-small); line-height: 1.5; }

/* ─── 5. СЕТКА И КОНТЕЙНЕР */
.container {
  max-width: var(--container-max);
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--container-padding-desktop);
}
.grid { display: grid; gap: var(--grid-gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* ─── 6. КНОПКИ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 14px 28px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: transform var(--transition-base), background-color var(--transition-base), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-base);
}
.btn--primary { background: var(--color-primary); color: #041018; }
.btn--primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn--secondary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn--secondary:hover { background: rgba(var(--color-primary-rgb), 0.1); }

.btn--ghost { background: transparent; color: var(--color-primary); padding-inline: var(--space-2); }
.btn--ghost:hover { color: var(--color-primary-hover); }

.btn--sm { min-height: 40px; padding: 10px 18px; }
.btn--lg { min-height: 54px; padding: 16px 32px; }
.btn--full { width: 100%; }

.btn:hover { box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ─── 7. ССЫЛКИ */
a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-hover); }
a:visited { color: var(--color-primary); }
.link-clean { text-decoration: none; }
.link-clean:hover { text-decoration: underline; }

/* ─── 8. СПИСКИ */
ul, ol { padding-left: var(--space-3); }
li { margin-bottom: var(--space-1); line-height: var(--lh-body); }

.list-check { list-style: none; padding-left: 0; }
.list-check li { padding-left: var(--space-4); position: relative; margin-bottom: var(--space-2); }
.list-check li::before { content: "✓"; position: absolute; left: 0; color: var(--color-accent); font-weight: 700; }

.list-numbered { list-style: none; padding-left: 0; counter-reset: list-counter; }
.list-numbered li { counter-increment: list-counter; padding-left: var(--space-5); position: relative; margin-bottom: var(--space-3); }
.list-numbered li::before {
  content: counter(list-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  color: #041018;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

/* ─── 9. КАРТОЧКИ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-fast);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-secondary); }
.card--glass {
  background: rgba(var(--color-surface-rgb), 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(var(--color-text-rgb), 0.08);
}
.card--flat { box-shadow: none; }
.card--bordered { border-width: 2px; }

.card__icon { font-size: 32px; margin-bottom: var(--space-2); }
.card__title { font-size: var(--text-h3); font-weight: 600; margin-bottom: var(--space-2); }
.card__text { font-size: var(--text-body); color: var(--color-text-secondary); }

/* ─── 10. ФОРМЫ И ПОЛЯ ВВОДА */
.form { display: flex; flex-direction: column; gap: var(--space-3); }
.form-group { display: flex; flex-direction: column; gap: var(--space-1); }
.form-label { font-family: var(--font-label); font-size: var(--text-small); font-weight: 600; color: var(--color-text-secondary); }

.input, .textarea, .select {
  width: 100%;
  height: 50px;
  padding: 0 var(--space-3);
  font-size: var(--text-body);
  background: #0F1627;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}
.textarea { height: auto; min-height: 120px; padding: var(--space-2) var(--space-3); resize: vertical; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}
.input--error { border-color: var(--color-error); }
.form-hint { font-size: var(--text-small); color: var(--color-text-muted); }
.form-error { font-size: var(--text-small); color: var(--color-error); }

.range-slider {
  width: 100%;
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

/* ─── 11. ТАБЛИЦЫ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-body); }
th, td { padding: var(--space-2) var(--space-3); text-align: left; border-bottom: 1px solid var(--color-border); }
th { font-family: var(--font-label); font-size: var(--text-small); font-weight: 600; color: var(--color-text-secondary); background: var(--color-surface-alt); }
tr:hover td { background: var(--color-surface-alt); }

/* ─── 12. ИЗОБРАЖЕНИЯ И МЕДИА */
img, video { max-width: 100%; height: auto; display: block; }
.img-rounded { border-radius: var(--radius-md); }
.img-circle { border-radius: var(--radius-full); }
.aspect-16-9 { aspect-ratio: 16 / 9; }
.aspect-1-1 { aspect-ratio: 1 / 1; }

/* ─── 13. HEADER / НАВИГАЦИЯ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: 68px;
  background: rgba(var(--color-header-bg-rgb), 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; }

.site-logo { font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: var(--color-text); text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: var(--space-4); }
.site-nav a { font-family: var(--font-label); font-size: var(--text-label); text-decoration: none; color: var(--color-text-secondary); }
.site-nav a:hover { color: var(--color-primary); }

.hamburger { display: none; flex-direction: column; gap: 5px; padding: var(--space-1); cursor: pointer; }
.hamburger span { width: 24px; height: 2px; background: var(--color-text); border-radius: var(--radius-full); transition: all var(--transition-base); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── 14. FOOTER */
.site-footer { background: var(--color-footer-bg); color: var(--color-footer-text); padding-block: var(--space-10); font-size: var(--text-small); }
.site-footer a { color: var(--color-footer-link); text-decoration: none; }
.site-footer a:hover { color: var(--color-text); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-6); }
.footer-links { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.footer-heading { font-family: var(--font-label); font-size: var(--text-label); color: var(--color-text); margin-bottom: var(--space-3); }
.footer-bottom {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-footer-border);
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.social-icons { display: flex; gap: var(--space-2); }
.social-icons a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-footer-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.social-icons a:hover { background: var(--color-primary); color: #041018; }

/* ─── 15. СЕКЦИИ СТРАНИЦЫ */
.section { padding-block: var(--section-gap-desktop); }
.section--alt { background: var(--color-surface-alt); }
.section--dark { background: var(--color-primary); color: #041018; }
.section-header { text-align: center; max-width: 720px; margin: 0 auto var(--space-8); }

.hero { padding-block: var(--space-12); background: var(--gradient-hero); }
.hero__grid { display: grid; grid-template-columns: 7fr 5fr; gap: var(--space-8); align-items: center; }
.hero__label { font-family: var(--font-label); font-size: var(--text-small); color: var(--color-accent); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--space-2); }
.hero__title { margin-bottom: var(--space-4); }
.hero__subtitle { font-size: var(--text-body-lg); color: var(--color-text-secondary); margin-bottom: var(--space-5); }
.hero__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.stat-item { text-align: center; border-left: 1px solid var(--color-border); padding-left: var(--space-3); }
.stat-item:first-child { border-left: none; }
.stat-number { font-family: var(--font-ui); font-size: clamp(32px, 5vw, 56px); color: var(--color-secondary); line-height: 1; }
.stat-label { font-size: var(--text-small); color: var(--color-text-secondary); margin-top: var(--space-1); }

.review-card {}
.review-meta { display: flex; align-items: center; gap: var(--space-2); }
.review-name { font-size: var(--text-small); font-weight: 600; }
.stars { color: var(--color-star); }
.rating-block { padding: var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }

.fit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.fit-col { padding: var(--space-5); border-radius: var(--radius-lg); border: 2px solid; }
.fit-col--yes { background: rgba(var(--color-success-rgb), 0.06); border-color: var(--color-success); }
.fit-col--no { background: rgba(var(--color-error-rgb), 0.06); border-color: var(--color-error); }

.calculator { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); }
.calc-result { background: var(--color-primary); color: #041018; border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }

.howto-steps { display: flex; flex-direction: column; gap: var(--space-4); }
.howto-step { display: grid; grid-template-columns: 48px 1fr; gap: var(--space-3); }
.tips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.tip-card { padding: var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }

.comparison-table {}
.sticky-cta {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1000;
  padding: var(--space-2) var(--space-3);
  background: var(--color-primary);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
}

/* ─── 16. УТИЛИТЫ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-text-muted); }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; }
.badge--primary { background: var(--color-primary); color: #041018; }
.badge--secondary { background: var(--color-secondary); color: var(--color-text); }
.badge--accent { background: var(--color-accent); color: #041018; }
.badge--outline { background: transparent; color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.divider { width: 48px; height: 3px; background: var(--color-accent); border-radius: var(--radius-full); margin-block: var(--space-3); }

/* ─── 17. АНИМАЦИИ И ПЕРЕХОДЫ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

.animate-fade-in-up { animation: fadeInUp 0.4s ease both; }
.animate-fade-in { animation: fadeIn 0.3s ease both; }

/* ─── 18. АККОРДЕОН / FAQ */
.accordion { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.accordion__trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}
.accordion__trigger:hover { background: var(--color-surface-alt); }
.accordion__trigger[aria-expanded="true"] { border-bottom: 1px solid var(--color-border); }
.accordion__icon { transition: transform var(--transition-base); }
.accordion__body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.accordion__body.open { max-height: 1000px; }
.accordion__content { padding: var(--space-4) var(--space-5); color: var(--color-text-secondary); }

/* ─── 19. МОДАЛЬНЫЕ ОКНА */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6);
  position: relative;
  animation: scaleIn 0.2s ease;
}
.modal__close { position: absolute; top: var(--space-3); right: var(--space-3); font-size: 24px; color: var(--color-text-muted); cursor: pointer; }
.modal__title { font-size: var(--text-h3); margin-bottom: var(--space-4); }

/* ─── 20. COOKIE BANNER */
.cookie-banner {
  display: none;
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 1050;
  max-width: 560px;
  margin-inline: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-lg);
}
.cookie-banner.visible { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.cookie-actions { display: flex; gap: var(--space-2); }

/* ─── 21. МОБИЛЬНОЕ МЕНЮ */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 800;
  background: var(--color-surface);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}
.mobile-menu.open { display: flex; }
.mobile-menu a { font-family: var(--font-heading); font-size: var(--text-h3); color: var(--color-text); text-decoration: none; }
.mobile-menu a:hover { color: var(--color-primary); }

/* ─── 22. MEDIA QUERIES */
@media (max-width: 1199px) {
  .container { padding-inline: var(--container-padding-tablet); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  :root { --section-gap-desktop: var(--section-gap-mobile); --section-inner-desktop: var(--section-inner-mobile); }
  h1 { font-size: calc(var(--text-h1) * 0.76); }
  h2 { font-size: calc(var(--text-h2) * 0.82); }

  .container { padding-inline: var(--container-padding-mobile); }
  .grid-2, .grid-3, .grid-4, .hero__grid, .fit-grid, .tips-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .site-header { height: 58px; }
  .site-nav { display: none; }
  .hamburger { display: flex; }

  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .fit-col--yes { order: -1; }

  .sticky-cta { display: block; min-height: 64px; }
  body { padding-bottom: 72px; }
}

/* ─── 23. DARK THEME */
[data-theme="dark"] {
  --color-bg: #0A0F1A;
  --color-surface: #121A2A;
  --color-surface-alt: #182338;
  --color-border: #2A3650;
  --color-text: #F3F7FF;
  --color-text-secondary: #B7C2D9;
  --color-text-muted: #7F8AA3;
}
[data-theme="dark"] .site-header { background: rgba(var(--color-header-bg-rgb), 0.9); }
[data-theme="dark"] .card,
[data-theme="dark"] .modal { background: var(--color-surface); }

/* ─── 24. PREFERS-REDUCED-MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}