/* Resets, type scale and layout primitives. Uses tokens.css names only.
   Hierarchy comes from size and weight. No borders under headings,
   no coloured bars on panels. White space is structural. */

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

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

body,
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

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

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

table {
  border-collapse: collapse;
  width: 100%;
}

/* Page */
body {
  background: var(--parchment);
  color: var(--deep-ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Type roles. Each role is a class, and headings default to the matching role. */
.t-number {
  font-size: var(--t-number);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--signal-red);
  font-variant-numeric: tabular-nums;
}

h1,
.t-hero {
  font-size: var(--t-hero);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h2,
.t-h2 {
  font-size: var(--t-h2);
  font-weight: 600;
  line-height: 1.3;
}

h3,
.t-h3 {
  font-size: var(--t-h3);
  font-weight: 600;
  line-height: 1.4;
}

.t-body {
  font-size: var(--t-body);
  font-weight: 400;
  line-height: var(--lh-body);
}

.t-small {
  font-size: var(--t-small);
  font-weight: 400;
  line-height: 1.5;
}

.t-label {
  font-size: var(--t-label);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--deep-ink);
}

/* A red section label, for pages with no headline number on them.
   Never use it directly above the number: two reds at different
   values read as a mistake rather than a system. */
.t-label-red {
  color: var(--signal-red-ink);
}

.t-meta {
  font-size: var(--t-meta);
  font-weight: 400;
  line-height: 1.5;
  color: var(--rule-gray);
}

a {
  color: var(--deep-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--signal-red-ink);
}

:focus-visible {
  outline: 2px solid var(--signal-red);
  outline-offset: 2px;
}

/* Layout: one centred column */
.wrap {
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Vertical rhythm. Children of a stack are spaced, the stack itself is not.
   The gap resolves on the stack, so a nested stack keeps its own spacing. */
.stack {
  --stack-gap: 16px;
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}

/* Flex items do not shrink below their content width on their own.
   Without this a wide table inside a stack forces a horizontal page scroll. */
.stack > * {
  min-width: 0;
}

.stack-sm { --stack-gap: 8px; }
.stack-lg { --stack-gap: 32px; }
.stack-xl { --stack-gap: 64px; }

.section {
  padding-top: 48px;
  padding-bottom: 48px;
}

/* Hidden from sight, kept for screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
