/*
 * Base stylesheet: modern reset + defaults matching the type scale.
 * Import order in the consuming app: fonts.css, tokens.css, base.css.
 */

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-interface);
  font-size: var(--text-interface-body-size);
  font-weight: var(--text-interface-body-weight);
  line-height: var(--text-interface-body-leading);
  -webkit-font-smoothing: antialiased;
}

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

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

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

a {
  color: var(--slate);
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

h1 {
  font-family: var(--font-interface);
  font-size: var(--text-page-title-size);
  font-weight: var(--text-page-title-weight);
  line-height: var(--text-page-title-leading);
}

h2 {
  font-family: var(--font-interface);
  font-size: var(--text-section-size);
  font-weight: var(--text-section-weight);
  line-height: var(--text-section-leading);
}

h3 {
  font-family: var(--font-interface);
  font-size: var(--text-subsection-size);
  font-weight: var(--text-subsection-weight);
  line-height: var(--text-subsection-leading);
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Tabular numerals wherever numbers appear as data, not prose. */
.numeric,
table,
time,
[data-numeric] {
  font-variant-numeric: tabular-nums;
}

/* Lesson prose measure and family. Apply to the reading container. */
.reading {
  font-family: var(--font-reading);
  font-size: var(--text-lesson-body-size);
  font-weight: var(--text-lesson-body-weight);
  line-height: var(--text-lesson-body-leading);
  max-width: var(--measure-reading);
}

/* Skip-to-content link: visually hidden until focused. */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  color: var(--ink);
  border: var(--rule-border);
}

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

/* Visually-hide content while keeping it available to screen readers. */
.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;
}

/* Focus-visible treatment, per the design system quality floor. Never
   `outline: none` without an equivalent replacement. */
:focus {
  outline: none;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

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