/* honeypot.uig.me. Base tokens match lab.uig.me; the data colors (--seq-*,
   --event) are the validated dataviz ramps, stepped separately for dark mode. */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5d646d;
  --border: #e3e4e6;
  --accent: #0b6bcb;
  --chip: #eef1f4;
  --code-bg: #f3f4f6;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --land: #eceef1;          /* no sessions */
  --seq-1: #b7d3f6;         /* 1-9 */
  --seq-2: #6da7ec;         /* 10-99 */
  --seq-3: #2a78d6;         /* 100-999 */
  --seq-4: #184f95;         /* 1000+ */
  --bar: #2a78d6;
  --event: #eb6834;
  --target: #1f2328;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111418;
    --surface: #181c21;
    --text: #e4e7eb;
    --muted: #9aa3ad;
    --border: #2b3139;
    --accent: #5aa9f5;
    --chip: #232931;
    --code-bg: #1f242b;
    --land: #262c34;
    --seq-1: #184f95;
    --seq-2: #256abf;
    --seq-3: #5598e7;
    --seq-4: #9ec5f4;
    --bar: #3987e5;
    --event: #d95926;
    --target: #e4e7eb;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111418; --surface: #181c21; --text: #e4e7eb; --muted: #9aa3ad; --border: #2b3139;
  --accent: #5aa9f5; --chip: #232931; --code-bg: #1f242b; --land: #262c34;
  --seq-1: #184f95; --seq-2: #256abf; --seq-3: #5598e7; --seq-4: #9ec5f4;
  --bar: #3987e5; --event: #d95926; --target: #e4e7eb;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-weight: 700; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; }
.site-header nav { display: flex; gap: 20px; }
.site-header nav a { color: var(--muted); }
.site-header nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 24px 0; color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--muted); }
.site-footer .credit { margin: 8px 0 0; }

main.wrap { padding-top: 32px; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; margin: 40px 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
.lead { color: var(--muted); max-width: 680px; margin: 0; }
.meta { color: var(--muted); font-size: 14px; margin: 0; }

.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 8px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 18px; min-width: 150px; flex: 1 1 150px; display: flex; flex-direction: column;
}
.stat .num { white-space: nowrap; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.map-card { margin-top: 24px; }
.map-card h2 { margin: 0; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }

.controls { display: flex; gap: 8px; align-items: center; }
.controls button {
  font: inherit; font-size: 14px; color: var(--text); background: var(--chip); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 12px; cursor: pointer; min-height: 32px;
}
.controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; }
.seg button { border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.seg button:last-child { border-radius: 0 6px 6px 0; }
.seg button[aria-checked="true"] { background: var(--surface); font-weight: 600; }

.progress { height: 3px; background: var(--chip); border-radius: 2px; margin: 12px 0; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--muted); }

.map-wrap { position: relative; }
#map { display: block; width: 100%; height: auto; }
#map .country { fill: var(--land); stroke: var(--surface); stroke-width: 0.5; }
#map .country:hover { stroke: var(--text); stroke-width: 1; }
#map .tiny { stroke: var(--text); stroke-width: 1; }
#map .arc { fill: none; stroke: var(--event); stroke-width: 1.5; stroke-linecap: round; }
#map .src { fill: var(--event); stroke: var(--surface); stroke-width: 2; }
#map .pulse { fill: none; stroke: var(--event); stroke-width: 1.5; }
#map .target { fill: var(--surface); stroke: var(--target); stroke-width: 2; }
#map .target-label { fill: var(--muted); font: 12px var(--font); }

.tooltip {
  position: absolute; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 13px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}
.tooltip b { font-variant-numeric: tabular-nums; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend-title { color: var(--text); }
.bins { display: inline-flex; gap: 2px; align-items: center; }
.bins span { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.bins i { display: block; width: 44px; height: 10px; border-radius: 2px; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.dot-src, .dot-target { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-src { background: var(--event); }
.dot-target { border: 2px solid var(--target); }

.feed-h { margin: 20px 0 6px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; font-size: 13px; min-height: 8em; }
.feed li {
  display: grid; grid-template-columns: 70px 150px 70px minmax(0, 1fr); gap: 10px;
  padding: 4px 0; border-top: 1px solid var(--border);
}
.feed li:first-child { border-top: 0; }
.feed .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.feed .where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .kind { color: var(--muted); }
.feed .what { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .empty { display: block; color: var(--muted); font-style: italic; }

#daily { display: block; width: 100%; height: 200px; }
#daily .bar { fill: var(--bar); }
#daily .bar:hover { opacity: 0.8; }
#daily .axis text { fill: var(--muted); font: 12px var(--font); }
#daily .axis line, #daily .axis path { stroke: var(--border); }
#daily .grid line { stroke: var(--border); stroke-dasharray: 2 3; }

.tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tables .wide { grid-column: 1 / -1; }
table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
td { padding: 3px 0; vertical-align: top; }
td.v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
td.n { width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
td.b { width: 30%; padding-left: 8px; }
td.b i { display: block; height: 8px; margin-top: 7px; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
table.mono td.v { font-family: var(--mono); font-size: 13px; }
.tables .meta { margin-bottom: 8px; }
td.none { color: var(--muted); font-style: italic; }

.about p { color: var(--muted); max-width: 720px; }

@media (max-width: 640px) {
  .tables { grid-template-columns: minmax(0, 1fr); }
  .feed li { grid-template-columns: 62px minmax(0, 1fr); }
  .feed .kind { display: none; }
  .feed .what { grid-column: 2; }
  .site-header .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 2px; }
  .site-header nav { gap: 16px; }
}

@media (forced-colors: active) {
  #map .arc, #map .pulse { stroke: CanvasText; }
  #map .src { fill: CanvasText; }
}
