:root {
  color-scheme: dark;
  --bg: #07090d;
  --bg-2: #0b0e14;
  --panel: #0f131a;
  --panel-2: #141924;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #e8edf4;
  --text-2: #b4bcc8;
  --muted: #7d8696;
  --accent: #3df5a7;
  --accent-2: #8b7bff;
  --accent-ink: #04140d;
  --glow: rgba(61, 245, 167, 0.18);

  /* status: reserved, always paired with icon + label */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --info: #3987e5;

  /* chart ink */
  --series: #3987e5;
  --series-hover: #5598e7;
  --grid: #222834;
  --axis: #383f4c;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
code, pre, .mono { font-family: var(--mono); }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: rgba(61, 245, 167, 0.3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- background ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.55;
}
.bg-spot {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px circle at var(--mx, 70%) var(--my, 10%), var(--glow), transparent 60%),
    radial-gradient(900px circle at 10% -10%, rgba(139, 123, 255, 0.14), transparent 60%);
  transition: background 0.2s;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(7, 9, 13, 0.7);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-family: var(--mono); font-size: 14px; font-weight: 800;
  box-shadow: 0 0 24px -4px var(--glow);
}
.brand small { color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 12px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-2); font-size: 14px; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } .brand small { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.28); transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 0 0 0 var(--glow), 0 10px 30px -10px rgba(61, 245, 167, 0.6);
}
.btn-primary:hover { box-shadow: 0 0 0 6px var(--glow), 0 10px 30px -10px rgba(61, 245, 167, 0.8); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-ghost { background: transparent; }
.btn svg { width: 16px; height: 16px; }

/* ---------- generic ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.section { padding: 110px 0; position: relative; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head .kicker { font-family: var(--mono); color: var(--accent); font-size: 13px; letter-spacing: 0.04em; }
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(30px, 4.4vw, 46px); margin-top: 10px; }
.lead { color: var(--text-2); font-size: 18px; margin-top: 16px; }
.grad {
  background: linear-gradient(90deg, var(--accent), #7cf3ff 45%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- status pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; border: 1px solid currentColor; white-space: nowrap;
  font-family: var(--mono);
}
.pill .ic { font-size: 11px; }
.s-good { color: #4fd44f; background: rgba(12, 163, 12, 0.12); }
.s-warning { color: var(--warning); background: rgba(250, 178, 25, 0.1); }
.s-serious { color: var(--serious); background: rgba(236, 131, 90, 0.1); }
.s-critical { color: #ff6b6b; background: rgba(208, 59, 59, 0.14); }
.s-info { color: #7db4f5; background: rgba(57, 135, 229, 0.12); }
.s-neutral { color: var(--text-2); background: rgba(255, 255, 255, 0.04); border-color: var(--line-2); }

/* ---------- pipeline ---------- */
.pipeline {
  display: grid; grid-template-columns: 1fr 1.15fr 1fr 1fr; gap: 34px; align-items: center;
  position: relative;
}
.pipe-col { display: grid; gap: 14px; position: relative; }
.pipe-col + .pipe-col::before {
  content: ""; position: absolute; left: -34px; top: 50%; width: 34px; height: 2px;
  background: var(--line-2);
}
.pipe-col.split::after {
  content: ""; position: absolute; left: -18px; top: 25%; bottom: 25%; width: 2px; background: var(--line-2);
}
.pipe-col.join::before { left: -34px; }
.pipe-col.split + .pipe-col::after {
  content: ""; position: absolute; left: -16px; top: -26px; bottom: -26px; width: 2px; background: var(--line-2);
  display: none;
}
.node {
  position: relative; padding: 14px 16px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line-2); transition: border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
  opacity: 0.55;
}
.node .n-top { display: flex; align-items: center; gap: 10px; }
.node .n-ic {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.05); font-size: 15px; flex: none;
}
.node .n-name { font-weight: 650; font-size: 14.5px; }
.node .n-sub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.node .n-state { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.node.running { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow), 0 0 40px -8px var(--accent); }
.node.running .n-state::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.node.done { opacity: 1; border-color: rgba(61, 245, 167, 0.45); }
.node.done .n-state { color: var(--accent); }
.node.skipped { opacity: 0.35; }
.node.scan::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(61, 245, 167, 0.12), transparent);
  background-size: 200% 100%; animation: scan 1.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scan { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 860px) {
  .pipeline { grid-template-columns: 1fr; gap: 22px; }
  .pipe-col + .pipe-col::before { left: 50%; top: -22px; width: 2px; height: 22px; }
  .pipe-col.split { grid-template-columns: 1fr 1fr; }
  .pipe-col.split::after { display: none; }
}
@media (max-width: 480px) { .pipe-col.split { grid-template-columns: 1fr; } }

/* ---------- console log ---------- */
.console {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75; color: var(--text-2);
  background: #05070a; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  max-height: 210px; overflow: auto;
}
.console .t { color: var(--muted); }
.console .ok { color: var(--accent); }
.console .err { color: #ff6b6b; }
.console .warn { color: var(--warning); }

/* ---------- result ---------- */
.result-head { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; padding: 26px; }
.result-head h3 { font-size: 22px; margin-top: 8px; word-break: break-word; }
.result-head h3 a { text-decoration: none; }
.result-head h3 a:hover { text-decoration: underline; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; color: var(--muted); font-size: 13.5px; font-family: var(--mono); }
.meta-row .add { color: #4fd44f; }
.meta-row .del { color: #ff6b6b; }
.score { position: relative; width: 112px; height: 112px; }
.score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.score .val b { font-size: 32px; letter-spacing: -0.03em; line-height: 1; }
.score .val span { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.counters { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.counter { padding: 16px 22px; border-right: 1px solid var(--line); }
.counter:last-child { border-right: none; }
.counter b { font-size: 24px; display: block; letter-spacing: -0.02em; }
.counter span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 720px) {
  .result-head { grid-template-columns: 1fr; }
  .counters { grid-template-columns: repeat(2, 1fr); }
  .counter:nth-child(2) { border-right: none; }
  .counter:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { border: none; background: none; padding: 8px 14px; border-radius: 8px; font-size: 13.5px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.finding { display: grid; gap: 8px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.finding:last-child { border-bottom: none; }
.finding-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.loc { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); background: rgba(255, 255, 255, 0.04); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); word-break: break-all; }
.kind { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-left: auto; }
.finding p { margin: 0; color: var(--text); }
.fix {
  font-size: 14px; color: var(--text-2); padding: 10px 14px; border-radius: 9px;
  background: rgba(61, 245, 167, 0.05); border-left: 2px solid var(--accent);
}
.fix b { color: var(--accent); font-family: var(--mono); font-size: 12px; font-weight: 600; margin-right: 6px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; display: block; margin-bottom: 8px; }
.notice {
  display: flex; gap: 10px; padding: 12px 16px; border-radius: 10px; font-size: 14px;
  border: 1px solid rgba(250, 178, 25, 0.35); background: rgba(250, 178, 25, 0.07); color: #ffd57a;
}
.notice.error { border-color: rgba(208, 59, 59, 0.45); background: rgba(208, 59, 59, 0.08); color: #ff9b9b; }

/* GitHub-style comment preview */
.gh-comment { border: 1px solid #30363d; border-radius: 10px; overflow: hidden; background: #0d1117; }
.gh-comment-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #161b22;
  border-bottom: 1px solid #30363d; font-size: 13.5px; color: #8b949e;
}
.gh-comment-head b { color: #e6edf3; }
.gh-bot { font-size: 11px; border: 1px solid #30363d; border-radius: 999px; padding: 0 7px; }
.markdown { padding: 20px 22px; font-size: 14.5px; color: #e6edf3; overflow-wrap: anywhere; }
.markdown h1, .markdown h2, .markdown h3 { margin: 18px 0 10px; line-height: 1.3; }
.markdown h1 { font-size: 22px; } .markdown h2 { font-size: 19px; border-bottom: 1px solid #21262d; padding-bottom: 6px; } .markdown h3 { font-size: 16px; }
.markdown > :first-child { margin-top: 0; }
.markdown code { background: rgba(110, 118, 129, 0.25); padding: 0.15em 0.4em; border-radius: 6px; font-size: 85%; }
.markdown pre { background: #161b22; padding: 14px; border-radius: 8px; overflow: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown table { border-collapse: collapse; display: block; overflow: auto; }
.markdown th, .markdown td { border: 1px solid #30363d; padding: 6px 12px; }
.markdown blockquote { margin: 0; padding: 0 1em; color: #8b949e; border-left: 3px solid #30363d; }
.markdown a { color: #4493f8; }
.markdown details { margin: 8px 0; }
.markdown pre.raw { white-space: pre-wrap; }

/* ---------- gantt ---------- */
.gantt { display: grid; gap: 8px; }
.g-row { display: grid; grid-template-columns: 130px 1fr 54px; align-items: center; gap: 12px; font-size: 12.5px; }
.g-row .g-label { font-family: var(--mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-row .g-val { font-family: var(--mono); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.g-track { position: relative; height: 14px; border-radius: 4px; background: rgba(255, 255, 255, 0.03); }
.g-bar {
  position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--series); min-width: 3px;
  transition: left 0.5s, width 0.5s;
}
.g-bar.par { background: var(--series); box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset; }
.g-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
@media (max-width: 520px) { .g-row { grid-template-columns: 96px 1fr 44px; } }

/* ---------- tooltip ---------- */
.tip {
  position: fixed; z-index: 100; pointer-events: none; padding: 8px 10px; border-radius: 8px;
  background: #1b2130; border: 1px solid var(--line-2); font-size: 12.5px; box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity 0.1s; white-space: nowrap;
}
.tip.show { opacity: 1; }
.tip b { font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
footer a { color: var(--text-2); text-decoration: none; }
footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
