/* styles.base.css — Base tokens, reset, typography, utilities */
:root {
  --bg: #0B0B0C;
  --surface: #121214;
  --text: #F5F6F7;
  --muted: #B8BBC2;
  --brand: #4FD1C5;
  --accent: #A78BFA;
  --brand-red: #E8131A;
  color-scheme: light dark;
  --header-h: 56px;
  /* Type scale */
  --step--1: clamp(0.85rem, 0.8rem + 0.2vw, 0.95rem);
  --step-0: clamp(1rem, 0.95rem + 0.4vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.1rem + 1vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.2rem + 1.6vw, 2rem);
  --step-3: clamp(2rem, 1.6rem + 3vw, 3rem);
  /* Spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  /* Layout */
  --maxw: 72rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 6px 24px rgba(0,0,0,0.35);
}

/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html {
  scroll-behavior: smooth;
  background: var(--bg);           /* match body to avoid white flash on overscroll */
  overflow-x: hidden;              /* prevent horizontal scrolling at root */
  overscroll-behavior-x: none;     /* disable horizontal overscroll/bounce */
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
  /* Reserve space so the scroll-to-top button never masks content */
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  overflow-x: hidden;              /* prevent page from panning horizontally */
  /* allow nested horizontal scrollers like the top nav */
  overscroll-behavior-x: contain;  /* keep root from bouncing while permitting inner scrollers */
}

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

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: calc(var(--gutter) + env(safe-area-inset-left));
  padding-right: calc(var(--gutter) + env(safe-area-inset-right));
}

/* Typography */
h1 { font-size: var(--step-3); line-height: 1.1; margin: 0 0 var(--space-3); }
h2 { font-size: var(--step-2); line-height: 1.2; margin: 0 0 var(--space-2); }
h3 { font-size: var(--step-1); line-height: 1.3; margin: 0 0 var(--space-2); }
p, li { font-size: var(--step-0); color: var(--text); }
.subhead { color: var(--muted); font-weight: 600; }

/* Links */
a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus-visible { text-decoration-thickness: 2px; }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -1000px;
  left: 0;
  background: var(--accent);
  color: #000;
  padding: var(--space-1) var(--space-2);
  border-radius: 6px;
  z-index: 1000;
}
.skip-link:focus { top: 0.5rem; left: 0.5rem; }

/* Sections base */
.section { padding-block: var(--space-2); }
section[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

/* Utilities */
.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;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}