:root {
  --void: #08080f;
  --panel: rgba(18, 20, 36, 0.78);
  --stroke: rgba(0, 240, 255, 0.22);
  --cyan: #00f0ff;
  --gold: #c9a84c;
  --lime: #39ff14;
  --matrix: rgba(57, 255, 20, 0.42);
  --text: #e8eef7;
  --muted: #9aa6b8;
  --danger: #ff4d6d;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Consolas", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--void); color: var(--text); font-family: var(--font);
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Matrix rain — behind everything, max ~half opacity via canvas globalAlpha */
.matrix-rain {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: 0.5; /* hard cap: at least half transparent */
}
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(0,240,255,0.10), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(201,168,76,0.08), transparent 50%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
}

.auth-gate {
  position: relative; z-index: 3;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  max-width: 34rem; width: 100%;
  padding: 1.75rem 1.5rem 1.5rem;
}
.gate-laws {
  margin: 0.75rem 0 1rem; padding-left: 1.15rem;
  color: var(--muted); line-height: 1.5; font-size: 0.95rem;
}
.gate-laws li { margin: 0.35rem 0; }
.auth-gate .note {
  font-family: var(--mono); font-size: 0.85rem; color: var(--gold); min-height: 1.25rem;
}
.auth-gate .note.ok { color: var(--lime); }
.auth-gate .note.err { color: var(--danger); }

.app-shell { position: relative; z-index: 2; }
.app-shell[hidden], [hidden] { display: none !important; }

.top, main, .foot { position: relative; z-index: 2; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 1rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(12px); background: rgba(8,8,15,0.72);
}
.brand { display: flex; flex-direction: column; gap: 0.15rem; }
.mark { font-weight: 800; letter-spacing: 0.08em; color: var(--cyan); font-size: 1.1rem; }
.sub { color: var(--gold); font-size: 0.85rem; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-size: 0.92rem; }
.who {
  width: 100%; margin: 0; font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
}
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; display: flex; flex-direction: column; gap: 1.25rem; }
.glass {
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35), 0 20px 50px rgba(0,0,0,0.35);
  backdrop-filter: blur(16px);
}
.hero { padding: 1.75rem 1.5rem 1.5rem; }
.eyebrow {
  display: inline-block; font-size: 0.72rem; letter-spacing: 0.12em; font-weight: 700;
  color: var(--gold); border: 1px solid rgba(201,168,76,0.45); padding: 0.35rem 0.6rem; border-radius: 999px;
}
.hero h1, .auth-card h1 {
  margin: 0.85rem 0 0.6rem; font-size: clamp(1.55rem, 4vw, 2.35rem); line-height: 1.15;
  background: linear-gradient(120deg, #fff 10%, var(--cyan) 55%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--muted); max-width: 52rem; line-height: 1.55; font-size: 1.02rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.1rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.65rem 1rem; border-radius: 12px; border: 1px solid var(--stroke);
  color: var(--text); background: rgba(255,255,255,0.04); font-weight: 600; cursor: pointer;
  font-family: inherit; font-size: 0.92rem;
}
.btn:hover { text-decoration: none; border-color: var(--cyan); color: var(--cyan); }
.btn.primary { background: linear-gradient(135deg, rgba(0,240,255,0.25), rgba(201,168,76,0.18)); border-color: rgba(0,240,255,0.45); }
.btn.small { padding: 0.4rem 0.75rem; font-size: 0.85rem; margin-top: 0; }
.btn.ghost { background: transparent; }
.probe { margin: 1rem 0 0; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { padding: 1.15rem 1.15rem 1.25rem; }
.card h2, .panel h2 { margin: 0 0 0.5rem; font-size: 1.1rem; color: #fff; }
.tag {
  display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
  padding: 0.2rem 0.45rem; border-radius: 6px; margin-bottom: 0.75rem;
}
.tag.demo { background: rgba(255,77,109,0.15); color: var(--danger); border: 1px solid rgba(255,77,109,0.35); }
.tag.ok { background: rgba(57,255,20,0.1); color: var(--lime); border: 1px solid rgba(57,255,20,0.3); }
.meters { display: flex; flex-direction: column; gap: 0.65rem; }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.5rem; align-items: center; font-size: 0.88rem; }
.meter span { grid-column: 1; color: var(--muted); }
.meter b { grid-column: 2; font-family: var(--mono); color: var(--cyan); }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--cyan), var(--gold)); border-radius: inherit; }
.fine { color: var(--muted); font-size: 0.82rem; line-height: 1.45; margin: 0.75rem 0 0; }
.panel { padding: 1.25rem 1.35rem; }
.laws { margin: 0.5rem 0 0; padding-left: 1.2rem; line-height: 1.55; color: var(--muted); }
.laws strong { color: var(--text); }
.laws code, .code, pre code { font-family: var(--mono); font-size: 0.8rem; color: var(--cyan); }
.code {
  margin: 0; padding: 0.85rem; border-radius: 12px; overflow: auto;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.06);
  color: #d7e7ff; max-height: 220px; white-space: pre-wrap; word-break: break-word;
}
.callout {
  margin-top: 0.85rem; padding: 0.85rem 1rem; border-radius: 12px;
  border: 1px solid rgba(0,240,255,0.25); background: rgba(0,240,255,0.06); line-height: 1.45;
}
.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tbl th, .tbl td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.tbl th { color: var(--gold); font-weight: 700; }
.tbl td:first-child { color: var(--cyan); font-family: var(--mono); font-size: 0.84rem; }
.foot {
  border-top: 1px solid var(--stroke); padding: 1.25rem 1.5rem 2rem; text-align: center; color: var(--muted); font-size: 0.88rem;
}
.foot p { margin: 0.25rem 0; }
@media (max-width: 640px) {
  .top { flex-direction: column; align-items: flex-start; }
}
