/* ==========================================================================
   Base — Reset, Typography, Layout
   ========================================================================== */

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

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-theme), color var(--transition-theme);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  color: var(--color-text);
  transition: color var(--transition-theme);
}

h1 { font-size: var(--text-5xl); font-weight: 700; }
h2 { font-size: var(--text-4xl); font-weight: 700; }
h3 { font-size: var(--text-3xl); font-weight: 600; }
h4 { font-size: var(--text-2xl); font-weight: 600; }
h5 { font-size: var(--text-xl);  font-weight: 600; }
h6 { font-size: var(--text-lg);  font-weight: 600; }

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
  transition: color var(--transition-theme);
}

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

a:hover {
  color: var(--color-accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

strong { font-weight: 600; color: var(--color-text); }
em { font-style: italic; }
small { font-size: var(--text-sm); }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-accent-subtle);
  padding: 0.15em 0.4em;
  border-radius: var(--badge-radius);
}

/* ---------- Lists ---------- */
ul, ol { padding-left: var(--space-6); }
li { margin-bottom: var(--space-2); }
li::marker { color: var(--color-accent); }

/* ---------- Images ---------- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-12) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: var(--text-lg);
}

main {
  position: relative;
  padding-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

/* ---------- Utility Classes ---------- */
.text-center { text-align: center; }
.text-accent { color: var(--color-accent); }
.text-muted  { color: var(--color-text-muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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