/* ============================================================
   Doghouse KG — base.css
   Токены, reset, типографика, кнопки, таблицы, утилиты
   ============================================================ */
:root {
  --bg: #0D0F1A;
  --bg-2: #14102B;
  --card: #16182A;
  --card-2: #1B1E33;
  --border: #262A45;
  --text: #F4F5FB;
  --muted: #9CA0B8;
  --muted-2: #6E7288;
  --magenta: #FF2E9A;
  --orange: #FFB405;
  --orange-2: #F5A623;
  --green: #2FD36B;
  --grad-cta: linear-gradient(135deg, #FFB405 0%, #F5A623 55%, #FF7A1A 100%);
  --grad-text: linear-gradient(120deg, #FFB405 0%, #FF2E9A 65%, #B455FF 100%);
  --grad-bar: linear-gradient(180deg, #FFB405 0%, #FF2E9A 100%);
  --radius: 16px;
  --radius-sm: 12px;
  --font-head: 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }

/* ---------- Типографика ---------- */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; line-height: 1.18; }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono { font-family: var(--font-mono); }

/* ---------- Заголовок секции [NN] ---------- */
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.sec-head::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 46px;
  border-radius: 3px;
  background: var(--grad-bar);
}
.sec-head__num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 1px;
  align-self: flex-start;
  padding-top: 6px;
}
.sec-head h2 { font-size: clamp(23px, 3.4vw, 34px); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .3px;
  line-height: 1;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s, background .25s, border-color .25s;
  white-space: nowrap;
}
.btn--primary {
  background: var(--grad-cta);
  color: #1A1005;
  box-shadow: 0 6px 22px rgba(255, 180, 5, .28);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(255, 180, 5, .5); }
.btn--ghost {
  background: rgba(255, 180, 5, .06);
  color: var(--orange);
  border-color: rgba(255, 180, 5, .45);
}
.btn--ghost:hover { background: rgba(255, 180, 5, .14); border-color: var(--orange); transform: translateY(-2px); }
.btn--sm { padding: 11px 22px; font-size: 14px; }

/* ---------- Бейджи ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- Карточки ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

/* ---------- Таблицы: адаптивная обёртка (обязательно) ---------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 22px 0 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.table-responsive table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}
.table-responsive th,
.table-responsive td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  vertical-align: top;
}
.table-responsive thead th {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--orange);
  background: rgba(255, 180, 5, .05);
  white-space: nowrap;
}
.table-responsive tbody tr:last-child td { border-bottom: none; }
.table-responsive tbody tr:hover { background: rgba(255, 255, 255, .025); }
.table-responsive td strong { color: var(--orange); }

/* ---------- Изображения в контенте ---------- */
.img-card {
  margin: 26px 0 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.img-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform .5s ease;
}
.img-card:hover img { transform: scale(1.02); }

/* Модификатор: показывать картинку целиком, без обрезки */
.img-card--fit img {
  aspect-ratio: auto;
  object-fit: contain;
}
.img-card--fit:hover img { transform: none; }

/* ---------- Проза статьи ---------- */
.prose p { color: #C7CADD; margin-bottom: 18px; max-width: 850px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); }
.prose em { color: var(--muted); }

/* ---------- Секции ---------- */
.section { padding: 54px 0; scroll-margin-top: calc(var(--header-h) + 20px); position: relative; }
.section--alt { background: var(--bg-2); }

/* ---------- Утилиты ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

@media (max-width: 640px) {
  .section { padding: 42px 0; }
  .card { padding: 20px; }
  .btn { padding: 14px 24px; font-size: 15px; }
}
