/* The super element: a quiet reading page, like a clean sheet of engineering paper. One
   narrow column, a faint drafting grid behind it, and one accent colour for the points a
   model keeps. The fonts are the shared ones in ../assets/fonts/. */

@font-face {
  font-family: Inter;
  src: url("../assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/SpaceGrotesk-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #F3F0E8;
  --grid: rgba(30, 42, 54, 0.06);
  --ink: #1E2A36;
  --muted: #4A5663;
  --rule: #CFC7B8;
  --panel: #E3DED2;
  --mesh: #A89F8F;
  --node: #C4501C;
  --link: #1F4FB8;
  --focus: #1F4FB8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14181D;
    --grid: rgba(236, 231, 221, 0.05);
    --ink: #ECE7DD;
    --muted: #B9B2A6;
    --rule: #3A4048;
    --panel: #232A32;
    --mesh: #808B96;
    --node: #F08A4B;
    --link: #9DBBFF;
    --focus: #F08A4B;
  }
}

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.65;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* One column, about 65 characters wide, with at least 16px either side. */
.top,
.sheet,
.foot {
  box-sizing: border-box;
  max-width: calc(38rem + 32px);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.top {
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.top a {
  color: var(--muted);
  text-decoration: none;
}

.top a::before {
  content: "\2190\00a0";
}

.top a:hover {
  color: var(--link);
}

.sheet {
  padding-top: 32px;
  padding-bottom: 24px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--node);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(32px, 7vw, 46px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lede {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

section {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 0 0 12px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

p {
  margin: 0 0 16px;
}

section p:last-child {
  margin-bottom: 0;
}

figure {
  margin: 28px 0 0;
}

.diagram {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
}

.d-fill {
  fill: var(--panel);
}

.d-mesh {
  fill: none;
  stroke: var(--mesh);
  stroke-width: 1.25;
}

.d-panel {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}

.d-node {
  fill: var(--node);
}

.d-label {
  fill: var(--ink);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 17px;
  font-weight: 600;
}

figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* Where it stands: set apart, like a note pinned to the sheet. */
.status {
  padding: 20px 20px 22px;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--node);
  border-radius: 4px;
  background: var(--paper);
}

.foot {
  padding-top: 16px;
  padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 15px;
}

/* The source line is a citation, not the story: smaller and in the muted text colour, which
   has its own light and dark value. */
.source p {
  font-size: 0.875rem;
  color: var(--muted);
}
