/* ==========================================================================
   base.css - Reset, Typography, Accessibility & Focus Handling
   ========================================================================== */

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

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

body {
  background-color: var(--panel);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
  padding: 0 !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Accessibility: Skip Link & Focus Ring
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background-color: var(--surface);
  color: var(--ink);
  padding: var(--space-3) var(--space-5);
  border: 2px solid var(--steel);
  border-radius: var(--radius-m);
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.15s ease-out;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: var(--space-4);
}

:focus-visible {
  outline: 3px solid var(--steel);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-align: left;
  font-stretch: 110%;
}

h1 {
  font-size: var(--step-5);
  margin-bottom: var(--space-5);
}

@media (min-width: 900px) {
  h1 {
    font-size: var(--step-6);
  }
}

h2 {
  font-size: var(--step-3);
  margin-bottom: var(--space-4);
}

@media (min-width: 900px) {
  h2 {
    font-size: var(--step-4);
  }
}

h3 {
  font-size: var(--step-2);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--step-1);
  margin-bottom: var(--space-2);
}

p {
  max-width: var(--measure);
  margin-bottom: var(--space-4);
}

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

.lead {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.text-meta {
  font-size: var(--step--1);
  color: var(--ink-soft);
  line-height: 1.4;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--steel);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

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

ul,
ol {
  list-style-position: outside;
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}

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

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

hr {
  border: 0;
  height: 1px;
  background-color: var(--line);
  margin: var(--space-7) 0;
}

/* --------------------------------------------------------------------------
   Prefers 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;
  }
}
