:root {
  color-scheme: dark;
  --ink: #0a1730;
  --panel: #0f2148;
  --panel-soft: #142c59;
  --grid-line: rgba(146, 180, 255, 0.07);
  --border: #2c4676;
  --border-bright: #4a6fb0;
  --paper: #e9f1ff;
  --muted: #8aa3d1;
  --accent: #ffb454;
  --accent-dim: rgba(255, 180, 84, 0.35);
  --good: #34d399;
  --bad: #fb7185;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
  --sans: "IBM Plex Sans", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(circle at 50% -10%, rgba(74, 111, 176, 0.18), transparent 55%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
  background-attachment: fixed;
}

.page-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 18px 56px;
}

/* ---------- Hero ---------- */
.hero-card {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--panel-soft));
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 44px 40px;
  box-shadow: 0 30px 60px rgba(4, 10, 25, 0.45);
}

.reticle-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--accent);
  pointer-events: none;
}
.corner-tl { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.corner-tr { top: -1px; right: -1px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.corner-bl { bottom: -1px; left: -1px; border-bottom: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.corner-br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

.hero-copy { max-width: 640px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  margin: 0;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.2s ease-out infinite;
  flex: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

h1 {
  font-family: var(--mono);
  margin: 16px 0 12px;
  font-size: clamp(1.9rem, 4.6vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.subcopy {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 560px;
  margin: 0;
}

/* ---------- Form ---------- */
.audit-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 28px;
}

.input-wrap {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: rgba(6, 14, 32, 0.55);
  transition: border-color 0.2s ease;
}
.input-wrap:focus-within {
  border-color: var(--accent);
}

.input-tag {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-right: 1px solid var(--border);
}

input {
  min-width: 0;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--paper);
  font: 1rem var(--sans);
}
input::placeholder { color: #5b6f97; }
input:focus { outline: none; }

button {
  padding: 0 26px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  cursor: pointer;
  background: var(--accent);
  color: #24160a;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
button:hover {
  background: #ffc476;
  box-shadow: 0 8px 20px rgba(255, 180, 84, 0.25);
  transform: translateY(-1px);
}
button:active { transform: translateY(0); }

/* ---------- Status panel ---------- */
.status-panel {
  position: relative;
  overflow: hidden;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #071023;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9rem;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(146, 180, 255, 0.035) 0px,
    rgba(146, 180, 255, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
}
.status-panel::after {
  content: "▍";
  margin-left: 4px;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
.status-panel:not(.success-card):not(.error-card)::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 180, 84, 0.28), transparent);
  animation: sweep 1.6s linear infinite;
}

@keyframes sweep {
  from { left: -40%; }
  to { left: 100%; }
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.error-card {
  border-color: rgba(251, 113, 133, 0.45);
  color: var(--bad);
  background: #1c0f14;
}
.error-card::after { display: none; }
.success-card {
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--good);
  background: #0b1f19;
}
.success-card::after { display: none; }

/* ---------- Summary ---------- */
.summary-banner {
  margin-top: 22px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
  background: var(--panel-soft);
  color: var(--paper);
  font-size: 0.95rem;
  line-height: 1.5;
}
.summary-banner strong {
  color: var(--accent);
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  margin-right: 4px;
}

/* ---------- Report grid ---------- */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.report-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--panel);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.report-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
}
.report-card h3 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.report-card .value {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--paper);
  word-break: break-word;
}

.hidden { display: none; }
.sr-only { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */
.footer-note {
  text-align: center;
  padding: 30px 12px 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}
.footer-note a { color: var(--accent); text-decoration: none; }
.footer-note a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .audit-form { grid-template-columns: 1fr; }
  button { padding: 14px 22px; }
  .hero-card { padding: 30px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot,
  .status-panel::after,
  .status-panel:not(.success-card):not(.error-card)::before {
    animation: none;
  }
}