:root {
  color-scheme: dark;
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.74);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: none;
}

a,
button {
  cursor: none;
}

.screen {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
  isolation: isolate;
}

.hero {
  display: grid;
  justify-items: center;
  gap: clamp(28px, 4.8vw, 50px);
  width: min(1120px, 100%);
  text-align: center;
}

.title {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.24em;
  margin: 0;
  color: var(--fg);
  font-family: "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(44px, 8.2vw, 118px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.86;
  text-transform: uppercase;
}

.title__word {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(0, 0.72em, 0) scaleY(1.08);
  transform-origin: 50% 100%;
  animation: word-in 920ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(360ms + (var(--word-index) * 150ms));
}

.subtitle {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 0.32em;
  color: var(--muted);
  font-size: clamp(12px, 1.1vw, 15px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  opacity: 0;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateY(10px);
  animation: subtitle-in 700ms cubic-bezier(0.16, 1, 0.3, 1) 1350ms forwards;
  transition: color 200ms ease;
}

.subtitle::before,
.subtitle::after {
  color: currentColor;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.subtitle::before {
  content: "[";
}

.subtitle::after {
  content: "]";
}

.subtitle:hover,
.subtitle:focus-visible {
  color: var(--fg);
}

.subtitle:hover::before,
.subtitle:focus-visible::before {
  transform: translateX(-0.28em);
}

.subtitle:hover::after,
.subtitle:focus-visible::after {
  transform: translateX(0.28em);
}

.subtitle:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 8px;
}

#trail {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100vw;
  height: 100vh;
  opacity: 1;
  pointer-events: none;
  transition: opacity 500ms ease;
}

.cursor-trail {
  position: fixed;
  inset: 0;
  z-index: 4;
  opacity: 1;
  pointer-events: none;
  transition: opacity 500ms ease;
}

body.trail-muted #trail,
body.trail-muted .cursor-trail {
  opacity: 0;
}

.cursor-spark {
  position: fixed;
  left: var(--spark-x);
  top: var(--spark-y);
  width: var(--spark-size);
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.34);
  opacity: 0.72;
  transform: translate(-50%, -50%) scale(0.72);
  animation: spark-out 1400ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(circle at 18% 33%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1px),
    radial-gradient(circle at 77% 61%, rgba(255, 255, 255, 0.28) 0 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;
}

@keyframes word-in {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scaleY(1);
  }
}

@keyframes subtitle-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spark-out {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.6);
  }
}

@media (max-width: 680px) {
  .screen {
    padding: 18px;
  }

  .hero {
    gap: 30px;
  }

  .title {
    font-size: clamp(40px, 13vw, 72px);
    line-height: 0.9;
  }
}

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

@media (hover: none), (pointer: coarse) {
  body,
  a,
  button {
    cursor: auto;
  }

  #trail {
    display: none;
  }

  .cursor-trail {
    display: none;
  }
}
