@font-face {
  font-family: "DepartureMono-Regular-Local";
  src: url("/assets/fonts/DepartureMono-Regular.woff") format("woff");
  font-display: swap;
  font-weight: normal;
  font-style: normal;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  cursor: url("/assets/img/cursor.png"), default;
}

#c {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 7vh 1.5rem 11vh;
  z-index: 2;
  pointer-events: none;
  transition: opacity 2s ease-in-out;
}

.ui.fade-out {
  opacity: 0;
}

.splash-title {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1rem, 3vw, 2.2rem);
  padding-left: 0.28em;
  color: #050505;
  letter-spacing: 0.28em;
  text-align: center;
  line-height: 1.7;

  filter: drop-shadow(0 0 3px #ff5a00);

  animation: blackHoleGlow 8s ease-in-out infinite;
}

@keyframes blackHoleGlow {
  0%,
  100% {
    text-shadow:
      0 0 2px #fff9d8,
      0 0 8px #ffcc00,
      0 0 18px #ffb300,
      0 0 38px #ff6a00,
      0 0 70px rgba(255, 80, 0, 0.55);
  }

  18% {
    text-shadow:
      0 0 1px #fff9d8,
      0 0 5px #ffd84d,
      0 0 12px #ffb300,
      0 0 22px #ff7700,
      0 0 45px rgba(255, 100, 0, 0.4);
  }

  45% {
    text-shadow:
      0 0 3px #ffffff,
      0 0 12px #ffe766,
      0 0 30px #ffcc00,
      0 0 65px #ff8800,
      0 0 110px rgba(255, 120, 0, 0.85);
  }

  60% {
    text-shadow:
      0 0 1px #fff4c4,
      0 0 6px #ffcc00,
      0 0 15px #ff9900,
      0 0 30px #ff5500,
      0 0 55px rgba(255, 50, 0, 0.45);
  }

  82% {
    text-shadow:
      0 0 4px #ffffff,
      0 0 14px #ffe766,
      0 0 34px #ffcc00,
      0 0 80px #ff9900,
      0 0 140px rgba(255, 180, 0, 0.9);
  }
}

.animations-disabled {
  animation: none;
}

.cta {
  pointer-events: all;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.5rem, 1.2vw, 0.78rem);
  color: #b794f6;
  text-decoration: none;
  display: inline-block;
  padding: 1.1em 2.1em;
  border: 2px solid #b794f6;
  letter-spacing: 0.14em;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: url("/assets/img/pointer.png"), pointer;

  transition:
    color 0.22s,
    background 0.22s,
    border-color 0.22s,
    transform 0.22s,
    box-shadow 0.22s;

  box-shadow:
    0 0 16px rgba(183, 148, 246, 0.55),
    0 0 40px rgba(139, 92, 246, 0.25),
    inset 0 0 14px rgba(183, 148, 246, 0.1);
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(196, 181, 253, 0.2) 50%,
    transparent 70%
  );

  transform: translateX(-130%);
  transition: transform 0.45s ease;
}

.cta:hover {
  color: #ffffff;
  border-color: #d8b4fe;
  background: rgba(168, 85, 247, 0.12);

  box-shadow:
    0 0 30px rgba(196, 181, 253, 0.75),
    0 0 70px rgba(168, 85, 247, 0.45),
    inset 0 0 22px rgba(216, 180, 254, 0.18);
}

.cta:hover::before {
  transform: translateX(130%);
}

.mode-label {
  font-family: "Press Start 2P", monospace;
  font-size: 0.7em;
  color: #c08a4f;
  padding-top: 15px;
  text-align: center;
  line-height: 1.8;
  max-width: 90vw;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  pointer-events: all;
}

.void-toggle {
  position: relative;
  display: inline-block;
  width: 62px;
  height: 28px;
}

.void-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  z-index: 1;
  cursor: url("/assets/img/pointer.png"), pointer;
}

.void-toggle .slider {
  position: absolute;
  inset: 0;

  cursor: url("/assets/img/pointer.png"), pointer;

  border-radius: 999px;

  background: rgba(20, 12, 35, 0.65);

  border-top: 2px solid rgba(216, 180, 255, 0.18);
  border-left: 2px solid rgba(216, 180, 255, 0.1);

  border-right: 1px solid rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(0, 0, 0, 0.65);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -2px 4px rgba(0, 0, 0, 0.4);

  transition: all 0.25s ease;
}

.void-toggle .slider::before {
  content: "";

  position: absolute;

  width: 20px;
  height: 20px;

  left: 4px;
  top: 3px;

  border-radius: 50%;

  background: linear-gradient(180deg, #d8b4fe, #a584e4);

  box-shadow:
    0 0 8px rgba(216, 180, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);

  transition: transform 0.25s ease;
}

.void-toggle input:checked + .slider {
  box-shadow:
    0 0 8px rgba(165, 132, 228, 0.35),
    0 0 18px rgba(138, 88, 231, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.void-toggle input:checked + .slider::before {
  transform: translateX(34px);
}

.void-toggle input:not(:checked) + .slider {
  opacity: 0.75;
}

.void-toggle input:not(:checked) + .slider::before {
  background: linear-gradient(180deg, #5c4b77, #3a294f);

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.button-group {
  pointer-events: all;

  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 1.3em;
}

@keyframes btnPulse {
  0%,
  100% {
    box-shadow:
      0 0 16px #a684e47e,
      0 0 40px #8d4fff,
      inset 0 0 14px rgba(255, 107, 53, 0.09);
  }
  50% {
    box-shadow:
      0 0 24px #ffbb008f,
      0 0 60px #a58700,
      inset 0 0 20px rgba(255, 107, 53, 0.13);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-title,
  .cta {
    animation: none;
  }
  .cta,
  .cta::before {
    transition: none;
  }
}

@media (max-width: 600px) {
  .ui {
    padding-bottom: 3vh;
  }

  .button-group {
    gap: 0.7rem;
  }

  .button-group .mode-label {
    padding-top: 5px !important;
  }
}

/* polish layer */
.splash-crt {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at center,
      transparent 56%,
      rgba(0, 0, 0, 0.62) 100%
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.028) 0 1px,
      transparent 1px 3px
    );
}

/* smooth fade-in on load (replaces the old stepped CRT flicker, which
   made all text and buttons blink on every reload) */
@keyframes uiFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ui-power-on {
  animation: uiFadeIn 1.2s ease-out 0.2s backwards;
}

.cta {
  animation: btnPulse 3.4s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(183, 148, 246, 0.7);
}

.cta:hover,
.cta:focus-visible {
  animation: none;
}

.cta:active {
  transform: translateY(2px) scale(0.98);
}

.cta:focus-visible,
.void-toggle input:focus-visible + .slider {
  outline: 2px solid #ffcc00;
  outline-offset: 4px;
}

.mode-label small {
  display: block;
  margin: 10px auto 0;
  max-width: 36em;
  font-size: 0.8em;
}

.fx-off .cta {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .ui-power-on,
  .cta {
    animation: none;
  }
}
