/* honeyprompt — LLMjacking live dashboard
   Warm stone/charcoal palette (vulnify-family base, own amber/ember accent).
   Vanilla CSS, no external resources. System monospace — no Google Fonts. */

:root {
  /* warm charcoal/stone base (vulnify family) */
  --bg: #0c0a09;            /* warm near-black */
  --bg-2: #141210;          /* secondary surface */
  --bg-panel: rgba(28, 25, 23, 0.66);  /* #1c1917 @ alpha — glassy warm panel */
  --bg-panel-solid: #1c1917;
  --bg-elevated: #292524;
  --border: #44403c;        /* warm border */
  --border-soft: #292524;
  --border-bright: #57534e;

  /* accent: amber/ember — the honeypot's own identity (distinct from vulnify's orange).
     "embers glowing in the dark; red = danger." */
  --accent: #fbbf24;        /* warm amber — primary accent (headings, text, badges) */
  --accent-dim: #d99e1a;    /* deeper amber for borders */
  --ember: #f59e0b;         /* secondary ember tone */

  /* data/bars: amber fill (the accent doing real work) on a DARK inset track. The
     separation comes from VALUE contrast — bright amber against a near-black track —
     not from hue. This is what fixes the "blend": the empty track is visibly dark, so
     each bar's length reads unambiguously. */
  --data: #fbbf24;
  --data-dim: #f59e0b;
  --track: #0a0807;        /* near-black inset track (darker than panel) */

  /* severity (vulnify-aligned) */
  --sev-low: #22c55e;
  --sev-medium: #eab308;
  --sev-high: #ef4444;
  --sev-crit: #dc2626;

  /* warm text ramp (vulnify) */
  --text: #fafaf9;
  --text-dim: #a8a29e;
  --text-faint: #78716c;
  --text-ghost: #57534e;

  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;

  --sp-xs: 4px; --sp-sm: 8px; --sp-md: 16px; --sp-lg: 24px; --sp-xl: 32px;
  --radius: 8px;
  --t-fast: 150ms; --t-normal: 250ms;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 15% 8%, rgba(245, 158, 11, 0.06), transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(124, 45, 18, 0.10), transparent 46%);
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #1c1917; padding: var(--sp-sm) var(--sp-md);
}
.skip-link:focus { left: var(--sp-sm); }

/* ---- layout ---- */
.wrap { max-width: 1320px; margin: 0 auto; padding: var(--sp-lg) var(--sp-md); }

header.masthead {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-md);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--sp-md); margin-bottom: var(--sp-lg);
}
.brand { display: flex; align-items: center; gap: var(--sp-sm); }
.brand-logo { width: 2.4em; height: 2.4em; flex: none; display: block; border-radius: 22%; }
.brand-word {
  font-size: 1.5rem; font-weight: 700; letter-spacing: 0.04em;
  background: linear-gradient(92deg, var(--ember), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .dim { color: var(--text-faint); font-weight: 400; -webkit-text-fill-color: var(--text-faint); }
.tagline { color: var(--text-dim); font-size: 0.8rem; }

.masthead-right { display: flex; align-items: center; gap: var(--sp-md); flex-wrap: wrap; }

/* ---- top nav (view switch) ---- */
.topnav { display: flex; gap: var(--sp-sm); margin-top: var(--sp-sm); }
.navlink {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--radius); border: 1px solid transparent;
}
.navlink:hover { color: var(--text); text-decoration: none; border-color: var(--border); }
.navlink.active { color: var(--accent); border-color: var(--accent-dim); }

/* ---- live ticker ---- */
.ticker { display: flex; gap: var(--sp-md); align-items: center; }
.ticker-item { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.ticker-item .tk-label { color: var(--text-faint); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; }
.ticker-item .tk-val { color: var(--accent); font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ticker-item .tk-val.flash { animation: tkflash 600ms ease-out; }
@keyframes tkflash { 0% { color: #fde68a; text-shadow: 0 0 10px var(--ember); } 100% { color: var(--accent); text-shadow: none; } }

.source-badge {
  display: inline-flex; align-items: center; gap: var(--sp-xs);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: var(--sp-xs) var(--sp-sm); border-radius: var(--radius);
  border: 1px solid var(--border-bright);
}
.source-badge.synthetic { color: var(--text-faint); border-color: var(--border); }
.source-badge.live { color: var(--sev-low); border-color: rgba(34,197,94,0.5); }
.source-badge .dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.source-badge.live .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

/* ---- stat cards ---- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp-md); margin-bottom: var(--sp-lg);
}
.stat {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-md);
  backdrop-filter: blur(6px);
}
.stat .label { color: var(--text-dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-size: 1.8rem; font-weight: 700; margin-top: var(--sp-xs); }
.stat.accent-green .value { color: var(--sev-low); }
.stat.accent-cyan .value { color: var(--accent); }
.stat.accent-purple .value { color: var(--ember); }
.stat.accent-high .value { color: var(--sev-high); }

/* ---- panels ---- */
.panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-md);
  backdrop-filter: blur(6px); margin-bottom: var(--sp-lg);
}
.panel h2 {
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: var(--sp-md); font-weight: 600;
}
.panel h2 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
/* "see all →" link on home teaser boards (Most-wanted models, Top networks) — sends the
   reader to the full ranked list on leaderboards. Right-aligned, subdued until hover. */
.panel h2 .see-all {
  float: right; text-transform: none; letter-spacing: 0; font-weight: 500;
  font-size: 0.78rem; color: var(--text-faint); opacity: 0.85;
  transition: color 0.15s ease, opacity 0.15s ease;
}
.panel h2 .see-all:hover, .panel h2 .see-all:focus-visible { color: var(--accent); opacity: 1; }

/* prose / legal pages (disclaimer) — panel + content span the container like every
   other panel (no inner width cap; only .wrap bounds the page at 1320px). */
.doc { line-height: 1.6; }
.doc h2 { margin-top: var(--sp-lg); }
.doc h2:first-child { margin-top: 0; }
.doc p { margin-bottom: var(--sp-md); color: var(--text); }
.doc ul { margin: 0 0 var(--sp-md) 1.2em; }
.doc li { margin-bottom: var(--sp-sm); }
.doc .muted { font-size: 0.85rem; }

.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--sp-lg); }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }


/* ---- feed ---- */
.feed { display: flex; flex-direction: column; gap: 1px; max-height: 560px; overflow-y: auto; }
.feed-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: var(--sp-sm); align-items: center;
  padding: var(--sp-sm); border-left: 3px solid var(--text-faint);
  background: rgba(250,250,249,0.012);
}
/* new-row flash as events arrive (suppressed on first render) */
.feed-row.is-new { animation: rowFlash 1.1s ease-out; }
@keyframes rowFlash {
  0% { background: rgba(251, 191, 36, 0.18); }
  100% { background: rgba(250, 250, 249, 0.012); }
}

/* empty state — shown at go-live before the first attack lands */
.feed-empty { padding: var(--sp-xl) var(--sp-md); text-align: center; }
.feed-empty .fe-title { color: var(--accent); font-size: 1rem; margin-bottom: var(--sp-xs); }
.feed-empty .fe-sub { color: var(--text-dim); font-size: 0.82rem; }

.feed-row.sev-low { border-left-color: var(--sev-low); }
.feed-row.sev-medium { border-left-color: var(--sev-medium); }
.feed-row.sev-high { border-left-color: var(--sev-high); background: rgba(239,68,68,0.06); }
.feed-row .time { color: var(--text-faint); font-size: 0.7rem; }
.feed-row .rep-count {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent); font-weight: 700;
  font-size: 0.66rem; line-height: 1.5; white-space: nowrap;
}
.feed-row .who { min-width: 0; }
.feed-row .ip { color: var(--text); font-weight: 600; }
.feed-row .org { color: var(--text-dim); font-size: 0.72rem; }
.feed-row .payload {
  color: var(--text-dim); font-size: 0.74rem; margin-top: 2px;
  overflow-wrap: anywhere; word-break: break-word;
}
.feed-row .verdict {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px var(--sp-sm); border-radius: 4px; white-space: nowrap;
  border: 1px solid var(--border);
}
.v-llmjacking_recon { color: var(--accent); }
.v-llmjacking_abuse { color: var(--sev-high); border-color: rgba(239,68,68,0.4); }
.v-ssrf_attempt { color: var(--sev-medium); }
.v-mcp_exfil_attempt { color: var(--ember); border-color: rgba(245,158,11,0.4); }
.v-scanner { color: var(--text-dim); }
.tag-ssrf { color: var(--sev-medium); font-size: 0.7rem; }
.flag { font-size: 0.72rem; color: var(--text-dim); }

/* ---- breakdown lists: label row + distinct progress-bar track ---- */
.bar-list { display: flex; flex-direction: column; gap: var(--sp-sm); }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-sm); align-items: center; }
.bar-row .bl { display: flex; align-items: center; gap: var(--sp-sm); min-width: 0; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .cnt { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
/* dark inset track — the visible darkness is what gives the fill a crisp edge */
.bar-track {
  grid-column: 1 / -1; height: 7px; background: var(--track);
  border: 1px solid var(--border-soft); border-radius: 4px; overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: 3px;
  /* muted amber — deeper/less saturated than the accent so bars are calm, not glowing */
  background: linear-gradient(90deg, #9a6a12, #c08a2a);
  box-shadow: 0 0 4px rgba(192, 138, 42, 0.25);  /* soft glow, toned down */
}

/* ---- leaderboard grid: short-label boards flow 2–3 per row ---- */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}
.board .empty, .bar-list .empty { color: var(--text-faint); font-size: 0.74rem; }

.board-intro { font-size: 0.8rem; margin-bottom: var(--sp-md); }
.board-section { margin-bottom: 0; }            /* grid/stack gap handles spacing */
.board-section h2 { color: var(--accent); }
.board-section .bar-list { gap: var(--sp-sm); }

/* long-label boards: full width, stacked, with spacing */
.board-wide { margin-bottom: var(--sp-lg); }
.board-wide:last-child { margin-bottom: 0; }

/* ---- filter chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-sm); margin-bottom: var(--sp-md); }
.chip {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim); background: rgba(250,250,249,0.025);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-xs) var(--sp-sm); cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.chip:hover { color: var(--text); border-color: var(--border-bright); }
.chip.active { color: #1c1917; background: var(--accent); border-color: var(--accent); font-weight: 600; }

/* ==== P3 panels ==== */
/* responsive panel grids (funnel+timeline = 2-up; promoted boards = 3-up) */
.panel-grid { display: grid; gap: var(--sp-lg); margin-bottom: var(--sp-lg); }
.panel-grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.panel-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.panel-grid .panel { margin-bottom: 0; }
.panel-sub { font-size: 0.74rem; margin: -2px 0 var(--sp-md); }

/* the promoted boards use id containers with class="board" — make it a bar column */
.board { display: flex; flex-direction: column; gap: var(--sp-sm); }

/* escalation funnel — labelled bars, tier-tinted, widthed vs the largest stage */
.funnel { display: flex; flex-direction: column; gap: var(--sp-sm); }
.funnel-row {
  display: grid; grid-template-columns: 96px 1fr auto; gap: var(--sp-sm);
  align-items: center;
}
.funnel-label { font-size: 0.78rem; color: var(--text-dim); white-space: nowrap; }
.funnel-cnt { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.funnel-track { height: 14px; background: var(--track); border: 1px solid var(--border-soft); border-radius: 4px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 3px; background: var(--tier); transition: width var(--t-fast); }
/* tier ramp: cool (noise) -> hot (RCE). --tier drives each row's fill. */
.funnel-row.tier-scan        { --tier: #3f6b8c; }   /* muted blue — background scan */
.funnel-row.tier-fingerprint { --tier: #4f8cc0; }   /* brighter blue — probing */
.funnel-row.tier-cred        { --tier: var(--sev-medium); }
.funnel-row.tier-abuse       { --tier: var(--ember); }
.funnel-row.tier-exfil       { --tier: #f97316; }   /* orange — exfil */
.funnel-row.tier-rce         { --tier: var(--sev-high); } /* red — top tier */

/* ---- most-wanted models: a ranked chart (our signature dataset, its own visual) ---- */
.model-chart { display: flex; flex-direction: column; gap: var(--sp-sm); }
.mc-row {
  padding: var(--sp-sm); border: 1px solid var(--border-soft); border-radius: 6px;
  background: var(--track); transition: border-color var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
.mc-head { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-sm); align-items: baseline; }
.mc-rank { font-size: 0.72rem; font-weight: 700; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.mc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.mc-cnt  { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.mc-track { margin-top: 6px; height: 8px; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 4px; overflow: hidden; }
.mc-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #9a6a12, #c08a2a);
  transition: width var(--t-fast), filter var(--t-fast);
}
/* the top three leaders read hotter so the podium is obvious at a glance */
.mc-row.mc-top .mc-rank { color: var(--accent); }
.mc-row.mc-top .mc-fill { background: linear-gradient(90deg, #b97a14, var(--accent)); }

/* ---- "alive" interactions: hover highlights across the data objects (pure CSS, no JS, ---- */
/* ---- CSP-safe). Calm by default, responsive on hover; disabled under reduced-motion.   ---- */
.mc-row:hover { border-color: var(--border-bright); transform: translateY(-1px); }
.mc-row:hover .mc-fill { filter: brightness(1.18); }
.bar-row:hover .name { color: var(--text); }
.bar-row:hover + .bar-track .bar-fill,
.bar-track:hover .bar-fill { filter: brightness(1.2); }
.funnel-row:hover .funnel-fill { filter: brightness(1.18); }
.funnel-row:hover .funnel-label { color: var(--text); }
.punch-cell { transition: outline-color var(--t-fast), transform var(--t-fast); outline: 1px solid transparent; }
.punch-cell:hover { outline-color: var(--accent); transform: scale(1.18); z-index: 1; }

/* verdict-mix timeline (stacked SVG) + legend */
#timeline { width: 100%; height: 120px; display: block; }
.tl-recon { fill: #3f6b8c; }
.tl-abuse { fill: var(--ember); }
.tl-exfil { fill: #f97316; }
.tl-rce   { fill: var(--sev-high); }
.tl-legend { display: flex; flex-wrap: wrap; gap: var(--sp-md); margin-top: var(--sp-sm); }
.tl-key { font-size: 0.7rem; color: var(--text-dim); display: inline-flex; align-items: center; gap: 5px; }
.tl-key::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--k); display: inline-block; }
.tl-k-recon { --k: #3f6b8c; }
.tl-k-abuse { --k: var(--ember); }
.tl-k-exfil { --k: #f97316; }
.tl-k-rce   { --k: var(--sev-high); }

/* ---- footer ---- */
footer.foot {
  border-top: 1px solid var(--border); margin-top: var(--sp-xl);
  padding-top: var(--sp-md); color: var(--text-faint); font-size: 0.74rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-sm);
}

.muted { color: var(--text-faint); }
.err { color: var(--sev-high); padding: var(--sp-md); }

/* ============================================================================
   INVERTED-PYRAMID REDESIGN — glance zone (hero stats, models, intent) above the
   fold; explorer zone (map, feed, punchcard) below. See index.html structure.
   ============================================================================ */

/* hero stats: behavioral-first 5-up. Cap at 5 columns so cards stay roomy. */
.hero-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (min-width: 880px) { .hero-stats { grid-template-columns: repeat(5, 1fr); } }

/* intent bar: single stacked bar, segments colored by category class */
.intent-bar {
  display: flex; height: 16px; border-radius: 5px; overflow: hidden;
  background: var(--track); border: 1px solid var(--border-soft);
}
.intent-seg { height: 100%; transition: width 240ms ease; }
.intent-seg.i-enum  { background: var(--sev-low); }     /* enumeration = green (noise floor) */
.intent-seg.i-abuse { background: var(--accent); }      /* inference abuse = amber */
.intent-seg.i-exfil { background: var(--ember); }       /* exfil/secret theft = ember */
.intent-seg.i-rce   { background: var(--sev-high); }    /* rce/ssrf = red (deepest) */
.intent-legend { display: flex; flex-wrap: wrap; gap: var(--sp-md); margin-top: var(--sp-md); }
.intent-key { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--text-dim); }
.intent-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.intent-key.i-enum  .intent-swatch { background: var(--sev-low); }
.intent-key.i-abuse .intent-swatch { background: var(--accent); }
.intent-key.i-exfil .intent-swatch { background: var(--ember); }
.intent-key.i-rce   .intent-swatch { background: var(--sev-high); }

/* punchcard panel: flex column so the heatmap fills the panel height (matched to the taller
   neighbour in the row), no dead space below the grid. */
.punch-panel { display: flex; flex-direction: column; }
/* punchcard: weekday label column + a 24-cell hour row per weekday. Cells STRETCH to fill the
   panel WIDTH (no square aspect-ratio), and the 7 rows share the available HEIGHT (1fr each)
   so the grid grows to fill the panel — full heatmap block, no gaps. Cell --v (0..1) drives
   opacity of an amber overlay on the dark track. Set via DOM style API (CSP-safe). */
.punchcard {
  display: grid; grid-template-columns: auto 1fr; gap: 5px 8px; align-items: stretch;
  grid-auto-rows: 1fr; flex: 1; min-height: 150px;
}
.punch-day { font-size: 0.66rem; color: var(--text-faint); text-align: right; padding-right: 2px; align-self: center; }
.punch-row { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; }
.punch-cell {
  border-radius: 3px; background: var(--track);
  position: relative; min-height: 14px;
}
.punch-cell::after {
  content: ""; position: absolute; inset: 0; border-radius: 3px;
  background: var(--accent); opacity: var(--v, 0);
}
.punch-foot { margin-top: var(--sp-md); font-size: 0.7rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
