/* ================================================================
 * BUILD CAMP TRAINING - BASE STYLES
 * Global reset, body defaults, and foundational element styles.
 * Requires: variables.css (must be loaded first)
 * ================================================================ */

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

/* ---- Document ---- */
html {
  scroll-behavior: smooth;
  font-size: var(--font-size-base);
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}

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

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

small {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

code, pre {
  font-family: var(--font-family-mono);
}

pre {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  font-size: var(--font-size-sm);
}

code {
  background: var(--bg-card);
  padding: 0.15em 0.4em;
  border-radius: var(--border-radius-sm);
  font-size: 0.9em;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* ---- Links ---- */
a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

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

/* ---- Lists ---- */
ul, ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

li {
  margin-bottom: var(--space-xs);
}

/* ---- Selection ---- */
::selection {
  background: var(--primary);
  color: var(--white);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Container ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* ---- Utility: Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
