/* ================================================================
   BASE — reset, typography, utilities
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
  min-height: 100vh;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--accent); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

ul, ol { list-style: none; }

/* ===== FOCUS — accessible by default ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--fs-4xl); font-weight: 700; }
h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 700; line-height: var(--lh-snug); }
h3 { font-size: var(--fs-xl); font-weight: 600; line-height: var(--lh-snug); }
h4 { font-size: var(--fs-lg); font-weight: 600; }

p {
  color: var(--text-secondary);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
}

p.lead {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}

strong { color: var(--text-primary); font-weight: 600; }
em { font-style: normal; }

code, .mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
}

.tabular { font-variant-numeric: tabular-nums; }

/* ===== UTILITY CLASSES ===== */
.container {
  max-width: var(--container-lg);
  margin: 0 auto;
  padding-inline: var(--container-padding);
}
.container-wide { max-width: var(--container-xl); }
.container-narrow { max-width: var(--container-md); }

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

.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

.uppercase {
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.glow-text {
  background: linear-gradient(135deg, #ffffff 0%, #00ff88 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Section padding rhythm */
.section { padding-block: clamp(60px, 9vw, 120px); }
.section-tight { padding-block: clamp(40px, 6vw, 72px); }

/* Visually hidden (a11y) */
.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;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -40px; left: 8px;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: var(--z-toast);
  transition: top var(--t-base);
}
.skip-link:focus { top: 8px; }

/* ===== Scroll animation (fade-up — respects prefers-reduced-motion) ===== */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; }
}

/* Selection */
::selection {
  background: var(--accent);
  color: var(--text-inverse);
}
