:root {
  --black: #040509;
  --ink: #08111f;
  --white: #f8fbff;
  --blue: #006dff;
  --blue-deep: #003fbd;
  --blue-royal: #1d63ff;
  --blue-ice: #8bb8ff;
  --cyan: #3fd6ff;
  --line: rgba(248, 251, 255, 0.16);
  --brand-font: Helvetica, Arial, "Nimbus Sans", ui-sans-serif, system-ui, sans-serif;
  --body-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--white);
  background: var(--black);
  font-family: var(--body-font);
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.gateway-kicker,
.gateway-corner-note,
.gateway-copy h1,
.language-choice span,
.language-choice strong {
  font-family: var(--brand-font);
}

img,
canvas {
  display: block;
}

.gateway {
  --mx: 50%;
  --my: 50%;
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 34px;
  background:
    radial-gradient(circle at 50% 48%, rgba(29, 99, 255, 0.22), transparent 30%),
    linear-gradient(135deg, #020307 0%, #071123 46%, #03050b 100%);
}

.gateway::before {
  content: "";
  position: absolute;
  inset: -25%;
  z-index: -5;
  background:
    linear-gradient(90deg, rgba(0, 109, 255, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(63, 214, 255, 0.065) 1px, transparent 1px);
  background-size: 78px 78px;
  transform: scale(1.1);
  transform-origin: center;
  animation: gateway-grid-drift 24s linear infinite;
}

.gateway::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(63, 214, 255, 0.24), transparent 0 8rem),
    radial-gradient(circle at var(--mx) var(--my), rgba(0, 109, 255, 0.34), transparent 0 17rem),
    radial-gradient(circle at var(--mx) var(--my), rgba(0, 63, 189, 0.28), transparent 0 29rem),
    linear-gradient(180deg, rgba(4, 5, 9, 0.1), rgba(4, 5, 9, 0.84));
  mix-blend-mode: screen;
  pointer-events: none;
}

.gateway-base,
.gateway-reveal {
  position: absolute;
  inset: 0;
  z-index: -4;
  background:
    radial-gradient(circle at 50% 47%, rgba(0, 109, 255, 0.18), transparent 27%),
    url("assets/hero-circuit-lines.png") center / cover no-repeat,
    url("assets/hero-field.png") center / cover no-repeat;
}

.gateway-base {
  filter: grayscale(1) brightness(0.42) contrast(1.22);
  opacity: 0.42;
}

.gateway-reveal {
  filter: saturate(1.55) brightness(1.18) contrast(1.1) drop-shadow(0 0 18px rgba(0, 109, 255, 0.3));
  opacity: 0.98;
  -webkit-mask-image: radial-gradient(circle 14rem at var(--mx) var(--my), #000 0 36%, rgba(0, 0, 0, 0.56) 58%, transparent 82%);
  mask-image: radial-gradient(circle 14rem at var(--mx) var(--my), #000 0 36%, rgba(0, 0, 0, 0.56) 58%, transparent 82%);
}

.gateway-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: 0.9;
  mix-blend-mode: screen;
}

.gateway-cursor {
  position: fixed;
  left: var(--mx);
  top: var(--my);
  z-index: 10;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(139, 184, 255, 0.76);
  border-radius: 50%;
  box-shadow:
    0 0 16px rgba(63, 214, 255, 0.64),
    0 0 48px rgba(0, 109, 255, 0.82),
    0 0 118px rgba(0, 63, 189, 0.56);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.gateway-shell {
  width: min(1120px, 100%);
  min-height: calc(100svh - 68px);
  display: grid;
  grid-template-rows: auto minmax(13rem, 0.82fr) auto auto minmax(22px, 0.18fr);
  place-items: center;
  position: relative;
  z-index: 1;
  text-align: center;
}

.gateway-kicker {
  align-self: start;
  justify-self: start;
  margin: 0;
  color: rgba(248, 251, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.gateway-corner-note {
  position: fixed;
  left: 34px;
  bottom: 30px;
  z-index: 3;
  margin: 0;
  color: rgba(248, 251, 255, 0.58);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
  pointer-events: none;
}

.gateway-logo {
  width: min(52rem, 88vw);
  display: grid;
  place-items: center;
  filter:
    drop-shadow(0 0 22px rgba(0, 109, 255, 0.42))
    drop-shadow(0 0 80px rgba(0, 63, 189, 0.35));
  transform: translateY(4px);
  justify-self: center;
  animation: gateway-logo-in 1200ms cubic-bezier(0.16, 0.78, 0.22, 1) both;
}

.gateway-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.gateway-copy {
  transform: translateY(-44px);
  display: grid;
  justify-items: center;
  text-align: center;
  animation: gateway-copy-in 1350ms cubic-bezier(0.16, 0.78, 0.22, 1) 160ms both;
}

.gateway-copy h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6.2vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-wrap: balance;
}

.gateway-copy p {
  margin: 0.8rem 0 0;
  color: rgba(248, 251, 255, 0.7);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
}

.language-choices {
  --choices-y: -32px;
  align-self: start;
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: translateY(var(--choices-y));
  animation: gateway-choices-in 1450ms cubic-bezier(0.16, 0.78, 0.22, 1) 280ms both;
}

.language-choice {
  min-height: 112px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "code title"
    "code copy";
  align-content: center;
  column-gap: 18px;
  padding: 0.4rem 0 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(139, 184, 255, 0.32);
  background: transparent;
  transition: transform 220ms ease, border-color 220ms ease;
}

.language-choice:hover,
.language-choice:focus-visible {
  border-color: rgba(63, 214, 255, 0.86);
  transform: translateY(-2px);
  outline: none;
}

.language-choice span {
  grid-area: code;
  width: 4.4rem;
  height: 4.4rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(139, 184, 255, 0.38);
  border-radius: 50%;
  background: rgba(4, 5, 9, 0.42);
  color: var(--blue-ice);
  font-weight: 900;
  box-shadow: 0 0 22px rgba(0, 109, 255, 0.18);
}

.language-choice strong {
  grid-area: title;
  align-self: end;
  font-size: 1.55rem;
  line-height: 1.05;
}

.language-choice small {
  grid-area: copy;
  align-self: start;
  margin-top: 0.42rem;
  color: rgba(248, 251, 255, 0.68);
  font-size: 0.95rem;
  line-height: 1.45;
}

body.is-leaving .gateway-shell {
  animation: leave 520ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

body.is-leaving .gateway-reveal {
  -webkit-mask-image: radial-gradient(circle 120vw at var(--mx) var(--my), #000 0 65%, transparent 75%);
  mask-image: radial-gradient(circle 120vw at var(--mx) var(--my), #000 0 65%, transparent 75%);
}

@keyframes gateway-grid-drift {
  from {
    transform: scale(1.1) translate3d(0, 0, 0);
  }

  to {
    transform: scale(1.1) translate3d(78px, 78px, 0);
  }
}

@keyframes gateway-logo-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    filter:
      drop-shadow(0 0 0 rgba(0, 109, 255, 0))
      drop-shadow(0 0 0 rgba(0, 63, 189, 0));
  }

  to {
    opacity: 1;
    transform: translateY(4px) scale(1);
  }
}

@keyframes gateway-copy-in {
  from {
    opacity: 0;
    transform: translateY(-22px) scale(0.98);
    filter: blur(4px);
  }

  to {
    opacity: 1;
    transform: translateY(-44px) scale(1);
    filter: blur(0);
  }
}

@keyframes gateway-choices-in {
  from {
    opacity: 0;
    transform: translateY(calc(var(--choices-y) + 20px)) scale(0.985);
    filter: blur(4px);
  }

  to {
    opacity: 1;
    transform: translateY(var(--choices-y)) scale(1);
    filter: blur(0);
  }
}

@keyframes leave {
  to {
    opacity: 0;
    transform: scale(0.985);
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .gateway {
    min-height: 100svh;
    padding: 22px;
  }

  .gateway-shell {
    min-height: calc(100svh - 44px);
    grid-template-rows: auto minmax(13rem, 0.8fr) auto auto minmax(16px, 0.2fr);
  }

  .gateway-logo {
    width: min(28rem, 94vw);
  }

  .gateway-copy {
    transform: translateY(-22px);
  }

  .language-choices {
    --choices-y: -18px;
    grid-template-columns: 1fr;
    gap: 1rem;
    transform: translateY(var(--choices-y));
  }

  .gateway-corner-note {
    left: 22px;
    bottom: 18px;
    font-size: 0.74rem;
  }

  .language-choice {
    min-height: 88px;
    padding: 0.25rem 0 0.85rem;
  }

  .language-choice span {
    width: 3.4rem;
    height: 3.4rem;
  }

  .language-choice strong {
    font-size: 1.25rem;
  }
}

@media (pointer: coarse) {
  .gateway {
    --mx: 50%;
    --my: 44%;
  }

  .gateway-cursor {
    display: none;
  }

  .gateway-reveal {
    -webkit-mask-image: radial-gradient(circle 17rem at 50% 42%, #000 0 48%, rgba(0, 0, 0, 0.58) 65%, transparent 82%);
    mask-image: radial-gradient(circle 17rem at 50% 42%, #000 0 48%, rgba(0, 0, 0, 0.58) 65%, transparent 82%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .gateway-canvas,
  .gateway-cursor {
    display: none;
  }
}
