/* element defaults: reset, typography, links, lists, tables
   nothing here targets a page or a component */

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* offset for the sticky header */
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  color: var(--text-heading);
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  font-weight: 900;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-step-4);
}
h2 {
  font-size: var(--text-step-3);
}
h3 {
  font-size: var(--text-step-2);
}
h4 {
  font-size: var(--text-step-1);
}

ul,
ol {
  padding-left: var(--space-4);
}

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

li::marker {
  color: var(--accent);
  font-weight: 900;
}

a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-contrast);
  background: var(--accent-fill);
  text-decoration: none;
}

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

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

hr {
  border: 0;
  border-top: var(--line) solid var(--border);
  margin: var(--space-6) 0;
}

table {
  width: 100%;
  max-width: var(--content-width);
  border-collapse: collapse;
  border: var(--line) solid var(--border);
  box-shadow: var(--shadow-small);
  background: var(--bg-raised);
  font-size: var(--text-small);
}

th,
td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border: var(--line-thin) solid var(--border);
}

th {
  background: var(--accent-fill);
  color: var(--accent-contrast);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* shared building blocks */

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.lead {
  font-size: var(--text-step-1);
  color: var(--text);
  font-weight: 600;
  line-height: 1.5;
}

.muted {
  color: var(--text-muted);
}

/* the button lifts on hover and presses flat on click */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: var(--line) solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-body);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-raised);
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}

.button:hover {
  color: var(--text);
  background: var(--bg-raised);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-large);
}

.button:active {
  transform: translate(5px, 5px);
  box-shadow: none;
}

.button-primary,
.button-primary:hover {
  background: var(--accent-fill);
  color: var(--accent-contrast);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  border: var(--line) solid #000000;
  background: var(--accent-fill-alt);
  color: var(--accent-contrast);
  font-weight: 800;
  box-shadow: var(--shadow-ink);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

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