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

html.app-unlocked #site-gate {
  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;
  display: none !important;
  opacity: 0;
  transition: none !important;
  pointer-events: none;
}

/* Invite flow: never show a dimmed intermediate gate frame. */
html.guest-entry .site-gate.is-exiting {
  display: none !important;
  opacity: 0;
  transition: none !important;
}

.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.14), 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.1), transparent 70%);
  animation-delay: -4s;
}

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

.site-gate__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: min(640px, calc(100vw - 2.5rem));
  min-width: min(22.5rem, 100%);
  gap: clamp(1.75rem, 3.5vw, 2.6rem);
  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;
  align-self: center;
  width: fit-content;
  max-width: 100%;
  /* Keep the bottom card a bit wider than the title on long brand names. */
  padding-inline: 1.35rem;
  box-sizing: border-box;
}

.site-gate__brand-mark {
  width: clamp(3.6rem, 8.5vw, 4.25rem);
  height: clamp(3.6rem, 8.5vw, 4.25rem);
  margin: 0 auto 1.15rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 16, 22, 0.55);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.site-gate__brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
  /* Knock out baked-in black so the glass tile shows; keeps full mark size */
  mix-blend-mode: screen;
}

.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;
  width: max-content;
  max-width: 100%;
  color: #ffffff;
  font-family: Outfit, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.5rem, 6.2vw, 3.55rem);
  font-weight: 750;
  letter-spacing: -0.048em;
  line-height: 1.02;
  text-wrap: balance;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.site-gate__lede {
  margin: 0.7rem auto 0;
  max-width: 32ch;
  color: rgba(226, 232, 240, 0.72);
  font-size: clamp(0.9rem, 1.8vw, 0.98rem);
  font-weight: 450;
  line-height: 1.45;
  text-wrap: pretty;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.site-gate__card {
  position: relative;
  width: 100%;
  min-width: min(25rem, 100%);
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(12, 16, 22, 0.55);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  padding: 1.25rem 1.25rem 1.1rem;
  animation: site-gate-rise 0.85s ease-out 0.14s both;
}

/* Keep for a11y / brand JS; hide so brand leads the composition */
.site-gate__card-title,
.site-gate__card-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-gate__form {
  position: relative;
}

.site-gate__label {
  display: block;
  margin-bottom: 0.45rem;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.78rem;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.site-gate__input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(8, 11, 16, 0.72);
  color: #f8fafc;
  padding: 0.8rem 0.9rem;
  font: inherit;
  font-size: 0.98rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.site-gate__input:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
}

.site-gate__input:focus {
  outline: none;
  border-color: rgba(45, 140, 255, 0.55);
  background: rgba(8, 11, 16, 0.88);
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.14);
}

.site-gate__submit {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.82rem 1rem;
  background: #2d8cff;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.site-gate__submit:hover {
  background: #3b95ff;
  filter: none;
  transform: none;
}

.site-gate__submit:active {
  background: #247ae0;
  transform: none;
}

.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: 0.95rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(148, 163, 184, 0.72);
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
  letter-spacing: 0.01em;
}

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

.site-gate__invite-fail {
  display: none;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 14px;
  background: rgba(17, 22, 29, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  padding: 1.1rem 1.15rem;
  text-align: center;
}

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

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

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

.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.25rem;
  color: #fff;
  font-family: Outfit, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
}

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

.site-gate__spinner {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.14rem auto 0.5rem;
  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: hide site-default brand until invite portal/logo is ready. */
html.guest-entry.invite-brand-pending .site-gate__brand-block {
  opacity: 0;
}

html.guest-entry.invite-brand-ready .site-gate__brand-block {
  opacity: 1;
  transition: opacity 0.18s ease;
}

/* 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;
}

/* Keep verifying card hidden while title is unknown so width paints once. */
html.guest-entry.invite-brand-pending:not(.app-unlocked):not(.guest-invite-fail)
  .site-gate__invite-loading {
  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: 14px;
  }

  .site-gate__brand-mark {
    width: 3.4rem;
    height: 3.4rem;
    margin-bottom: 0.95rem;
    border-radius: 14px;
  }

  .site-gate__brand {
    font-size: clamp(2.15rem, 9.2vw, 2.85rem);
  }
}

@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;
  }

}
