:root {
  color-scheme: light dark;
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #18130c;
  --muted: rgba(24, 19, 12, 0.55);
  --faint: rgba(24, 19, 12, 0.35);
  --hairline: rgba(24, 19, 12, 0.1);
  --soft: rgba(24, 19, 12, 0.04);
  --accent: #06c;
  --err: #b22;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  --tint: color-mix(in srgb, var(--accent) 10%, transparent);
  --tint-strong: color-mix(in srgb, var(--accent) 18%, transparent);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120e;
    --surface: #1c1a16;
    --text: #e8e2d2;
    --muted: rgba(232, 226, 210, 0.6);
    --faint: rgba(232, 226, 210, 0.35);
    --hairline: rgba(232, 226, 210, 0.12);
    --soft: rgba(232, 226, 210, 0.05);
    --accent: #79b6ff;
    --err: #ff8a8a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}

body {
  font:
    15px / 1.7 ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-feature-settings: "cv11", "ss01";
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* Headings */
h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
h2.group {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 12px;
}

/* Brand lockup — horizontal on result pages, vertically stacked hero on the
   landing (overrides under body.home-empty). */
.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 28px;
}
.brand > svg {
  flex-shrink: 0;
  color: var(--text);
}
.brand-text {
  flex: 1;
  min-width: 0;
}
.brand-text h1 {
  margin: 0 0 4px;
}
.brand-text .sub {
  margin: 0;
}
.brand-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 120ms var(--ease);
}
.brand-link:hover {
  opacity: 0.7;
}

/* Text */
p {
  margin: 0 0 12px;
}
p.sub {
  color: var(--muted);
  margin: 0 0 24px;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition:
    color 120ms var(--ease),
    text-decoration-thickness 120ms var(--ease);
}
a:hover {
  text-decoration-thickness: 2px;
}

kbd,
.mono,
pre,
dd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--soft);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}
pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

/* Search form — single rounded input with the submit chip inline-right.
   Modeled on Safari/macOS search fields. */
form {
  position: relative;
  margin: 0 0 16px;
}
input[type="text"] {
  width: 100%;
  padding: 16px 60px 16px 20px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 17px;
  line-height: 1.4;
  border-radius: var(--radius-lg);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 150ms var(--ease),
    box-shadow 150ms var(--ease);
}
input[type="text"]::placeholder {
  color: var(--faint);
}
input[type="text"]:hover {
  border-color: var(--faint);
}
input[type="text"]:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm), var(--focus);
}

form button[type="submit"] {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  transition:
    filter 120ms var(--ease),
    transform 80ms var(--ease),
    box-shadow 150ms var(--ease);
}
form button[type="submit"]:hover {
  filter: brightness(1.08);
}
form button[type="submit"]:active {
  transform: translateY(-50%) scale(0.94);
}
form button[type="submit"]:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}

/* Example chips — rounded pills with accent hover */
.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  font-size: 13px;
}
.examples .label {
  color: var(--faint);
  margin-right: 2px;
}
.examples .chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  transition:
    background 120ms var(--ease),
    border-color 120ms var(--ease),
    color 120ms var(--ease),
    transform 80ms var(--ease);
}
.examples .chip:hover {
  background: var(--tint);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
}
.examples .chip:active {
  transform: scale(0.96);
}

.stats-panel {
  max-width: 640px;
  margin: 30px auto 0;
}
.stats-topline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 0 2px 10px;
  color: var(--muted);
  font-size: 12px;
}
.stats-topline span {
  color: var(--text);
  font-weight: 650;
}
.stats-topline time {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: right;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.stat-cell {
  display: block;
  min-width: 0;
  min-height: 96px;
  padding: 15px 14px 13px;
  background: color-mix(in srgb, var(--surface) 94%, var(--bg));
  color: inherit;
  text-decoration: none;
  transition:
    background 120ms var(--ease),
    color 120ms var(--ease);
}
.stat-cell:hover {
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
.stat-cell:focus-visible {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--accent);
  outline: none;
}
.stat-value {
  font-size: 23px;
  line-height: 1.1;
  font-weight: 720;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  margin-top: 8px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}
.stat-note {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty home state — hero centering + bigger type */
body.home-empty main {
  padding-top: 9vh;
}
body.home-empty .brand {
  flex-direction: column;
  text-align: center;
  gap: 18px;
  margin-bottom: 36px;
}
body.home-empty .brand-text h1 {
  font-size: 38px;
  letter-spacing: -0.025em;
}
body.home-empty .brand-text .sub {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  font-size: 16px;
}
body.home-empty form {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
body.home-empty input[type="text"] {
  font-size: 18px;
  padding: 18px 68px 18px 22px;
}
body.home-empty form button[type="submit"] {
  width: 44px;
  height: 44px;
  right: 8px;
}
body.home-empty .examples {
  justify-content: center;
}

@media (max-width: 620px) {
  .stats-panel {
    margin-top: 24px;
  }
  .stats-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
  .stats-topline time {
    text-align: left;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-cell {
    min-height: 86px;
  }
}

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

/* Result section — each group is a card */
.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.card-error {
  background: color-mix(in srgb, var(--err) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--err) 25%, var(--hairline));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.err {
  color: var(--err);
}
.card-error .err {
  margin: 0;
}
/* The <form> wraps the button; collapse it so the button itself is the flex
   item that `align-items: center` aligns against the message (otherwise the
   form's line-box inflates the row height and floats the button to the top). */
.card-error form {
  margin: 0;
  display: flex;
  align-items: center;
}
/* Scoped to beat the global `form button[type="submit"]` search-icon rule
   (which is absolutely-positioned, 40x40, accent-filled). */
.card-error .refresh-btn {
  position: static;
  transform: none;
  flex: none;
  width: auto;
  height: auto;
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  /* After `font` (its shorthand resets line-height) so the button hugs its label. */
  line-height: 1;
  color: var(--text);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--err) 30%, var(--hairline));
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
}
.card-error .refresh-btn:hover {
  filter: none;
  background: color-mix(in srgb, var(--err) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--err) 45%, var(--hairline));
}
.card-error .refresh-btn:active {
  transform: none;
}
.card-error .refresh-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: none;
}

dl {
  display: block;
  margin: 0;
  font-size: 14px;
}
.card dl {
  margin: 0 -10px;
}
dl .row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 20px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  transition: background 120ms var(--ease);
}
dl .row:hover {
  background: var(--tint);
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  word-break: break-word;
}
.dns-record-card {
  padding-bottom: 14px;
}
.dns-record-table-wrap {
  margin: 0 -8px -4px;
  overflow-x: auto;
}
.dns-records {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 12px;
}
.dns-records th,
.dns-records td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}
.dns-records th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.dns-records td {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.dns-records tr:last-child td {
  border-bottom: 0;
}
.dns-records tbody tr {
  transition: background 120ms var(--ease);
}
.dns-records tbody tr:hover {
  background: var(--tint);
}
.dns-records .dns-type {
  width: 72px;
  color: var(--text);
  font-weight: 650;
}
.dns-records .dns-name {
  width: 190px;
  color: var(--muted);
}
.dns-records .dns-ttl {
  width: 72px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dns-values {
  display: flex;
  min-width: 220px;
  flex-direction: column;
  gap: 3px;
}
pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--soft);
  border-radius: var(--radius-md);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.result-actions {
  margin: 4px 0 0;
  font-size: 13px;
  text-align: right;
}
.result-actions a {
  color: var(--muted);
}
.result-actions a:hover {
  color: var(--text);
}

/* Page footer */
footer {
  margin-top: 56px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
footer code {
  color: var(--faint);
  background: none;
  padding: 0;
}
footer .links {
  display: flex;
  gap: 16px;
}
footer .links a {
  color: var(--faint);
}
footer .links a:hover {
  color: var(--text);
}

/* Docs page */
.docs h2.group {
  margin-top: 40px;
}
.docs p {
  font-size: 14px;
}
.docs ul {
  padding-left: 18px;
  margin: 8px 0 12px;
}
.docs ul li {
  margin: 3px 0;
  font-size: 14px;
}
.docs ul li code {
  font-size: 13px;
}
.docs table {
  font-size: 13px;
  border-collapse: collapse;
  margin: 6px 0 4px;
  width: 100%;
}
.docs th,
.docs td {
  text-align: left;
  vertical-align: top;
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.docs tr:last-child td {
  border-bottom: 0;
}
.docs tbody tr {
  transition: background 120ms var(--ease);
}
.docs tbody tr:hover {
  background: var(--tint);
}
.docs tbody tr:hover td {
  border-bottom-color: transparent;
}
.docs th {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding-bottom: 8px;
}
.docs td:first-child {
  white-space: nowrap;
  padding-right: 24px;
}
.docs td:first-child code {
  font-size: 12px;
}
.docs pre.example {
  font-size: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  margin: 10px 0 18px;
}

/* Stats detail */
body.stats-detail main {
  max-width: 1120px;
}
.stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -6px 0 34px;
}
.stats-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.stats-tabs a:hover,
.stats-tabs a.active {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--hairline));
  background: var(--tint);
  color: var(--text);
}
.stats-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.stats-detail-head h2 {
  margin: 0 0 5px;
  font-size: 24px;
  line-height: 1.2;
}
.stats-detail-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.stats-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.stats-count span {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 720;
}
.stats-count small {
  display: block;
  color: var(--faint);
  font-size: 11px;
}
.stats-search {
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.stats-search input[type="search"],
.stats-search input[type="number"],
.stats-search input[type="date"],
.stats-search select {
  height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 13px;
  outline: none;
  box-shadow: var(--shadow-sm);
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color 150ms var(--ease),
    box-shadow 150ms var(--ease);
}
.stats-search input[name="q"] {
  flex: 1 1 240px;
  min-width: 220px;
}
.stats-search input[type="search"]:not([name="q"]),
.stats-search input[type="number"],
.stats-search input[type="date"],
.stats-search select {
  flex: 0 1 150px;
  min-width: 116px;
}
.stats-search select {
  cursor: pointer;
}
.stats-search input[type="search"]::placeholder {
  color: var(--faint);
}
.stats-search input[type="search"]:focus-visible,
.stats-search input[type="number"]:focus-visible,
.stats-search input[type="date"]:focus-visible,
.stats-search select:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm), var(--focus);
}
.stats-search button[type="submit"],
.stats-clear {
  position: static;
  transform: none;
  width: auto;
  height: 38px;
  min-width: 68px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  text-decoration: none;
}
.stats-search button[type="submit"]:active {
  transform: scale(0.97);
}
.stats-clear {
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--muted);
}
.stats-clear:hover {
  background: var(--tint);
  color: var(--text);
}
.table-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.stats-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.stats-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
}
.stats-table th,
.stats-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}
.stats-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.stats-table th a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}
.stats-table th a:hover {
  color: var(--text);
}
.sort-mark {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: lowercase;
}
.stats-table td {
  max-width: 360px;
  word-break: break-word;
}
.stats-table tr:last-child td {
  border-bottom: 0;
}
.stats-table tbody tr:hover {
  background: var(--tint);
}
.stats-table tbody tr.linked-row {
  cursor: pointer;
}
.stats-table tbody tr.linked-row td {
  padding: 0;
}
.stats-table .row-link {
  display: block;
  padding: 9px 12px;
  min-height: 100%;
  color: inherit;
  text-decoration: none;
}
.stats-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.stats-table .timestamp {
  white-space: nowrap;
}
.stats-table .timestamp time {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stats-table .changes {
  min-width: 280px;
  max-width: 520px;
  white-space: pre-wrap;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
}
.pager a:hover {
  background: var(--tint);
}

@media (max-width: 620px) {
  .stats-detail-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .stats-count {
    text-align: left;
  }
  .table-meta {
    flex-direction: column;
    gap: 2px;
  }
  .stats-search {
    flex-wrap: wrap;
  }
  .stats-search input[type="search"] {
    flex-basis: 100%;
  }
}

/* Global focus rings */
a:focus-visible {
  box-shadow: var(--focus);
  outline: none;
  border-radius: var(--radius-sm);
}

/* Selection */
::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Result reveal */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.fade-in {
  animation: rise-in 260ms var(--ease) both;
}
.result.fade-in > .card {
  animation: rise-in 260ms var(--ease) both;
}
.result.fade-in > .card:nth-child(2) {
  animation-delay: 40ms;
}
.result.fade-in > .card:nth-child(3) {
  animation-delay: 70ms;
}
.result.fade-in > .card:nth-child(4) {
  animation-delay: 100ms;
}
.result.fade-in > .card:nth-child(5) {
  animation-delay: 130ms;
}
.result.fade-in > .card:nth-child(n + 6) {
  animation-delay: 160ms;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: accessibility reset must beat all other animations */
    animation-duration: 1ms !important;
    /* biome-ignore lint/complexity/noImportantStyles: accessibility reset must beat all other transitions */
    transition-duration: 1ms !important;
  }
}
