/* One screen: the wordmark on the left, a slow light on the right that the
   letters fade into. The light layer sits above the text in screen blend
   mode, so the right-hand letters wash out where it is brightest. */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 200 500;
  font-display: block;
  src: url(/fonts/jost-latin.woff2) format('woff2');
}

:root {
  --ground: #0a0b10;
  --text: #f4f6fb;
  --text-soft: rgba(232, 236, 248, 0.86);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--ground);
  color: var(--text);
  font-family: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  isolation: isolate;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 max(16px, 9vw) 4vh;
  overflow: hidden;
}

/* The wordmark sits above the light with a soft shadow, so the beam passes
   behind it. Its fill is clipped to the letters, so the shadow comes from a
   filter rather than text-shadow, which would paint over the fill. */
.wordmark {
  position: relative;
  z-index: 3;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)) drop-shadow(0 10px 28px rgba(0, 0, 0, 0.6));
  margin: 0 0 0 -0.04em;
  font-size: clamp(64px, 12vw, 240px);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff 0%, #fff 46%, rgba(255, 255, 255, 0.55) 72%, rgba(255, 255, 255, 0) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.line {
  position: relative;
  z-index: 1;
  max-width: 46ch;
  margin: 4.5vh 0 0 0.2em;
  color: var(--text-soft);
  font-size: clamp(17px, 1.6vw, 26px);
  font-weight: 350;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

/* The team's way into the back office. A dark pill keeps it readable when
   the light drifts behind it. */
.team-login {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(10, 11, 16, 0.5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 26px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.team-login:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(10, 11, 16, 0.7);
}

.team-login:focus-visible {
  outline: 2px solid #9db8ff;
  outline-offset: 3px;
}

/* ------------------------------------------------------------ the light */

.light {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

.glow {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.glow-core {
  left: 52%;
  top: -4%;
  width: 86vw;
  height: 112vh;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 1) 0%, rgba(236, 242, 255, 0.92) 28%, rgba(168, 192, 246, 0.62) 52%, rgba(86, 112, 196, 0.28) 74%, rgba(40, 50, 110, 0) 100%);
  filter: blur(24px);
  animation: drift-core 19s ease-in-out infinite alternate;
}

.glow-blue {
  left: 34%;
  top: 22%;
  width: 56vw;
  height: 62vh;
  background: radial-gradient(closest-side, rgba(96, 128, 222, 0.62) 0%, rgba(72, 96, 190, 0.32) 55%, rgba(40, 50, 120, 0) 100%);
  filter: blur(40px);
  animation: drift-blue 26s ease-in-out infinite alternate;
}

.glow-violet {
  left: 14%;
  top: 40%;
  width: 52vw;
  height: 46vh;
  background: radial-gradient(closest-side, rgba(84, 70, 160, 0.42) 0%, rgba(60, 50, 130, 0.18) 60%, rgba(30, 24, 70, 0) 100%);
  filter: blur(46px);
  animation: drift-violet 31s ease-in-out infinite alternate;
}

/* Wisps through the brightest part, from an SVG noise texture. */
.smoke {
  position: absolute;
  left: 52%;
  top: -10%;
  width: 66vw;
  height: 120vh;
  background: url(/smoke.svg) center / cover no-repeat;
  opacity: 0.34;
  -webkit-mask-image: radial-gradient(closest-side, #000 10%, transparent 72%);
  mask-image: radial-gradient(closest-side, #000 10%, transparent 72%);
  animation: drift-smoke 37s ease-in-out infinite alternate;
}

.ray {
  position: absolute;
  left: 76%;
  top: 46%;
  width: 26vw;
  height: 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(40, 90, 230, 0) 0%, rgba(52, 110, 245, 0.95) 22%, rgba(120, 190, 255, 0.85) 70%, rgba(170, 245, 255, 0) 100%);
  filter: blur(3px);
  transform: rotate(27deg);
  transform-origin: left center;
  animation: ray 14s ease-in-out infinite alternate;
}

@keyframes drift-core {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-4vw, 3vh, 0) scale(1.07); }
}

@keyframes drift-blue {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(5vw, -4vh, 0) scale(1.1); }
}

@keyframes drift-violet {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(6vw, -3vh, 0); }
}

@keyframes drift-smoke {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to { transform: translate3d(-3vw, 2vh, 0) rotate(4deg); }
}

@keyframes ray {
  from { opacity: 0.75; transform: rotate(27deg) translateX(0); }
  to { opacity: 1; transform: rotate(29deg) translateX(-1.5vw); }
}

/* With WebGL the canvas carries the light and the CSS layers fade out. */
#light-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.has-gl #light-canvas {
  opacity: 1;
}

.glow,
.smoke,
.ray {
  transition: opacity 0.9s ease;
}

.has-gl .glow,
.has-gl .smoke,
.has-gl .ray {
  opacity: 0;
  animation: none;
}

/* ------------------------------------------------------------ phones */

@media (max-width: 760px) {
  .stage {
    justify-content: flex-end;
    padding: 0 max(16px, env(safe-area-inset-right)) max(22vh, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .wordmark {
    font-size: min(18vw, 100px);
  }

  .line {
    margin-top: 3vh;
    font-size: 18px;
  }

  .glow-core {
    left: 14%;
    top: 4%;
    width: 130vw;
    height: 70vh;
  }

  .glow-blue {
    left: -10%;
    top: 26%;
    width: 120vw;
    height: 50vh;
  }

  .glow-violet {
    left: -20%;
    top: 34%;
    width: 110vw;
    height: 40vh;
  }

  .smoke {
    left: 10%;
    top: -20%;
    width: 120vw;
    height: 80vh;
  }

  .ray {
    left: 50%;
    top: 36%;
    width: 52vw;
    height: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow,
  .smoke,
  .ray {
    animation: none;
  }
}
