:root {
  --black: #020205;
  --ink: #f2f0ec;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #9a5cff; color: #fff; }

.identity {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100svh;
  overflow: hidden;
  background: var(--black);
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* The name written in caustic light (light.js). */
.light-canvas {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.light-stage {
  container-type: size;
  display: grid;
  place-items: center;
  min-height: 0;
}

/* Static type stands in only when there is no light: without scripts, or when WebGL fails. */
.light-fallback {
  color: #dfe2f6;
  font-family: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  font-size: min(23cqw, 66cqh);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  text-shadow: 0 0 0.25em rgba(133, 143, 250, 0.45);
}

/* It is hidden while the light loads as well as once it is ready, with no fade: the type and the
   lit word are not the same size, so showing both for a moment wrote the name twice. */
[data-light="pending"] .light-fallback,
[data-light="ready"] .light-fallback {
  opacity: 0;
}

.home-playground:not([data-light="ready"]) .light-canvas {
  opacity: 0;
}

/* The browser paints before home.js can set pending. Keep the same backdrop through
   the first complete frame. A stalled module or font still gets a readable word. */
@media (scripting: enabled) {
  .home-playground:not([data-light="ready"]):not([data-light="fallback"]) .light-fallback {
    opacity: 0;
    animation: reveal-static-word 0s 1.5s forwards;
  }
}

@keyframes reveal-static-word {
  to { opacity: 1; }
}

.identity-line {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: 1.5rem clamp(1.25rem, 2.5vw, 2.5rem);
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  color: rgba(242, 240, 236, 0.58);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-align: left;
}

@media (max-width: 520px) {
  .identity-line {
    flex-direction: column;
    padding-inline: 1rem;
    text-align: center;
  }
}
