:root {
  color-scheme: dark;
  background: #120f19;
  color: #efe5ff;
  --accent: #c297ff;
  --control-inset: clamp(25px, calc(3.6vw + 9px), 65px);
}

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

body { margin: 0; }

.home {
  display: grid;
  place-items: center;
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--control-inset) + 39px) 20px;
  background:
    repeating-linear-gradient(0deg, #0a070e1f 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 50% 44%, #261b37, #1a1325 44%, #120f19 76%);
}

.pixel-bars {
  position: absolute;
  inset: var(--control-inset);
  pointer-events: none;
}

.pixel-bars span {
  position: absolute;
  width: 61px;
  height: 5px;
  background: repeating-linear-gradient(to right, #8055ad 0 5px, transparent 5px 8px);
}

.pixel-bars span::after {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  background: #e5cdff;
  animation: pixel-sweep 5s infinite paused;
}

.home[data-playing] .pixel-bars span::after { animation-play-state: running; }

.pixel-bars span:first-child { top: 4px; left: 0; }

.pixel-bars span:last-child {
  bottom: 19px;
  right: 55px;
  transform: scaleX(-1);
}

.pixel-bars span:last-child::after { animation-delay: -2.5s; }

@keyframes pixel-sweep {
  0% { transform: translateX(0); animation-timing-function: steps(7, end); }
  20% { transform: translateX(56px); }
  28%, 100% { transform: translateX(56px); opacity: 0; }
}

.hero {
  width: min(100%, 672px);
  display: grid;
  justify-items: center;
  gap: clamp(12px, 3vw, 26px);
  padding-bottom: clamp(30px, 7vh, 70px);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

h1 { margin: 0; line-height: 0; }

h1 img {
  display: block;
  width: clamp(180px, 30vw, 360px);
  height: auto;
  image-rendering: pixelated;
}

.motion-toggle:not([hidden]) {
  position: absolute;
  bottom: var(--control-inset);
  right: var(--control-inset);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  color: #b4a3c8;
  background: transparent;
  cursor: pointer;
}

.motion-toggle:hover, .motion-toggle:focus-visible {
  border-color: #694f86;
  color: var(--accent);
}

.motion-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.motion-toggle span {
  width: 10px;
  height: 12px;
  border-inline: 3px solid currentColor;
}

.motion-toggle[data-paused] span {
  width: 12px;
  height: 15px;
  border: 0;
  background: currentColor;
  clip-path: polygon(0 0, 3px 0, 3px 3px, 6px 3px, 6px 6px, 12px 6px, 12px 9px, 6px 9px, 6px 12px, 3px 12px, 3px 15px, 0 15px);
}

@media (max-height: 560px) and (min-width: 681px) {
  .hero { width: min(100%, 104vh); padding-bottom: 0; }
  h1 img { width: clamp(180px, 44vh, 360px); }
}
