/* ============================================================
   BASE — Reset, CSS custom properties, typography
   ============================================================ */

:root {
  /* Backgrounds */
  --bg-base:     #0a0a0f;
  --bg-surface:  #12121a;
  --bg-raised:   #1a1a26;

  /* Brand */
  --color-primary:        #399be1;
  --color-accent:         #00d4ff;
  --color-gradient-start: #399be1;
  --color-gradient-end:   #00d4ff;

  /* Text */
  --text-primary:   #f0f0f8;
  --text-secondary: #9090b0;
  --text-muted:     #5a5a7a;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glass:  rgba(255, 255, 255, 0.12);

  /* Shadows */
  --shadow-glow: 0 0 40px rgba(57, 155, 225, 0.3);
  --shadow-glow-accent: 0 0 40px rgba(0, 212, 255, 0.2);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Radii */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-pill: 9999px;

  /* Typography */
  --font-body:    'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    ui-monospace, 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  4rem;
  --text-7xl:  5rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 600ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Navbar height (used in JS offset) */
  --navbar-height: 80px;
}

/* Modern reset */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

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

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

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

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

ul, ol {
  list-style: none;
  padding: 0;
}

/* Headings — consistent hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.5rem, 6vw, var(--text-7xl)); font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, var(--text-5xl)); font-weight: 700; }
h3 { font-size: clamp(1.35rem, 2.5vw, var(--text-3xl)); font-weight: 600; }
h4 { font-size: var(--text-xl); font-weight: 600; }
h5 { font-size: var(--text-lg); font-weight: 600; }
h6 { font-size: var(--text-base); font-weight: 600; }

/* Selection */
::selection {
  background: var(--color-primary);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--bg-raised);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Gradient text utility */
.gradient-text {
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text--animated {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

/* ── Light mode overrides ────────────────────────────────── */
[data-theme="light"] {
  --bg-base:     #f5f5fa;
  --bg-surface:  #ffffff;
  --bg-raised:   #ebebf4;

  --text-primary:   #0f0f1a;
  --text-secondary: #50506e;
  --text-muted:     #9090b0;

  --border-subtle: rgba(0, 0, 0, 0.07);
  --border-glass:  rgba(0, 0, 0, 0.11);

  --shadow-glow:        0 0 40px rgba(57, 155, 225, 0.15);
  --shadow-glow-accent: 0 0 40px rgba(0, 212, 255, 0.12);
  --shadow-card:        0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Scrollbar light mode */
html[data-theme="light"]::-webkit-scrollbar-track { background: var(--bg-base); }
html[data-theme="light"]::-webkit-scrollbar-thumb { background: var(--bg-raised); }
html[data-theme="light"]::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* Eyebrow label */
.eyebrow {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  display: inline-block;
}

/* ── Utility classes ────────────────────────────────────── */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--color-accent); }

.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

.leading-tight { line-height: 1.3; }
.leading-normal { line-height: 1.65; }
.leading-relaxed { line-height: 1.8; }

.tracking-tight  { letter-spacing: -0.02em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide   { letter-spacing: 0.05em; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mx-auto { margin-inline: auto; }

.text-center { text-align: center; }
.text-left { text-align: left; }

.max-w-sm  { max-width: 24rem; }
.max-w-md  { max-width: 28rem; }
.max-w-lg  { max-width: 32rem; }
.max-w-xl  { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-pill { border-radius: var(--radius-pill); }

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* Text sizes */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }

/* Font weights */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* Whitespace */
.whitespace-pre-line { white-space: pre-line; }
