/* Blitzraum, coming soon. Type follows the Blitzraum design system:
   the system sans, the name at 700 in ink (its dark theme value, on space), no web fonts. */

:root {
  --void: #05070b;
  --ink: #f2f4f7;
  --sans: system-ui, sans-serif;
  /* Advance width of "Blitzraum" in em at 700, measured in the system sans. */
  --word: 4.32;
  --gutter: max(24px, 6vw);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Home: one fixed frame, nothing scrolls. */

html:has(.home) {
  height: 100%;
}

.home {
  height: 100%;
  overflow: hidden;
  background: var(--void);
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* Roughly the frame's tones, shown until the first rendered frame fades in. */
  background:
    radial-gradient(60% 38% at 70% 64%, #2a3344 0%, #111722 45%, transparent 75%),
    var(--void);
}

.stage canvas,
.stage video,
.stage .poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage canvas {
  opacity: 0;
  transition: opacity 1.6s ease-out;
}

.stage.is-live canvas {
  opacity: 1;
}

.stage.is-poster {
  background: var(--void) url("/media/poster.jpg") center / cover no-repeat;
}

.stage.is-poster canvas {
  display: none;
}

/* Video mode keeps the frame dark at the edges like the shader does. */
.stage.is-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 55%, transparent 55%, rgb(3 5 8 / 0.6) 100%);
  pointer-events: none;
}

/* The name: right side, its baseline at 70% of the frame. --bl is the
   baseline's depth in the line box, in em; main.js measures it, since every
   platform's system font differs. */

.title {
  --name: min(calc(40vw / var(--word)), 22vh);
  position: absolute;
  top: 70%;
  right: var(--gutter);
  margin: 0;
  text-align: right;
}

.name {
  margin: calc(var(--bl, 0.86) * -1em) 0 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: var(--name);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--ink);
}

.name span {
  display: inline-block;
  animation: rise 1.6s cubic-bezier(0.2, 0.7, 0.25, 1) 0.5s both;
}

@keyframes rise {
  from {
    transform: translateY(0.08em) scale(0.985);
    opacity: 0;
    filter: blur(0.05em);
  }
  to {
    transform: none;
    opacity: 1;
    filter: none;
  }
}

@media (max-width: 700px) and (orientation: portrait) {
  .title {
    --name: calc(80vw / var(--word));
  }
}

@media (prefers-reduced-motion: reduce) {
  .name span {
    animation: none;
  }
  .stage canvas {
    transition: none;
  }
}
