/* ===== Ghost VPN · shared base styles ===== */
:root {
  /* Default = "ghost" theme (violet) */
  --bg: #0c0a12;
  --bg-2: #110e18;
  --surface: rgba(28,22,42,0.55);
  --surface-2: #1a1626;
  --line: #28233a;
  --line-strong: #352e4d;
  --fg: #f1edf9;
  --fg-mute: #a39cbd;
  --fg-dim: #6e668a;
  --accent: oklch(0.78 0.2 295);
  --accent-2: oklch(0.86 0.16 210);
  --accent-ink: #0c0a12;
  --accent-soft: color-mix(in oklab, var(--accent) 18%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 55%, transparent);

  --good: oklch(0.78 0.18 150);
  --danger: oklch(0.72 0.18 25);
  --warn: oklch(0.82 0.15 80);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 10px 30px -12px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 0 1px var(--accent-line), 0 18px 60px -20px color-mix(in oklab, var(--accent) 50%, transparent);

  --font-sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: 'Instrument Serif', 'Manrope', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ===== Theme presets ===== */
[data-theme="lime"] {
  --bg: #0a0c0b;
  --bg-2: #0f1311;
  --surface: rgba(20,25,22,0.55);
  --surface-2: #181d1a;
  --line: #232a26;
  --line-strong: #2e3732;
  --fg: #eef2ed;
  --fg-mute: #9aa39d;
  --fg-dim: #6a7269;
  --accent: oklch(0.88 0.21 130);
  --accent-2: oklch(0.78 0.18 215);
  --accent-ink: #0a0c0b;
}
[data-theme="ice"] {
  --bg: #0a0e15;
  --bg-2: #0f141d;
  --surface: rgba(20,28,42,0.55);
  --surface-2: #161d2a;
  --line: #232c3c;
  --line-strong: #30394d;
  --fg: #ecf2fa;
  --fg-mute: #94a2b8;
  --fg-dim: #67738b;
  --accent: oklch(0.86 0.16 215);
  --accent-2: oklch(0.78 0.2 295);
  --accent-ink: #04101a;
}
[data-theme="stealth"] {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --surface: rgba(22,22,22,0.6);
  --surface-2: #161616;
  --line: #232323;
  --line-strong: #2f2f2f;
  --fg: #f5f5f5;
  --fg-mute: #9c9c9c;
  --fg-dim: #6a6a6a;
  --accent: #f5f5f5;
  --accent-2: #d0d0d0;
  --accent-ink: #0a0a0a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Grain overlay */
body[data-grain="true"]::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1   0 0 0 0 1   0 0 0 0 1   0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.6'/></svg>");
  mix-blend-mode: overlay;
  opacity: 0.08;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* Layout */
.wrap { width: min(1280px, 92vw); margin-inline: auto; }
.section { padding: clamp(80px, 11vw, 160px) 0; position: relative; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-mute);
  display: inline-flex; gap: 10px; align-items: center;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent); box-shadow: 0 0 14px var(--accent);
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
.h-display {
  font-size: clamp(48px, 7vw, 112px);
  font-weight: 500; line-height: 0.95;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.h-section {
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 500; line-height: 1.0;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.h-display em, .h-section em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
.lede {
  color: var(--fg-mute);
  font-size: clamp(16px, 1.2vw, 20px);
  line-height: 1.55;
  max-width: 60ch;
  text-wrap: pretty;
}
.mono { font-family: var(--font-mono); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--fg);
  font-family: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer;
  transition: transform .2s ease, background .2s, border-color .2s, box-shadow .3s, color .2s;
  text-decoration: none;
}
.btn:hover { border-color: var(--fg); transform: translateY(-1px); }
.btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  box-shadow: 0 12px 30px -10px color-mix(in oklab, var(--accent) 60%, transparent);
}
.btn.primary:hover {
  box-shadow: 0 0 0 6px var(--accent-soft), 0 16px 40px -8px color-mix(in oklab, var(--accent) 70%, transparent);
}
.btn .arrow { transition: transform .25s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn.sm { height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn.lg { height: 56px; padding: 0 28px; font-size: 16px; }
.btn.ghost { border-color: transparent; padding: 0 14px; }
.btn.ghost:hover { background: var(--surface-2); }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono); font-size: 12px;
  color: var(--fg-mute);
}
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 1.6s ease infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.85); } }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-color: var(--line); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 16px;
}
.logo {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 600; letter-spacing: -0.02em; font-size: 19px;
  text-decoration: none; color: var(--fg);
}
.logo-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--accent);
  position: relative;
}
.logo-mark svg { width: 100%; height: 100%; }
.nav-links { display: flex; gap: 2px; align-items: center; }
.nav-links a {
  color: var(--fg-mute); text-decoration: none; font-size: 14.5px;
  padding: 8px 14px; border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--fg); background: var(--surface-2); }
.nav-cta { display: flex; gap: 10px; align-items: center; }

/* ThemePicker web component */
ghost-theme-picker { position: relative; display: inline-block; }
ghost-theme-picker .tp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--fg-mute);
  font: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
ghost-theme-picker .tp-btn:hover { color: var(--fg); border-color: var(--fg-dim); }
ghost-theme-picker.open .tp-btn { color: var(--fg); border-color: var(--fg-dim); }
ghost-theme-picker .tp-swatch {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
  background: var(--accent);
}
ghost-theme-picker .tp-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,0.6);
  z-index: 100;
}
.tp-menu-head { font-family: var(--font-mono); font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; }
.tp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp-opt {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg); font: inherit; text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.tp-opt:hover { border-color: var(--line-strong); background: var(--surface-2); }
.tp-opt[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.tp-tile {
  height: 50px;
  border-radius: 8px;
  position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}
.tp-tile-accent {
  position: absolute; right: 8px; top: 8px;
  width: 14px; height: 14px; border-radius: 50%;
}
.tp-tile-lines {
  position: absolute; left: 8px; right: 30px; bottom: 8px;
  display: flex; flex-direction: column; gap: 3px;
}
.tp-tile-lines span { display: block; height: 3px; border-radius: 2px; }
.tp-tile-lines span:nth-child(1) { width: 60%; }
.tp-tile-lines span:nth-child(2) { width: 90%; }
.tp-tile-lines span:nth-child(3) { width: 75%; }
.tp-name { font-size: 13px; font-weight: 500; }
.tp-mode { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.06em; }

/* Lang switcher */
ghost-lang { display: inline-flex; }
ghost-lang .lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--fg-mute);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  transition: color .2s, border-color .2s;
}
ghost-lang .lang-btn:hover { color: var(--fg); }
ghost-lang .lang-btn .sep { color: var(--fg-dim); }
ghost-lang .lang-btn .on { color: var(--fg); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }
.reveal[data-d="4"] { transition-delay: .32s; }
.reveal[data-d="5"] { transition-delay: .4s; }

/* Aurora */
.aurora { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.aurora .blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.45;
  mix-blend-mode: screen;
}
.aurora .a {
  width: 520px; height: 520px; left: -120px; top: -120px;
  background: color-mix(in oklab, var(--accent) 60%, transparent);
  animation: drift1 18s ease-in-out infinite;
}
.aurora .b {
  width: 420px; height: 420px; right: -60px; top: 40px;
  background: color-mix(in oklab, var(--accent-2) 50%, transparent);
  animation: drift2 22s ease-in-out infinite;
}
@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(60px, 40px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-50px, 60px); } }

/* Footer (shared) */
.footer { padding: 60px 0 40px; border-top: 1px solid var(--line); position: relative; z-index: 1; }
.footer-grid {
  display: grid; gap: 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer h4 { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-dim); margin: 0 0 14px; font-weight: 500; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer a { color: var(--fg-mute); text-decoration: none; font-size: 14px; transition: color .2s; }
.footer a:hover { color: var(--fg); }
.footer-bottom {
  margin-top: 60px; padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--fg-dim);
}
