/* ============================================================
   StarLine VPN — лендинг-кандидат (M3-токены, точечная карта)
   Один SVG карты: точки+дуги+узлы в одном viewBox = не рассинхронивается.
   ============================================================ */

:root {
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --radius-xs: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --accent: #4c8dff;
  --accent-strong: #6ea1ff;
  --accent-on: #071018;
  --brand-shimmer: #a8c8ff;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d11;
  --bg-soft: #0e1116;
  --surface: #141821;
  --surface-2: #1a1f2a;
  --surface-3: #212734;
  --outline: #262d3a;
  --outline-soft: #1d2330;
  --text: #e8ebf1;
  --text-muted: #98a1b3;
  --text-faint: #6b7488;
  --shadow-card: 0 18px 50px -22px rgba(0, 0, 0, 0.65);
  --map-dot: rgba(116, 134, 168, 0.34);
  --texture-dot: rgba(116, 134, 168, 0.17);
  --map-label: #74829c;
  --hero-fade: #0b0d11;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f2ea;
  --bg-soft: #f2eee5;
  --surface: #fdfaf3;
  --surface-2: #f0ebe0;
  --surface-3: #e7e1d2;
  --outline: #ded6c4;
  --outline-soft: #e8e2d4;
  --text: #211d13;
  --text-muted: #615a49;
  --text-faint: #918a77;
  --shadow-card: 0 18px 44px -24px rgba(64, 52, 28, 0.24);
  --accent: #1f6fe8;
  --accent-strong: #1558c4;
  --accent-on: #fdfaf3;
  --map-dot: rgba(66, 55, 32, 0.23);
  --texture-dot: rgba(66, 55, 32, 0.14);
  --map-label: #8a826c;
  --hero-fade: #f6f2ea;
}

* { box-sizing: border-box; }

/* class display не должен перебивать атрибут hidden */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body.sl-page {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    linear-gradient(var(--bg-soft), var(--bg) 340px),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.sl-container {
  width: min(calc(100% - 48px), 1240px);
  margin-inline: auto;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }

a { color: inherit; text-decoration: none; }

/* ---------- шапка ---------- */

.sl-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--outline-soft);
}

.sl-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.sl-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.sl-brand svg {
  width: 21px;
  height: 21px;
  fill: var(--accent);
}

.sl-brand strong {
  font-weight: 600;
  background: linear-gradient(100deg,
    var(--accent) 0%, var(--brand-shimmer) 30%, var(--accent) 55%, var(--brand-shimmer) 80%, var(--accent) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sl-brand-shimmer 4.5s linear infinite;
}

@keyframes sl-brand-shimmer {
  to { background-position: 300% 0; }
}

.sl-header__live {
  justify-self: center;
}

.sl-header__side {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.sl-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--outline);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sl-iconbtn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sl-iconbtn svg { width: 18px; height: 18px; }

html[data-theme="dark"] .sl-theme-icon--light { display: none; }
html[data-theme="light"] .sl-theme-icon--dark { display: none; }

/* ---------- кнопки / поля / чипы ---------- */

.sl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}

.sl-btn svg { width: 16px; height: 16px; }

.sl-btn--primary {
  background: var(--accent);
  color: var(--accent-on);
}

.sl-btn--primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}

.sl-btn--primary:active { transform: translateY(0); }

.sl-btn--tonal {
  background: var(--surface-2);
  border-color: var(--outline);
  color: var(--text);
}

.sl-btn--tonal:hover { background: var(--surface-3); }

.sl-btn--sm { padding: 9px 16px; font-size: 13px; height: 36px; }

.sl-btn--block { width: 100%; }

.sl-btn:focus-visible,
.sl-iconbtn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sl-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.sl-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d17c;
  box-shadow: 0 0 0 3px color-mix(in srgb, #34d17c 22%, transparent);
}

/* ---------- hero ---------- */

.sl-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--outline-soft);
}

/* Точечная фактура заполняет пустые края hero: усилена у краёв окна,
   прозрачна в центре, чтобы не спорить с текстом и картой. */
.sl-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--texture-dot) 1.1px, transparent 1.6px);
  background-size: 26px 26px;
  background-position: 13px 13px;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 21%, transparent 79%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0%, transparent 21%, transparent 79%, #000 100%);
}

/* Позиция карты привязана к КАРТОЧКЕ, а не к краю окна: карточка на
   широких экранах центрируется вместе с контейнером (максимум 1240px),
   и привязка к right окна прятала хаб за ней. right подобран так, чтобы
   узловая сеть (NL..RU-хаб, 0.303..0.597 ширины карты) всегда попадала
   в зазор между текстом и карточкой. Ниже 1280px карта уходит в поток
   отдельной полосой (см. media), там перекрытие исключено. */
.sl-hero__map {
  position: absolute;
  top: -30px;
  right: calc(27.45vw - 220px);
  width: min(56vw, 880px);
  z-index: 0;
  pointer-events: none;
  /* края точечного поля растворяются в фоне: маска, а не заплатки */
  -webkit-mask-image: radial-gradient(94% 94% at 46% 46%, #000 54%, transparent 97%);
  mask-image: radial-gradient(94% 94% at 46% 46%, #000 54%, transparent 97%);
}

/* на самых широких экранах ширина карты упирается в кап 880px,
   а карточка продолжает ехать влево вместе с центрированным контейнером */
@media (min-width: 1572px) {
  .sl-hero__map { right: calc(50vw - 574px); }
}

.sl-map { display: block; width: 100%; height: auto; }

.sl-hero__inner {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(340px, 5fr) minmax(420px, 6fr);
  align-items: center;
  gap: 40px;
  padding-block: 40px 44px;
}

.sl-hero__copy { max-width: 560px; }

.sl-hero__copy h1 {
  margin: 22px 0 18px;
  font-size: clamp(42px, 4.6vw, 62px);
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.sl-hero__sub {
  margin: 0 0 26px;
  max-width: 46ch;
  font-size: 16px;
  color: var(--text-muted);
}

.sl-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sl-hero__actions .sl-btn { padding-block: 13px; font-size: 15px; }

.sl-hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.sl-hero__facts span {
  padding: 6px 12px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

/* ---------- карта: точки, дуги, узлы ---------- */

.sl-map #map-dots { fill: var(--map-dot); }

.sl-arc__track {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  opacity: 0.4;
}

.sl-arc__run {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5.6;
  stroke-linecap: round;
  stroke-dasharray: 0.1 26;
  animation: sl-march 2.5s linear infinite;
}

.sl-arc__run--d2 { animation-duration: 3s;   animation-delay: -0.6s; }
.sl-arc__run--d3 { animation-duration: 2.8s; animation-delay: -1.2s; }
.sl-arc__run--d4 { animation-duration: 2.2s; animation-delay: -1.7s; }
.sl-arc__run--d5 { animation-duration: 3.3s; animation-delay: -0.3s; }

@keyframes sl-march { to { stroke-dashoffset: -26.1; } }

.sl-node__ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0.6;
}

.sl-node__core { fill: var(--accent); }

.sl-node__core--hub {
  fill: #f4eede;
  stroke: var(--accent);
  stroke-width: 2.4;
}

html[data-theme="light"] .sl-node__core--hub { fill: #2a2312; }

.sl-node__pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  transform-box: fill-box;
  transform-origin: center;
  animation: sl-pulse 2.6s ease-out infinite;
}

@keyframes sl-pulse {
  0%   { transform: scale(0.32); opacity: 0.85; }
  100% { transform: scale(1.35); opacity: 0; }
}

.sl-node-labels text {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1em;
  fill: var(--map-label);
}

/* ---------- карточка входа ---------- */

.sl-auth {
  justify-self: end;
  width: min(100%, 380px);
  padding: 22px 22px 18px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.sl-auth__head h2 {
  margin-top: 10px;
  font-size: 22px;
}

.sl-auth__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 16px 0 14px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
}

.sl-auth__tabs button {
  padding: 9px 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sl-auth__tabs button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.35);
}

.sl-auth__form {
  display: grid;
  gap: 12px;
}

.sl-field { display: grid; gap: 6px; }

.sl-field > span:first-child {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.sl-field__wrap { position: relative; display: block; }

.sl-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sl-field input::placeholder { color: var(--text-faint); }

.sl-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.sl-field__wrap input { padding-right: 46px; }

.sl-field__eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}

.sl-field__eye:hover { color: var(--text); }

.sl-field__eye svg { width: 18px; height: 18px; }

.sl-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}

.sl-check input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  flex: none;
}

.sl-linkbtn {
  justify-self: center;
  padding: 4px 8px;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.sl-linkbtn:hover { color: var(--text); }

/* ---------- секции ---------- */

.sl-panel {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
}

/* ---------- киккер секции ---------- */

.sl-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.sl-kicker::before { content: "// "; color: var(--text-faint); }

/* ---------- почему мы ---------- */

.sl-why { padding: 46px 0 40px; }

.sl-why__head h2 { font-size: 24px; }

.sl-why__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.sl-why__card {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 13px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  padding: 15px 17px;
}

.sl-why__icon {
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.sl-why__icon svg { width: 19px; height: 19px; }

.sl-why__card h3 { font-size: 14.5px; margin: 1px 0 3px; }

.sl-why__card p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }

.sl-steps {
  padding: 44px 0 52px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--outline-soft);
}

.sl-steps h2 { font-size: 24px; margin-bottom: 24px; }

.sl-steps__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.sl-steps article {
  position: relative;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
}

.sl-step__num {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
}

@supports (-webkit-text-stroke: 1px black) {
  .sl-step__num {
    color: transparent;
    -webkit-text-stroke: 1.2px var(--accent);
  }
}

.sl-steps h3 { font-size: 16.5px; margin-bottom: 6px; }

.sl-steps p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

.sl-cta { padding: 38px 0 56px; }

.sl-cta__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 30px 34px;
}

/* ---------- финальный CTA: карточка в общем стиле ---------- */

/* Та же поверхность/рамка/радиус, что у остальных карточек страницы.
   Космонавт — на своей родной светло-сиреневой плитке (как в референсе),
   поэтому арт читается одинаково в обеих темах. */
.sl-space {
  position: relative;
  display: flex;
  align-items: center;
  gap: 30px;
  width: min(100%, 820px);
  margin-inline: auto;
  padding: 30px 34px;
}

.sl-space__astro {
  width: 150px;
  height: auto;
  flex: none;
  animation: sl-float 3.6s ease-in-out infinite;
  will-change: transform;
}

/* арт — тёмно-фиолетовый контур под светлый фон: в светлой теме показываем
   его как нарисован, без превращений; белые заливки сливается с карточкой
   и рисунок читается чистой линией */
html[data-theme="light"] .sl-space__astro {
  filter: none;
}

.sl-space__body { flex: 1; min-width: 0; }

.sl-space__kicker {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.sl-space__body h2 { font-size: 28px; color: var(--text); }

.sl-space__body p { margin: 8px 0 0; color: var(--text-muted); font-size: 15px; }

.sl-space__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex: none;
  margin-left: auto;
}

.sl-space__btn { padding-block: 13px; }

.sl-space__login {
  padding: 4px 2px;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.sl-space__login:hover { color: var(--text); }

/* ---------- футер ---------- */

.sl-footer {
  border-top: 1px solid var(--outline-soft);
  padding: 26px 0 30px;
}

.sl-footer__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 26px;
  font-size: 13px;
  color: var(--text-faint);
}

.sl-footer__brand {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--text-muted);
}

.sl-footer__brand strong {
  font-weight: 600;
  background: linear-gradient(100deg,
    var(--accent) 0%, var(--brand-shimmer) 30%, var(--accent) 55%, var(--brand-shimmer) 80%, var(--accent) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sl-brand-shimmer 4.5s linear infinite;
}

.sl-footer__link { color: var(--text-muted); }

.sl-footer__link:hover { color: var(--text); }

.sl-footer__note { margin-left: auto; }

/* ---------- адаптив ---------- */

@media (max-width: 1279px) {
  /* карта перестаёт быть фоном и встаёт полосой между текстом и формой */
  .sl-hero__map {
    position: static;
    width: min(100%, 860px);
    margin: 8px auto -8px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent);
  }

  .sl-hero__inner {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 22px;
    padding-top: 36px;
  }

  .sl-hero__copy { max-width: 620px; }

  .sl-auth {
    justify-self: stretch;
    width: min(100%, 460px);
    margin-inline: auto;
  }
}

@media (max-width: 1100px) {
  .sl-why__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .sl-container { width: calc(100% - 28px); }
  /* шапка в 360–640px: бренд + переключатель + «Войти»; статус-чип не влезает без переполнения */
  .sl-header__live { display: none; }

  /* без чипа сетка схлопывается неверно: кнопки уезжают в центр.
     Две колонки: бренд слева, тема и «Войти» прижаты вправо. */
  .sl-header__inner { grid-template-columns: 1fr auto; min-height: 58px; gap: 10px; }

  .sl-hero__copy h1 { font-size: clamp(36px, 11.5vw, 46px); }
  .sl-hero__actions { display: grid; grid-template-columns: 1fr; }

  .sl-node-labels text { display: none; }

  .sl-why { padding-top: 32px; }
  .sl-why__grid { grid-template-columns: 1fr; }
  .sl-steps__grid { grid-template-columns: 1fr; }

  .sl-space { flex-direction: column; text-align: center; gap: 14px; padding: 26px 18px 24px; }
  .sl-space__astro { width: 108px; }
  .sl-space__body h2 { font-size: 24px; }
  .sl-space__actions { width: 100%; margin-left: 0; }
  .sl-space__login { text-align: center; }
  .sl-space__btn { width: 100%; }
  .sl-auth { padding: 20px 18px 18px; }

  .sl-footer__note { margin-left: 0; width: 100%; }
}

/* ---------- доступность ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sl-arc__run { animation-duration: 6s; }
  .sl-space__astro, .sl-node__pulse { animation: none; }
  .sl-brand strong, .sl-footer__brand strong { animation: none; background-position: 60% 0; }
  .sl-btn { transition: none; }
}
