/* base.css - reset, document typography, page skeleton. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchored sections must not slide under the fixed bar. */
  scroll-padding-top: calc(var(--nav-h) + 0.75rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-ui);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0 0 var(--gap-2);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-1);
}
h4 {
  font-size: var(--step-0);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

p {
  margin: 0 0 var(--gap-3);
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}

:where(a, button, summary, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

strong,
b {
  font-weight: 600;
}

small {
  font-size: var(--step--1);
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--gap-4) 0;
}

ul,
ol {
  margin: 0 0 var(--gap-3);
  padding-left: 1.25rem;
}
li {
  margin-bottom: var(--gap-1);
}

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

/* Numbers line up in columns. This is why Inter is here. */
table,
.num {
  font-variant-numeric: tabular-nums;
}

/* -- layout ------------------------------------------------------------- */

.wrap {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}

.prose {
  width: min(100%, var(--measure));
}

.bleed {
  width: min(100% - 2rem, calc(var(--wide) + 8rem));
  margin-inline: auto;
}

.section {
  padding-block: var(--gap-6) var(--gap-5);
  border-top: 1px solid var(--rule);
}
.section:first-of-type {
  border-top: 0;
}

.section__eyebrow {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--gap-1);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.section__eyebrow::before {
  content: attr(data-n);
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink-soft);
  margin-bottom: var(--gap-4);
  width: min(100%, 42rem);
}

/* -- utilities ----------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  transition: top 0.15s;
}
.skip-link:focus {
  top: 0.5rem;
}

/* Reading level. Both registers are in the HTML; one is hidden. */
[data-register] {
  display: none;
}
:root[data-reading='plain'] [data-register='plain'],
:root[data-reading='technical'] [data-register='technical'] {
  display: revert;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .sitenav,
  .controls,
  .pano__scrollhint {
    display: none !important;
  }
  [data-register] {
    display: revert !important;
  }
}
