/* Quartz Digital Forensics — site styles
   One stylesheet for every page. Tokens first; change colors and type here only. */

:root {
  --ink: #14181C;          /* primary text, dark buttons */
  --ink-2: #454D54;        /* body copy */
  --ink-3: #545C63;        /* captions, labels (4.5:1 on paper) */
  --paper: #F4F4F1;        /* page background */
  --paper-2: #FBFBF9;      /* alternate section background */
  --rule: #D6D8D3;         /* hairlines */
  --accent: #2B47C9;       /* links, eyebrows, logo mark */
  --accent-hover: #1A2F8F;

  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max: 1200px;
  --gutter: 24px;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 10;
}
.skip-link:focus { left: 8px; color: var(--paper); }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  padding-top: 18px;
  padding-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 22px; height: 30px; stroke: var(--accent); }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 28px;
  font-size: 15px;
}
.nav a:not(.btn) {
  color: var(--ink);
  text-decoration: none;
  padding: 12px 0;
}
.nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 6px; }
.nav a[aria-current="page"] {
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 14px 24px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.25;
  text-decoration: none;
  text-align: center;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #2A3138; border-color: #2A3138; color: var(--paper); }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn--sm { padding: 11px 18px; font-size: 15px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Type ---------- */

sup { font-size: 0.7em; line-height: 0; vertical-align: super; letter-spacing: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.5;
}

.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.display {
  font-size: clamp(38px, 4.4vw, 60px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.h1 {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.h3 { font-size: 20px; font-weight: 600; line-height: 1.3; }

.lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 600px; }
.lede--lg { font-size: 20px; max-width: none; }
.body { font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.note { font-size: 15px; line-height: 1.6; color: var(--ink-3); max-width: 760px; }
.fine { font-size: 13px; color: var(--ink-3); }

/* ---------- Holding page ---------- */

.holding {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
}
.holding .wrap {
  padding-top: 56px;
  padding-bottom: 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px 80px;
}
.holding__intro { flex: 1 1 560px; min-width: 0; }
.holding__intro .display { margin-top: 20px; }
.holding__intro .lede { margin-top: 20px; }
.holding__intro .btn-row { margin-top: 28px; }

.holding__aside {
  flex: 1 1 340px;
  min-width: 0;
  border-top: 2px solid var(--ink);
  padding-top: 24px;
}

.facts { display: flex; flex-direction: column; gap: 22px; }
.facts dt { margin-bottom: 6px; }
.facts .name { font-size: 18px; font-weight: 500; }
.facts .bio { margin-top: 10px; font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 425px; }
.facts .email { font-size: 18px; overflow-wrap: anywhere; }

.affiliation {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
}
.affiliation p {
  flex: 1 1 260px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}
.seals {
  flex: 0 0 auto;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.seals img { width: 56px; height: 56px; object-fit: contain; }

/* ---------- Article (primer) ---------- */

.page-hero .wrap {
  padding-top: 80px;
  padding-bottom: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 48px 64px;
}
.page-hero__title { flex: 1 1 560px; min-width: 0; }
.page-hero__title .h1 { margin-top: 24px; }
.page-hero__title .meta { margin-top: 24px; font-size: 14px; font-style: italic; color: var(--ink-3); }
.page-hero .lede--lg { flex: 1 1 420px; min-width: 0; }

.section .wrap { padding-top: 88px; padding-bottom: 88px; }
.section--alt {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.section--alt + .section--alt { border-top: 0; }
.section .eyebrow + .h2 { margin-top: 16px; }
.section .h2 + .body,
.section .h2 + .lede { margin-top: 16px; max-width: 760px; }
.section-body { margin-top: 40px; }

.split .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 64px;
  align-items: flex-start;
}
.split__head { flex: 1 1 340px; min-width: 0; }
.split__body { flex: 1 1 520px; min-width: 0; }

/* Four-up cells joined by hairlines */
.cells {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.cell { background: var(--paper-2); padding: 28px; }
.cell .num { font-family: var(--mono); font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.cell .h3 { margin-bottom: 10px; }
.cell p:last-child { font-size: 15px; line-height: 1.6; color: var(--ink-2); }

/* Comparison table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}
.compare {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}
.compare th, .compare td {
  padding: 16px 20px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.compare thead th {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.compare thead th:first-child { width: 18%; }
.compare thead th.is-focus { color: var(--ink); }
.compare tbody th { font-weight: 600; }
.compare td { color: var(--ink-2); }
.compare td.is-focus { background: var(--paper); color: var(--ink); }

/* Two cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.card {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 32px;
  border-radius: var(--radius);
}
.card .h3 { margin-bottom: 20px; }
.card ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Glossary */
.terms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0 48px;
}
.terms > div { padding: 20px 0; border-top: 1px solid var(--rule); }
.terms dt { font-weight: 600; font-size: 17px; margin-bottom: 6px; }
.terms dd { font-size: 15px; line-height: 1.6; color: var(--ink-2); }

/* Rules list */
.rules > div { padding: 20px 0; border-top: 1px solid var(--rule); }
.rules > div:last-of-type { border-bottom: 1px solid var(--rule); }
.rules dt { font-family: var(--mono); font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.rules dd { color: var(--ink-2); }
.rules + .fine { margin-top: 16px; }

/* Author block */
.author .wrap { padding-top: 80px; padding-bottom: 80px; }
.author .h2 { font-size: clamp(26px, 2.8vw, 34px); margin: 16px 0; }
.author__contact { border-top: 2px solid var(--ink); padding-top: 20px; flex: 1 1 320px; }
.author__contact .label { margin-bottom: 6px; }
.author__contact a { font-size: 18px; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); }
.site-footer .wrap {
  padding-top: 28px;
  padding-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
}

/* ---------- 404 ---------- */

.notfound { flex: 1 0 auto; display: flex; align-items: center; }
.notfound .wrap { padding-top: 96px; padding-bottom: 96px; }
.notfound .h1 { margin: 20px 0; }

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  .holding .wrap, .page-hero .wrap { padding-top: 40px; padding-bottom: 40px; }
  .section .wrap { padding-top: 56px; padding-bottom: 56px; }
  .terms { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .card { padding: 24px; }
}

@media print {
  .site-header .nav, .btn-row, .skip-link { display: none; }
  body { background: #fff; }
}
