html:not(.app-unlocked) #app-mount {
  display: none !important;
}

.site-gate {
  --gate-ink: #f3f4f6;
  --gate-muted: #c4cad3;
  --gate-line: rgba(148, 163, 184, 0.28);
  --gate-primary: #2d8cff;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: clamp(1.25rem, 3vw, 2.5rem) 1.25rem;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--gate-ink);
  background: #0d1117;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

.site-gate[hidden] {
  display: none !important;
}

.site-gate__atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.site-gate__photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* Tiny inline LQIP so the skyline tone appears instantly */
  background:
    center / cover no-repeat
    url("data:image/webp;base64,UklGRlgAAABXRUJQVlA4IEwAAADwAwCdASoYABAAPxFOv1osIqgkmAGAIgljAJ0AHsbnkhCka2PEYdnuAPjSIZ6uSuzVNmtrmNsReY0n4uxpylV6zaf3ooChpmjsKgAA");
  transform: scale(1.04);
  animation: site-gate-photo 18s ease-in-out infinite alternate;
}

.site-gate__photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.site-gate__photo-img.is-loaded {
  opacity: 1;
}

.site-gate.is-exiting {
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.32s ease;
  pointer-events: none;
}

.site-gate__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.55) 0%, rgba(10, 14, 20, 0.72) 42%, rgba(8, 12, 18, 0.88) 100%),
    radial-gradient(circle at 50% 20%, rgba(45, 140, 255, 0.16), transparent 45%);
}

.site-gate__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.85;
  animation: site-gate-drift 14s ease-in-out infinite alternate;
}

.site-gate__orb--a {
  width: min(52vw, 420px);
  height: min(52vw, 420px);
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(45, 140, 255, 0.28), transparent 68%);
}

.site-gate__orb--b {
  width: min(44vw, 360px);
  height: min(44vw, 360px);
  right: -6%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18), transparent 70%);
  animation-delay: -4s;
}

.site-gate__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 20%, transparent 75%);
  opacity: 0.45;
}

.site-gate__stage {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  display: grid;
  gap: clamp(1.1rem, 2.5vw, 1.75rem);
  opacity: 0;
  animation: none;
}

html.gate-ready .site-gate__stage {
  opacity: 1;
  animation: site-gate-rise 0.7s ease-out both;
}

.site-gate__brand-block {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0;
}

.site-gate__brand-mark {
  width: 3.6rem;
  height: 3.6rem;
  margin: 0 auto 1.05rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(13, 17, 23, 0.82);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-gate__brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-gate__brand-switcher {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(15, 23, 42, 0.88);
  color: #94a3b8;
  font-size: 0.78rem;
  backdrop-filter: blur(8px);
}

.site-gate__brand-switcher a {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 650;
}

.site-gate__brand-switcher a:hover {
  text-decoration: underline;
}

.site-gate__eyebrow {
  display: none !important;
}

.site-gate__brand {
  margin: 0;
  color: #ffffff;
  font-family: Outfit, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2rem, 5.4vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.site-gate__lede {
  margin: 0.7rem auto 0;
  max-width: 34ch;
  color: #c7ced8;
  font-size: clamp(0.92rem, 2vw, 1.02rem);
  line-height: 1.5;
  text-wrap: pretty;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.4);
}

.site-gate__card {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(28, 33, 40, 0.96), rgba(17, 22, 29, 0.94));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: clamp(1.35rem, 3vw, 1.85rem);
  animation: site-gate-rise 0.85s ease-out 0.08s both;
}

.site-gate__card-title {
  margin: 0;
  color: #fff;
  font-family: Outfit, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-gate__card-copy {
  margin: 0.45rem 0 1.2rem;
  color: #b6bec9;
  font-size: 0.92rem;
  line-height: 1.5;
}

.site-gate__label {
  display: block;
  margin-bottom: 0.4rem;
  color: #e5e7eb;
  font-size: 0.8rem;
  font-weight: 650;
}

.site-gate__input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.85rem;
  border: 1px solid #3d4450;
  border-radius: 12px;
  background: #0d1117;
  color: #f8fafc;
  padding: 0.82rem 0.95rem;
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.site-gate__input:focus {
  outline: none;
  border-color: rgba(45, 140, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.18);
}

.site-gate__submit {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0.88rem 1rem;
  background: linear-gradient(135deg, #2d8cff, #0ea5e9);
  color: #fff;
  font: inherit;
  font-weight: 750;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.site-gate__submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.site-gate__submit:active {
  transform: translateY(0);
}

.site-gate__error {
  margin: 0.85rem 0 0;
  color: #fca5a5;
  font-size: 0.88rem;
}

.site-gate__status {
  margin: 0.75rem 0 0;
  color: #93c5fd;
  font-size: 0.88rem;
}

.site-gate__footnote {
  margin: 1.05rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(48, 54, 61, 0.85);
  color: #8b949e;
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: center;
  letter-spacing: 0.01em;
}

.site-gate__invite-loading {
  display: none;
  width: min(420px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(17, 22, 29, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  padding: 1.4rem 1.25rem;
  text-align: center;
}

.site-gate__invite-fail {
  display: none;
  width: min(420px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 18px;
  background: rgba(17, 22, 29, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  padding: 1.4rem 1.25rem;
  text-align: center;
}

.site-gate__invite-fail strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #fff;
  font-family: Outfit, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.15rem;
}

.site-gate__invite-fail > p {
  margin: 0;
  color: #b6bec9;
  font-size: 0.9rem;
  line-height: 1.45;
}

.site-gate__invite-fail-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.site-gate__invite-fail-link {
  color: #93c5fd;
  font-size: 0.86rem;
  text-decoration: none;
}

.site-gate__invite-fail-link:hover {
  text-decoration: underline;
}

.site-gate__invite-loading strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #fff;
  font-family: Outfit, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.15rem;
}

.site-gate__invite-loading p {
  margin: 0;
  color: #b6bec9;
  font-size: 0.9rem;
  line-height: 1.45;
}

.site-gate__spinner {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0 auto 0.85rem;
  border: 2px solid rgba(147, 197, 253, 0.25);
  border-top-color: #93c5fd;
  border-radius: 50%;
  animation: site-gate-spin 0.8s linear infinite;
}

/* Invite links: never flash the host unlock form. */
html.guest-entry:not(.app-unlocked) .site-gate__card,
html.guest-entry:not(.app-unlocked) .site-gate__lede {
  display: none !important;
}

html.guest-entry:not(.app-unlocked):not(.guest-invite-fail) .site-gate__invite-loading {
  display: block;
}

html.guest-entry.guest-invite-fail:not(.app-unlocked) .site-gate__invite-loading {
  display: none !important;
}

html.guest-entry.guest-invite-fail:not(.app-unlocked) .site-gate__invite-fail {
  display: block;
}

@keyframes site-gate-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes site-gate-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(2%, 3%, 0) scale(1.05);
  }
}

@keyframes site-gate-photo {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-1.2%, 1%, 0);
  }
}

@keyframes site-gate-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 560px) {
  .site-gate__card {
    border-radius: 16px;
  }

  .site-gate__brand {
    font-size: clamp(1.9rem, 9vw, 2.4rem);
  }
}

@media (max-height: 760px) {
  .site-gate__stage {
    gap: 1rem;
  }

  .site-gate__brand {
    font-size: clamp(1.85rem, 5vw, 2.4rem);
  }

  .site-gate__lede {
    margin-top: 0.55rem;
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-gate__stage,
  .site-gate__card,
  .site-gate__orb,
  .site-gate__photo,
  .site-gate__spinner {
    animation: none !important;
  }

  .site-gate__photo,
  .site-gate__photo-img {
    transform: none;
  }

  .site-gate__photo-img {
    transition: none;
    opacity: 1;
  }

  .site-gate.is-exiting,
  .site-gate__submit {
    transition: none;
  }
}
