/* ==========================================================================
   Karakoram — Design tokens (LOCKED)
   Single source of truth for color, type, spacing, radius, shadow, motion.
   Do not hardcode values outside this file.
   ========================================================================== */

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

:root {
  /* ---- Color ---- */
  --bg-primary: #080808;
  --bg-secondary: #0f0f0f;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(0, 200, 255, 0.4);
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-dim: #444444;
  --accent: #00c8ff;
  --accent-hover: #33d4ff;
  --accent-glow: rgba(0, 200, 255, 0.15);
  --danger: #ff4444;
  --success: #44ff88;
  --warning: #ffaa44;

  /* ---- Type ---- */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Menlo", ui-monospace, monospace;

  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 48px;
  --text-4xl: 64px;

  /* ---- Spacing (8px grid) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* ---- Radius ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* ---- Shadow ---- */
  --shadow-glow: 0 0 30px rgba(0, 200, 255, 0.15);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 8px 48px rgba(0, 0, 0, 0.6);

  /* ---- Motion ---- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ---- Layout ---- */
  --content-max: 1200px;
  --nav-h: 72px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--accent-glow); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Lucide icons render as inline SVG — normalize sizing/stroke */
[data-lucide] {
  width: 1em;
  height: 1em;
  stroke-width: 1.75;
  vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Shared components — buttons (used by landing + auth)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  padding-inline: var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--transition-fast), background var(--transition-base),
    border-color var(--transition-base), box-shadow var(--transition-base), color var(--transition-base);
}
.btn [data-lucide] { font-size: 18px; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #04222c; }
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-primary); }
.btn-ghost:hover:not(:disabled) { border-color: var(--border-hover); background: rgba(0, 200, 255, 0.06); }
.btn-sm { height: 40px; padding-inline: var(--space-4); font-size: var(--text-sm); }
.btn-lg { height: 56px; padding-inline: var(--space-8); font-size: var(--text-lg); }
.btn-block { width: 100%; }

/* In-button loading spinner */
.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(4, 34, 44, 0.35);
  border-top-color: #04222c;
  animation: spin 0.7s linear infinite;
}
.btn-ghost .spinner { border-color: rgba(255,255,255,0.25); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Ambient background (injected by bg.js / stars.js) — shared shell
   ========================================================================== */

.bg-gradient {
  position: fixed;
  inset: -10%;
  z-index: -4;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 15%, rgba(0, 200, 255, 0.10), transparent 42%),
    radial-gradient(circle at 82% 25%, rgba(0, 120, 255, 0.07), transparent 40%),
    radial-gradient(circle at 50% 88%, rgba(0, 200, 255, 0.06), transparent 52%),
    var(--bg-primary);
  background-size: 140% 140%;
  animation: gradientShift 48s ease-in-out infinite;
}
@keyframes gradientShift {
  0%   { background-position: 0% 0%, 100% 0%, 50% 100%; }
  50%  { background-position: 18% 28%, 72% 40%, 42% 72%; }
  100% { background-position: 0% 0%, 100% 0%, 50% 100%; }
}

.bg-mountains {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 32vh;
  min-height: 200px;
  z-index: -3;
  pointer-events: none;
  opacity: 0.9;
}
.mountain-back {
  fill: rgba(16, 58, 84, 0.5);
  stroke: rgba(0, 200, 255, 0.12);
  stroke-width: 1.5;
}
.mountain-front {
  fill: rgba(9, 34, 50, 0.92);
  stroke: rgba(0, 200, 255, 0.3);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 6px rgba(0, 200, 255, 0.1));
}
.mountain-glint {
  fill: var(--accent);
  opacity: 0.7;
  filter: drop-shadow(0 0 4px var(--accent));
}

#starfieldCanvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 320px; height: 320px;
  margin: -160px 0 0 -160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity var(--transition-base);
  will-change: transform;
}
.cursor-glow.visible { opacity: 0.45; }

@media (prefers-reduced-motion: reduce) {
  .bg-gradient { animation: none; }
  #starfieldCanvas, .cursor-glow { display: none; }
}
