:root {
  color-scheme: dark;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #e8edf1;
  --muted: #8794a1;
  --blue: #9cb9cc;
  --beam-size: 184px;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #111923;
}

body {
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.scene {
  --light-x: 50vw;
  --light-y: 50vh;
  --pointer-x: 50vw;
  --pointer-y: 50vh;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  overflow: hidden;
  isolation: isolate;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 52% 48%, rgba(54, 70, 83, 0.5), transparent 46%),
    linear-gradient(135deg, #263440 0%, #1b2732 46%, #202d38 100%);
}

.scene::before,
.scene::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
}

.scene::before {
  opacity: 0.34;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.15'/%3E%3C/svg%3E");
}

.scene::after {
  z-index: 0;
  border: 1px solid rgba(214, 228, 237, 0.1);
  inset: 14px;
  pointer-events: none;
}

.topbar,
.footer {
  position: absolute;
  z-index: 2;
  right: clamp(34px, 6.1vw, 92px);
  left: clamp(34px, 6.1vw, 92px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.topbar {
  top: clamp(36px, 6.5vh, 64px);
}

.wordmark {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.wordmark__dot {
  --status-color: 255, 99, 99;
  width: 7px;
  height: 7px;
  border: 1px solid rgb(var(--status-color));
  border-radius: 50%;
  background: rgba(var(--status-color), 0.22);
  box-shadow: 0 0 10px rgba(var(--status-color), 0.72);
  animation: status-pulse 1.25s ease-in-out infinite;
}

.reveal-enabled .wordmark__dot {
  --status-color: 99, 255, 125;
}

.reveal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.reveal-toggle:focus-visible {
  outline: 1px solid var(--blue);
  outline-offset: 5px;
}

.reveal-toggle__track {
  width: 36px;
  height: 20px;
  padding: 3px;
  border: 1px solid rgba(232, 237, 241, 0.5);
  border-radius: 20px;
  transition: border-color 160ms ease, background 160ms ease;
}

.reveal-toggle__track::after {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}

.reveal-toggle[aria-checked="true"] .reveal-toggle__track {
  border-color: #8dffa0;
  background: rgba(99, 255, 125, 0.15);
}

.reveal-toggle[aria-checked="true"] .reveal-toggle__track::after {
  background: #8dffa0;
  transform: translateX(16px);
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.24;
    box-shadow: 0 0 4px rgba(var(--status-color), 0.35);
    transform: scale(0.86);
  }

  50% {
    opacity: 1;
    box-shadow:
      0 0 10px rgba(var(--status-color), 1),
      0 0 24px rgba(var(--status-color), 0.88);
    transform: scale(1.18);
  }
}

.message {
  position: absolute;
  top: 49%;
  left: 50%;
  width: min(630px, 82vw);
  transform: translate(-50%, -50%);
  text-align: center;
}

h1 {
  margin: 0;
  color: #e8eef1;
  font-size: clamp(70px, 12vw, 156px);
  font-weight: 500;
  letter-spacing: -0.095em;
  line-height: 0.79;
}

.message__period {
  color: #a7c4d5;
}

.glow-text {
  color: #e8eef1;
  text-shadow: 0 0 0 rgba(172, 215, 239, 0);
  transition: color 160ms ease, text-shadow 160ms ease;
}

.glow-text.is-glowing {
  color: #f4fbff;
  text-shadow:
    0 0 11px rgba(187, 224, 243, 0.9),
    0 0 30px rgba(138, 198, 229, 0.7),
    0 0 58px rgba(91, 164, 201, 0.45);
}

.morph-trigger {
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  cursor: none;
}

.morph-content {
  display: inline-block;
  white-space: nowrap;
}

.morph-letter {
  display: inline-block;
  transform-origin: 50% 65%;
}

.morph-letter.is-leaving {
  animation: letter-dissolve 320ms cubic-bezier(0.6, 0, 0.8, 0.25) both;
}

.morph-letter.is-arriving {
  animation: letter-materialize 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes letter-dissolve {
  to {
    opacity: 0;
    filter: blur(9px);
    transform: translate(var(--drift-x), var(--drift-y)) rotate(var(--tilt)) scale(0.68);
  }
}

@keyframes letter-materialize {
  0% {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(0.18em) scale(0.78);
  }

  68% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-0.035em) scale(1.045);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

.transform-ripple {
  position: absolute;
  z-index: 5;
  width: 150vmax;
  height: 150vmax;
  border: 1px solid rgba(183, 224, 244, 0.4);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(161, 210, 237, 0.1), transparent 68%);
  box-shadow: 0 0 54px rgba(112, 183, 216, 0.18);
  pointer-events: none;
  animation: eclipse-ripple 860ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transform: translate(-50%, -50%) scale(0.015);
}

@keyframes eclipse-ripple {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.015);
  }

  14% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

.message p {
  margin: 38px 0 0;
  color: rgba(222, 232, 238, 0.68);
  font-size: clamp(12px, 1.1vw, 14px);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.footer {
  bottom: clamp(37px, 6vh, 58px);
  min-height: 20px;
  justify-content: center;
}

.footer__hint {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: #c1d3de;
}

.footer__hint-icon {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(191, 215, 229, 0.7);
  border-radius: 50%;
}

.footer__hint-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c1d3de;
  content: "";
  transform: translate(-50%, -50%);
}

.mobile-hint {
  display: none;
}

.darkness {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle 132px at var(--light-x) var(--light-y),
      rgba(177, 216, 237, 0.12) 0,
      rgba(151, 195, 219, 0.045) 38%,
      transparent 100%
    ),
    radial-gradient(
      circle var(--beam-size) at var(--light-x) var(--light-y),
      rgba(5, 10, 17, 0) 0,
      rgba(5, 10, 17, 0.04) 48%,
      rgba(5, 10, 17, 0.5) 73%,
      rgba(5, 10, 17, 0.91) 100%
    );
}

.flashlight {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  width: calc(var(--beam-size) * 2);
  height: calc(var(--beam-size) * 2);
  border: 1px solid rgba(194, 218, 232, 0.32);
  border-radius: 50%;
  box-shadow:
    0 0 26px rgba(141, 184, 210, 0.08),
    inset 0 0 32px rgba(141, 184, 210, 0.025);
  pointer-events: none;
  transform: translate3d(var(--pointer-x), var(--pointer-y), 0) translate(-50%, -50%);
  will-change: transform;
}

.flashlight::before,
.flashlight::after {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(194, 218, 232, 0.11);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.flashlight::before {
  width: 344px;
  height: 344px;
}

.flashlight::after {
  width: 9px;
  height: 9px;
  border-color: rgba(218, 234, 242, 0.55);
  box-shadow: 0 0 11px rgba(167, 206, 226, 0.4);
}

@media (max-width: 700px) {
  .scene {
    --beam-size: 128px;
    min-height: 100svh;
    background:
      radial-gradient(ellipse at 50% 46%, rgba(54, 70, 83, 0.44), transparent 54%),
      linear-gradient(145deg, #263440 0%, #1b2732 50%, #202d38 100%);
  }

  .scene::after {
    inset: 9px;
  }

  .topbar,
  .footer {
    right: 30px;
    left: 30px;
    font-size: 9px;
  }

  .topbar {
    top: 36px;
  }

  .message {
    top: 47%;
    width: 88vw;
  }

  h1 {
    font-size: clamp(72px, 16vw, 116px);
  }

  .message p {
    max-width: 245px;
    margin: 30px auto 0;
    line-height: 1.7;
  }

  .footer {
    z-index: 5;
    bottom: 35px;
    justify-content: center;
  }

  .footer__index,
  .footer__count,
  .desktop-hint {
    display: none;
  }

  .mobile-hint {
    display: inline;
    color: #e8edf1;
    font-weight: 600;
    text-shadow: 0 0 12px rgba(172, 215, 239, 0.24);
  }

  .flashlight {
    width: calc(var(--beam-size) * 2);
    height: calc(var(--beam-size) * 2);
  }

  .flashlight::before {
    width: 234px;
    height: 234px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  .wordmark__dot {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .morph-letter,
  .transform-ripple {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}
