/* The fan fund — one stylesheet for every page.
   Oswald for anything that needs weight, Source Sans for reading, IBM Plex
   Mono for anything a reader could check for themselves. Warm paper, one red,
   nothing decorative. */

:root {
  --bg: #FBF8F7;
  --surface: #FFFFFF;
  --surface-2: #F3ECEC;
  --fg: #191315;
  --muted: #6D5D61;
  --faint: #9A898C;
  --line: #E3D9DA;
  --accent: #C8102E;
  --accent-ink: #FFFFFF;
  --ok: #1C6B47;
  --warn: #9A5B12;
  --bad: #A8252E;
  --display: "Oswald", "Haettenschweiler", "Arial Narrow", sans-serif;
  --body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --wrap: 720px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141011; --surface: #1E1819; --surface-2: #272021;
    --fg: #F2EBEC; --muted: #A89698; --faint: #7C6B6E; --line: #342B2D;
    --accent: #FF4458; --accent-ink: #1A1416;
    --ok: #5FD39B; --warn: #E0A355; --bad: #FF7A80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141011; --surface: #1E1819; --surface-2: #272021;
  --fg: #F2EBEC; --muted: #A89698; --faint: #7C6B6E; --line: #342B2D;
  --accent: #FF4458; --accent-ink: #1A1416;
  --ok: #5FD39B; --warn: #E0A355; --bad: #FF7A80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; }

/* ---- Structure ---------------------------------------------------------- */

.bleed {
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
main.inner { padding-block: 0 56px; display: flex; flex-direction: column; gap: 46px; }
section { display: flex; flex-direction: column; gap: 16px; }
p { margin: 0; max-width: 64ch; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* ---- Disclaimer strip and nav ------------------------------------------- */

.disclaimer .inner {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  padding-block: 8px;
}

nav .inner {
  display: flex; flex-wrap: wrap; gap: 2px 20px;
  padding-block: 11px;
  font-family: var(--display); font-weight: 500; font-size: 13px;
  letter-spacing: .09em; text-transform: uppercase;
}
nav a { color: var(--muted); text-decoration: none; padding-block: 3px; }
nav a:hover { color: var(--fg); }
nav a[aria-current="page"] { color: var(--accent); }

/* ---- Type -------------------------------------------------------------- */

header.page { display: flex; flex-direction: column; gap: 13px; padding-top: 42px; }
.eyebrow {
  font-family: var(--display); font-weight: 500; font-size: 12px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
}
h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(36px, 9vw, 64px); line-height: .96;
  letter-spacing: -0.02em; text-transform: uppercase;
  margin: 0; text-wrap: balance;
}
h1.huge { font-size: clamp(40px, 10.5vw, 76px); line-height: .94; }
.lede { font-size: 19.5px; color: var(--muted); max-width: 50ch; }
h2 {
  font-family: var(--display); font-weight: 500; font-size: 14px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
h3 { font-family: var(--body); font-weight: 600; font-size: 17px; margin: 0; }
.note { font-size: 15px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
strong, b { font-weight: 600; }

/* ---- Stacked bordered rows (used everywhere) --------------------------- */

.stack { display: flex; flex-direction: column; gap: 2px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  padding: 17px 20px; display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.card + .card { border-top: 0; }
.card b.head { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: .01em; }
.card p { font-size: 15.5px; }

/* numbered steps */
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.step .n {
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  color: var(--accent-ink); background: var(--accent);
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
}
.step .b { min-width: 0; display: flex; flex-direction: column; gap: 4px; }

/* question / answer, for the design-decisions page */
.qa { display: flex; flex-direction: column; gap: 7px; }
.qa .q {
  font-family: var(--display); font-weight: 600; font-size: 20px;
  letter-spacing: .01em; line-height: 1.25; text-wrap: balance;
}
.qa p { font-size: 16.5px; }

/* two-column compare */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
@media (max-width: 620px) { .pair { grid-template-columns: 1fr; } }
.pair > div {
  background: var(--surface); border: 1px solid var(--line); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.pair .when {
  font-family: var(--display); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.pair .when.hot { color: var(--accent); }
.pair ul { margin: 0; padding-left: 18px; font-size: 15px; }
.pair li { margin-bottom: 4px; }

/* ---- Tables ------------------------------------------------------------- */

.scroller { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--display); font-weight: 500; font-size: 11px;
  letter-spacing: .11em; text-transform: uppercase; color: var(--faint);
  border-bottom-color: var(--line);
}
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---- Figures ------------------------------------------------------------ */

.figure { display: flex; flex-direction: column; gap: 3px; }
.figure .big {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(44px, 12vw, 80px); line-height: 1;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent);
}
.figure .label {
  font-family: var(--display); font-size: 13px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--muted);
}
.facts { display: flex; flex-wrap: wrap; gap: 4px 34px; border-top: 1px solid var(--line); padding-top: 14px; }
.facts div { display: flex; flex-direction: column; }
.facts .v { font-family: var(--display); font-weight: 500; font-size: 25px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.facts .k { font-size: 13px; color: var(--muted); }

/* ---- Status pills and verdicts ----------------------------------------- */

.pill {
  font-family: var(--display); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; white-space: nowrap; color: var(--faint);
}
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }

.verdict {
  font-family: var(--display); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; display: flex; align-items: center; gap: 8px;
}
.verdict .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--warn); }

.panel {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 10px;
}

/* ---- Code and buttons -------------------------------------------------- */

code { font-family: var(--mono); font-size: .92em; }
pre, .block {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  background: var(--surface); border: 1px solid var(--line);
  padding: 14px 16px; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap;
}
button {
  font-family: var(--display); font-weight: 500; font-size: 13px;
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink);
  border: 0; padding: 11px 18px; cursor: pointer; align-self: flex-start;
}
button:hover { filter: brightness(1.08); }
button.quiet { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

/* A link that is the next thing to do, dressed as a button. Used where a
   page's job is finished and the reader should be somewhere else. */
a.cta {
  display: inline-block;
  font-family: var(--display); font-weight: 500; font-size: 13px;
  letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
  padding: 13px 22px; margin-top: 4px;
}
a.cta:hover { filter: brightness(1.08); color: var(--accent-ink); }

/* ---- Footer ------------------------------------------------------------ */

footer.inner {
  border-top: 1px solid var(--line); padding-top: 22px; padding-bottom: 40px;
  font-size: 14px; color: var(--muted);
  display: flex; flex-direction: column; gap: 10px;
  max-width: var(--wrap); margin: 0 auto;
}
footer a { color: var(--muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
