/* Mimizu. A name goes down through the layers of the DNS like a worm through
   soil: the descent is drawn as one rail, a node per layer, coloured by what
   that layer's servers said. System fonts only, since the page is served by
   a program on this machine and may be used with no network but DNS. */

:root {
  --bg: #f5f4ef;
  --panel: #fffefb;
  --sunk: #eceae3;
  --ink: #1b1d20;
  --soft: #41464d;
  --muted: #6d737b;
  --rule: #d6d4cc;
  --rule-soft: #e6e4dd;
  --accent: #2f5d7c;
  --worm: #b0536b;
  --ok: #2a6e4f;
  --ok-bg: #e4f1ea;
  --said: #2f5d7c;
  --said-bg: #e3ecf3;
  --warn: #8a5b12;
  --warn-bg: #f6ecd8;
  --bad: #a23b2a;
  --bad-bg: #f7e3de;
  --info: #5c6470;
  --info-bg: #e9ebee;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --panel: #1b1e22;
    --sunk: #23272c;
    --ink: #e8e9e5;
    --soft: #c4c7c2;
    --muted: #8f969d;
    --rule: #353a41;
    --rule-soft: #2a2e34;
    --accent: #86b4d3;
    --worm: #e08aa0;
    --ok: #6cc3a0;
    --ok-bg: #1d3329;
    --said: #86b4d3;
    --said-bg: #1d2c38;
    --warn: #d9ad55;
    --warn-bg: #362c19;
    --bad: #ec8b78;
    --bad-bg: #3b221d;
    --info: #a6aeb7;
    --info-bg: #262a30;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
}
.shell { max-width: 64rem; margin: 0 auto; padding: 2.4rem clamp(1rem, 4vw, 2rem) 4rem; }
[hidden] { display: none !important; }
a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- masthead ---- */
.masthead h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}
.masthead h1::after {
  content: "";
  display: inline-block;
  width: 0.34em;
  height: 0.34em;
  margin-left: 0.18em;
  border-radius: 50%;
  background: var(--worm);
  vertical-align: 0.08em;
}
.lede { color: var(--soft); max-width: 40rem; margin: 0.7rem 0 0; font-size: 1.05rem; }

/* ---- the question ---- */
.ask {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-top: 2rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field-name { flex: 1 1 18rem; }
.field-type { flex: 0 1 17rem; }
.field-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.field input, .field select {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 0.6rem 0.7rem;
  width: 100%;
  min-width: 0;
}
.field input { font-family: var(--mono); font-size: 1rem; }
.go {
  flex: 0 0 auto;
  padding: 0.62rem 1.4rem;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: var(--panel);
  font-weight: 600;
  cursor: pointer;
}
.go:hover { filter: brightness(1.08); }
.go[aria-busy="true"] { opacity: 0.8; }
.examples { color: var(--muted); font-size: 0.92rem; margin: 0.8rem 0 0; }
.example {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.92em;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.status { min-height: 1.5em; color: var(--soft); margin: 1rem 0 0; }
.status.error { color: var(--bad); font-weight: 600; }

/* ---- the outcome ---- */
.summary {
  margin-top: 1.2rem;
  padding: 1.1rem 1.2rem 1.1rem 1.35rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--info);
  border-radius: 10px;
}
.summary.o-answered { border-left-color: var(--ok); }
.summary.o-nxdomain, .summary.o-nodata { border-left-color: var(--warn); }
.summary.o-stopped, .summary.o-error { border-left-color: var(--bad); }
.summary .outcome { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin: 0; }
.summary.o-answered .outcome { color: var(--ok); }
.summary.o-nxdomain .outcome, .summary.o-nodata .outcome { color: var(--warn); }
.summary.o-stopped .outcome, .summary.o-error .outcome { color: var(--bad); }
.summary .said { font-size: 1.15rem; margin: 0.25rem 0 0; }
.summary .meta { color: var(--muted); font-size: 0.88rem; margin: 0.6rem 0 0; }
.answer-list { list-style: none; margin: 0.7rem 0 0; padding: 0; }
.answer-list li {
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  background: var(--sunk);
  border-radius: 5px;
  margin-top: 0.3rem;
  overflow-wrap: anywhere;
}

/* ---- findings ---- */
.findings { margin-top: 1.4rem; }
.findings h2, .descent-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  margin: 0 0 0.3rem;
}
.finding-link {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink);
  text-decoration: none;
}
.finding-link:hover .finding-title { text-decoration: underline; }
.finding-where { color: var(--muted); font-size: 0.85rem; margin-left: auto; white-space: nowrap; }
.finding-note { color: var(--soft); font-size: 0.88rem; margin: 0; padding: 0.4rem 0; border-bottom: 1px solid var(--rule-soft); }
.finding-note b { color: var(--ink); font-weight: 600; }

.tip {
  margin-top: 0.8rem;
  padding: 0.75rem 0.95rem;
  border-radius: 8px;
  background: var(--info-bg);
  border-left: 4px solid var(--info);
  scroll-margin-top: 1rem;
}
.tip.lvl-problem { background: var(--bad-bg); border-left-color: var(--bad); }
.tip.lvl-warning { background: var(--warn-bg); border-left-color: var(--warn); }
.tip.lvl-hint { background: var(--said-bg); border-left-color: var(--said); }
.tip h3 { font-size: 1rem; margin: 0.1rem 0 0; }
.tip p { margin: 0.35rem 0 0; }
.tip .fix { margin-top: 0.5rem; }
.tip .fix b { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 0.35rem; }
.tip:target { outline: 2px solid var(--accent); }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.08rem 0.45rem;
  border-radius: 99px;
  border: 1px solid currentColor;
  white-space: nowrap;
  color: var(--info);
}
.badge.lvl-problem { color: var(--bad); }
.badge.lvl-warning { color: var(--warn); }
.badge.lvl-hint { color: var(--said); }

/* ---- the descent ---- */
.descent { list-style: none; margin: 1.6rem 0 0; padding: 0; position: relative; }
.layer {
  position: relative;
  padding: 0 0 1.6rem 2.2rem;
}
.layer::before {
  content: "";
  position: absolute;
  left: 0.62rem;
  top: 0.9rem;
  bottom: 0;
  border-left: 3px solid var(--worm);
  opacity: 0.35;
}
.layer:last-child::before { display: none; }
.node {
  position: absolute;
  left: 0.2rem;
  top: 0.55rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--panel);
  border: 3px solid var(--muted);
}
.layer.asking .node { border-style: dashed; animation: turn 1.4s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .layer.asking .node { animation: none; } }
.layer[data-verdict="referral"] .node,
.layer[data-verdict="answer"] .node,
.layer[data-verdict="alias"] .node { border-color: var(--ok); background: var(--ok); }
.layer[data-verdict="nxdomain"] .node,
.layer[data-verdict="nodata"] .node { border-color: var(--warn); background: var(--warn); }
.layer[data-verdict="stop"] .node { border-color: var(--bad); background: var(--bad); }

.layer-card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.8rem 1rem 0.9rem;
}
.layer-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.7rem; }
.zone { font-family: var(--mono); font-size: 1.2rem; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.role { color: var(--muted); font-size: 0.9rem; }
.via { color: var(--muted); font-size: 0.86rem; margin: 0.1rem 0 0; }

.servers { margin-top: 0.6rem; }
.servers > summary {
  cursor: pointer;
  color: var(--soft);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
}
.tally { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.chip {
  font-size: 0.75rem;
  padding: 0.05rem 0.45rem;
  border-radius: 99px;
  background: var(--sunk);
  color: var(--soft);
  white-space: nowrap;
}
.chip.k-good { background: var(--ok-bg); color: var(--ok); }
.chip.k-said { background: var(--said-bg); color: var(--said); }
.chip.k-lame { background: var(--warn-bg); color: var(--warn); }
.chip.k-bad { background: var(--bad-bg); color: var(--bad); }

.replies { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.reply { border-top: 1px solid var(--rule-soft); }
.reply > details > summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: 0.7rem minmax(8rem, 15rem) minmax(6rem, 10rem) 5.2rem 1fr;
  gap: 0.2rem 0.7rem;
  align-items: baseline;
  padding: 0.35rem 0.2rem;
  font-size: 0.9rem;
  list-style: none;
}
.reply > details > summary::-webkit-details-marker { display: none; }
.reply > details[open] > summary { background: var(--sunk); border-radius: 5px; }
.dot { width: 0.62rem; height: 0.62rem; border-radius: 50%; background: var(--muted); align-self: center; }
.k-good .dot { background: var(--ok); }
.k-said .dot { background: var(--said); }
.k-lame .dot { background: var(--warn); }
.k-bad .dot { background: var(--bad); }
.srv { font-family: var(--mono); overflow-wrap: anywhere; }
.ip { font-family: var(--mono); color: var(--soft); overflow-wrap: anywhere; }
.ms { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.what { color: var(--soft); overflow-wrap: anywhere; }
.k-bad .what, .k-lame .what { color: var(--ink); }
@media (max-width: 44rem) {
  .reply > details > summary { grid-template-columns: 0.7rem 1fr auto; }
  .reply .ip { grid-column: 2; }
  .reply .ms { grid-column: 3; grid-row: 1; }
  .reply .what { grid-column: 2 / 4; }
}

.records { padding: 0.4rem 0.2rem 0.8rem 1.4rem; }
.records h4 { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0.6rem 0 0.2rem; }
.records .notes { margin: 0.4rem 0 0; padding-left: 1.1rem; color: var(--soft); font-size: 0.88rem; }
.flags { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); margin: 0.2rem 0 0; }
.scroll { overflow-x: auto; }
table.rr { border-collapse: collapse; font-family: var(--mono); font-size: 0.8rem; width: 100%; }
table.rr td { padding: 0.12rem 0.8rem 0.12rem 0; vertical-align: top; border-bottom: 1px solid var(--rule-soft); }
table.rr td.data { overflow-wrap: anywhere; min-width: 12rem; }
table.rr td.ttl { color: var(--muted); text-align: right; }
table.rr td.type { font-weight: 600; }

.skipped { list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.86rem; color: var(--muted); }
.skipped li::before { content: "— "; }

.lookups, .aliases { margin: 0.5rem 0 0; padding: 0; list-style: none; font-size: 0.88rem; color: var(--soft); }
.lookups li, .aliases li { padding: 0.15rem 0; }
.lookups .failed { color: var(--bad); }

.verdict {
  margin: 0.7rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
  font-weight: 600;
}
.verdict:empty { display: none; }
.verdict.v-stop { color: var(--bad); }
.verdict.v-nxdomain, .verdict.v-nodata { color: var(--warn); }

.check { margin-top: 0.8rem; }
.check h4 { font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.3rem; }
table.checks { border-collapse: collapse; width: 100%; font-size: 0.84rem; }
table.checks th { text-align: left; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 0.8rem 0.3rem 0; border-bottom: 1px solid var(--rule); }
table.checks td { padding: 0.25rem 0.8rem 0.25rem 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
table.checks td.mono { overflow-wrap: anywhere; }
table.checks .no { color: var(--bad); font-weight: 600; }

.colophon { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.86rem; }
