/* Fixed overlay so page CSS cannot leak content past the gate. */
.gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
  overflow: auto;
  background: #070708;
  color: #f4f4f2;
  font-family: "Outfit", "SF Pro Text", system-ui, sans-serif;
}

/* Same atmosphere as docs landing: noise, cyan glow, rings watermark. */
.gate-noise {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.04;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.gate-glow {
  pointer-events: none;
  position: absolute;
  width: min(65vw, 560px);
  height: min(65vw, 560px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.13), transparent 68%);
  top: -16%;
  right: -10%;
  filter: blur(6px);
  z-index: 0;
}

.gate-rings {
  pointer-events: none;
  position: absolute;
  width: min(42vw, 240px);
  height: min(42vw, 240px);
  bottom: -50px;
  left: -36px;
  opacity: 0.16;
  z-index: 0;
}

.gate-rings img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

html[data-gate="required"]:not(.admitted) {
  overflow: hidden;
}

html[data-gate="required"]:not(.admitted) .gate {
  display: grid;
}

html[data-gate="required"]:not(.admitted) body > :not(.gate) {
  visibility: hidden !important;
  pointer-events: none !important;
}

html.admitted .gate {
  display: none !important;
}

.gate-card {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  background: rgba(16, 16, 18, .92);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 24px;
  padding: 1.6rem 1.6rem 1.4rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  backdrop-filter: blur(12px);
}

.gate-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.gate-brand img { height: 28px; width: auto; }

.gate .kicker {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #9a9aa3;
  font-weight: 600;
}

.gate h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 460;
  font-size: clamp(2rem, 4vw, 2.7rem);
  letter-spacing: -.03em;
  line-height: 1.08;
  margin: .35rem 0 .8rem;
  color: #f4f4f2;
}

.gate p { color: #c8c8d0; margin: 0 0 .9rem; }

.eq {
  margin: 1.2rem 0 1.1rem;
  padding: 1.15rem 1.1rem 1rem;
  border-radius: 16px;
  background: #070708;
  border: 1px solid rgba(0, 229, 255, .28);
  text-align: center;
}

.eq-main {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: -.03em;
  line-height: 1;
  color: #fff;
}

.eq-main sup { font-size: .55em; }

.eq small {
  display: block;
  margin-top: .75rem;
  color: #8e8e98;
  letter-spacing: .04em;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .72rem;
}

.gate form { display: grid; gap: .7rem; }

.gate input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .12);
  background: #101114;
  color: #fff;
  border-radius: 12px;
  padding: .95rem 1rem;
  font: 500 1rem/1.3 "JetBrains Mono", ui-monospace, monospace;
  outline: none;
}

.gate input:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, .15);
}

.gate button {
  border: 0;
  border-radius: 999px;
  background: #00e5ff;
  color: #041316;
  font: 650 .95rem/1 "Outfit", system-ui, sans-serif;
  padding: .9rem 1.1rem;
  cursor: pointer;
}

.gate button:hover { filter: brightness(1.05); }

.gate-note {
  min-height: 1.35em;
  margin: .35rem 0 0;
  padding: 0 .25rem;
  text-align: center;
  font: 550 .92rem/1.35 "Outfit", system-ui, sans-serif;
  color: transparent;
}

.gate-note.is-error {
  color: #ff5c6a;
}

.gate-note.is-ok {
  color: #5ee0a0;
}

.gate-back {
  display: inline-block;
  margin-top: 1rem;
  color: #8e8e98;
  font-size: .88rem;
  text-decoration: none;
}

.gate-back:hover { color: #00e5ff; }

.shake { animation: gate-shake .42s cubic-bezier(.22, 1, .36, 1); }

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@media print {
  .gate { display: none !important; }
  html[data-gate="required"]:not(.admitted) body > :not(.gate) {
    visibility: visible !important;
    pointer-events: auto !important;
  }
}
