/* ==========================================================================
   StilRU (Стиль РУ) - Base Stylesheet (base.css)
   Milestone 2: UI Design System & Modular CSS
   Zero External CDNs | Self-Hosted WOFF2 Fonts | Dark Obsidian & Electric Cyan
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FONTS & TYPOGRAPHY (@font-face)
   -------------------------------------------------------------------------- */

/* Display / Heading Font: Unbounded (Cyrillic + Latin) */
@font-face {
  font-family: 'Unbounded';
  src: url('/assets/fonts/unbounded-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Unbounded';
  src: url('/assets/fonts/unbounded-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Unbounded';
  src: url('/assets/fonts/unbounded-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Unbounded';
  src: url('/assets/fonts/unbounded-900.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Unbounded';
  src: url('/assets/fonts/unbounded-latin-900.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Body & UI Font: Manrope (Full Cyrillic + Latin) */
@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/manrope-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/manrope-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/manrope-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. DESIGN TOKENS & CSS VARIABLES (:root)
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette: Dark Obsidian Base + Vibrant Electric Cyan Accent */
  --bg-obsidian: #0A0D14;
  --bg-surface: #121722;
  --bg-surface-hover: #1A2232;
  --bg-card: #141C2B;
  --bg-overlay: rgba(10, 13, 20, 0.85);

  --accent-cyan: #00E5FF;
  --accent-cyan-dark: #00B4D8;
  --accent-cyan-glow: rgba(0, 229, 255, 0.25);
  --accent-cyan-subtle: rgba(0, 229, 255, 0.08);

  --text-main: #F0F6FC;
  --text-muted: #8B949E;
  --text-dim: #484F58;

  --line-subtle: rgba(255, 255, 255, 0.08);
  --line-cyan: rgba(0, 229, 255, 0.15);
  --line-cyan-strong: rgba(0, 229, 255, 0.6);

  /* Typography Stacks */
  --font-display: 'Unbounded', 'Manrope', system-ui, -apple-system, sans-serif;
  --font-body: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Layout Spacing & Dimensions */
  --shell-max: 1240px;
  --shell: min(var(--shell-max), calc(100vw - 48px));
  --header-height: 80px;

  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Z-Index Layers */
  --z-below: -1;
  --z-normal: 1;
  --z-header: 100;
  --z-drawer: 105;
  --z-modal: 110;
  --z-floating: 90;
  --z-banner: 95;

  /* Shadows & Glows */
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(0, 229, 255, 0.3);
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* --------------------------------------------------------------------------
   3. MODERN CSS RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--bg-obsidian);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms ease;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
}

::selection {
  background: var(--accent-cyan);
  color: var(--bg-obsidian);
}

/* --------------------------------------------------------------------------
   4. CONTAINER & UTILITY CLASSES
   -------------------------------------------------------------------------- */
.shell {
  width: var(--shell);
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: clamp(70px, 7vw, 120px);
}

/* Eyebrow badge tag */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Lead text style */
.lead {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-muted);
}

/* Electric Cyan accent text modifier */
.accent-text,
.highlight {
  color: var(--accent-cyan);
  background: linear-gradient(135deg, #00E5FF 0%, #80F4FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Primary Button */
.btn-primary,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid var(--accent-cyan);
  background: var(--accent-cyan);
  color: var(--bg-obsidian);
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.25);
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover,
.button:hover {
  background: var(--accent-cyan-dark);
  border-color: var(--accent-cyan-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 229, 255, 0.4);
}

/* Secondary Button */
.btn-secondary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: none;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover,
.button-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: var(--accent-cyan-subtle);
  transform: translateY(-2px);
}

/* Accessibility & Helper Classes */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 12px 20px;
  background: var(--accent-cyan);
  color: var(--bg-obsidian);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 200ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   5. SCROLL REVEAL ANIMATIONS
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }

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

/* --------------------------------------------------------------------------
   6. ACCESSIBILITY OVERRIDES (prefers-reduced-motion)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .btn-primary:hover,
  .button:hover,
  .btn-secondary:hover,
  .button-secondary:hover {
    transform: none !important;
  }
}
