/* netcivic.com base stylesheet. Spec: Brand and Design.md in the vault. */

/* Self-hosted fonts. All three are SIL OFL. Files go in /assets/fonts/. */
@font-face { font-family: "Host Grotesk"; src: url("/assets/fonts/HostGrotesk-VF.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Libre Caslon Text"; src: url("/assets/fonts/LibreCaslonText-VF.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Libre Caslon Text"; src: url("/assets/fonts/LibreCaslonText-Italic-VF.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Archivo Narrow"; src: url("/assets/fonts/ArchivoNarrow-VF.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --page: #ffffff;
  --ink: #0e1525;
  --muted: #4b5563;
  --rule: #d1d5db;
  --purple: #7c5cbf;
  --marker: rgba(124, 92, 191, 0.2);

  --heading: "Host Grotesk", system-ui, sans-serif;
  --body: "Libre Caslon Text", Georgia, serif;
  --small: "Archivo Narrow", "Arial Narrow", sans-serif;

  --margin-col: 200px;
  --read-col: 660px;
  color-scheme: light;
}

[data-theme="dark"] {
  --page: #0e1525;
  --ink: #e6edf3;
  --muted: #9aa4b2;
  --rule: #2c3547;
  --purple: #a371f7;
  --marker: rgba(163, 113, 247, 0.34);
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.6;
}

a { color: var(--ink); text-decoration-color: var(--purple); text-underline-offset: 3px; }
a:hover { color: var(--purple); }
p { margin: 0; }
p + p { margin-top: 20px; }
img { max-width: 100%; height: auto; }
.only-dark { display: none; }
[data-theme="dark"] .only-light { display: none; }
[data-theme="dark"] .only-dark { display: unset; }

.page { max-width: 1040px; margin: 0 auto; padding: 40px 32px 56px; }

/* Header */
.site-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.site-logo { display: block; line-height: 0; }
.site-logo img { width: 250px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 28px; padding-bottom: 6px; font-family: var(--heading); font-size: 17px; font-weight: 500; }
.site-nav a { text-decoration: none; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.theme-toggle { appearance: none; border: none; background: none; color: var(--muted); cursor: pointer; padding: 4px; line-height: 0; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }

/* The stepped rule. Used once per page, under the header. Nowhere else. */
.step-rule { display: flex; margin-top: 28px; }
.step-rule::before { content: ""; width: 200px; height: 4px; background: var(--ink); }
.step-rule::after { content: ""; flex: 1; height: 4px; background: var(--ink); margin-top: 4px; }

/* Headings */
h1, h2, h3 { font-family: var(--heading); font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.1; letter-spacing: -0.02em; max-width: 16em; }
main { padding-top: 32px; }
.statement { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.14; letter-spacing: -0.015em; max-width: 21em; margin-top: 32px; }
h2 { font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
h3 { font-size: 21px; line-height: 1.3; }

/* Small text: dates, captions, labels, notes */
.small { font-family: var(--small); font-size: 17px; line-height: 1.4; color: var(--muted); }

/* A row is a margin column plus a reading column. Stacks on narrow screens. */
.row { display: flex; flex-wrap: wrap; gap: 16px 40px; margin-top: 56px; }
.row--ruled { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--ink); }
.row > .margin { flex: 0 0 var(--margin-col); padding-top: 5px; font-family: var(--small); font-size: 16px; font-weight: 500; letter-spacing: 0; line-height: 1.4; color: var(--muted); }
.row > .content { flex: 1 1 480px; min-width: 0; max-width: var(--read-col); }
.content > h2 + p, .content > h3 + p { margin-top: 14px; }

/* Home: the list of paths */
.paths { list-style: none; margin: 0; padding: 0; }
.paths li + li { border-top: 1px solid var(--rule); }
.paths a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; padding: 16px 0; text-decoration: none; }
.paths li:first-child a { padding-top: 0; }
.paths li:last-child a { padding-bottom: 0; }
.paths .path { flex: 0 0 120px; font-family: var(--heading); font-weight: 600; font-size: 22px; }
.paths .what { flex: 1 1 280px; }

/* Study stage line */
.stage { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 18px 0 0; padding: 12px 0 0; border-top: 1px solid var(--rule); font-family: var(--small); font-size: 17px; color: var(--muted); }
.stage .done { color: var(--ink); }
.stage [aria-current="step"] { color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stage [aria-current="step"]::before { content: ""; width: 10px; height: 10px; background: var(--purple); }

/* Study page */
.kicker { margin-top: 56px; font-family: var(--small); font-size: 17px; color: var(--muted); }
.kicker + h1 { margin-top: 10px; }
.finding { margin-top: 28px; font-size: 24px; line-height: 1.5; max-width: 30em; }
/* The marker. One sentence per study. Nothing else on the site is marked. */
mark { background: var(--marker); color: inherit; padding: 2px 4px; margin: 0 -4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.finding + .stage { margin-top: 36px; padding-top: 0; border-top: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 12px 48px; margin: 16px 0 0; padding: 16px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-family: var(--small); font-size: 17px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts .companion { margin-left: auto; align-self: center; font-family: var(--heading); font-weight: 600; }
figure { margin: 56px 0 0; }
figcaption { margin-top: 10px; font-family: var(--small); font-size: 16px; color: var(--muted); }
figcaption a { color: inherit; }

/* Footer */
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 96px; padding-top: 24px; border-top: 4px solid var(--ink); font-family: var(--small); font-size: 16px; color: var(--muted); }
.site-footer img { width: 120px; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 24px; margin: 0; padding: 0; }
.site-footer a { color: inherit; }

.notice { display: flex; align-items: baseline; gap: 8px; }
.notice svg { flex-shrink: 0; position: relative; top: 1px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
