@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Viht VPN Docs — визуально совпадает с лендингом anviht.ru (landing-v2) */

:root {
  color-scheme: dark;
  --header-h: 56px;
  --lv-orange: #e86b3a;
  --lv-orange-deep: #c94d2c;
  --lv-blue: #2b4bb9;
  --lv-purple: #8b6bc9;
  --accent: var(--lv-orange);
  --accent-dim: rgba(232, 107, 58, 0.14);
  --accent-hover: #ff9359;
  --bg: #000000;
  --bg-elevated: #121212;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: #888888;
  --code-bg: rgba(255, 255, 255, 0.06);
  --sidebar-w: 268px;
  --toc-w: 220px;
  --max-doc: 720px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f8;
  --bg-elevated: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --text: #111827;
  --muted: #6b7280;
  --code-bg: rgba(0, 0, 0, 0.06);
  --accent-dim: rgba(232, 107, 58, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 18% 8%, rgba(232, 107, 58, 0.32), transparent 42%),
    radial-gradient(circle at 85% 20%, rgba(43, 75, 185, 0.26), transparent 46%),
    linear-gradient(rgba(100, 160, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 160, 255, 0.1) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
  min-height: 100vh;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(circle at 20% 10%, rgba(232, 107, 58, 0.12), transparent 45%),
    radial-gradient(circle at 80% 18%, rgba(43, 75, 185, 0.1), transparent 48%),
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Top bar (как верх лендинга) ——— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="light"] .site-header {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom-color: var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 18px;
  height: 100%;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand__logo {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--lv-orange), var(--lv-blue));
  box-shadow: 0 8px 28px rgba(232, 107, 58, 0.35);
}

.brand__logo--sm {
  width: 28px;
  height: 28px;
  font-size: 13px;
  border-radius: 10px;
}

.docs-header-home {
  flex-shrink: 0;
  margin-left: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(90deg, var(--lv-orange-deep), var(--lv-orange) 35%, var(--lv-blue));
  box-shadow: 0 8px 28px rgba(43, 75, 185, 0.3);
  transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.docs-header-home:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 12px 32px rgba(232, 107, 58, 0.35);
}

[data-theme="light"] .docs-header-home {
  box-shadow: 0 6px 20px rgba(43, 75, 185, 0.2);
}

.site-header__center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.search-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
}

.search-wrap__icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  opacity: 0.45;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 0 72px 0 38px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  border-color: color-mix(in srgb, var(--lv-orange) 50%, var(--border-strong));
  box-shadow: 0 0 0 3px rgba(232, 107, 58, 0.2);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-family: ui-monospace, monospace;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg);
  pointer-events: none;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lang-switch {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: default;
}

@media (min-width: 900px) {
  .lang-switch {
    display: inline-flex;
  }
}

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  border-color: rgba(232, 107, 58, 0.35);
  background: color-mix(in srgb, var(--bg-elevated) 88%, var(--lv-orange));
}

/* ——— Layout ——— */
.doc-shell {
  padding-top: var(--header-h);
  min-height: 100vh;
}

.doc-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
}

.doc-layout--toc {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 18px 14px 32px;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent;
}

[data-theme="light"] .sidebar {
  border-right-color: var(--border);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 99px;
}

.sidebar__hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  padding: 0 8px;
}

.nav-group {
  margin: 18px 0 8px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-group:first-child {
  margin-top: 0;
}

.nav a {
  display: block;
  padding: 8px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
}

.nav a.active {
  color: #fff;
  background: linear-gradient(90deg, var(--lv-orange-deep), var(--lv-orange) 40%, var(--lv-blue));
  box-shadow: 0 8px 26px rgba(43, 75, 185, 0.35);
}

[data-theme="light"] .nav a.active {
  color: #fff;
}

.doc-main-wrap {
  display: contents;
}

@media (min-width: 1100px) {
  .doc-layout:not(.doc-layout--toc) .doc-main {
    padding-right: 24px;
  }
}

.doc-main {
  padding: 28px 28px 80px;
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .doc-main {
  border-right-color: var(--border);
}

.doc-layout:not(.doc-layout--toc) .doc-main {
  border-right: none;
  max-width: calc(var(--max-doc) + 56px);
}

.doc-prose {
  max-width: var(--max-doc);
}

.doc-kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-kicker.docs-kicker--grad {
  background: linear-gradient(90deg, var(--lv-orange), var(--lv-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.doc-main h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.doc-lead {
  margin: 0 0 28px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.doc-main h2 {
  margin: 32px 0 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.doc-main h3 {
  margin: 22px 0 10px;
  font-size: 17px;
  font-weight: 600;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.doc-main p {
  margin: 0 0 14px;
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
}

.doc-main a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.doc-main a:hover {
  color: var(--accent-hover);
}

.doc-main code {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--code-bg);
  border: 1px solid var(--border);
}

.doc-main ul,
.doc-main ol {
  margin: 0 0 16px;
  padding-left: 22px;
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
}

.doc-main li + li {
  margin-top: 8px;
}

.doc-main strong {
  font-weight: 600;
  color: var(--text);
}

/* Tables */
.doc-main table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0 24px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.doc-main th,
.doc-main td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.doc-main tr:last-child td {
  border-bottom: none;
}

.doc-main th {
  background: color-mix(in srgb, var(--muted) 8%, transparent);
  font-weight: 600;
}

.doc-main tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* Callout */
.note {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--lv-orange) 45%, var(--border));
  background: linear-gradient(
    135deg,
    rgba(232, 107, 58, 0.12),
    rgba(43, 75, 185, 0.08)
  );
  font-size: 14px;
}

/* External / download link rows */
.link-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 22px 0 10px;
}

.link-section-title:first-child {
  margin-top: 0;
}

.link-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 4px;
}

a.link-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.12s ease;
}

a.link-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent-dim) 70%, var(--bg-elevated));
  transform: translateY(-1px);
}

.link-card__text {
  min-width: 0;
}

.link-card__label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
}

.link-card__hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
  line-height: 1.45;
}

.link-card__ext {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  line-height: 1.2;
  padding-top: 2px;
}

.doc-prose--legal {
  max-width: 48rem;
}

.doc-legal p,
.doc-legal li {
  font-size: 14px;
  line-height: 1.75;
}

.doc-legal h2 {
  margin-top: 26px;
  margin-bottom: 10px;
  font-size: 17px;
}

.doc-legal ul.tight li + li {
  margin-top: 6px;
}

/* Accordions */
.accordion {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.doc-details {
  border-bottom: 1px solid var(--border);
}

.doc-details:last-child {
  border-bottom: none;
}

.doc-details summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px 14px 40px;
  font-weight: 600;
  font-size: 14px;
  position: relative;
  color: var(--text);
  transition: background 0.15s ease;
}

.doc-details summary::-webkit-details-marker {
  display: none;
}

.doc-details summary::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(-45deg);
  transition: transform 0.2s ease;
}

.doc-details[open] summary::before {
  transform: translateY(-35%) rotate(45deg);
}

.doc-details summary:hover {
  background: color-mix(in srgb, var(--muted) 6%, transparent);
}

.doc-details__body {
  padding: 0 16px 16px 40px;
  font-size: 14px;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  animation: docFade 0.2s ease;
}

@keyframes docFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.feature-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
  border-color: color-mix(in srgb, var(--lv-orange) 40%, var(--border));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

[data-theme="light"] .feature-card {
  background: var(--bg-elevated);
  border-color: var(--border);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* TOC */
.doc-toc {
  padding: 28px 16px 32px;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  scrollbar-width: thin;
}

.toc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 12px;
  padding: 0 4px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color 0.15s ease, background 0.15s ease;
}

.toc-nav a:hover {
  color: var(--text);
}

.toc-nav a.is-active {
  color: var(--lv-orange);
  font-weight: 600;
  border-left-color: var(--lv-purple);
}

.search-empty-hint {
  display: none;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.doc-main.is-searching .search-empty-hint {
  display: block;
}

.doc-section-hidden {
  display: none !important;
}

/* Motion */
.doc-main article {
  animation: docPageIn 0.35s ease both;
}

@keyframes docPageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Responsive */
@media (max-width: 1099px) {
  .doc-layout--toc {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }

  .doc-toc {
    display: none;
  }

  .doc-layout--toc .doc-main {
    border-right: none;
  }
}

@media (max-width: 900px) {
  .doc-layout,
  .doc-layout--toc {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .doc-main {
    border-right: none;
    padding: 20px 18px 64px;
  }

  .site-header__center {
    display: none;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .docs-header-home {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}
