/* ==========================================================================
   Base: reset, typography, links, focus, utilities, long-form prose
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: var(--paper-grain);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.is-menu-open { overflow: hidden; }

main { flex: 1 0 auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-heading);
  letter-spacing: -0.005em;
  text-wrap: balance;
  color: var(--color-text);
}
h1 { font-size: var(--fs-h1); line-height: 1.06; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p, ul, ol, dl, figure, blockquote { margin: 0 0 var(--space-5); }
p { text-wrap: pretty; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: 0.35em; }

img, picture, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
img { font-style: italic; }            /* readable alt text if an image fails */

a {
  color: var(--color-brand-teal-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color var(--dur-1) var(--ease), text-decoration-color var(--dur-1) var(--ease);
}
a:hover { color: var(--color-terracotta-text); }

strong, b { font-weight: 700; }
em, i { font-style: italic; }
hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-7) 0; }

::selection { background: var(--color-clay); color: var(--color-text); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

button { font: inherit; color: inherit; }

/* skip link ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--color-ink-green);
  color: var(--color-text-on-dark);
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur-1) var(--ease);
}
.skip-link:focus { top: var(--space-3); color: var(--color-text-on-dark); }

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

/* type utilities ------------------------------------------------------------ */
.eyebrow {
  display: block;
  margin: 0 0 var(--space-4);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-terracotta-text);
}
.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--color-text);
}
.muted { color: var(--color-text-muted); }
.small { font-size: var(--fs-small); }
.italic-display { font-family: var(--font-display); font-style: italic; font-weight: 400; }

/* long-form text (course pages, articles) ------------------------------------ */
.prose { max-width: var(--container-text); }
.prose > * + * { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.2em; }
.prose h2 { margin-top: 2.2em; margin-bottom: 0.6em; font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); }
.prose h3 { margin-top: 1.8em; margin-bottom: 0.5em; font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem); }
.prose h4 { margin-top: 1.6em; margin-bottom: 0.4em; font-family: var(--font-body); font-size: 1rem; font-weight: 700; letter-spacing: 0.02em; }
.prose > :first-child { margin-top: 0; }
.prose li::marker { color: var(--color-terracotta-text); }
.prose blockquote {
  margin: 2em 0;
  padding: 0.2em 0 0.2em 1.4em;
  border-left: 2px solid var(--color-brand-terracotta);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2em;
  line-height: 1.55;
}
.prose a { text-decoration-line: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }

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