/* Element defaults: page ground, text, headings, links, focus ring, reduced motion. No classes for single screens. */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Form controls take the page's type instead of the browser's Arial default. */
button, input, select, textarea { font: inherit; }

/* Only the display face lacks a bold, so no weight is ever faked. */
body {
  min-height: 100vh;
  background: var(--color-paper);
  color: var(--color-ink);
  font: var(--weight-regular) var(--text-md)/var(--leading-body) var(--font-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

/* Headings: the display face has one weight, 400. A card title (h4) keeps the colour of its ground's text. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  font-synthesis: none;
  line-height: var(--leading-snug);
  text-wrap: balance;
}
h1, h2, h3 { color: var(--color-frame-deep); }
h1 { font-size: var(--text-3xl); line-height: var(--leading-tight); }
/* A phone page title keeps snug leading: it takes focus on every screen change. */
h2 { font-size: var(--text-2xl); }
h3, h4 { font-size: var(--text-xl); }
@media (min-width: 900px) {
  h2 { font-size: var(--text-3xl); line-height: var(--leading-tight); }
  h3 { font-size: var(--text-2xl); }
}
/* Too small for the display face: body 700. */
h5, h6 { font: var(--weight-bold) var(--text-md)/var(--leading-snug) var(--font-body); color: var(--color-ink); }
p, li { text-wrap: pretty; }
strong, b { font-weight: var(--weight-bold); }

a {
  color: var(--color-frame-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
@media (hover: hover) {
  a:hover { color: var(--color-frame-night); }
}

/* Meta: dates, counts, the signed-in email. 16px; 14px only inside .density-deep. */
.text-code { padding: 0 4px; border: 1px solid var(--color-edge); border-radius: var(--radius-mark); background: var(--color-paper); color: var(--color-ink); font-family: var(--font-mono); font-size: var(--text-code); }
.text-meta { font: var(--weight-regular) var(--text-meta, var(--text-sm))/var(--leading-snug) var(--font-body); color: var(--color-ink-soft); }

/* Figures that line up: codes, quantities, ledgers. */
.nums { font-variant-numeric: tabular-nums lining-nums; }

/* Icons: one inline sprite, drawn in the surrounding text colour. */
.icon { width: 1.25em; height: 1.25em; vertical-align: -0.28em; flex-shrink: 0; }

/* Long reading: the Learn note. */
.prose { max-width: var(--measure); font-size: var(--text-lg); line-height: var(--leading-loose); color: var(--color-ink); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--space-4); }
.prose ul, .prose ol { padding-inline-start: var(--space-5); }
.prose li { margin-bottom: var(--space-2); }
.prose li::marker { color: var(--color-frame-deep); }
.prose h3 { font-size: var(--text-xl); line-height: var(--leading-snug); margin: calc(var(--space-6) + var(--space-2)) 0 var(--space-3); }
.prose > :first-child { margin-top: 0; }
.prose a { text-decoration: underline; text-decoration-thickness: 2px; }
@media (hover: hover) {
  .prose a:hover { background: var(--color-frame-wash); }
}

/* Keyboard focus. Mouse and touch draw no ring. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--color-frame-night); outline-offset: 2px; }
/* The header is blue, so the ring there is white. The account menu that drops from it is white and keeps the dark ring. */
.header :where(a, button):focus-visible { outline-color: var(--color-on-frame); }
.header .account-menu :where(a, button):focus-visible { outline-color: var(--color-frame-night); }
/* Screen headings and the main area take focus from script only (screen change, skip link); no ring. */
:where(h1, h2, main)[tabindex="-1"]:focus { outline: none; }

/* iOS Safari zooms into a focused field whose text is under 16px; touch devices only. A field keeps its parent's size when that is larger;
   a large field (20px and up) keeps its own. */
@media (any-pointer: coarse) { :is(input, select, textarea):not(.finder .select, .input--lg) { font-size: max(var(--text-sm), 1em) !important; } }

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