/* Prism Design Tokens */
:root {
  --bg-base: #050510;
  --bg-surface: #0B0B1F;
  --bg-elevated: #15152E;
  --bg-elevated-2: #1C1C3A;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-soft: rgba(255, 255, 255, 0.10);
  --border-glow: rgba(139, 92, 246, 0.35);

  --text-primary: #F5F5FA;
  --text-secondary: #A8A8C0;
  --text-muted: #6E6E8C;
  --text-faint: #4A4A66;

  --accent-violet: #8B5CF6;
  --accent-cyan: #06B6D4;
  --accent-magenta: #EC4899;
  --accent-amber: #F59E0B;
  --accent-green: #10B981;

  --iridescent: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 35%, #EC4899 70%, #F59E0B 100%);
  --iridescent-soft: linear-gradient(135deg, rgba(139,92,246,0.6) 0%, rgba(6,182,212,0.6) 35%, rgba(236,72,153,0.6) 70%, rgba(245,158,11,0.6) 100%);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-entrance: 600ms;
  --dur-hover: 200ms;

  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;

  --font-display: "Sora", "Geist", "Inter Tight", system-ui, sans-serif;
  --font-body: "Inter", "Source Han Sans CN", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* Mobile breakpoints (max-width values for media queries) */
  --bp-tablet: 1024px;
  --bp-phone: 640px;
  --bp-narrow: 480px;
  --bp-tiny: 360px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Prevent iOS auto-zoom on focus when font-size < 16px */
input, textarea, select { font-size: 16px; }
@media (min-width: 641px) {
  input, textarea, select { font-size: inherit; }
}

/* Tap targets ≥ 44pt (Apple HIG) on mobile */
@media (max-width: 640px) {
  button, a.cta-primary, a.cta-ghost, .nav-link, .nav-login, .cs-btn, .cs-nav-link {
    min-height: 44px;
  }
}

/* Background ambience */
.bg-ambience {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-ambience .stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.5), transparent 50%),
    radial-gradient(1px 1px at 60% 80%, rgba(255,255,255,0.4), transparent 50%),
    radial-gradient(1px 1px at 80% 15%, rgba(255,255,255,0.5), transparent 50%),
    radial-gradient(1px 1px at 35% 65%, rgba(255,255,255,0.3), transparent 50%),
    radial-gradient(2px 2px at 90% 50%, rgba(255,255,255,0.5), transparent 50%),
    radial-gradient(1px 1px at 10% 90%, rgba(255,255,255,0.4), transparent 50%),
    radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.4), transparent 50%),
    radial-gradient(1px 1px at 75% 35%, rgba(255,255,255,0.3), transparent 50%),
    radial-gradient(1px 1px at 25% 50%, rgba(255,255,255,0.4), transparent 50%);
  background-size: 1200px 800px;
  opacity: 0.7;
  animation: drift 200s linear infinite;
}
.bg-ambience .nebula-1 {
  position: absolute;
  top: -20%; left: -10%;
  width: 70vw; height: 70vw;
  background: radial-gradient(circle, rgba(139,92,246,0.18), transparent 60%);
  filter: blur(60px);
  animation: float 40s ease-in-out infinite;
}
.bg-ambience .nebula-2 {
  position: absolute;
  bottom: -30%; right: -15%;
  width: 80vw; height: 80vw;
  background: radial-gradient(circle, rgba(6,182,212,0.12), transparent 60%);
  filter: blur(80px);
  animation: float 60s ease-in-out infinite reverse;
}
.bg-ambience .nebula-3 {
  position: absolute;
  top: 40%; left: 50%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(236,72,153,0.08), transparent 60%);
  filter: blur(60px);
  animation: float 80s ease-in-out infinite;
}
@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-1200px, -400px); }
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, -60px) scale(1.1); }
}

/* Iridescent text */
.iridescent-text {
  background: var(--iridescent);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  background-size: 200% 200%;
  animation: shimmer 8s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.4); }

/* Utility */
.mono { font-family: var(--font-mono); }
.display { font-family: var(--font-display); letter-spacing: -0.02em; font-weight: 600; }

button { font-family: inherit; }
input, textarea { font-family: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
