/* ===========================================================================
   beaverGate — cyber theme
   No external fonts/CDNs (keeps CSP at default-src 'self'). System mono stack.
   =========================================================================== */

:root {
  --bg:        #060a10;
  --bg-2:      #0a0e16;
  --grid:      rgba(0, 255, 170, 0.06);
  --cyan:      #28f0d8;
  --green:     #39ff88;
  --amber:     #ffcc55;
  --red:       #ff4d5e;
  --ink:       #cdeffa;
  --ink-dim:   #5e8a93;
  --glow-cyan: 0 0 8px rgba(40, 240, 216, 0.75), 0 0 22px rgba(40, 240, 216, 0.35);
  --mono: "SFMono-Regular", "JetBrains Mono", "Fira Code", Consolas,
          "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(120% 120% at 50% 0%, var(--bg-2) 0%, var(--bg) 70%);
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
}

/* --- animated scene canvas (full viewport background) --- */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* --- CRT scanline + vignette overlay --- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.18) 3px,
      rgba(0, 0, 0, 0) 4px);
  mix-blend-mode: multiply;
}
.scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 100% at 50% 50%,
              transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* --- top bar with the Enter button --- */
.topbar {
  position: fixed;
  top: 0; right: 0; left: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  padding: max(18px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 0;
}

.enter-btn {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(8, 18, 22, 0.72);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  padding: 0.7em 1.2em;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  box-shadow: var(--glow-cyan);
  backdrop-filter: blur(3px);
  transition: transform 0.12s ease, background 0.18s ease, color 0.18s ease;
}
.enter-btn:hover,
.enter-btn:focus-visible {
  background: var(--cyan);
  color: #032018;
  outline: none;
  transform: translateY(-1px);
}
.enter-btn:active { transform: translateY(0); }
.enter-btn[data-busy="true"] { opacity: 0.6; pointer-events: none; }
.enter-btn__glyph { font-size: 0.7em; }

/* --- centered hero title --- */
.hero {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 0 16px;
}
.hero__title {
  margin: 0;
  font-size: clamp(2.6rem, 12vw, 7rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-shadow: var(--glow-cyan);
  position: relative;
}
/* subtle chromatic-aberration glitch */
.hero__title::before,
.hero__title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.5;
}
.hero__title::before { color: var(--red);   transform: translate(-2px, 0); mix-blend-mode: screen; animation: glitch 4.2s infinite steps(2); }
.hero__title::after  { color: var(--cyan);  transform: translate(2px, 0);  mix-blend-mode: screen; animation: glitch 3.1s infinite steps(2) reverse; }
@keyframes glitch {
  0%, 92%, 100% { transform: translate(0, 0); }
  93% { transform: translate(-3px, 1px); }
  96% { transform: translate(3px, -1px); }
}
.hero__sub {
  margin: 1.1em 0 0;
  color: var(--ink-dim);
  letter-spacing: 0.28em;
  font-size: clamp(0.7rem, 2.2vw, 0.95rem);
  text-transform: uppercase;
}
.hero__actions {
  margin-top: 1.8em;
  pointer-events: auto;
}
.hero__actions .enter-btn { text-decoration: none; }

/* --- bottom status bar --- */
.statusbar {
  position: fixed;
  left: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0 clamp(16px, 4vw, 40px) max(16px, env(safe-area-inset-bottom));
  color: var(--ink-dim);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.statusbar__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* --- reject modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 10, 0.78);
  backdrop-filter: blur(4px);
  animation: fade 0.18s ease;
}
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal__panel {
  width: min(440px, 92vw);
  background: var(--bg-2);
  border: 1px solid var(--red);
  border-radius: 6px;
  box-shadow: 0 0 14px rgba(255, 77, 94, 0.55), 0 0 40px rgba(255, 77, 94, 0.2);
  padding: clamp(22px, 5vw, 34px);
  text-align: center;
}
.modal__glitch {
  margin: 0 0 0.8em;
  color: var(--red);
  letter-spacing: 0.3em;
  font-size: 0.78rem;
  text-shadow: 0 0 8px rgba(255, 77, 94, 0.8);
}
.modal__title {
  margin: 0 0 0.6em;
  font-size: clamp(1.3rem, 4.5vw, 1.7rem);
  color: var(--ink);
}
.modal__body {
  margin: 0 0 1.6em;
  color: var(--ink-dim);
  font-size: 0.88rem;
  line-height: 1.5;
}
.modal__close {
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  background: transparent;
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 0.65em 1.6em;
  transition: background 0.18s ease, color 0.18s ease;
}
.modal__close:hover,
.modal__close:focus-visible {
  background: var(--red);
  color: #190305;
  outline: none;
}

/* --- respect reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
  .hero__title::before,
  .hero__title::after,
  .statusbar__dot { animation: none; }
}
