@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

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

:root {
  --bg:    #080808;
  --bg2:   #0d0d0d;
  --bg3:   #131313;
  --bg4:   #181818;
  --line:  #1c1c1c;
  --line2: #282828;
  --muted: #4a4a4a;
  --sub:   #777;
  --fg:    #e8e8e8;
  --white: #ffffff;
  --accent: #44e8d6;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 6px;
  --font: 'Space Grotesk', sans-serif;
  --mono: 'Space Mono', monospace;
}

html { scroll-behavior: smooth; }

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

a { color: inherit; }

body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.022;
  pointer-events: none;
  z-index: 9999;
}

/* ── SCROLL PROGRESS ── */
.progress-line {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--white);
  z-index: 10000;
  pointer-events: none;
  transition: width .1s linear;
}

/* ── CONTAINER ── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ── BG DECORATORS ── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.08) 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 34%, rgba(255,255,255,0.06) 0 1px, transparent 1.5px),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 260px 260px, 340px 340px, 64px 64px, 64px 64px;
}
.bg-glow {
  position: fixed; z-index: 0; pointer-events: none;
  border-radius: 50%; filter: blur(140px);
}
.glow-a {
  width: 640px; height: 640px;
  top: -200px; left: -200px;
  background: rgba(255,255,255,0.012);
}
.glow-b {
  width: 500px; height: 500px;
  bottom: -160px; right: -160px;
  background: rgba(255,255,255,0.008);
}

/* ── HEADER ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  border-bottom: 1px solid var(--line);
  background: rgba(8,8,8,.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--white);
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
}
.brand-shield {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--white); font-size: 0; line-height: 0;
}
.brand-text { color: var(--white); }
.brand-text b { font-weight: 700; color: var(--white); }

.header-actions,
#headerNav {
  display: flex; align-items: center; gap: 12px;
}

/* ── BURGER ── */
.burger-btn {
  display: none;
  flex-direction: column; gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
.burger-btn span {
  display: block; width: 16px; height: 1.5px;
  background: var(--fg); border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.burger-btn.burger-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger-btn.burger-active span:nth-child(2) { opacity: 0; }
.burger-btn.burger-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 20px; border-radius: var(--radius);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  border: 1px solid transparent; white-space: nowrap; line-height: 1.4;
}
.btn.solid {
  background: var(--white); color: var(--bg);
  border-color: var(--white);
}
.btn.solid:hover { background: transparent; color: var(--white); }
.btn.ghost {
  background: transparent; color: var(--fg);
  border-color: var(--line2);
}
.btn.ghost:hover { background: var(--white); color: var(--bg); border-color: var(--white); }
.btn.wide { width: 100%; }

/* ── LEGAL PAGES ── */
body > * { position: relative; z-index: 1; }

.legal-main {
  padding-top: 112px;
  padding-bottom: 80px;
  min-height: calc(100vh - 68px);
}
.legal-hero {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.legal-hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--white);
  margin-bottom: 12px;
  line-height: 1.1;
}
.legal-hero p {
  font-size: 15px;
  color: var(--sub);
  max-width: 560px;
  line-height: 1.7;
}
.legal-card {
  background: rgba(19,19,19,.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 48px;
  line-height: 1.75;
}
.legal-card h2 {
  font-size: 15px; font-weight: 700;
  color: var(--white); letter-spacing: -.01em;
  margin: 32px 0 10px;
}
.legal-card h2:first-child { margin-top: 0; }
.legal-card h3 { font-size: 14px; font-weight: 600; color: var(--fg); margin: 20px 0 8px; }
.legal-card p { font-size: 14px; color: var(--sub); margin-bottom: 8px; }
.legal-card ul, .legal-card ol {
  padding-left: 20px; color: var(--sub);
  font-size: 14px; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.legal-card a { color: var(--fg); transition: color .2s; }
.legal-card a:hover { color: var(--white); }
.legal-card strong { color: var(--fg); }
.legal-updated {
  font-size: 12px !important; color: var(--muted) !important;
  font-family: var(--mono); margin-top: 24px !important;
}

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 28px;
  position: relative; z-index: 1;
  background: var(--bg);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 40px;
  align-items: start;
}
.footer-brand {}
.footer-copy {
  font-size: 12px; color: var(--muted);
  font-family: var(--mono);
}
.footer-support {}
.footer-title {
  font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--sub); margin-bottom: 10px;
}
.footer-note {
  font-size: 11px; color: var(--muted);
  font-family: var(--mono); margin-top: 6px;
}
.telegram-link {
  display: inline-block;
  font-size: 13px; color: var(--muted);
  text-decoration: none; transition: color .2s;
}
.telegram-link:hover { color: var(--white); }
.footer-links {
  display: flex; flex-wrap: wrap;
  gap: 8px 16px; align-items: flex-start;
}
.footer-links a {
  font-size: 12px; color: var(--muted);
  text-decoration: none; font-family: var(--mono);
  transition: color .2s;
}
.footer-links a:hover { color: var(--white); }

/* ── PLAN CARDS ── */
.plan-card { cursor: pointer; }
.plan-card.active {}
.plan-name {}
.plan-price {}
.plan-note {}

/* ── TRIAL ── */
.trial-banner {}
.trial-btn {}
.trial-hint {
  font-size: 12px; color: var(--muted);
  display: block; margin-top: 4px; line-height: 1.5;
}
.trial-hint.error  { color: #f87171; }
.trial-hint.success { color: var(--ok); }
.trial-output {
  width: 100%; margin-top: 10px;
  background: var(--bg); border: 1px solid var(--line2);
  border-radius: var(--radius); padding: 12px;
  color: var(--fg); font-family: var(--mono); font-size: 11px;
  resize: vertical; min-height: 80px;
}
.trial-actions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 8px;
}
.trial-copy {
  padding: 8px 16px; background: transparent;
  border: 1px solid var(--line2); border-radius: var(--radius);
  font-family: var(--font); font-size: 12px;
  color: var(--sub); cursor: pointer;
  transition: color .2s, border-color .2s;
}
.trial-copy:hover { color: var(--white); border-color: var(--fg); }

/* ── CABINET ── */
.spinner {
  border-color: rgba(255,255,255,.18);
  border-top-color: var(--white);
}
input,
textarea {
  color-scheme: dark;
}

/* ── REVEAL ── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s cubic-bezier(0.16,1,0.3,1),
              transform .7s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: none; }

/* ── UTILITIES ── */
.hidden { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .container { padding: 0 28px; }
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .site-header {
    background: rgba(8,8,8,.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .brand { position: relative; z-index: 9100; max-width: calc(100vw - 104px); }
  .burger-btn {
    display: flex;
    position: relative;
    z-index: 9100;
    background: rgba(255,255,255,.025);
  }
  .header-actions,
  #headerNav {
    display: none;
    position: fixed;
    top: 68px; left: 0; right: 0; bottom: 0;
    height: calc(100dvh - 68px);
    max-height: calc(100dvh - 68px);
    background:
      radial-gradient(circle at 70% 0%, rgba(255,255,255,.06), transparent 32%),
      linear-gradient(180deg, rgba(13,13,13,.98), rgba(8,8,8,.995) 46%, #080808);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 28px 26px calc(34px + env(safe-area-inset-bottom));
    gap: 0;
    z-index: 9000;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 30px 90px rgba(0,0,0,.65);
  }
  #headerNav.nav-open { display: flex; }
  .header-actions.nav-open { display: flex; }
  #headerNav a,
  .header-actions a {
    width: 100%;
    min-height: 52px;
    justify-content: center;
  }
  .legal-card { padding: 24px 20px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}
