/* tastydata — crawler honeypot. Immersive full-bleed globe with floating
   panels. Dark "Workers dev" theme; tokens lifted from the iss/live-data look. */

@font-face {
  font-family: "FT Kunst Grotesk";
  src: url("/fonts/KunstGrotesk-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "FT Kunst Grotesk";
  src: url("/fonts/KunstGrotesk-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Apercu Mono Pro";
  src: url("/fonts/ApercuMonoPro-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root,
html.dark {
  --accent-100: #ff5e1f;
  --accent-200: #ff7038;
  --bg-100: #151414;
  --fg-100: #f0e3de;
  --text-secondary: #9a9390;
  --text-subtle: #f0e3de55;
  --border-100: #f0e3de1f;
  --border-200: #f0e3de33;
  --green: #34d058;
  --red: #ff5b66;
  --cyan: #6fe0ff;
  --yellow: #ffcf5e;
  --panel: #0e0d0cd9;
  --font-sans: "FT Kunst Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Apercu Mono Pro", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--fg-100);
  background-color: var(--bg-100);
  background-image: radial-gradient(circle at 50% 35%, #221f1d 0%, #151414 55%, #0d0c0b 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
#root { height: 100vh; width: 100vw; }

/* ---------- globe stage (full-bleed) ---------- */
.stage { position: fixed; inset: 0; z-index: 0; }
.stage canvas { display: block; touch-action: none; }

/* graceful fallback when WebGL is unavailable */
.globe-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  color: var(--text-subtle); padding: 0 24px;
}
.globe-fallback svg { color: var(--accent-100); opacity: 0.7; }
.gf-title { margin: 4px 0 0; font-size: 15px; color: var(--text-secondary); font-weight: 500; }
.gf-sub { margin: 0; max-width: 360px; font-size: 12.5px; font-family: var(--font-mono); line-height: 1.5; }

/* newest-visitor ping ring (HTML, projected from 3D) */
.ping { position: absolute; top: 0; left: 0; pointer-events: none; will-change: transform; z-index: 1; }
.ping-ring,
.ping-dot {
  position: absolute; left: 0; top: 0; border-radius: 999px; transform: translate(-50%, -50%);
}
.ping-dot { width: 7px; height: 7px; background: var(--accent-200); box-shadow: 0 0 10px 2px #ff7038aa; }
.ping-ring {
  width: 10px; height: 10px; border: 2px solid var(--accent-200);
  animation: ping 1.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  0% { width: 8px; height: 8px; opacity: 0.9; }
  100% { width: 56px; height: 56px; opacity: 0; }
}

/* ---------- hover tooltip on a dot ---------- */
.dot-tip {
  transform: translateY(-150%);
  min-width: 168px; max-width: 260px;
  background: #0b0a09f2; border: 1px solid var(--border-200); border-radius: 10px;
  padding: 10px 12px; box-shadow: 0 14px 40px #000000aa;
  font-family: var(--font-mono); color: var(--fg-100);
  position: relative;
}
/* little pointer at the bottom, aimed at the dot */
.dot-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px; background: #0b0a09f2;
  border-right: 1px solid var(--border-200); border-bottom: 1px solid var(--border-200);
}
.dot-tip-head { display: flex; align-items: baseline; gap: 7px; font-size: 13px; font-weight: 500; }
.dot-tip-sym { flex-shrink: 0; }
.dot-tip.cat-verified .dot-tip-sym { color: var(--green); }
.dot-tip.cat-suspected .dot-tip-sym { color: var(--yellow); }
.dot-tip.cat-scraper .dot-tip-sym { color: var(--red); }
.dot-tip.cat-human .dot-tip-sym { color: var(--cyan); }
.dot-tip-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 6px; }
.dot-tip-meta { font-size: 11px; color: var(--text-secondary); }
.dot-tip-path { font-size: 11px; color: var(--cyan); margin-top: 3px; word-break: break-all; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 20px 24px; pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.brand-logo { color: var(--accent-100); flex-shrink: 0; }
.brand h1 { font-size: 20px; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.brand .sub { margin: 2px 0 0; font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono); }
.topbar-right { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.kpi-strip { display: flex; gap: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.kpi b { font-weight: 500; color: var(--fg-100); font-variant-numeric: tabular-nums; }
.kpi b.green { color: var(--green); }
.kpi b.red { color: var(--red); }
.kpi b.cyan { color: var(--cyan); }
.kpi-scope {
  font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-subtle); border: 1px solid var(--border-100); border-radius: 999px;
  padding: 1px 7px; align-self: center;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  padding: 5px 11px; border-radius: 999px;
  color: var(--green); background: #34d0581f; border: 1px solid #34d05840;
  backdrop-filter: blur(8px);
}
.live-pill .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
.live-pill.off { color: var(--text-subtle); background: #ffffff0a; border-color: var(--border-100); }
.live-pill.off .dot { animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- floating chart cards ---------- */
.chart-card {
  position: fixed; z-index: 10; width: 250px;
  background: var(--panel); border: 1px solid var(--border-100); border-radius: 12px;
  overflow: hidden; backdrop-filter: blur(10px); box-shadow: 0 14px 40px #00000055;
}
/* explicit slots so cards clear the topbar and never overlap */
.chart-tl { left: 24px; top: 96px; }   /* hits/min */
.chart-bl { left: 24px; top: 296px; }  /* bot vs human donut */
.chart-tr { right: 24px; top: 96px; }  /* top crawlers */

.chart-card-bar {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  background: #ffffff08; border-bottom: 1px solid var(--border-100);
}
.chart-prompt { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--accent-100); opacity: 0.85; }
.chart-title { font-family: var(--font-mono); font-size: 12px; color: var(--fg-100); flex: 1; }
.chart-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-subtle); }
.chart-card-body { padding: 6px 8px 2px; }

/* ---------- bottom dock (terminal + footer) ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 24px 16px; pointer-events: none;
}

/* status terminal */
.status-term {
  pointer-events: auto; width: min(620px, 70vw);
  background: #07080acc; border: 1px solid var(--border-100); border-radius: 12px;
  overflow: hidden; backdrop-filter: blur(10px); box-shadow: 0 14px 40px #00000066;
}
.status-term-bar {
  display: flex; align-items: center; gap: 9px; padding: 7px 12px;
  background: #ffffff08; border-bottom: 1px solid var(--border-100);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary);
}
.status-dots { display: inline-flex; gap: 5px; }
.status-dots i { width: 9px; height: 9px; border-radius: 999px; background: #ffffff1f; display: block; }
.status-dots i:first-child { background: #ff5f57; }
.status-dots i:nth-child(2) { background: #febc2e; }
.status-dots i:nth-child(3) { background: #28c840; }
.status-term-name { flex: 1; }
.status-term-count { color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.status-term-body { padding: 12px 14px; font-family: var(--font-mono); }
.status-line { font-size: 14px; color: var(--fg-100); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.status-prompt { color: var(--accent-100); }
.status-sym { width: 12px; text-align: center; flex-shrink: 0; }
.cat-verified .status-sym { color: var(--green); }
.cat-suspected .status-sym { color: var(--yellow); }
.cat-scraper .status-sym { color: var(--red); }
.cat-human .status-sym { color: var(--text-subtle); }
.status-caret {
  display: inline-block; width: 8px; height: 15px; background: var(--accent-100);
  transform: translateY(2px); margin-left: 2px;
}
.status-caret.blink { animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.status-meta {
  margin-top: 7px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary);
}
.status-tag {
  font-size: 10px; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--border-100); background: #ffffff0a;
}
.cat-verified .status-tag { color: var(--green); background: #34d0581a; border-color: #34d05840; }
.cat-suspected .status-tag { color: var(--yellow); background: #ffcf5e1a; border-color: #ffcf5e40; }
.cat-scraper .status-tag { color: var(--red); background: #ff5b661a; border-color: #ff5b6640; }
.status-tag.trap { color: var(--red); background: #ff5b661a; border-color: #ff5b6640; }
.status-tag.kind { color: var(--cyan); background: #6fe0ff14; border-color: #6fe0ff33; text-transform: uppercase; letter-spacing: 0.04em; }
.status-sep { opacity: 0.5; }

/* ---------- ApexCharts dark tweaks ---------- */
.apexcharts-tooltip {
  background: #211f1e !important; border: 1px solid var(--border-200) !important;
  color: var(--fg-100) !important; font-family: var(--font-mono) !important;
  box-shadow: 0 10px 30px #00000080 !important;
}
.apexcharts-tooltip-title { background: #191817 !important; border-bottom: 1px solid var(--border-100) !important; font-family: var(--font-mono) !important; }
.apexcharts-legend-text { color: var(--text-secondary) !important; font-family: var(--font-mono) !important; }

/* ---------- responsive: hide side charts on narrow screens ---------- */
@media (max-width: 900px) {
  .chart-card { display: none; }
  .status-term { width: 88vw; }
  .kpi-strip { display: none; }
}
