:root {
  color-scheme: dark;
  --ink: #edf5ee;
  --muted: #a9b7ae;
  --quiet: #718177;
  --night: #07100c;
  --line: rgba(230, 245, 232, 0.14);
  --green: #a8e46b;
  --orange: #ffa755;
  --red: #ff7e67;
  --panel: rgba(12, 28, 20, 0.88);
  --panel-soft: rgba(255, 255, 255, 0.035);
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  background: var(--night);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3, p { margin-top: 0; }

.app-shell {
  width: min(980px, calc(100% - 34px));
  margin: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.top-links {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.top-links a:hover,
footer a:hover { color: var(--green); }

.hero {
  max-width: 760px;
  padding: 58px 0 32px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 17px;
  cursor: pointer;
  font-weight: 900;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--panel-soft);
}

.secondary:hover,
.secondary.is-active {
  border-color: rgba(168, 228, 107, 0.5);
  color: var(--green);
  background: rgba(168, 228, 107, 0.055);
}

.history-panel {
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(20px, 4vw, 34px);
  background: var(--panel);
}

.history-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 26px;
}

.history-status {
  max-width: 350px;
  margin: 0;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: right;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.history-summary article {
  border: 1px solid rgba(224, 243, 225, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(1, 12, 7, 0.26);
}

.history-summary span {
  display: block;
  margin-bottom: 7px;
  color: var(--quiet);
  font-family: "DM Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-summary strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.history-list {
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.scan-row {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr) 86px;
  gap: 16px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

.scan-time {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: nowrap;
}

.scan-message {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
}

.scan-tag {
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scan-row.airborne .scan-tag { border-color: rgba(255, 167, 85, 0.45); color: var(--orange); }
.scan-row.detected .scan-tag { border-color: rgba(168, 228, 107, 0.45); color: var(--green); }
.scan-row.error .scan-tag { border-color: rgba(255, 126, 103, 0.45); color: var(--red); }
.status-word { font-weight: 900; }
.status-word.airborne { color: var(--orange); }
.status-word.detected { color: var(--green); }
.status-word.quiet { color: var(--ink); }
.status-word.error { color: var(--red); }

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 145px;
  border: 1px solid rgba(224, 243, 225, 0.12);
  border-radius: 18px;
  margin-top: 20px;
  padding: 18px;
  color: var(--muted);
  background: rgba(1, 12, 7, 0.26);
}

.empty-icon {
  color: var(--quiet);
  font-family: "DM Mono", monospace;
  font-size: 2.2rem;
}

.empty-state h3 { margin-bottom: 6px; color: var(--ink); font-size: 1rem; }
.empty-state p { max-width: 460px; margin-bottom: 0; font-size: 0.94rem; line-height: 1.55; }

footer {
  padding: 4px 0 34px;
  color: var(--quiet);
  font-size: 0.78rem;
}

footer p { margin-bottom: 0; line-height: 1.55; }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 26px, 980px); }
  .topbar { align-items: flex-start; flex-direction: column; justify-content: center; padding: 16px 0 14px; }
  .hero { padding: 38px 0 24px; }
  .history-heading { display: block; }
  .history-status { max-width: none; margin-top: 14px; text-align: left; }
  .history-summary { grid-template-columns: 1fr; }
  .scan-row { grid-template-columns: 1fr; gap: 4px; }
  .scan-tag { justify-self: start; margin-top: 4px; }
  .history-panel { border-radius: 20px; padding: 20px; }
}
