/* ==========================================================================
   SPECTRUM ALLIANCE — GLOBAL BASE STYLES
   Reset, typography, utility classes, accessibility
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');
@import 'tokens.css';

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background-color: var(--sa-dark);
  color: var(--sa-light);
  line-height: var(--leading-normal);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── Accessibility ───────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--sa-white);
  color: var(--sa-dark);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-md);
  z-index: var(--z-toast);
  transition: top var(--dur-fast);
}
.skip-link:focus { top: var(--space-4); }

*:focus-visible {
  outline: 2px solid var(--sa-spectrum-5);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Container ───────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.container--sm  { max-width: var(--container-sm); }
.container--md  { max-width: var(--container-md); }
.container--lg  { max-width: var(--container-lg); }
.container--2xl { max-width: var(--container-2xl); }
@media (max-width: 768px) { .container { padding-inline: var(--space-4); } }

/* ── Section spacing ─────────────────────────────────────────────────── */
.section { padding-block: var(--space-24); }
.section--sm { padding-block: var(--space-16); }
.section--lg { padding-block: var(--space-32); }
@media (max-width: 768px) {
  .section { padding-block: var(--space-16); }
  .section--lg { padding-block: var(--space-24); }
}

/* ── Typography helpers ──────────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sa-spectrum-5);
  margin-bottom: var(--space-3);
}
.headline-xl {
  font-size: clamp(var(--text-4xl), 6vw, var(--text-7xl));
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: -0.03em;
}
.headline-lg {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}
.headline-md {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: -0.02em;
}
.headline-sm {
  font-size: clamp(var(--text-xl), 2vw, var(--text-3xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
}
.body-lg { font-size: var(--text-lg); line-height: var(--leading-relaxed); }
.body-md { font-size: var(--text-base); line-height: var(--leading-relaxed); }
.body-sm { font-size: var(--text-sm); line-height: var(--leading-relaxed); }
.text-muted { color: var(--sa-ghost); }
.text-gradient {
  background: var(--sa-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  border-radius: var(--radius-full);
  transition: all var(--dur-base) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}
.btn--primary {
  background: var(--brand-gradient, var(--ws-gradient));
  color: var(--sa-white);
  box-shadow: 0 4px 20px rgba(58,123,255,0.3);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(58,123,255,0.4); }
.btn--secondary {
  background: transparent;
  color: var(--sa-white);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}
.btn--secondary:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.05); }
.btn--ghost { background: transparent; color: var(--sa-silver); }
.btn--ghost:hover { color: var(--sa-white); }
.btn--sm { padding: var(--space-2) var(--space-5); font-size: var(--text-sm); }
.btn--lg { padding: var(--space-4) var(--space-12); font-size: var(--text-lg); }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--dur-base) var(--ease-out);
}
.card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card--glass {
  background: rgba(10,15,30,0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ── Grid helpers ────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-6); }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Divider ─────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  margin-block: var(--space-16);
}

/* ── Badge ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  border-radius: var(--radius-full);
  border: 1px solid;
}
.badge--spectrum {
  background: rgba(58,123,255,0.1);
  border-color: rgba(58,123,255,0.3);
  color: var(--sa-spectrum-5);
}
.badge--gold {
  background: rgba(217,119,6,0.1);
  border-color: rgba(217,119,6,0.3);
  color: var(--eles-gold);
}

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

/* ── Utility ─────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.text-center { text-align: center; }
.max-w-prose { max-width: 65ch; }
.mx-auto { margin-inline: auto; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.hidden { display: none !important; }
