/* ==========================================================================
   NEXORA — Core Stylesheet
   Design system: tokens, reset, typography, layout, buttons, cards, utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Color — surfaces (deep navy/black, not neutral gray) */
  --bg-primary: #05070b;
  --bg-secondary: #080d14;
  --bg-elevated: #0c131c;
  --bg-card: rgba(148, 163, 184, 0.045);
  --bg-card-hover: rgba(148, 163, 184, 0.07);

  /* Color — borders (cool slate tint, not neutral white) */
  --border-color: rgba(148, 163, 184, 0.14);
  --border-color-strong: rgba(148, 163, 184, 0.22);
  --border-accent: rgba(34, 211, 238, 0.35);

  /* Color — text */
  --text-primary: #f5f7fa;
  --text-secondary: #9ba8b8;
  --text-muted: #6f7c8b;

  /* Color — accents: electric cyan + soft violet, green reserved for
     success states only (see --success below) */
  --accent-primary: #22d3ee;      /* electric cyan */
  --accent-primary-strong: #67e8f9;
  --accent-secondary: #7c6cff;    /* soft violet */
  --accent-secondary-strong: #a78bfa;
  --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  --accent-gradient-soft: linear-gradient(135deg, rgba(34, 211, 238, 0.16) 0%, rgba(124, 108, 255, 0.16) 100%);

  /* Feedback colors — success green used sparingly, as a small indicator only */
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;

  /* Shadow / glow — kept low-opacity; glow reads as depth, not brightness */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.4);
  --glow-primary: 0 0 0 1px rgba(34, 211, 238, 0.22), 0 0 30px rgba(34, 211, 238, 0.1);
  --glow-secondary: 0 0 0 1px rgba(124, 108, 255, 0.22), 0 0 30px rgba(124, 108, 255, 0.1);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Spacing scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Layout */
  --container-max: 1280px;
  --container-pad: clamp(20px, 5vw, 48px);
  --section-pad-y: clamp(64px, 10vw, 128px);

  /* Typography */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --fs-xs: clamp(0.75rem, 0.72rem + 0.1vw, 0.8125rem);
  --fs-sm: clamp(0.875rem, 0.84rem + 0.15vw, 0.9375rem);
  --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --fs-lg: clamp(1.125rem, 1.06rem + 0.3vw, 1.25rem);
  --fs-xl: clamp(1.375rem, 1.28rem + 0.5vw, 1.625rem);
  --fs-2xl: clamp(1.75rem, 1.55rem + 1vw, 2.25rem);
  --fs-3xl: clamp(2.25rem, 1.9rem + 1.8vw, 3.25rem);
  --fs-4xl: clamp(2.75rem, 2.1rem + 3.2vw, 4.5rem);

  /* Semantic type scale — the single hierarchy every section draws from.
     Aliases the primitive --fs-* steps above plus a few section-level
     sizes, so H2/card-title/body stay identical across all sections. */
  --text-xs: var(--fs-xs);
  --text-sm: var(--fs-sm);
  --text-base: var(--fs-base);
  --text-lg: var(--fs-lg);
  --text-xl: var(--fs-xl);
  --text-2xl: var(--fs-2xl);
  --text-3xl: var(--fs-3xl);
  --text-display: clamp(3rem, 2.3rem + 3.5vw, 5.5rem);
  --text-h2: clamp(2.25rem, 1.7rem + 2.5vw, 4rem);
  --text-card-title: clamp(1.1rem, 1.02rem + 0.4vw, 1.35rem);
  --text-body-lg: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  --text-body: clamp(0.95rem, 0.91rem + 0.2vw, 1.1rem);

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.6;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Motion (referenced by animations.css) */
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 180ms;
  --duration-base: 320ms;
  --duration-slow: 600ms;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  font-weight: var(--fw-regular);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

ul,
ol {
  list-style: none;
}

/* Visible focus states — accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); font-weight: var(--fw-semibold); }

p {
  color: var(--text-secondary);
  line-height: var(--lh-normal);
}

.text-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-muted { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   4. LAYOUT — container / section system
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-pad-y);
  position: relative;
}

.stack {
  display: flex;
  flex-direction: column;
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85em 1.6em;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition:
    transform var(--duration-fast) var(--ease-premium),
    box-shadow var(--duration-base) var(--ease-premium),
    border-color var(--duration-base) var(--ease-premium),
    background var(--duration-base) var(--ease-premium);
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #051018;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--glow-primary), var(--shadow-md);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  border-color: var(--border-color-strong);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding-inline: 0.4em;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   6. CARDS
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition:
    transform var(--duration-base) var(--ease-premium),
    border-color var(--duration-base) var(--ease-premium),
    box-shadow var(--duration-base) var(--ease-premium),
    background var(--duration-base) var(--ease-premium);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: rgba(15, 20, 28, 0.55);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   7. BACKGROUND SYSTEM — ambient glow / grid
   -------------------------------------------------------------------------- */
.bg-ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-ambient::before,
.bg-ambient::after {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
}

.bg-ambient::before {
  top: -180px;
  left: -120px;
  background: var(--accent-primary);
}

.bg-ambient::after {
  bottom: -220px;
  right: -140px;
  background: var(--accent-secondary);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black, transparent 75%);
  pointer-events: none;
  z-index: 0;
}
