@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap");

/* A single hue lives on :root and is inherited by every spectrum border.
   htmx only swaps inner fragments and never re-renders :root, so the animation
   is shared instead of restarted and all borders stay in step with the wave. */
@property --spectrum-hue {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}

:root {
  color-scheme: light;
  --ink: #2a1a44;
  --muted: #6d5a87;
  --night: #241640;
  --violet: #5b2e91;
  --violet-light: #c4a9e0;
  --gold: #b9770e;
  --gold-light: #ffcf3f;
  --blue: #2f6fb5;
  --pink: #c23f7e;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #fbf7ff;
  --shadow: rgba(42, 26, 68, 0.28);
  --spectrum-border: #994ab5;
  --pixel: "Press Start 2P", "Courier New", monospace;
  --mono: "VT323", ui-monospace, monospace;
  background: var(--night);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 20px;
  animation: spectrum-hue 64s linear infinite;
}

@keyframes spectrum-hue {
  from {
    --spectrum-hue: 0deg;
  }

  to {
    --spectrum-hue: 360deg;
  }
}

/* Reusable box edge: draws the border in a pseudo-element and hue-rotates only
   that ring, so a box's background and content keep their own colors. */
.spectrum-box {
  position: relative;
}

.spectrum-box::after {
  position: absolute;
  inset: 0;
  border: 3px solid var(--spectrum-border);
  filter: hue-rotate(var(--spectrum-hue));
  pointer-events: none;
  content: "";
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--night);
}

.spectrum {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  width: 100%;
  height: min(100vh, 100vw);
  transform: translateY(-50%);
  overflow: visible;
  z-index: -2;
  pointer-events: none;
  filter: hue-rotate(var(--spectrum-hue));
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 8px 8px;
  mix-blend-mode: screen;
  content: "";
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1100px, 100%);
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  padding: 40px 24px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--gold);
  font-family: var(--pixel);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  line-height: 1.8;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.7);
}

h1,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  line-height: 1.1;
}

.title,
.page-title {
  font-family: var(--pixel);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.title {
  color: #ff9b21;
  font-size: min(7cqw, 3rem);
  line-height: 1.2;
  white-space: nowrap;
  text-shadow:
    3px 3px 0 #fff6d8,
    6px 6px 0 #3679b1,
    9px 9px 0 #39206b;
}

.page-title {
  max-width: 680px;
  color: var(--violet);
  font-size: clamp(1.2rem, 4vw, 2.35rem);
  text-shadow: 3px 3px 0 rgba(255, 255, 255, 0.75);
}

p {
  line-height: 1.35;
}

button,
.link-button {
  display: inline-block;
  border: 2px solid #a86400;
  padding: 15px 20px;
  color: #2a1102;
  background: var(--gold-light);
  box-shadow: 0 5px 0 #8a4d12;
  font-family: var(--pixel);
  font-size: 0.62rem;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button:hover,
.link-button:hover {
  background: #ffe07a;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #8a4d12;
}

button:active,
.link-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #8a4d12;
}

button:focus-visible,
.link-button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

button:disabled,
button:disabled:hover {
  border-color: var(--violet-light);
  color: var(--muted);
  background: #efe9f7;
  box-shadow: 0 5px 0 #d8cceb;
  cursor: not-allowed;
  transform: none;
}

.secondary {
  border-color: var(--violet);
  color: var(--violet);
  background: #ffffff;
  box-shadow: 0 5px 0 var(--violet-light);
}

.secondary:hover {
  background: #f3ecfb;
  box-shadow: 0 7px 0 var(--violet-light);
}

.link-button {
  margin-top: 28px;
}

.hero {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(30px, 7vw, 72px);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--shadow);
  backdrop-filter: blur(9px) saturate(1.3);
  -webkit-backdrop-filter: blur(9px) saturate(1.3);
  text-align: center;
  container-type: inline-size;
}

.finished {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(20px, 4vw, 40px);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--shadow);
  backdrop-filter: blur(9px) saturate(1.3);
  -webkit-backdrop-filter: blur(9px) saturate(1.3);
  text-align: center;
}

.hero::before {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 9px;
  height: 9px;
  background: var(--pink);
  box-shadow: -14px 0 0 var(--blue), -28px 0 0 var(--gold);
  content: "";
}

@media (max-width: 520px) {
  :root {
    font-size: 18px;
  }

  .shell {
    padding: 22px 16px;
  }
}

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