@font-face {
  font-family: "Roboto Mono";
  src: url("../fonts/Roboto_Mono/RobotoMono-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  src: url("../fonts/Roboto_Mono/RobotoMono-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark light;
  --bg: #0c0c0c;
  --ink: #e9e7e0;
  --ink-dim: #8f8d85;
  --rule: #e9e7e0;
  --rule-dim: #33312d;
  --accent: #ff4f1f;
  --mono:
    "Roboto Mono", ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f1efe9;
    --ink: #14130f;
    --ink-dim: #6b685f;
    --rule: #14130f;
    --rule-dim: #cfccc2;
    --accent: #d62e00;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 "Roboto Mono",
    ui-monospace,
    monospace;
}

.site-header,
.grid,
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* --- masthead --- */

.site-header {
  padding-top: 2.5rem;
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 4px solid var(--rule);
  padding-bottom: 0.75rem;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1;
}

.accent {
  color: var(--accent);
}

.home-link {
  text-decoration: none;
  color: inherit;
}

.report-time {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--ink-dim);
  align-self: flex-end;
}

.lede {
  margin: 0.75rem 0 0;
  max-width: 70ch;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-dim);
}

/* --- grid & cards --- */

.grid {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.75rem;
  /* Cards number themselves so optional ones (e.g. the IPv6 leak test when
     DUALSTACK_DOMAIN is unset) can be omitted without leaving a gap. Starts
     at -1 so the first card reads 00. */
  counter-reset: card -1;
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg);
  border: 2px solid var(--rule);
}

.card h2 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0;
  padding: 0.55rem 1rem;
  border-bottom: 2px solid var(--rule);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sec-num {
  color: var(--accent);
  font-family: var(--mono);
}

.sec-num::before {
  counter-increment: card;
  content: counter(card, decimal-leading-zero);
}

.card > dl,
.card > .hint,
.card > table {
  margin-left: 1rem;
  margin-right: 1rem;
}

.hint {
  margin-top: 0.7rem;
  margin-bottom: 0;
  font-size: 0.78rem;
  color: var(--ink-dim);
}

.card > dl,
.card > table {
  margin-bottom: 0.75rem;
}

dl {
  margin: 0.35rem 0 0;
}

dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--rule-dim);
}

dl > div:first-child {
  border-top: none;
}

dt {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  padding-top: 0.2em;
}

dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.88em;
  font-weight: 600;
}

.mono {
  font-family: var(--mono);
}
.big {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--accent);
}
.small {
  font-size: 0.74em;
  font-weight: 400;
}
.wrap {
  text-align: right;
  max-width: 22rem;
}
.unavailable {
  color: var(--ink-dim);
  font-weight: 400;
}

/* --- headers table --- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

#headers-table td {
  padding: 0.32rem 0.4rem 0.32rem 0;
  border-top: 1px solid var(--rule-dim);
  vertical-align: top;
  overflow-wrap: anywhere;
  font-family: var(--mono);
}

#headers-table tr:first-child td {
  border-top: none;
}

#headers-table td:first-child {
  color: var(--ink-dim);
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding-top: 0.45rem;
}

.tag,
.tag-demo {
  display: inline-block;
  border: 1px solid var(--ink-dim);
  color: var(--ink-dim);
  padding: 0 0.35em;
  font-size: 0.62rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

/* --- score card --- */

.span-all {
  grid-column: 1 / -1;
}

.score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  margin: 0.75rem 1rem;
}

.score-block {
  flex: 1 1 15rem;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 1.25rem;
  row-gap: 0.3rem;
}

.score-block h3 {
  grid-column: 2;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  order: -1;
}

.dial {
  --fill: 0;
  grid-row: 1 / span 2;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--fill) * 1%), var(--rule-dim) 0);
  display: grid;
  place-items: center;
}

.dial::before {
  content: "";
  grid-area: 1 / 1;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg);
}

.dial-val {
  grid-area: 1 / 1;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  padding: 0 0.4rem;
  overflow-wrap: anywhere;
}

.score-block dl {
  grid-column: 2;
  width: 100%;
  margin: 0;
}
.score-block .hint {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}

/* --- consistency checks --- */

.checks {
  margin: 0.6rem 1rem 0.85rem;
  padding-left: 1.1rem;
  font-size: 0.84rem;
  line-height: 1.5;
}

.checks li {
  padding: 0.15rem 0;
  color: var(--ink-dim);
}
.checks li::marker {
  color: var(--rule-dim);
}

.checks.flagged li {
  color: var(--ink);
}
.checks.flagged li::marker {
  color: var(--accent);
}

/* --- footer --- */

.site-footer {
  padding-bottom: 2.5rem;
  color: var(--ink-dim);
  font-size: 0.8rem;
}

.site-footer p:first-child {
  margin-top: 0;
  border-top: 4px solid var(--rule);
  padding-top: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  font-weight: 700;
}

.site-footer a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.site-footer a:hover {
  color: var(--ink);
}
