/* ==========================================================================
   BENCH — shared design system
   A client-side hardware diagnostics console. Dark CRT/oscilloscope styling:
   phosphor green primary signal, amber for caution, signal-pink for alerts.
   ========================================================================== */

:root {
  --bg: #0a0d12;
  --bg-alt: #0d1117;
  --panel: #12161d;
  --panel-raised: #161c24;
  --panel-border: #232a35;
  --grid-line: rgba(255, 255, 255, 0.035);

  --text-main: #e7ecf2;
  --text-muted: #8a93a3;
  --text-dim: #4d5666;

  --accent: #59e6a4;       /* phosphor green — primary signal */
  --accent-dim: #2f8f66;
  --accent-glow: rgba(89, 230, 164, 0.35);

  --violet: #8b7cf6;       /* secondary — input devices */
  --amber: #ffb84d;        /* caution / pending */
  --signal: #ff5470;       /* alert / fast double-click / fail */
  --signal-glow: rgba(255, 84, 112, 0.35);

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

/* ---- Graph-paper grid + scanline sweep (site signature) ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

body::after {
  content: "";
  position: fixed;
  left: 0; right: 0;
  height: 140px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--accent-glow) 45%, transparent);
  opacity: 0.14;
  filter: blur(2px);
  animation: sweep 9s linear infinite;
}

@keyframes sweep {
  0%   { top: -140px; }
  100% { top: 100vh; }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; display: none; }
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

p { color: var(--text-muted); }

code, .mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* ---- Header ---- */
.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(10, 13, 18, 0.9), rgba(10, 13, 18, 0.6));
  backdrop-filter: blur(6px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-main);
}

.brand .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.brand-path { color: var(--text-dim); }

.back-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.back-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Footer ---- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--panel-border);
  margin-top: 80px;
  padding: 28px 0 40px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  background: var(--panel-raised);
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  color: #06110c;
  border-color: var(--accent);
  font-weight: 600;
}

.btn.primary:hover {
  background: #6dfcb5;
}

/* ---- Shared readout panel (used across test pages) ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.stat {
  flex: 1;
  min-width: 140px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.stat label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.stat .value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--accent);
}

.log {
  width: 100%;
  height: 220px;
  background: var(--bg-alt);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 14px 16px;
  resize: none;
  outline: none;
}

.log:focus { border-color: var(--accent-dim); }

.page-head {
  padding: 48px 0 28px;
}

.page-head h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  margin: 10px 0 10px;
}

.page-head p {
  max-width: 60ch;
}

.test-main {
  padding-bottom: 60px;
  position: relative;
  z-index: 1;
}
