/* Page foundations: every value comes from a design token. */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--surface-container);
  color: var(--text-primary);
  font-family: var(--text-style-body-m-font-family);
  font-size: var(--text-style-body-m-font-size);
  line-height: var(--text-style-body-m-line-height);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: var(--footer-height, var(--space-xl)); /* token-exception: footer height measured by app.js; room for the fixed footer */
}

/* Figma "Container": wordmark above the card, centred */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-l); /* clearance above and below the wordmark */
  padding: var(--space-l) var(--space-s);
}
/* Wider screens: wordmark and card sit in the middle of the viewport */
@media (min-width: 40rem) { /* token-exception: no breakpoint tokens yet */
  .page { justify-content: safe center; }
}

.page__wordmark {
  margin: 0;
  color: var(--text-primary);
  line-height: 0;
}
.page__wordmark svg {
  display: block;
  height: var(--space-l);
  aspect-ratio: 343 / 42;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--surface-container);
}
.backdrop canvas { transition: opacity 0.8s linear; }
.backdrop canvas.is-entering { opacity: 0; }

/* Visualiser looks can be bright (Altara is mostly sky), so a tint keeps the wordmark and card readable.
   It fades in with the look, not in one step. */
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--surface-container) 45%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s linear;
}
.backdrop.has-glitch::after { opacity: 1; }
/* Backgrounds stack, so the glitch can fade in over the grain */
.backdrop canvas,
.backdrop video,
.backdrop img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
