/* ============================================================
   Mavix Web — base.css
   Дизайн-система: переменные, reset, типографика, утилиты.
   ============================================================ */

:root {
  /* Палитра — Aviation Dark */
  --bg: #07090E;
  --bg-elev-1: #0D1117;
  --surface: #11151D;
  --card: #161B24;
  --card-hover: #1A212C;
  --border: #1F2733;
  --border-strong: #2A3441;
  --border-focus: rgba(0, 217, 255, 0.45);

  --text: #E8EEF5;
  --text-soft: #C0CAD8;
  --muted: #8893A4;
  --muted-strong: #B0BCCC;

  --accent: #00D9FF;
  --accent-hover: #33E1FF;
  --accent-press: #00B8E0;
  --accent-soft: rgba(0, 217, 255, 0.12);
  --accent-glow: rgba(0, 217, 255, 0.35);

  --success: #4ADE80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.12);

  /* Радиусы */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 999px;

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 0 1px var(--border-focus), 0 0 24px var(--accent-glow);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.4);

  /* Шрифты */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Размеры шрифта */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;
  --fs-4xl: 36px;
  --fs-5xl: 48px;
  --fs-6xl: 60px;
  --fs-7xl: 72px;

  /* Layout */
  --container: 1200px;
  --container-narrow: 880px;
  --sidebar-width: 260px;
  --header-height: 68px;

  /* Easing & timings */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 320ms;
}

/* ============================================================
   Reset
   ============================================================ */

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

/* HTML-атрибут hidden должен побеждать любой display: ... в CSS */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

/* Якоря и сами секции не должны прятаться под sticky-шапкой */
[id] {
  scroll-margin-top: calc(var(--header-height) + 12px);
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  /* clip вместо hidden — не создаёт scroll-container и не ломает
     position: sticky на дочернем .header (особенно заметно на
     длинных страницах кабинета: docs, software). */
  overflow-x: clip;
}

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

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

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: var(--fs-5xl); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: var(--fs-4xl); font-weight: 700; letter-spacing: -0.03em; }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p {
  margin: 0;
  color: var(--text-soft);
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Полоса прокрутки */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ============================================================
   Layout-утилиты
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section-sm {
  padding: 64px 0;
}

@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .section-sm { padding: 40px 0; }
  .container, .container-narrow { padding: 0 20px; }
}

/* ============================================================
   Типографика-утилиты
   ============================================================ */

.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--muted); }
.text-soft { color: var(--text-soft); }
.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  padding: 6px 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: var(--r-full);
}

/* ============================================================
   Анимации
   ============================================================ */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.95); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fade-up {
  animation: fade-up 600ms var(--ease) both;
}

/* Скрыть для всех, кроме скринридеров */
.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;
}

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