/* ==========================================================================
   SysAdmin Wiki — базовые стили
   Тёмная графитовая тема, акценты: синий и фиолетовый
   ========================================================================== */

/* ---------- Токены дизайна ---------- */
:root {
  --bg: #0a0c11;
  --bg-soft: #0e1118;
  --surface: #12151f;
  --surface-2: #171b29;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.3);
  --text: #e9ecf3;
  --text-muted: #98a2b6;

  --blue: #4f7cff;
  --blue-strong: #7c9bff;
  --blue-soft: rgba(79, 124, 255, 0.12);
  --purple: #9a6bff;
  --purple-soft: rgba(154, 107, 255, 0.12);
  --gradient: linear-gradient(120deg, #4f7cff 0%, #9a6bff 100%);
  --success: #4ade80;

  --radius: 18px;
  --header-height: 72px;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Space Grotesk", "Inter", system-ui, sans-serif;
}

/* ---------- Сброс и базовая типографика ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 85% -5%, rgba(79, 124, 255, 0.12), transparent 60%),
    radial-gradient(820px 480px at -10% 22%, rgba(154, 107, 255, 0.1), transparent 60%),
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-locked {
  overflow: hidden;
}

svg {
  display: block;
}

ul[class] {
  padding: 0;
  margin: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

::selection {
  background: rgba(79, 124, 255, 0.38);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #242b3d;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: #313a55;
}

/* ---------- Утилиты ---------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 300;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  left: 12px;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 17, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  color: var(--blue-strong);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.logo-text em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav .nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.09);
}

.nav-link.is-active {
  color: #dce7ff;
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(79, 124, 255, 0.35);
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.06);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle span:nth-child(1) { top: 7px; }
.nav-toggle span:nth-child(2) { top: 14px; }
.nav-toggle span:nth-child(3) { top: 21px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 10px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 10px;
  transform: rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding-block: clamp(72px, 11vw, 132px) clamp(56px, 8vw, 96px);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}

.hero-glow--blue {
  width: 480px;
  height: 480px;
  top: -180px;
  right: -120px;
  background: rgba(79, 124, 255, 0.22);
}

.hero-glow--purple {
  width: 420px;
  height: 420px;
  bottom: -200px;
  left: -140px;
  background: rgba(154, 107, 255, 0.2);
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(79, 124, 255, 0.35);
  background: rgba(79, 124, 255, 0.1);
  color: #b9ccff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: hero-pulse 2.2s infinite;
}

@keyframes hero-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(74, 222, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.9rem, 7.5vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 22px 0 20px;
}

.hero-title em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-description {
  max-width: 640px;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.6vw, 1.13rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 12px 34px rgba(79, 124, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(109, 141, 255, 0.48);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, 0.06);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(124, 158, 255, 0.6);
  background: rgba(79, 124, 255, 0.1);
  transform: translateY(-2px);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  margin-top: 38px;
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.hero-points svg {
  width: 16px;
  height: 16px;
  color: var(--success);
}

/* ---------- Секции и карточки ---------- */
.sections {
  padding-block: clamp(56px, 7vw, 92px);
}

.section-header {
  max-width: 660px;
  margin-bottom: clamp(34px, 5vw, 54px);
}

.section-eyebrow {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 12px 0 14px;
}

.section-description {
  color: var(--text-muted);
  line-height: 1.7;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), rgba(17, 21, 30, 0.75));
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(124, 158, 255, 0.45);
  box-shadow: 0 26px 60px rgba(2, 6, 23, 0.65);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
  border: 1px solid rgba(124, 158, 255, 0.32);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.16), rgba(154, 107, 255, 0.16));
  color: #9db8ff;
}

.card-icon svg {
  width: 26px;
  height: 26px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 10px;
}

.card:hover .card-title {
  color: #d6e2ff;
}

.card-text {
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.97rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.card-tags li {
  padding: 5px 11px;
  border: 1px solid rgba(79, 124, 255, 0.24);
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.09);
  color: #a9c0ff;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.74rem;
}

/* ---------- Подвал ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: clamp(44px, 6vw, 68px);
  padding-bottom: 26px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.05) 40%, rgba(148, 163, 184, 0.07));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--border);
}

.footer-heading {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-about p,
.footer-project p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.7;
}

.footer-list {
  display: grid;
  gap: 4px;
}

.footer-list a {
  color: var(--text-muted);
  font-size: 0.93rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-list a:hover {
  color: var(--blue-strong);
}

.footer-tech {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: #8fa2d9;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   Адаптивность
   ========================================================================== */

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(13, 16, 23, 0.97);
    box-shadow: 0 30px 60px rgba(2, 6, 23, 0.65);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  }

  .main-nav.open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .main-nav .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
  }

  .main-nav .nav-link {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 1rem;
  }
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .hero-actions {
    width: 100%;
    max-width: 340px;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Страница статьи (шаблон) ---------- */
.article {
  padding-block: clamp(40px, 6vw, 72px) clamp(56px, 7vw, 92px);
}

.article-inner {
  max-width: 780px;
}

.article-breadcrumb a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-breadcrumb a:hover {
  color: var(--blue-strong);
}

.article-category {
  display: inline-block;
  margin-top: 26px;
  padding: 5px 12px;
  border: 1px solid rgba(79, 124, 255, 0.35);
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.1);
  color: #b9ccff;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.article-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 16px 0;
}

.article-lead {
  margin-bottom: 38px;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.article-section {
  margin-bottom: 38px;
}

.article-section h2 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.article-section p,
.article-section li {
  color: var(--text-muted);
  line-height: 1.75;
}

.article-section ul,
.article-section ol {
  padding-left: 22px;
  margin-top: 12px;
}

.article-section li {
  margin-bottom: 8px;
}

.article-section li::marker {
  color: var(--blue);
}

.article-section code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: #c9d6f5;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.article-section pre {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0d1017;
  overflow-x: auto;
}

.article-section pre code {
  padding: 0;
  background: none;
  color: #c9d6f5;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ---------- Уважение к настройкам доступности ---------- */
@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;
  }
}
