/* Round 3 system: base. Reset, reading, headings and their pencilled sublines, links, focus. */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
  scroll-padding-bottom: calc(var(--bar-h) + 2rem);
  interpolate-size: allow-keywords;
  caret-color: var(--call);
  accent-color: var(--call);
  scrollbar-color: var(--boundary) var(--ground);
}
body {
  margin: 0;
  min-height: 100svh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--face-text);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* the bottom bar's height is reserved at the foot, so it never covers the last line */
  padding-bottom: calc(var(--bar-h) + 1.5rem + env(safe-area-inset-bottom));
}
main { display: block; overflow-x: clip; }
/* --display-weight: 600, or 400 where the display face has one weight (Style, Celebrate); a bold is never synthesised. */
h1, h2, h3, h4 { margin: 0; font-family: var(--face-display); font-weight: var(--display-weight); font-synthesis: style small-caps; line-height: 1.12; letter-spacing: -0.005em; text-wrap: balance; color: var(--ink); }
h1 { font-size: var(--step-display); }
h2 { font-size: var(--step-1); }
h3 { font-size: var(--step-2); }
h4 { font-size: 1.125rem; }
p, ul, ol, dl, figure, blockquote { margin: 0; }
p, li, dd, figcaption { text-wrap: pretty; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, svg, picture, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
strong, b { font-weight: 650; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); }
a:hover { text-decoration-color: currentColor; }
.num { font-variant-numeric: tabular-nums lining-nums; }
::selection { background: color-mix(in srgb, var(--area-ink) 30%, transparent); color: var(--ink); }

/* Focus: 2 px ink, 3 px offset, on every ground (5.2). */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip-link { position: absolute; left: var(--s-4); top: -200px; z-index: 1000; padding: var(--s-3) var(--s-4); background: var(--ink); color: var(--ground); border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; }
.skip-link:focus-visible { top: var(--s-3); outline-color: var(--ink); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- the page's measure ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--page-max)); margin-inline: auto; }
.wrap--read { width: min(100% - 2 * var(--gutter), var(--measure)); margin-inline: auto; }
.section { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.section + .section { padding-top: 0; }
.stack > * + * { margin-top: var(--stack, var(--s-4)); }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--s-4); }
.prose h2, .prose h3 { margin-top: var(--s-7); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: var(--s-2); }
.lede { font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem); line-height: 1.5; color: var(--ink); max-width: 46ch; }
.quiet { color: var(--ink-2); }
.caps { font-family: var(--face-caps); font-size: var(--step-quiet); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-2); }

/* ---------- a headline and its pencilled subline (brief 6) ---------- */
/* <hgroup class="pair"><h1>Be at the party, not running it.</h1><p class="subline">...</p></hgroup> */
.pair { display: grid; gap: 0.5em; margin: 0; }
.pair > :is(h1, h2, h3) { margin: 0; }
.subline {
  font-family: var(--face-note);
  font-weight: 600;
  font-size: max(18px, 0.42em);
  line-height: 1.38;
  color: var(--ink-2);
  padding-left: 0.9em;
  max-width: 40ch;
  text-wrap: pretty;
}
h1 + .subline, .pair > h1 ~ .subline { font-size: max(18px, calc(var(--step-display) * 0.42)); }
.pair > h2 ~ .subline { font-size: max(18px, calc(var(--step-1) * 0.5)); }
.pair > h3 ~ .subline { font-size: 18px; }
.pair--hero > h1 { font-size: var(--step-hero); }
.pair--hero > h1 ~ .subline { font-size: max(19px, calc(var(--step-hero) * 0.38)); }
.note { font-family: var(--face-note); font-weight: 600; }

/* Her tagline is set as she writes it, never transformed. */
.tagline { font-family: var(--face-head); font-weight: 600; text-transform: none; letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
