/* Reset, page ground, and the two rules that apply to every element. */

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

/*
 * The ambient light.
 *
 * The page was one flat sheet of #08080a from the header to the footer, and
 * that flatness was half of what read as rigid — with no light source, every
 * surface is the same piece of paper. Two very wide, very weak washes give the
 * whole document a direction: warm from the top left where the curve rises,
 * cool and low on the right to keep the warm one from reading as a stain.
 *
 * Fixed rather than scrolled, so it behaves like light in a room rather than
 * like a graphic printed on the page.
 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 46% at 22% 0%, var(--ambient), transparent 68%),
    radial-gradient(52% 40% at 96% 34%, var(--ambient-cool), transparent 72%);
}

body {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

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

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

/* One focus treatment for every interactive element. Keyboard users get the
   same ring everywhere, and it is the accent colour so it is never ambiguous
   which control is live. */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--gold-line);
  outline-offset: 2px;
  border-radius: 3px;
}

::placeholder {
  color: var(--text-3);
}

/* Overflow strips on narrow screens scroll without showing a bar. */
.scroll-x {
  overflow-x: auto;
  scrollbar-width: none;
}

.scroll-x::-webkit-scrollbar {
  display: none;
}

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

/* Motion is opt-out, not decoration: it exists to show what changed after
   somebody acted, so when the reader has asked for none there is nothing of
   value to lose. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
