/* ==========================================================================
   Base — reset, elements, typography, decorations (v3 Core)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  background-color: var(--bg-page);
  color: var(--text-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }

/* ---- Headings ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  letter-spacing: -0.02em;
}
h1, .h1 { font-size: var(--fs-h1); }
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
h4, .h4 { font-size: var(--fs-h4); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
h5, .h5 { font-size: var(--fs-h5); font-weight: var(--fw-semibold); letter-spacing: normal; }
h6, .h6 { font-size: var(--fs-h6); font-weight: var(--fw-semibold); letter-spacing: normal; }

.hero-text, .display {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

/* ---- Body text ---- */
p { line-height: var(--lh-relaxed); }
p + p { margin-top: var(--space-4); }
.text-lg   { font-size: var(--fs-lg); line-height: var(--lh-relaxed); }
.text-base { font-size: var(--fs-base); line-height: var(--lh-base); }
.text-sm   { font-size: var(--fs-sm); line-height: var(--lh-base); }
.text-xs, .text-caption { font-size: var(--fs-xs); line-height: var(--lh-base); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-inverse { color: var(--text-inverse); }
.text-brand { color: var(--text-brand); }

/* ---- Micro-caps kicker ---- */
.micro-caps {
  font-size: var(--fs-micro); font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted);
}

/* ---- Mono / tabular numerals ---- */
.mono, .numeric { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-primary); }

/* ---- Links ---- */
a { color: var(--brand-primary); text-decoration: none; transition: color var(--transition-base); }
a:hover { color: var(--brand-hover); }

/* ---- Lists ---- */
ul, ol { list-style: none; }
.prose ul, .content-area ul { list-style: disc; padding-left: 1.25em; }
.prose ol, .content-area ol { list-style: decimal; padding-left: 1.25em; }
.prose li, .content-area li { margin-bottom: var(--space-2); line-height: var(--lh-relaxed); }
.prose > * + *, .content-area > * + * { margin-top: var(--space-4); }
.prose h2, .prose h3, .content-area h2, .content-area h3 { margin-top: var(--space-8); }

hr { border: 0; border-top: 1px solid var(--border-default); margin: var(--space-8) 0; }
::selection { background: var(--brand-primary); color: #fff; }
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: var(--z-modal);
  background: var(--brand-primary); color: #fff; padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md); transition: top var(--transition-base);
}
.skip-link:focus { top: var(--space-4); color: #fff; }

.screen-reader-text, .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Decorations
   ========================================================================== */
.bg-grid-pattern {
  background-size: 32px 32px;
  background-image:
    linear-gradient(to right, rgb(37 99 235 / 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(37 99 235 / 0.06) 1px, transparent 1px);
}
.dark-grid-pattern {
  background-size: 32px 32px;
  background-image:
    linear-gradient(to right, rgb(255 255 255 / 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / 0.04) 1px, transparent 1px);
}
.radial-top-glow { background: radial-gradient(circle at 50% -20%, rgb(37 99 235 / 0.10), transparent 70%); }
.ambient-glow { position: absolute; border-radius: var(--radius-circle); filter: blur(64px); pointer-events: none; z-index: 0; }

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