/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--color-moonlight-blue); text-decoration: none; }
a:hover { color: var(--color-star-yellow); }
ul, ol { padding: 0; }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}
h1 { font-size: var(--text-hero); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.875rem, 3vw + 0.5rem, 2.75rem); letter-spacing: -0.01em; }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p  { line-height: var(--leading-normal); color: var(--text-secondary); }

/* Focus ring */
:focus-visible {
  outline: 3px solid rgba(255, 215, 0, 0.6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -9999px;
  left: var(--space-4);
  background: var(--color-star-yellow);
  color: var(--text-inverse);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  z-index: 9999;
}
.skip-link:focus { top: var(--space-4); color: var(--text-inverse); }

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

body.is-locked { overflow: hidden; }

::selection { background: var(--color-star-yellow); color: var(--text-inverse); }
