/* SafeRouter terminal theme — sample build for verifier + explorer.
   Pure black, matrix-green accent, monospace everywhere, ASCII fieldset cards. */

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

:root {
  /* ─── Surface ─── */
  --bg:                #000000;
  --bg-elevated:       #050505;
  --bg-elevated-2:     #0a0a0a;
  --bg-elevated-3:     #111111;
  --bg-solid:          #000000;
  --card-bg:           #050505;

  /* ─── Foreground (slightly green-tinted off-white) ─── */
  --fg:                #c9d1c0;
  --fg-muted:          #6e8268;
  --fg-dim:            #3a4a36;
  --fg-deep:           #243018;

  /* ─── Borders ─── */
  --border:            #14211a;
  --border-strong:     #1f3327;
  --border-hover:      #00b833;

  /* ─── Accent (matrix green) ─── */
  --accent:            #00ff41;
  --accent-dim:        #00b833;
  --accent-deep:       #007a22;
  --accent-fg:         #7dff9b;
  --accent-glow:       rgba(0, 255, 65, 0.40);
  --accent-tint:       rgba(0, 255, 65, 0.06);

  /* ─── Warn (amber CRT) ─── */
  --warn:              #ffb000;
  --warn-fg:           #ffd47a;
  --warn-glow:         rgba(255, 176, 0, 0.35);
  --warn-tint:         rgba(255, 176, 0, 0.08);

  /* ─── Error (CRT red) ─── */
  --error:             #ff3b3b;
  --error-fg:          #ff7a7a;
  --error-glow:        rgba(255, 59, 59, 0.35);
  --error-tint:        rgba(255, 59, 59, 0.08);

  /* ─── Legacy aliases (keep inline styles in existing pages working) ─── */
  --verified:          var(--accent);
  --demo:              var(--warn);
  --accent-tee:        var(--warn);
  --err:               var(--error);
  --warning:           var(--warn);
  --ok:                var(--accent);
  --ok-fg:             var(--accent-fg);

  /* ─── Typography (forced monospace) ─── */
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Monaco, 'Cascadia Code', Consolas, monospace;
  --font-sans: var(--font-mono);

  /* ─── Radius (terminal: zero curves) ─── */
  --r-sm: 0;
  --r-md: 0;
  --r-lg: 0;
  --r-xl: 0;
  --r-2xl: 0;
  --r-pill: 0;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ─── CRT scanlines (subtle, ~3% green tint every 3px) ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 255, 65, 0.022) 2px,
    rgba(0, 255, 65, 0.022) 3px
  );
}

/* ─── Phosphor glow vignette ─── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse at 15% 90%, rgba(0, 255, 65, 0.055) 0, transparent 55%),
    radial-gradient(ellipse at 85% 10%, rgba(0, 184, 51, 0.035) 0, transparent 55%);
}

::selection { background: var(--accent); color: #000; text-shadow: none; }

* { scrollbar-width: thin; scrollbar-color: var(--accent-dim) #000; }
*::-webkit-scrollbar          { width: 10px; height: 10px; }
*::-webkit-scrollbar-track    { background: #000; border-left: 1px solid var(--border); }
*::-webkit-scrollbar-thumb    { background: var(--border-strong); }
*::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: text-shadow 0.12s;
}
a:hover { text-shadow: 0 0 8px var(--accent-glow); }

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

/* ───────────────────────────────────────────────────────────────
   Nav — top bar, monospace, [tab] style
   ─────────────────────────────────────────────────────────────── */
nav.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.5rem;
  background: #000;
  border-bottom: 1px solid var(--border-strong);
  position: sticky; top: 0; z-index: 100;
  gap: 1rem;
}
nav.top .brand {
  display: inline-flex !important;
  align-items: center; gap: 0.625rem;
  /* Match maria.sumplus.xyz wordmark: Inter / text-base 16px / semibold 600 */
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-shadow: 0 0 6px var(--accent-glow);
  white-space: nowrap;
}
nav.top a.brand:hover { text-decoration: none; }
nav.top .brand img {
  display: block;
  /* Match maria.sumplus.xyz: 28×28 logo */
  width: 28px; height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}
/* Brand block, mirrored from maria.sumplus.xyz layout but with SafeRouter's
   matrix-green accent on the product half.
   - "Sumplus"  : Inter, semibold 600, white (#fff)  — same as Maria
   - "SafeRouter": Inter, regular 400, matrix green w/ phosphor glow
     (Maria's product half uses slate-400 / font-normal; we deliberately
      diverge here so the hacker-terminal identity reads from the product
      name, not the parent brand.) */
nav.top .brand .sp-mark    {
  color: #ffffff;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: none;
}
nav.top .brand .sp-product {
  color: var(--accent);
  font-weight: 400;
  text-shadow: 0 0 8px var(--accent-glow);
}

nav.top .links {
  display: flex; gap: 0;
  font-size: 0.75rem;
  flex-wrap: wrap;
}
nav.top .links a {
  color: var(--fg-muted);
  padding: 0.35rem 0.7rem;
  text-decoration: none;
  border: 1px solid transparent;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  transition: color 0.12s, border-color 0.12s, background-color 0.12s;
}
nav.top .links a:hover {
  color: var(--accent);
}
nav.top .links a.active {
  color: var(--accent);
  border-color: var(--border-strong);
  background: var(--accent-tint);
  text-shadow: 0 0 6px var(--accent-glow);
}

/* ───────────────────────────────────────────────────────────────
   Terminal panel — ASCII fieldset style.
   Use:  <div class="term-panel" data-label="VERDICT">…</div>
   Variant: .accent   = highlighted with matrix-green border + glow
   ─────────────────────────────────────────────────────────────── */
.term-panel {
  border: 1px solid var(--border-strong);
  background: #000;
  position: relative;
  padding: 1.25rem 1.5rem;
}
.term-panel[data-label]::before {
  content: '─[ ' attr(data-label) ' ]─';
  position: absolute;
  top: -0.65em;
  left: 0.9rem;
  background: #000;
  padding: 0 0.45rem;
  font-size: 0.7rem;
  color: var(--accent-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  white-space: nowrap;
  max-width: calc(100% - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
}
.term-panel.accent {
  border-color: var(--accent-dim);
  box-shadow:
    0 0 20px rgba(0, 255, 65, 0.06),
    inset 0 0 30px rgba(0, 255, 65, 0.02);
}
.term-panel.accent[data-label]::before { color: var(--accent); }
.term-panel.warn { border-color: var(--warn); }
.term-panel.warn[data-label]::before { color: var(--warn); }
.term-panel.err  { border-color: var(--error); }
.term-panel.err[data-label]::before  { color: var(--error); }

/* ───────────────────────────────────────────────────────────────
   Prompt prefix `> _`, cursor blink
   ─────────────────────────────────────────────────────────────── */
@keyframes term-blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
.cursor {
  display: inline-block;
  width: 0.55em; height: 1.0em;
  background: var(--accent);
  vertical-align: -2px;
  animation: term-blink 1.05s infinite;
  box-shadow: 0 0 8px var(--accent-glow);
  margin-left: 2px;
}
.prompt {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
  font-weight: 700;
  user-select: none;
  margin-right: 0.4em;
}

/* ───────────────────────────────────────────────────────────────
   Terminal buttons
   ─────────────────────────────────────────────────────────────── */
.term-btn {
  background: transparent;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  padding: 0.5rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  text-shadow: 0 0 4px var(--accent-glow);
}
.term-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 16px var(--accent-glow);
  text-shadow: none;
}
.term-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-shadow: none;
}
.term-btn.ghost {
  border-color: var(--border-strong);
  color: var(--fg-muted);
  text-shadow: none;
}
.term-btn.ghost:hover:not(:disabled) {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: transparent;
  box-shadow: none;
  text-shadow: 0 0 6px var(--accent-glow);
}
.term-btn.sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.7rem;
}

/* ───────────────────────────────────────────────────────────────
   Inputs
   ─────────────────────────────────────────────────────────────── */
.term-input {
  background: #000;
  border: 1px solid var(--border-strong);
  color: var(--fg);
  padding: 0.55rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  outline: none;
  width: 100%;
}
.term-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), inset 0 0 8px rgba(0, 255, 65, 0.06);
}
.term-input::placeholder { color: var(--fg-dim); }

/* ───────────────────────────────────────────────────────────────
   Chips / status pills (square — no rounded corners)
   ─────────────────────────────────────────────────────────────── */
.term-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  border: 1px solid var(--border-strong);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  font-family: var(--font-mono);
  background: #000;
  line-height: 1.5;
  white-space: nowrap;
}
.term-chip.ok   { border-color: var(--accent-dim); color: var(--accent);    background: var(--accent-tint); text-shadow: 0 0 6px var(--accent-glow); }
.term-chip.warn { border-color: var(--warn);       color: var(--warn-fg);   background: var(--warn-tint); }
.term-chip.err  { border-color: var(--error);      color: var(--error-fg);  background: var(--error-tint); }

/* ───────────────────────────────────────────────────────────────
   Hex / hash text styling
   ─────────────────────────────────────────────────────────────── */
.hex {
  font-family: var(--font-mono);
  color: var(--fg-muted);
  word-break: break-all;
  font-size: 0.8125rem;
}
.hex.accent {
  color: var(--accent);
  text-shadow: 0 0 5px var(--accent-glow);
}
.hex.dim { color: var(--fg-dim); }

/* ───────────────────────────────────────────────────────────────
   Decorative hex strip — random-looking hex as bg flavor.
   Use:  <div class="hex-strip"></div>
   ─────────────────────────────────────────────────────────────── */
.hex-strip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--fg-deep);
  letter-spacing: 0.04em;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  text-overflow: ellipsis;
}

/* ───────────────────────────────────────────────────────────────
   ASCII spinner / loading dots
   ─────────────────────────────────────────────────────────────── */
@keyframes term-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.pulse { animation: term-pulse 1.2s ease-in-out infinite; }

/* Convenience: dim the heading-with-leading-prompt style */
.term-heading {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 0.4rem 0;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
  line-height: 1.2;
}
.term-subheading {
  color: var(--fg-muted);
  font-size: 0.875rem;
  margin: 0 0 1.5rem 0;
  line-height: 1.55;
  max-width: 720px;
}
.term-subheading strong { color: var(--fg); font-weight: 600; }
.term-subheading code {
  color: var(--accent);
  background: var(--accent-tint);
  padding: 0 0.3rem;
  border: 1px solid var(--border-strong);
}
