:root {
  --black: #000000;
  --night: #08070d;
  --ink: #ffffff;
  --muted: #b8d8e8;
  --hot-pink: #ff0a8a;
  --deep-pink: #c8005a;
  --cyan: #00d4ff;
  --aqua: #22ffe5;
  --blue: #1768ff;
  --violet: #7657ff;
  --white-glow: #ffffff;
  --panel: rgb(7 9 18 / 78%);
  --panel-strong: rgb(12 15 31 / 88%);
  --line: rgb(0 212 255 / 36%);
}

html {
  background: var(--black);
}

body {
  background: var(--black);
  margin: 0;
  min-width: 320px;
}

* {
  box-sizing: border-box;
}

body,
button,
textarea {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  align-items: center;
  background: var(--black);
  color: var(--ink);
  display: flex;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  padding: 56px 24px;
  position: relative;
}

body.intro-pending .app-shell::before,
body.intro-pending .content::before,
body.intro-pending .content::after,
body.intro-pending .answer-card,
body.intro-pending .answer-card .reveal {
  animation: none;
  opacity: 0;
}

body.intro-pending .brand-lockup {
  animation: none;
  opacity: 0;
  transform: none;
}

body.intro-complete .brand-lockup {
  animation: none;
  opacity: 1;
  transform: none;
}

.app-shell::before {
  animation: background-reveal 1200ms ease 220ms both;
  background:
    radial-gradient(circle at 50% 16%, rgb(255 10 138 / 26%), transparent 28%),
    radial-gradient(circle at 26% 72%, rgb(0 212 255 / 22%), transparent 32%),
    radial-gradient(circle at 78% 64%, rgb(118 87 255 / 20%), transparent 30%),
    linear-gradient(180deg, #050409, #000000 72%);
  content: "";
  inset: 0;
  opacity: 0;
  position: absolute;
  z-index: -3;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin: 0 auto;
  max-width: 740px;
  position: relative;
  width: 100%;
}

.content::before,
.content::after {
  animation: sparkle 2600ms ease-in-out infinite alternate;
  background: var(--white-glow);
  border-radius: 999px;
  box-shadow:
    0 0 10px var(--white-glow),
    0 0 22px var(--cyan),
    0 0 34px var(--hot-pink);
  content: "";
  height: 4px;
  opacity: 0.86;
  position: absolute;
  width: 4px;
}

.content::before {
  left: -16px;
  top: 82px;
}

.content::after {
  animation-delay: 900ms;
  bottom: 22px;
  right: -8px;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 16px;
}

.intro-stage {
  align-items: center;
  background: var(--black);
  display: flex;
  inset: 0;
  justify-content: center;
  overflow: hidden;
  padding: 32px;
  position: fixed;
  z-index: 20;
}

.intro-stage[hidden] {
  display: none;
}

.intro-stage::before {
  animation: background-reveal 900ms ease both;
  background:
    radial-gradient(circle at 50% 45%, rgb(255 10 138 / 28%), transparent 30%),
    radial-gradient(circle at 40% 58%, rgb(0 212 255 / 24%), transparent 34%),
    linear-gradient(180deg, #020106, #000000);
  content: "";
  inset: 0;
  position: absolute;
}

.intro-stage::after {
  animation: sparkle 2100ms ease-in-out 400ms infinite alternate;
  background: var(--white-glow);
  border-radius: 999px;
  box-shadow:
    0 0 12px #ffffff,
    0 0 28px var(--cyan),
    0 0 54px var(--hot-pink);
  content: "";
  height: 5px;
  position: absolute;
  right: 21%;
  top: 31%;
  width: 5px;
}

.intro-title {
  color: #ffffff;
  font-size: clamp(3.4rem, 12vw, 10rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.94;
  max-width: calc(100vw - 48px);
  position: relative;
  text-align: center;
  transform-origin: left top;
  transition: transform 1100ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  z-index: 1;
}

.intro-text {
  display: inline-block;
  min-width: 0.2em;
}

.intro-caret {
  animation: cursor-blink 520ms linear infinite;
  border-right: 0.08em solid currentColor;
  display: inline-block;
  filter:
    drop-shadow(0 0 8px var(--white-glow))
    drop-shadow(0 0 18px var(--cyan))
    drop-shadow(0 0 30px var(--hot-pink));
  height: 0.84em;
  margin-left: 0.08em;
  transform: translateY(0.08em);
}

body.intro-docking .intro-stage {
  background: transparent;
  pointer-events: none;
}

body.intro-docking .intro-stage::before,
body.intro-docking .intro-stage::after,
body.intro-docking .intro-caret {
  opacity: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 58px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 0.98;
}

.neon-text {
  color: #ffffff;
  text-shadow:
    0 0 5px var(--hot-pink),
    0 0 10px var(--hot-pink),
    0 0 20px var(--hot-pink),
    0 0 40px var(--hot-pink),
    0 0 80px var(--hot-pink);
  animation: glow 8s ease-in-out infinite alternate;
}

.answer-card {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 8%), rgb(255 255 255 / 3%)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow:
    0 0 18px rgb(0 212 255 / 20%),
    0 0 40px rgb(255 10 138 / 16%),
    0 32px 80px rgb(0 0 0 / 72%);
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
  padding: 30px;
  position: relative;
}

.answer-card::before {
  background:
    linear-gradient(90deg, var(--hot-pink), #ffffff 32%, var(--cyan) 64%, var(--violet));
  box-shadow:
    0 0 10px var(--hot-pink),
    0 0 22px var(--cyan),
    0 0 34px rgb(118 87 255 / 70%);
  content: "";
  height: 3px;
  inset: 0 0 auto;
  position: absolute;
}

.answer-card::after {
  background:
    radial-gradient(circle at 18% 24%, rgb(255 255 255 / 20%), transparent 8%),
    radial-gradient(circle at 78% 22%, rgb(0 212 255 / 18%), transparent 10%),
    radial-gradient(circle at 86% 82%, rgb(255 10 138 / 14%), transparent 12%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.answer-card > * {
  position: relative;
  z-index: 1;
}

.answer-card--shared {
  gap: 18px;
}

.question-text,
.shared-title {
  color: #ffffff;
  font-size: 32px;
  font-weight: 840;
  letter-spacing: 0;
  line-height: 1.08;
  max-width: 12em;
  text-shadow:
    0 0 4px rgb(255 255 255 / 76%),
    0 0 12px rgb(0 212 255 / 74%),
    0 0 28px rgb(255 10 138 / 46%);
}

.shared-status {
  align-self: flex-start;
  background: rgb(0 212 255 / 12%);
  border: 1px solid rgb(0 212 255 / 64%);
  border-radius: 999px;
  box-shadow:
    0 0 10px rgb(0 212 255 / 42%),
    inset 0 0 12px rgb(255 255 255 / 10%);
  color: #cbf8ff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 8px 10px;
  text-shadow: 0 0 8px var(--cyan);
  text-transform: uppercase;
}

.saved-answer {
  color: #d9f7ff;
  font-size: 21px;
  line-height: 1.42;
  max-width: 34em;
  text-shadow: 0 0 14px rgb(0 212 255 / 26%);
}

.action-form,
.answer-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.answer-input {
  background:
    linear-gradient(180deg, rgb(0 0 0 / 54%), rgb(5 8 20 / 76%)),
    var(--panel-strong);
  border: 1px solid rgb(0 212 255 / 54%);
  border-radius: 8px;
  box-shadow:
    inset 0 0 22px rgb(0 212 255 / 10%),
    0 0 18px rgb(0 212 255 / 18%),
    0 0 28px rgb(255 10 138 / 10%);
  color: #ffffff;
  font: inherit;
  font-size: 21px;
  line-height: 1.42;
  min-height: 190px;
  outline: none;
  padding: 15px 16px;
  resize: vertical;
  width: 100%;
}

.answer-input::placeholder {
  color: rgb(203 248 255 / 64%);
}

.answer-input:focus {
  border-color: #ffffff;
  box-shadow:
    0 0 6px rgb(255 255 255 / 80%),
    0 0 18px rgb(0 212 255 / 76%),
    0 0 34px rgb(255 10 138 / 40%),
    inset 0 0 22px rgb(0 212 255 / 16%);
}

.field-error {
  color: #ffd8eb;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  text-shadow:
    0 0 8px var(--hot-pink),
    0 0 18px var(--hot-pink);
}

.primary-action {
  align-items: center;
  appearance: none;
  background:
    linear-gradient(135deg, var(--hot-pink), var(--deep-pink) 48%, var(--blue));
  border: 1px solid rgb(255 255 255 / 46%);
  border-radius: 8px;
  box-shadow:
    0 0 10px rgb(255 255 255 / 54%),
    0 0 24px rgb(255 10 138 / 74%),
    0 0 42px rgb(0 212 255 / 30%);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 18px;
  font-weight: 820;
  justify-content: center;
  line-height: 1.2;
  min-height: 52px;
  padding: 14px 18px;
  text-shadow: 0 0 10px rgb(255 255 255 / 72%);
  transition:
    box-shadow 180ms ease,
    filter 180ms ease,
    transform 180ms ease;
  width: 100%;
}

.primary-action:disabled {
  background: #242333;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
}

.primary-action:not(:disabled):hover {
  box-shadow:
    0 0 12px rgb(255 255 255 / 70%),
    0 0 30px rgb(255 10 138 / 86%),
    0 0 56px rgb(0 212 255 / 48%);
  filter: saturate(1.12);
  transform: translateY(-1px);
}

.primary-action:focus-visible {
  outline: 3px solid rgb(0 212 255 / 64%);
  outline-offset: 3px;
}

.reveal {
  animation: reveal-up 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}

.reveal-brand {
  --reveal-delay: 420ms;
}

.staged-reveal.reveal-card {
  --reveal-delay: 760ms;
}

.staged-reveal .reveal-question {
  --reveal-delay: 1060ms;
}

.staged-reveal .reveal-form {
  --reveal-delay: 1280ms;
}

.quick-reveal.reveal-card {
  --reveal-delay: 80ms;
}

.quick-reveal .reveal-question {
  --reveal-delay: 150ms;
}

.quick-reveal .reveal-form {
  --reveal-delay: 240ms;
}

.answer-card.htmx-swapping {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes background-reveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes glow {
  0% {
    text-shadow:
      0 0 5px var(--hot-pink),
      0 0 10px var(--hot-pink),
      0 0 20px var(--hot-pink),
      0 0 40px var(--hot-pink),
      0 0 80px var(--hot-pink);
  }

  100% {
    text-shadow:
      0 0 10px var(--cyan),
      0 0 20px var(--cyan),
      0 0 40px var(--cyan),
      0 0 80px var(--cyan),
      0 0 160px var(--cyan);
  }
}

@keyframes sparkle {
  from {
    opacity: 0.38;
    transform: scale(0.7);
  }

  to {
    opacity: 1;
    transform: scale(1.35);
  }
}

@keyframes cursor-blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .app-shell {
    align-items: stretch;
    padding: 38px 18px;
  }

  .content {
    gap: 24px;
    justify-content: center;
  }

  .content::before {
    left: 10px;
    top: 64px;
  }

  .content::after {
    bottom: 16px;
    right: 12px;
  }

  h1 {
    font-size: 42px;
  }

  .intro-stage {
    padding: 22px;
  }

  .intro-title {
    font-size: 14vw;
  }

  .answer-card {
    padding: 24px 18px 20px;
  }

  .question-text,
  .shared-title {
    font-size: 27px;
    max-width: none;
  }

  .saved-answer,
  .answer-input {
    font-size: 18px;
  }
}

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