/* zerø — styles ---------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --font-mono:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans:'Inter', system-ui, -apple-system, sans-serif;

  --radius:10px;
  --radius-sm:7px;

  --danger-0:#22c55e;
  --danger-mid:#f5a524;
  --danger-hi:#f43f5e;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px -12px rgba(0,0,0,0.5);
}

/* theme accents */
body[data-theme="blue"]   { --accent:#4d9fff; --accent-dim:#4d9fff33; }
body[data-theme="green"]  { --accent:#22c55e; --accent-dim:#22c55e33; }
body[data-theme="violet"] { --accent:#a78bfa; --accent-dim:#a78bfa33; }
body[data-theme="amber"]  { --accent:#f5a524; --accent-dim:#f5a52433; }
body[data-theme="red"]    { --accent:#f43f5e; --accent-dim:#f43f5e33; }

/* dark mode (default) */
body[data-mode="dark"]{
  --bg:#0b0f18;
  --bg-elev:#111827;
  --card:#141b2b;
  --card-hover:#171f33;
  --border:#232c40;
  --border-soft:#1b2334;
  --text:#e7ebf3;
  --text-dim:#8a93a6;
  --text-faint:#5b6478;
  --row-alt: rgba(255,255,255,0.015);
}

/* light mode */
body[data-mode="light"]{
  --bg:#f5f6f9;
  --bg-elev:#ffffff;
  --card:#ffffff;
  --card-hover:#fbfbfd;
  --border:#e2e5ec;
  --border-soft:#eceef3;
  --text:#141821;
  --text-dim:#5a6377;
  --text-faint:#8d94a5;
  --row-alt: rgba(0,0,0,0.015);
}

*{ box-sizing:border-box; }

html,body{
  margin:0; padding:0;
  min-height:100vh;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-sans);
  text-transform:lowercase;
  transition:background .2s ease, color .2s ease;
}

::selection{ background:var(--accent-dim); color:var(--text); }

button, input{ font-family:inherit; text-transform:lowercase; }

/* thin ambient scan line across the very top of the page — signature detail */
.scan-line{
  position:fixed; top:0; left:0; right:0; height:2px;
  background:linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity:.5; z-index:50;
  animation:sweep 5s linear infinite;
}
@keyframes sweep{
  0%{ transform:translateX(-100%); }
  100%{ transform:translateX(100%); }
}
@media (prefers-reduced-motion: reduce){
  .scan-line{ animation:none; opacity:.15; }
}

/* topbar ------------------------------------------------------------ */
.topbar{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 28px;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border-soft);
}
.brand{ display:flex; align-items:center; gap:8px; font-family:var(--font-mono); }
.brand-mark{
  display:inline-flex; align-items:center; justify-content:center;
  width:26px; height:26px; border-radius:6px;
  background:var(--accent-dim); color:var(--accent);
  font-weight:700; font-size:14px;
}
.brand-name{ font-weight:700; font-size:16px; letter-spacing:.02em; color:var(--text); }
.slash{ color:var(--accent); }

.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:var(--radius-sm);
  background:transparent; border:1px solid var(--border);
  color:var(--text-dim); cursor:pointer;
  transition:.15s ease;
}
.icon-btn:hover{ color:var(--text); border-color:var(--accent); }

.settings-panel{
  position:absolute; top:60px; right:24px;
  width:260px;
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow-card);
  padding:16px; z-index:41;
  display:flex; flex-direction:column; gap:14px;
}
.settings-row{ display:flex; flex-direction:column; gap:8px; }
.settings-row-tight{ padding-top:6px; border-top:1px solid var(--border-soft); }
.settings-label{ font-size:11px; letter-spacing:.06em; color:var(--text-faint); font-family:var(--font-mono); }
.settings-hint{ font-size:12px; color:var(--text-faint); }

.mode-toggle{ display:flex; border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.mode-btn{
  flex:1; padding:7px 0; background:transparent; border:none; color:var(--text-dim);
  cursor:pointer; font-size:12px; transition:.15s ease;
}
.mode-btn + .mode-btn{ border-left:1px solid var(--border); }
.mode-btn.active{ background:var(--accent-dim); color:var(--accent); }

.theme-swatches{ display:flex; gap:8px; }
.swatch{
  width:22px; height:22px; border-radius:50%;
  background:var(--sw); border:2px solid transparent; cursor:pointer;
  transition:.15s ease;
}
.swatch.active{ border-color:var(--text); transform:scale(1.08); }

/* layout -------------------------------------------------------------*/
.wrap{ max-width:920px; margin:0 auto; padding:36px 24px 60px; }

.intro{ margin-bottom:28px; }
.intro h1{
  font-family:var(--font-mono); font-size:clamp(22px,3vw,28px);
  font-weight:600; margin:0 0 8px; letter-spacing:-.01em;
}
.intro p{ margin:0; color:var(--text-dim); font-size:14px; max-width:56ch; }

/* dropzone -------------------------------------------------------------*/
.dropzone{
  border:1.5px dashed var(--border);
  border-radius:var(--radius);
  background:var(--card);
  padding:36px 24px;
  text-align:center;
  margin-bottom:28px;
  transition:border-color .15s ease, background .15s ease;
}
.dropzone.drag-over{ border-color:var(--accent); background:var(--accent-dim); }
.dropzone-inner{ display:flex; flex-direction:column; align-items:center; gap:6px; color:var(--text-dim); }
.dropzone-inner svg{ color:var(--accent); margin-bottom:6px; }
.dropzone-title{ color:var(--text); font-weight:600; font-size:14px; margin:0; }
.dropzone-sub{ margin:2px 0; font-size:12px; color:var(--text-faint); }
.dropzone-btns{ display:flex; gap:10px; margin-top:10px; }

.btn{
  padding:9px 16px; border-radius:var(--radius-sm); font-size:13px; font-weight:600;
  cursor:pointer; border:1px solid transparent; transition:.15s ease;
}
.btn-primary{ background:var(--accent); color:#0b0f18; }
.btn-primary:hover{ filter:brightness(1.08); }
.btn-ghost{ background:transparent; border-color:var(--border); color:var(--text); }
.btn-ghost:hover{ border-color:var(--accent); color:var(--accent); }

/* stats ----------------------------------------------------------------*/
.stats-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; margin-bottom:24px; }
.stat-card{
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  padding:16px 18px; display:flex; flex-direction:column; gap:8px;
}
.stat-label{ font-family:var(--font-mono); font-size:11px; letter-spacing:.06em; color:var(--text-faint); }
.stat-value{ font-family:var(--font-mono); font-size:22px; font-weight:700; color:var(--accent); }
.stat-clean{ color:var(--danger-0); }
.stat-status{ display:flex; align-items:center; gap:8px; font-size:18px; color:var(--text); }
.status-dot{
  width:8px; height:8px; border-radius:50%; background:var(--text-faint); display:inline-block;
}
.status-dot.scanning{ background:var(--accent); box-shadow:0 0 0 0 var(--accent-dim); animation:pulse 1.2s ease-in-out infinite; }
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 var(--accent-dim); }
  70%{ box-shadow:0 0 0 8px transparent; }
  100%{ box-shadow:0 0 0 0 transparent; }
}

/* report -----------------------------------------------------------------*/
.report{
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  overflow:hidden;
}
.report-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 20px 12px;
}
.report-head h2{ margin:0; font-size:15px; font-weight:700; }
.queue-pill{
  font-family:var(--font-mono); font-size:11px; color:var(--accent);
  background:var(--accent-dim); padding:4px 10px; border-radius:999px;
}

.table-scroll{ overflow-x:auto; }
.report-table{ width:100%; border-collapse:collapse; font-size:13px; }
.report-table thead th{
  text-align:left; padding:10px 20px; font-family:var(--font-mono);
  font-size:11px; letter-spacing:.05em; color:var(--text-faint); font-weight:600;
  border-bottom:1px solid var(--border-soft);
  white-space:nowrap;
}
.report-table tbody td{
  padding:13px 20px; border-bottom:1px solid var(--border-soft);
  color:var(--text); vertical-align:middle;
}
.report-table tbody tr:nth-child(even){ background:var(--row-alt); }
.report-table tbody tr:last-child td{ border-bottom:none; }
.report-table tbody tr:hover{ background:var(--card-hover); }

.col-file{ width:26%; }
.col-tag{ width:14%; }
.col-danger{ width:22%; }

.empty-row td{ text-align:center; color:var(--text-faint); padding:34px 20px; }

.file-cell{ display:flex; flex-direction:column; gap:2px; min-width:160px; }
.file-name{ font-family:var(--font-mono); font-weight:600; font-size:12.5px; word-break:break-all; }
.file-path{ font-size:11px; color:var(--text-faint); word-break:break-all; }

.tag-pill{
  font-family:var(--font-mono); font-size:11.5px; font-weight:700; padding:4px 9px;
  border-radius:999px; display:inline-block; white-space:nowrap;
}
.tag-clean{ color:var(--danger-0); background:color-mix(in srgb, var(--danger-0) 15%, transparent); }
.tag-bad{ color:var(--danger-hi); background:color-mix(in srgb, var(--danger-hi) 15%, transparent); }
.tag-pending{ color:var(--text-faint); background:var(--border-soft); }

.danger-wrap{ display:flex; align-items:center; gap:8px; }
.danger-meter{ display:flex; gap:2px; }
.danger-seg{ width:6px; height:14px; border-radius:1px; background:var(--border); }
.danger-seg.on{ background:var(--seg-color, var(--accent)); }
.danger-num{ font-family:var(--font-mono); font-size:11.5px; color:var(--text-dim); min-width:30px; }

.analysis-cell{ color:var(--text-dim); max-width:340px; line-height:1.45; }

.row-scanning .file-name{ color:var(--accent); }
.spinner{
  width:12px; height:12px; border-radius:50%;
  border:2px solid var(--border); border-top-color:var(--accent);
  display:inline-block; animation:spin .7s linear infinite; margin-right:6px; vertical-align:-2px;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

.page-footer{ margin-top:26px; text-align:center; }
.page-footer p{ font-size:11.5px; color:var(--text-faint); margin:0; }

/* responsive ---------------------------------------------------------*/
@media (max-width:720px){
  .stats-grid{ grid-template-columns:1fr; }
  .wrap{ padding:24px 16px 44px; }
  .settings-panel{ right:12px; left:12px; width:auto; }
  .analysis-cell{ max-width:220px; }
}

/* focus visibility */
button:focus-visible, input:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px;
}
