/* ============================================================
   xRay Rabbit v2 — Premium SaaS design tokens
   Calm, trustworthy, modern — not cyberpunk.
   Used by: Landing v2.html, Cabinet v2.html
============================================================ */

:root {
  /* ---- surfaces (dark mode, warm slate) ---- */
  --bg:       oklch(0.16 0.012 268);   /* page background */
  --bg-2:     oklch(0.18 0.014 270);   /* subtle elevation */
  --surface:  oklch(0.22 0.013 270);   /* card */
  --surface-hi: oklch(0.26 0.013 270); /* hovered card */
  --border:   oklch(0.32 0.012 270);
  --border-2: oklch(0.28 0.010 270);

  /* ---- text ---- */
  --text:     oklch(0.96 0.005 270);
  --text-2:   oklch(0.78 0.012 270);   /* secondary */
  --text-3:   oklch(0.60 0.014 270);   /* tertiary / hints */
  --text-4:   oklch(0.46 0.014 270);   /* muted */

  /* ---- brand — neon cyan/electric turquoise, primary accent ---- */
  --brand:    oklch(0.80 0.18 200);    /* primary action */
  --brand-2:  oklch(0.72 0.20 200);    /* darker */
  --brand-3:  oklch(0.88 0.12 200);    /* light tint */
  --brand-bg: oklch(0.30 0.10 200);    /* subtle bg wash */
  --brand-glow: oklch(0.80 0.18 200 / 0.45);

  /* ---- secondary accent — magenta/pink, balanced counterpoint ---- */
  --accent:   oklch(0.74 0.16 330);    /* magenta */
  --accent-bg: oklch(0.32 0.10 330);
  --accent-glow: oklch(0.74 0.16 330 / 0.38);

  /* ---- semantic ---- */
  --ok:       oklch(0.78 0.14 158);
  --ok-bg:    oklch(0.28 0.06 158);
  --warn:     oklch(0.82 0.13 80);
  --warn-bg:  oklch(0.30 0.06 80);
  --danger:   oklch(0.70 0.16 24);
  --danger-bg: oklch(0.28 0.07 24);

  /* ---- radii ---- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* ---- shadows ---- */
  --sh-1: 0 1px 2px oklch(0.10 0.01 270 / .4);
  --sh-2: 0 4px 14px oklch(0.10 0.01 270 / .35), 0 1px 2px oklch(0.10 0.01 270 / .3);
  --sh-3: 0 18px 40px -16px oklch(0.10 0.01 270 / .55), 0 6px 18px -8px oklch(0.10 0.01 270 / .35);
  --sh-brand: 0 12px 32px -10px var(--brand-glow);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss02";
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* ----- atmospheric gradients (soft, NOT screaming) ----- */
.aurora {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(50% 40% at 10% 0%,  oklch(0.42 0.13 200 / .28), transparent 60%),
    radial-gradient(45% 35% at 90% 10%, oklch(0.42 0.13 330 / .26), transparent 60%),
    radial-gradient(60% 40% at 50% 100%, oklch(0.34 0.11 200 / .16), transparent 70%);
  filter: blur(22px);
}
.noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ----- typography helpers ----- */
.h-display {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
}
.h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; }
.h2 { font-size: 32px; line-height: 1.15; letter-spacing: -0.015em; font-weight: 600; }
.h3 { font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; font-weight: 600; }
.h4 { font-size: 17px; line-height: 1.35; letter-spacing: -0.005em; font-weight: 600; }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.04em;
  color: var(--brand-3);
  text-transform: none;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand-glow);
}

.lead { font-size: 18px; color: var(--text-2); line-height: 1.6; }
.muted { color: var(--text-3); }

.mono { font-family: 'JetBrains Mono', monospace; letter-spacing: 0; }

/* ----- buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: inherit; font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  transition: transform .18s, box-shadow .2s, background .2s, color .2s, border-color .2s;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(0.5px); }

.btn-primary {
  background: var(--brand);
  color: oklch(0.16 0.04 200);
  box-shadow: var(--sh-brand), inset 0 1px 0 oklch(1 0 0 / .25);
}
.btn-primary:hover { background: oklch(from var(--brand) calc(l + 0.04) c h); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-hi); border-color: var(--border); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-bg);
}
.btn-danger:hover { background: var(--danger-bg); }

.btn-lg { font-size: 15.5px; padding: 14px 24px; }
.btn-sm { font-size: 13px; padding: 8px 14px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--r-sm);
}
.btn-block { display: flex; width: 100%; }

/* ----- cards ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .2s;
}
.card.hoverable:hover {
  border-color: var(--border);
  background: var(--surface-hi);
}
.card-pad-sm { padding: 18px; }
.card-pad-lg { padding: 32px; }

/* ----- badges / status ----- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  letter-spacing: -0.005em;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }

.badge-ok    { background: var(--ok-bg);     color: var(--ok); }
.badge-ok    .badge-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.badge-warn  { background: var(--warn-bg);   color: var(--warn); }
.badge-warn  .badge-dot { background: var(--warn); }
.badge-danger{ background: var(--danger-bg); color: var(--danger); }
.badge-danger .badge-dot { background: var(--danger); }
.badge-info  { background: var(--brand-bg);  color: var(--brand-3); }
.badge-info  .badge-dot { background: var(--brand); }
.badge-neutral { background: var(--bg-2); color: var(--text-3); border: 1px solid var(--border-2); }

/* ----- alerts ----- */
.alert {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r);
  border: 1px solid;
}
.alert-ok    { background: oklch(from var(--ok-bg) l c h / .35);    border-color: oklch(from var(--ok) l c h / .35); }
.alert-warn  { background: oklch(from var(--warn-bg) l c h / .35);  border-color: oklch(from var(--warn) l c h / .35); }
.alert-info  { background: oklch(from var(--brand-bg) l c h / .35); border-color: oklch(from var(--brand) l c h / .35); }
.alert-danger{ background: oklch(from var(--danger-bg) l c h / .35);border-color: oklch(from var(--danger) l c h / .35); }
.alert-icon {
  flex: 0 0 22px; width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.alert-ok    .alert-icon { background: var(--ok);     color: oklch(0.16 0.01 158); }
.alert-warn  .alert-icon { background: var(--warn);   color: oklch(0.18 0.02 80); }
.alert-info  .alert-icon { background: var(--brand);  color: oklch(0.16 0.04 200); }
.alert-danger.alert-icon { background: var(--danger); color: oklch(0.18 0.02 24); }

/* ----- forms ----- */
.input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
  outline: none;
}
.input:hover { border-color: var(--border); }
.input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px oklch(from var(--brand) l c h / .18);
}
.input::placeholder { color: var(--text-4); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 13px; color: var(--text-2); font-weight: 500;
}
.field-help { font-size: 12.5px; color: var(--text-3); }

/* ----- layout helpers ----- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.between { justify-content: space-between; }
.center { justify-content: center; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.right { text-align: right; }
.tcenter { text-align: center; }

/* ----- divider ----- */
.divider { height: 1px; background: var(--border-2); margin: 24px 0; }

/* ----- chip ----- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 5px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text-2);
}

/* ----- scrollbar ----- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ----- top nav ----- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: oklch(from var(--bg) l c h / .72);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border-2);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: 1320px; margin: 0 auto; gap: 24px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  color: var(--text);
}
.nav-brand img {
  width: 26px; height: 26px;
  /* recolor violet brand mark to electric neon cyan (grayscale-first chain) */
  filter: grayscale(100%) brightness(0.95) sepia(100%) saturate(6) hue-rotate(155deg) brightness(1.05);
}

/* Telegram link in header */
.nav-telegram {
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-telegram .nav-telegram-icon { display: block; }
.nav-menu { display: flex; gap: 4px; }
.nav-menu a {
  padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--text-2);
  transition: color .15s, background .15s;
}
.nav-menu a:hover { color: var(--text); background: var(--surface); }
.nav-menu a.active { color: var(--text); background: var(--surface); }

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

/* ----- reveal ----- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Mobile polish (≤720px)
   Tightens spacing, hides desktop nav links, enlarges touch
   targets, prevents horizontal overflow. Desktop unaffected.
============================================================ */
html, body { overflow-x: hidden; }

@media (max-width: 720px) {
  body { font-size: 15px; }
  .container, .container-wide { padding: 0 16px; }

  .h1 { font-size: 28px; line-height: 1.15; }
  .h2 { font-size: 24px; }
  .h3 { font-size: 19px; }
  .lead { font-size: 16px; line-height: 1.55; }

  .nav-inner { padding: 12px 16px; gap: 10px; }
  .nav-menu { display: none; }
  .nav-brand { font-size: 14.5px; gap: 8px; }
  .nav-brand img { width: 24px; height: 24px; }

  .btn-sm { font-size: 13px; padding: 10px 14px; min-height: 40px; }
  .btn { min-height: 44px; }
  .btn-lg { padding: 14px 22px; font-size: 15px; min-height: 48px; }

  .card { padding: 18px; border-radius: var(--r); }
  .card-pad-sm { padding: 14px; }
  .card-pad-lg { padding: 22px; }
}

@media (max-width: 720px) {
  .nav-telegram { padding: 8px 10px; }
  .nav-telegram .nav-telegram-label { display: none; }
}

@media (max-width: 380px) {
  .nav-inner { gap: 8px; }
  .nav-brand span { font-size: 14px; }
  .btn-sm { padding: 9px 12px; }
}
