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

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

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

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

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

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-heading);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

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

p {
  margin-bottom: 1em;
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  font-weight: 600;
}

/* ─── Layout Helpers ─── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--narrow {
  max-width: var(--container-narrow);
}

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

.section--dark {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--text-on-dark);
}

.section--alt {
  background-color: var(--bg-secondary);
}

.text-center { text-align: center; }
.text-left { text-align: left; }

/* ─── Scroll Animations ─── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─── Selection ─── */
::selection {
  background-color: var(--blue-200);
  color: var(--blue-900);
}
