/* ============================================================
   BASE — Reset, root defaults, semantic HTML foundations
   ============================================================ */

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

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

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

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

/* ── Focus ── */
:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ── Selection ── */
::selection {
  background-color: rgba(237, 0, 0, 0.15);
  color: var(--text-primary);
}

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

h1 { font-size: var(--text-display); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-sm); }

p {
  line-height: var(--leading-loose);
  color: var(--text-secondary);
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}@media (hover: hover){

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

strong { font-weight: var(--font-weight-bold); }
em     { font-style: italic; }

small  { font-size: var(--text-xs); }

/* ── Lists ── */
ul, ol {
  padding-left: var(--space-3);
}

li {
  line-height: var(--leading-loose);
}

/* ── Images & media ── */
img, video, picture, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* ── Forms ── */
input, button, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ── HR ── */
hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-4) 0;
}

/* ── Tables ── */
table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  font-weight: var(--font-weight-bold);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-cold-gray);
  border-radius: var(--radius-pill);
}@media (hover: hover){
::-webkit-scrollbar-thumb:hover { background: var(--color-anthracite); }}

/* ── Skip to content (accessibility) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-3);
  background: var(--color-red);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-bold);
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: var(--space-2);
}

/* ── Visually hidden (accessible) ── */
.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;
}

/* ── Dark section text inversions ── */
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--text-inverse);
}

.section--dark p {
  color: rgba(255,255,255,0.72);
}