/* ── Password Gate ────────────────────────────────────────────
   Full-screen overlay shown on first visit. Dismissed once the
   correct password is entered and stored in localStorage.
   Sits above everything (z-index 200).
*/

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease;
}

/* Hide hero text while gate is up */
body.gate-active main > .stack { visibility: hidden; }

/* Hide flags until authenticated; visibility keeps elements animatable */
body.gate-active .flag              { visibility: hidden; }
body.gate-active .flag.flag-revealing { visibility: visible; }

.gate-overlay.gate-hidden {
  opacity: 0;
  pointer-events: none;
}

.gate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  border: 2px solid #000;
  box-shadow: 6px 6px 0 0 #000;
  padding: 48px 56px;
  background: #fff;
  width: min(440px, calc(100vw - 48px));
}

@media (max-width: 480px) {
  .gate-card {
    padding: 36px 28px;
  }
}

.gate-name {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: #999;
  letter-spacing: 0.04em;
  margin: 0;
}

.gate-title {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(14px, 2.5vw, 20px);
  margin: 0;
  letter-spacing: 0.04em;
}

.gate-sub {
  font-family: "Roboto Mono", monospace;
  font-size: 12px;
  color: #666;
  margin: 0;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.gate-input {
  font-family: "Roboto Mono", monospace;
  font-size: 14px;
  border: 2px solid #000;
  padding: 12px 14px;
  width: 100%;
  background: #fff;
  color: #000;
  outline: none;
  box-sizing: border-box;
}

.gate-input:focus {
  box-shadow: 3px 3px 0 0 #000;
}

.gate-submit {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  background: #000;
  color: #fff;
  border: none;
  padding: 14px;
  cursor: pointer;
  width: 100%;
  letter-spacing: 0.06em;
  transition: background 0.08s;
}

.gate-submit:hover { background: #333; }
.gate-submit:focus-visible { outline: 2px solid #000; outline-offset: 3px; }

.gate-error {
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  color: #000;
  margin: 0;
  border-left: 3px solid #000;
  padding-left: 10px;
  align-self: flex-start;
}

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

.gate-card.shake { animation: gate-shake 0.38s ease; }
