/*
  Base element styles and reset.
  Keep this file to global, tag-level rules only — anything reusable
  and class-based belongs in components.css.
*/

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

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

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-body);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.theme-dark {
  background-color: var(--color-dark-bg);
  color: var(--color-dark-body);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-4);
  color: var(--color-ink);
  font-weight: 600;
}

h1,
h2 {
  font-family: var(--font-serif);
}

h1 {
  font-size: var(--text-h1);
  line-height: 1.15;
}

h2 {
  font-size: var(--text-h2);
  line-height: 1.25;
}

h3,
h4 {
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  line-height: 1.35;
}

.display {
  font-family: var(--font-serif);
  font-size: var(--text-display);
  line-height: 1.1;
  margin: 0 0 var(--space-5);
}

p {
  margin: 0 0 var(--space-4);
}

.lede {
  font-size: var(--text-lede);
  line-height: 1.6;
  color: var(--color-body);
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg {
  max-width: 100%;
  display: block;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.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;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--color-ink);
  color: var(--color-white);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top var(--transition-fast);
}

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