/* ASCII Study / 001 — self-contained; fills whatever window it's in. */
:root {
  --font-mono: "degular-mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-shape: "degular-variable", sans-serif; /* draws the numerals */
  --paper: #f2f2f2;
  --characters: #1e1f1d;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

.root {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}

.art {
  position: relative;
}

.base,
.sweep {
  font-family: var(--font-mono);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
  user-select: none;
}

.base {
  color: var(--characters);
  opacity: 0;
}

/* One-off intro: a blue sweep that settles into the character colour. */
.sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
    in oklch 90deg,
    var(--characters) 0%,
    var(--characters) 26%,
    #0c1e3d 32%,
    #123a7a 40%,
    #0056ff 50%,
    #2f6fff 56%,
    #6d9bff 64%,
    #b8d0ff 72%,
    #eef4ff 82%,
    var(--paper) 90%,
    var(--paper) 100%
  );
  background-repeat: no-repeat;
  background-size: 400% 100%;
  background-position: 100% 0;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.play .base {
  animation: show 0.12s ease-out 0.6s forwards;
}

.play .sweep {
  animation:
    sweep 0.75s cubic-bezier(0.2, 0, 0.3, 0.3) forwards,
    fade 0.75s linear forwards,
    blur 0.75s ease-out forwards;
}

@keyframes sweep {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@keyframes fade {
  0%,
  98.5% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes blur {
  0% {
    filter: blur(4px);
  }
  80% {
    filter: blur(0.5px);
  }
  100% {
    filter: blur(0);
  }
}

@keyframes show {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .base,
  .play .base {
    opacity: 1;
    animation: none;
  }

  .sweep {
    display: none;
  }
}
