/* ==========================================================================
   base.css — modern reset + global element defaults
   ========================================================================== */

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

* {
  margin: 0;
}

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

body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  font-size: var(--step-0);
  line-height: var(--line-body);
  color: var(--color-dark);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* --- Headings --------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-tight);
  color: var(--color-primary);
  text-wrap: balance;
}

h1 { font-size: var(--step-5); letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); letter-spacing: -0.01em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p,
ul,
ol {
  font-size: inherit;
}

p { text-wrap: pretty; }

/* --- Links ------------------------------------------------------------ */
a {
  color: var(--color-accent-ink);
  text-decoration-color: var(--color-line);
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

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

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

li + li {
  margin-top: var(--space-2);
}

/* --- Focus ------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* --- Accessibility helpers ------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100%;
  z-index: var(--z-overlay);
  background: var(--color-primary);
  color: var(--color-on-dark);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
}

.skip-link:focus {
  top: var(--space-4);
  color: var(--color-on-dark);
}

/* --- Motion preferences ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
