/* ============================================================
   Bada Design System (BDS) · Base Layer
   Version : 1.0.0
   Reference: docs/03-design-spec.md Part 1 (Typography + Reset)
   Purpose : Global reset, typography scale, link + selection
             styling, accessibility primitives. Depends on
             tokens.css. No component-specific styles here.
   ============================================================ */

/* Typography uses Apple system font stack (declared in tokens.css).
   No @import — we rely on -apple-system / BlinkMacSystemFont / system-ui
   so Mac/iOS gets real SF Pro, Win/Android gets closest sans face.
   Serif path was removed in v2.0.0 — Apple-style sans-only hierarchy. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
img, svg, video, canvas { max-width: 100%; display: block; }

/* ---------- Document ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--bds-font-sans);
  color: var(--bds-ink);
  background: var(--bds-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-ligatures: common-ligatures contextual;
  line-height: 1.55;
}

/* ---------- Typography scale (fluid) ----------
   Apple-style sans hierarchy. Semibold (600) for every display level,
   tight tracking on large sizes. SF Pro's Display/Text variants are
   auto-selected by -apple-system based on size on Mac/iOS. */
h1, h2, h3 {
  font-family: var(--bds-font-sans);
  font-weight: 600;
  letter-spacing: var(--bds-tracking-tight);
  margin: 0;
}
h1 { font-size: clamp(2.75rem, 7vw, 6.5rem); line-height: 1.05; }
h2 { font-size: clamp(2.25rem, 5vw, 4rem);   line-height: 1.08; }
h3 { font-size: clamp(1.625rem, 3.2vw, 2.5rem); line-height: 1.15; }

p { font-size: clamp(1rem, 1.1vw, 1.125rem); letter-spacing: var(--bds-tracking-body); }

.mono     { font-family: var(--bds-font-mono); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; }
.subtitle { font-size: 1.05rem; color: color-mix(in oklab, var(--bds-ink) 80%, transparent); }

/* ---------- Links ---------- */
a { color: inherit; text-decoration: none; transition: color var(--bds-dur-base) var(--bds-ease-premium); }
a:hover { color: var(--bds-gold); }

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--bds-gold);
  outline-offset: 3px;
}

::selection {
  background: var(--bds-gold);
  color: var(--bds-cream);
}

/* Screen-reader only utility — hides content visually while keeping it accessible to assistive tech. */
.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;
}
