/* ===== PentX — tech / cyber theme ===== */
:root {
  --bg:        #05060a;
  --bg-2:      #0a0d16;
  --fg:        #d6e2f0;
  --muted:     #6b7a90;
  --accent:    #17e6a1;   /* neon green */
  --accent-2:  #35a0ff;   /* electric blue */
  --danger:    #ff4d6d;
  --warn:      #ffcc55;
  --line:      rgba(120,160,220,0.10);
  --glow:      0 0 24px rgba(23,230,161,0.35);
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html, body { height: 100%; }

body {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #0e1424 0%, var(--bg) 60%);
  color: var(--fg);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- static backdrop (no per-frame work) ----------
 * A fixed grid that fades toward the edges. Painted once and composited —
 * no animation, so the GPU stays idle when nothing is happening.
 */
.grid-bg {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
}

/* scanline overlay removed — it was a full-screen extra compositing layer */

/* ---------- topbar ---------- */
.topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { color: var(--accent); font-size: 20px; text-shadow: var(--glow); }
.brand-name { font-weight: 700; letter-spacing: .5px; font-size: 18px; }
.brand-name .accent { color: var(--accent); }
.tag { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: var(--glow);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ---------- stage ---------- */
.stage {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  padding: 40px 20px 20px;
  gap: 34px;
  width: 100%;
}
.hero { text-align: center; max-width: 780px; width: 100%; }

.headline {
  font-size: clamp(38px, 7vw, 68px);
  font-weight: 800; letter-spacing: -1.5px; line-height: 1.02;
  margin-bottom: 16px;
}
.glitch {
  position: relative;
  background: linear-gradient(90deg, #fff 0%, var(--accent) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* animated glitch layers removed — the gradient headline stays, statically */
.glitch::before, .glitch::after { display: none; }

.subhead {
  color: var(--muted); font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6; max-width: 620px; margin: 0 auto 34px;
}

/* ---------- search / form ---------- */
.search { width: 100%; max-width: 680px; margin: 0 auto; }
.search-shell {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box,
              linear-gradient(90deg, var(--accent), var(--accent-2)) border-box;
  border: 1.5px solid transparent;
  border-radius: 16px;
  padding: 6px 6px 6px 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.03);
  transition: box-shadow .25s, transform .25s;
}
.search-shell:focus-within {
  box-shadow: 0 10px 50px rgba(23,230,161,.25), var(--glow);
  transform: translateY(-1px);
}
.search-icon { color: var(--accent); font-size: 20px; }
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--fg); font-family: var(--mono); font-size: 16px;
  padding: 16px 4px;
}
.search-input::placeholder { color: #46536b; }
.mode {
  background: #0f1524; color: var(--fg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-family: var(--mono);
  font-size: 13px; cursor: pointer; outline: none;
}

.cta {
  position: relative; overflow: hidden;
  margin: 18px auto 0; display: block;
  border: none; cursor: pointer;
  padding: 15px 42px; border-radius: 14px;
  font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .5px;
  color: #04120c;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 30px rgba(23,230,161,.35);
  transition: transform .15s, box-shadow .25s, opacity .2s;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(23,230,161,.55); }
.cta:active { transform: translateY(0); }
.cta:disabled { opacity: .55; cursor: not-allowed; transform: none; }
/* button sheen: idle by default (no looping repaint), sweeps once on hover */
.cta-glow {
  position: absolute; top: 0; left: 0; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transform: translateX(-150%) skewX(-20deg);
}
.cta:hover .cta-glow { animation: sheen 0.9s ease; }
@keyframes sheen {
  from { transform: translateX(-150%) skewX(-20deg); }
  to   { transform: translateX(650%) skewX(-20deg); }
}

.hint { margin-top: 16px; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.hint.error { color: var(--danger); }

/* ---------- console ---------- */
.console-wrap {
  width: 100%; max-width: 820px;
  background: rgba(8,11,20,.94);   /* solid-ish instead of expensive backdrop blur */
  border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: rise .35s ease;
}
@keyframes rise { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform:none; } }
.console-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: #0b0f1a;
}
.console-title { font-family: var(--mono); font-size: 13px; color: var(--fg); display:flex; align-items:center; gap:8px; }
.blink { color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.target-chip {
  font-size: 12px; color: var(--accent-2);
  background: rgba(53,160,255,.1); border: 1px solid rgba(53,160,255,.3);
  padding: 2px 8px; border-radius: 6px;
}
.console-actions { display: flex; align-items: center; gap: 12px; }
.elapsed { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.ghost-btn {
  background: transparent; border: 1px solid var(--danger); color: var(--danger);
  font-family: var(--mono); font-size: 12px; padding: 5px 12px;
  border-radius: 8px; cursor: pointer; transition: background .2s;
}
.ghost-btn:hover { background: rgba(255,77,109,.12); }

.progress { height: 3px; background: #0d1220; }
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: var(--glow); transition: width .4s ease;
}

.console {
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  padding: 16px 18px; height: 340px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}
.console .ln { display: block; }
.console .t   { color: var(--muted); }
.console .ok  { color: var(--accent); }
.console .info{ color: var(--accent-2); }
.console .warn{ color: var(--warn); }
.console .crit{ color: var(--danger); font-weight: 700; }
.console .dim { color: #4a5877; }
.console::-webkit-scrollbar { width: 8px; }
.console::-webkit-scrollbar-thumb { background: #1c2740; border-radius: 8px; }

/* ---------- footer ---------- */
.footer {
  position: relative; z-index: 3;
  display: flex; gap: 10px; justify-content: center; align-items: center;
  padding: 18px; color: var(--muted); font-family: var(--mono); font-size: 12px;
}
.footer .sep { opacity: .5; }

/* ---------- nav ---------- */
.nav { display: flex; align-items: center; gap: 18px; }
.nav-link {
  color: var(--muted); text-decoration: none; font-family: var(--mono);
  font-size: 13px; transition: color .2s; position: relative; z-index: 4;
}
.nav-link:hover { color: var(--accent); }

/* ---------- report action buttons (under console) ---------- */
.report-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-top: 1px solid var(--line); background: #0b0f1a;
}
.report-btn {
  font-family: var(--mono); font-size: 13px; text-decoration: none;
  padding: 9px 18px; border-radius: 10px; color: #04120c;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform .15s, box-shadow .2s;
}
.report-btn:hover { transform: translateY(-1px); box-shadow: var(--glow); }
.report-btn.ghost {
  background: transparent; color: var(--accent);
  border: 1px solid rgba(23,230,161,.4);
}
.report-btn.ghost:hover { background: rgba(23,230,161,.1); box-shadow: none; }

/* ---------- report + history pages ---------- */
.report-page {
  position: relative; z-index: 2;
  width: 100%; max-width: 900px; margin: 0 auto; padding: 20px 22px 60px; flex: 1;
}
.report-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-bottom: 24px;
}
.report-head h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -.5px; }
.report-dl { display: flex; gap: 10px; }

.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.meta-grid > div {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
}
.meta-grid span { display: block; color: var(--muted); font-family: var(--mono); font-size: 11px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.meta-grid b { font-family: var(--mono); font-size: 14px; color: var(--fg); word-break: break-word; }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.stat {
  flex: 1; min-width: 130px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 18px;
  text-align: center;
}
.stat b { display: block; font-size: 34px; font-weight: 800; color: var(--accent); }
.stat span { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.stat.crit b { color: var(--danger); }
.stat.warn b { color: var(--warn); }

.report-section { margin-bottom: 30px; }
.report-section h2 {
  font-size: 16px; font-family: var(--mono); color: var(--accent-2);
  border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 14px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.port-chip {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  background: rgba(23,230,161,.08); border: 1px solid rgba(23,230,161,.3);
  padding: 6px 12px; border-radius: 8px;
}
.finding-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.finding-list li {
  font-family: var(--mono); font-size: 13px; padding: 10px 14px;
  border-radius: 8px; border-left: 3px solid;
}
.finding-list.warn li { background: rgba(255,204,85,.06); border-color: var(--warn); color: #e8d5a0; }
.finding-list.crit li { background: rgba(255,77,109,.08); border-color: var(--danger); color: #f5b5c1; }
.muted { color: var(--muted); font-family: var(--mono); font-size: 13px; }
a.accent { color: var(--accent); text-decoration: none; }

.console.static { height: auto; max-height: 460px; }

/* ---------- history table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.hist { width: 100%; border-collapse: collapse; min-width: 640px; }
table.hist th, table.hist td {
  text-align: left; padding: 12px 14px; font-size: 13px;
  border-bottom: 1px solid var(--line);
}
table.hist th {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); background: #0b0f1a;
}
table.hist tbody tr:hover { background: rgba(53,160,255,.05); }
table.hist td.mono, .mono { font-family: var(--mono); }
table.hist td.warn { color: var(--warn); }
table.hist td.crit { color: var(--danger); }
table.hist td.muted { color: var(--muted); }
.pill {
  font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 6px;
  border: 1px solid var(--line);
}
.pill-recon    { color: var(--accent-2); border-color: rgba(53,160,255,.4); }
.pill-standard { color: var(--accent);   border-color: rgba(23,230,161,.4); }
.pill-deep     { color: var(--warn);     border-color: rgba(255,204,85,.4); }
.mini-btn {
  font-family: var(--mono); font-size: 12px; text-decoration: none;
  color: var(--accent); padding: 3px 8px; border: 1px solid rgba(23,230,161,.3);
  border-radius: 6px; margin-right: 4px;
}
.mini-btn:hover { background: rgba(23,230,161,.1); }
.mini-btn.live { color: var(--warn); border-color: rgba(255,204,85,.5); }
.mini-btn.live:hover { background: rgba(255,204,85,.12); }

/* scan status labels */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.st-done     { color: var(--accent); }
.st-running,
.st-queued   { color: var(--warn); }
.st-aborted,
.st-stalled  { color: var(--muted); }
.st-failed   { color: var(--danger); }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn); box-shadow: 0 0 8px var(--warn);
  animation: pulse 1.4s ease-in-out infinite;
}

@media (max-width: 560px) {
  .search-shell { flex-wrap: wrap; }
  .mode { flex: 1; }
  .tag { display: none; }
  .console { height: 280px; }
  .nav { gap: 12px; }
  /* the animated glitch pseudo-layers are the priciest paint on small GPUs */
  .glitch::before, .glitch::after { display: none; }
}

/* Respect users who ask for less motion — disables every looping animation. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .grid-bg { animation: none; }
  .glitch::before, .glitch::after { display: none; }
}
