@font-face {
  font-family: "Source Serif 4";
  src: url(fonts/source-serif-4.woff2) format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url(fonts/source-serif-4-italic.woff2) format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url(fonts/plex-mono-400.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url(fonts/plex-mono-500.woff2) format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #fafaf8;
  --paper: #ffffff;
  --ink: #17171a;
  --grey: #6e6e73;
  --grey-2: #9d9da2;
  --rule: #e2e2de;
  --rule-strong: #c9c9c4;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --measure: 880px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  font-optical-sizing: auto;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

header.site, main, footer.site {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 28px;
  padding-bottom: 28px;
}
.brand {
  color: var(--ink);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
header.site nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
}
header.site nav a { color: var(--grey); }
header.site nav a[aria-current="page"] { color: var(--ink); }

main { padding-top: 48px; padding-bottom: 72px; }
html { scroll-behavior: smooth; }
section { padding-top: 24px; scroll-margin-top: 16px; }
section.first { padding-top: 0; }
section h2 { margin-top: 40px; }
.facts:first-of-type { margin-top: 20px; }

footer.site { padding-bottom: 40px; }
footer.site .foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--grey);
}

h1 {
  font-weight: 500;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
}
h2 {
  font-weight: 500;
  font-size: 24px;
  line-height: 1.3;
  margin: 56px 0 12px;
}
h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
  margin: 40px 0 10px;
}
p { margin: 0 0 16px; }
.lede { font-size: 20px; color: var(--ink); margin-bottom: 48px; }
.label, .mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--grey); }

/* ---------- Leaderboard ---------- */

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--grey);
}
.placeholder-flag {
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.controls { display: inline-flex; gap: 28px; flex-wrap: wrap; }
.switch { display: inline-flex; gap: 14px; }
.switch button {
  font: inherit;
  color: var(--grey-2);
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
}
.switch button:hover { color: var(--grey); }
.switch button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }


/* bar view */
.bars-wrap { border-top: 1px solid var(--ink); padding-top: 8px; }
.bars text { font-family: var(--mono); font-size: 12px; fill: var(--grey); }
.bars text.name { font-family: var(--serif); font-size: 15px; fill: var(--ink); }
.bars text.val { fill: var(--ink); }
.bars .whisker { stroke: var(--ink); stroke-width: 1; }
.bars .track { fill: var(--rule); opacity: 0.5; }
.bars .grid { stroke: var(--rule); stroke-width: 1; }
.bars .axis { stroke: var(--ink); stroke-width: 1; }
.chart-foot { margin: 8px 0 20px; font-family: var(--mono); font-size: 12px; color: var(--grey); }

.facts { list-style: none; padding: 0; margin: 40px 0 28px; border-top: 1px solid var(--rule); }
.facts li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.facts b { font-weight: 600; }
.small { font-size: 15px; }

/* ---------- Method ---------- */

table.excerpt { width: 100%; border-collapse: collapse; margin: 28px 0 8px; font-size: 15px; }
table.excerpt caption { text-align: left; font-family: var(--mono); font-size: 12px; color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
table.excerpt th, table.excerpt td { text-align: left; vertical-align: top; padding: 8px 0; border-bottom: 1px solid var(--rule); }
table.excerpt th { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--grey); width: 150px; padding-right: 16px; padding-top: 10px; }
table.excerpt .mono { font-size: 14px; }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  body { font-size: 17px; }
  header.site, main, footer.site { padding-left: 16px; padding-right: 16px; }
  header.site { padding-top: 20px; padding-bottom: 12px; }
  header.site nav { gap: 14px; }
  main { padding-top: 28px; }
  h1 { font-size: 30px; }
  .lede { font-size: 18px; margin-bottom: 32px; }
  table.excerpt th { width: 96px; }
}

/* ---------- Contact form ---------- */

.contact-form { display: grid; gap: 16px; margin-top: 28px; }
.contact-form label { display: grid; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--grey); }
.contact-form input, .contact-form textarea {
  font: inherit; font-family: var(--serif); font-size: 17px; color: var(--ink);
  background: transparent; border: none; border-bottom: 1px solid var(--rule-strong); border-radius: 0; padding: 6px 0;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-bottom-color: var(--accent); }
.contact-form button {
  justify-self: start; font-family: var(--mono); font-size: 13px; color: #fff; background: var(--accent);
  border: none; padding: 9px 18px; cursor: pointer;
}
.contact-form button:hover { opacity: 0.9; }
.contact-form button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.contact-form .small { margin: 0; }

/* ---------- Example ---------- */

.sheet { border-top: 1px solid var(--ink); margin-top: 8px; }
.sheet-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 12px; color: var(--grey); text-transform: uppercase; letter-spacing: 0.05em;
}
.sheet-head span:first-child { color: var(--ink); }
.sheet h3 { margin-top: 36px; }
.sheet-cond { font-size: 17px; }
.table-scroll { overflow-x: auto; }
table.spec { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 0; }
table.spec th {
  text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.05em; padding: 0 12px 8px 0; border-bottom: 1px solid var(--ink);
}
table.spec td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.spec td[rowspan] { padding-right: 20px; }
table.spec th.num { text-align: right; }
table.spec td.num { text-align: right; font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
table.spec tr.hl td:not([rowspan]) { color: var(--accent); }
table.spec td:last-child, table.spec th:last-child { padding-left: 8px; color: var(--grey); }

figure.wave { margin: 32px 0 0; }
.wave-svg { display: block; }
.wave-svg text { font-family: var(--mono); font-size: 11px; fill: var(--grey); }
.wave-svg .grid { stroke: var(--rule); stroke-width: 1; }
.wave-svg .axis { stroke: var(--ink); stroke-width: 1; }
.wave-svg .band { fill: var(--accent); opacity: 0.07; }
.wave-svg .thresh { stroke: var(--grey-2); stroke-width: 1; stroke-dasharray: 3 4; }
.wave-svg .thresh-label { fill: var(--grey); }
.wave-svg .trace { fill: none; stroke-width: 1.75; }
.wave-svg .drop { stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.7; }
.wave-svg .cold { stroke: #8a93a6; fill: #6b7385; }
.wave-svg .room { stroke: var(--accent); fill: var(--accent); }
.wave-svg .hot { stroke: #c4775a; fill: #b0664b; }
.wave-svg .trace.cold, .wave-svg .trace.room, .wave-svg .trace.hot { fill: none; }
.wave-svg .edge-time { fill: var(--ink); }
figure.wave figcaption { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--grey); }

dl.spec-list { display: grid; grid-template-columns: 150px 1fr; margin: 8px 0 0; border-top: 1px solid var(--ink); }
dl.spec-list dt, dl.spec-list dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--rule); }
dl.spec-list dt { font-family: var(--mono); font-size: 12px; color: var(--grey); padding-top: 13px; }

ol.steps { padding: 0; margin: 20px 0 24px; list-style: none; counter-reset: step; border-top: 1px solid var(--rule); }
ol.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; padding: 10px 0; border-bottom: 1px solid var(--rule); }
ol.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 13px; color: var(--accent); padding-top: 4px; }

@media (max-width: 640px) {
  dl.spec-list { grid-template-columns: 1fr; }
  dl.spec-list dt { border-bottom: none; padding-bottom: 0; }
  .wave-svg text { font-size: 10px; }
  table.spec { font-size: 14px; }
}
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-form button:disabled { opacity: 0.6; cursor: default; }
.contact-form.sent #form-note { color: var(--ink); }
