/* Общая основа для всех страниц сайта: шрифты, токены, навигация, футер.
   Вынесено из инлайновых <style>, чтобы CSP обходился без 'unsafe-inline'
   и чтобы один набор токенов не расходился между страницами. */

/* ─── FONTS ─── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  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;
}

:root {
  --bg: #080d14;
  --bg2: #0d1520;
  --bg3: #111d2e;
  --border: rgba(56, 189, 248, 0.15);
  --accent: #38bdf8;
  --accent2: #818cf8;
  --accent3: #34d399;
  --text: #e2e8f0;
  --muted: #64748b;       /* decorative low-contrast */
  --muted-high: #94a3b8;  /* WCAG AA text */
  --subtle: #94a3b8;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Accessible focus ring */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--bg);
  padding: 10px 16px; z-index: 200; font-weight: 600;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ─── PARTICLES BG ─── */
#particles {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--accent);
  border-radius: 50%;
  animation: float linear infinite;
  opacity: 0;
  will-change: transform, opacity;
}
@keyframes float {
  0%   { transform: translateY(100vh) translateX(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-20px) translateX(40px); opacity: 0; }
}

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 40px;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(8, 13, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-size: 1rem; font-weight: 700; color: var(--accent); letter-spacing: 2px; text-decoration: none; }
.nav-links a {
  color: var(--subtle); text-decoration: none; margin-left: 28px;
  font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a[aria-current="page"] { color: var(--accent); }

/* ─── SHARED BITS ─── */
.section-label {
  font-size: 0.75rem; color: var(--accent); letter-spacing: 3px;
  text-transform: uppercase; margin-bottom: 10px;
}

.tag {
  font-size: 0.72rem; color: var(--accent); background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.2); border-radius: 20px;
  padding: 3px 10px; letter-spacing: 0.5px;
}

/* ─── CTA BUTTONS ─── */
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  padding: 12px 28px; border-radius: 8px; font-size: 0.9rem;
  text-decoration: none; font-weight: 600; letter-spacing: 0.5px;
  transition: all 0.2s; border: none; cursor: pointer;
  display: inline-block;
}
.btn-primary { background: var(--accent); color: #080d14; }
.btn-primary:hover { background: #7dd3fc; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost:hover { background: rgba(56,189,248,0.08); transform: translateY(-2px); }

/* ─── FOOTER ─── */
footer {
  position: relative; z-index: 1;
  text-align: center; padding: 28px;
  color: var(--muted-high); font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ─── SCROLL REVEAL ─── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  nav { padding: 14px 20px; }
  .nav-links { display: none; }
}

/* Respect users who prefer 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;
  }
  .particle { display: none; }
  .reveal { opacity: 1; transform: none; }
}
