/* ============================================================
   base.css — переменные, reset, типографика, шрифт
   ============================================================ */

/* --- Шрифт JetBrains Mono (самохостинг) --- */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Переменные --- */
:root {
  /* Фоны */
  --bg:        #0a0a0a;
  --bg-2:      #111111;
  --bg-3:      #161616;
  --bg-4:      #1c1c1c;

  /* Текст */
  --fg:        #f0f0f0;
  --fg-2:      #c8c8c8;
  --muted:     #8a8a8a;

  /* Акцент */
  --accent:    #00ff88;
  --accent-2:  #00cc6a;
  --accent-bg: rgba(0, 255, 136, 0.08);

  /* Служебные */
  --danger:    #ff4466;
  --danger-2:  #cc2244;
  --ok:        #00ff88;

  /* Границы и тени */
  --border:    #262626;
  --border-2:  #333333;
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* Размеры */
  --max:       1120px;
  --max-text:  720px;

  /* Шрифт */
  --font:      'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Тени */
  --shadow-1:  0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2:  0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-3:  0 12px 40px rgba(0, 0, 0, 0.6);

  /* Отступы секций */
  --section-py: 72px;
  --section-py-mobile: 48px;
}

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

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

html,
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

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

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

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

/* --- Типографика --- */
h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

h2 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

h3 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

h4 {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}

p {
  margin-bottom: 14px;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  padding-left: 20px;
}

/* Прозаический блок — ограниченная ширина для читаемости */
.prose {
  max-width: var(--max-text);
}

.prose p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg-2);
  margin-bottom: 18px;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* --- Фокус --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Выделение --- */
::selection {
  background: var(--accent);
  color: #000;
}

/* --- Скроллбар --- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* --- Skip-link --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  padding: 10px 18px;
  background: var(--accent);
  color: #000;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 700;
}
.skip-link:focus {
  top: 8px;
}

/* --- Уменьшение анимации --- */
@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;
  }
}

/* --- Мобильная типографика --- */
@media (max-width: 800px) {
  :root {
    --section-py: 48px;
  }
  html, body {
    font-size: 15px;
  }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  h3 { font-size: 17px; }
  .prose p { font-size: 16px; }
}

@media (max-width: 480px) {
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
}