:root {
  --ink: #0b0614;
  --ink-2: #160b28;
  --panel: #1a102c;
  --panel-lift: #24163a;
  --violet: #7b5cff;
  --violet-deep: #5a3fd4;
  --lilac: #e8d9ff;
  --mint: #57d6a4;
  --muted: #b2a3cc;
  --line: #3a2a55;
  --shadow: 0 22px 48px rgba(4, 0, 16, 0.55);
  --radius: 20px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
  color: var(--lilac);
  background: var(--ink);
  font-family: var(--font);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(100% 70% at 10% 0%, rgba(123, 92, 255, 0.28), transparent 50%),
    radial-gradient(80% 50% at 90% 100%, rgba(90, 63, 212, 0.22), transparent 45%),
    linear-gradient(180deg, #14081f, #07040e 75%);
}

button, a { font: inherit; }
button { cursor: pointer; }

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 20;
  background: #fff;
  color: #000;
  padding: 8px 12px;
  border-radius: 8px;
}

.skip:focus { left: 8px; }

#app { min-height: 100dvh; }

.shell {
  position: relative;
  min-height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  overflow: hidden;
  background: #12081f;
  box-shadow: 0 0 70px rgba(40, 10, 80, 0.45);
}

.hero {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0b0614;
}

.hero-poster,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero-poster {
  z-index: 0;
  background: #0b0614;
}

.hero-video {
  z-index: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.hero-video.is-ready {
  opacity: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    195deg,
    rgba(11, 6, 20, 0.2),
    rgba(18, 8, 36, 0.45) 48%,
    rgba(8, 4, 18, 0.72) 100%
  );
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 0;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(232, 217, 255, 0.2), 0 8px 24px rgba(90, 63, 212, 0.45);
}

.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: 0.28em;
  font-weight: 700;
}

.brand small {
  display: block;
  margin-top: -4px;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--lilac);
  opacity: 0.8;
}

.hero-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  padding: 28px 16px 0;
  color: #fff;
}

.hero-copy {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.hero-copy h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(34px, 9vw, 44px);
  line-height: 1.02;
  font-weight: 700;
}

.hero-copy h1 span {
  display: block;
  color: var(--lilac);
  font-style: italic;
}

.hero-copy p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.tags {
  margin-top: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--violet);
}

.feature-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
  padding: 10px;
  border-radius: 16px;
  background: rgba(12, 6, 24, 0.62);
  border: 1px solid rgba(123, 92, 255, 0.28);
  backdrop-filter: blur(10px);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--lilac);
}

.feature-item svg {
  width: 14px;
  height: 14px;
  color: var(--violet);
  flex: none;
}

.shade {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: rgba(6, 2, 14, 0.42);
  animation: fade-in 0.28s ease;
}

.panel,
.step {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 28px), 380px);
  animation: rise-in 0.32s ease;
}

.panel {
  background: linear-gradient(180deg, #221437, #160e28);
  border-radius: 20px;
  padding: 22px 18px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid rgba(123, 92, 255, 0.35);
  color: var(--lilac);
}

.welcome h2,
.success h2,
.matching h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 30px;
  color: #fff;
  letter-spacing: 0.02em;
}

.welcome p,
.success p,
.matching p,
.success li {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.55;
  color: #d6c8ef;
}

.welcome .lead { font-weight: 600; color: #fff; }

.row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.row button {
  flex: 1;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #12081f;
  font-weight: 700;
  color: var(--lilac);
}

.row button.primary {
  color: #fff;
  border-color: var(--violet);
  background: linear-gradient(180deg, #8f74ff, var(--violet-deep));
  box-shadow: 0 10px 22px rgba(90, 63, 212, 0.4);
}

.row button.mint {
  color: #07301d;
  border-color: #3cbc8a;
  background: linear-gradient(180deg, #76e8ba, var(--mint));
}

.row button:active { transform: scale(0.98); }

.step { text-align: center; }

.step-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(123, 92, 255, 0.35);
  border: 1px solid rgba(232, 217, 255, 0.2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.step-question {
  border-radius: 18px;
  background: #1a102c;
  padding: 20px 16px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
  box-shadow: var(--shadow);
  border: 1px solid rgba(123, 92, 255, 0.35);
  color: #fff;
}

.step .row {
  max-width: 280px;
  margin: 24px auto 0;
}

.step .row button {
  border: 0;
  min-height: 48px;
  font-size: 16px;
}

.matching .bar {
  height: 8px;
  margin-top: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: #2a1a44;
}

.matching .bar span {
  display: block;
  height: 100%;
  width: 18%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a88bff, var(--violet));
  animation: fill-bar 0.9s ease forwards;
}

.selection {
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
}

.selection h2 {
  margin: 0 0 12px;
  text-align: center;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  text-align: center;
}

.progress span {
  font-size: 11px;
  color: #8d7aaa;
  font-weight: 600;
}

.progress span.active {
  color: var(--lilac);
  font-weight: 800;
}

.progress i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 4px auto 0;
  border: 1px solid #3a2a55;
  border-radius: 12px;
  background: #12081f;
  font-style: normal;
}

.progress i img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.55;
  filter: invert(1) brightness(1.2);
}

.progress .active i {
  border-color: var(--violet);
  background: rgba(123, 92, 255, 0.25);
  box-shadow: 0 0 0 3px rgba(123, 92, 255, 0.18);
}

.progress .active i img { opacity: 1; }

.selection:not(.selection-1) .tile-label { display: none; }

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tile {
  display: block;
  border: 0;
  background: none;
  padding: 0;
  text-align: center;
  color: inherit;
}

.tile-photo {
  display: block;
  width: 100%;
  height: clamp(122px, 24vh, 156px);
  object-fit: cover;
  object-position: center 18%;
  border-radius: 18px 6px 18px 6px;
  background: #24163a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.tile.selected .tile-photo {
  box-shadow: 0 0 0 3px var(--violet), 0 8px 22px rgba(90, 63, 212, 0.45);
  transform: scale(0.98);
}

.tile-label {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--lilac);
}

.success { text-align: left; }
.success h2 { text-align: center; }
.success ol { margin: 8px 0 0; padding-left: 18px; }

.cta {
  display: block;
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  padding: 14px 16px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(180deg, #9a80ff, var(--violet-deep));
  box-shadow: 0 10px 22px rgba(90, 63, 212, 0.4);
}

.chat,
.download {
  min-height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  background: #10081c;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
  color: var(--lilac);
}

.chat-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 10px 14px;
  background: #160b28;
  border-bottom: 1px solid #2d1c48;
  font-weight: 800;
  color: #fff;
}

.chat-header img {
  width: 28px;
  height: 28px;
  border-radius: 10px;
}

.chat-header a {
  position: absolute;
  right: 14px;
  color: var(--lilac);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.chat-feed {
  flex: 1;
  overflow: auto;
  padding: 14px 16px 88px;
  background: linear-gradient(180deg, #12081f, #0b0614);
}

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #8f74ff, #5a3fd4);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.bubble {
  max-width: calc(100% - 46px);
  padding: 2px 4px;
  line-height: 1.5;
}

.bubble h2 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.bubble p {
  margin: 0 0 10px;
  font-size: 14px;
  color: #d6c8ef;
}

.chat-history-item { margin: 18px 0 0 4px; }
.chat-time { color: #7d6d97; font-size: 11px; margin-bottom: 4px; }
.chat-sender { color: #cbbde4; font-size: 12px; margin-bottom: 8px; font-weight: 600; }

.chat-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: #1a102c;
  border: 1px solid #34224f;
}

.chat-card img {
  width: 72px;
  height: 92px;
  object-fit: cover;
  border-radius: 12px 4px 12px 4px;
}

.chat-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #fff;
}

.chat-card span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.chat-input {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: #160b28;
  border-top: 1px solid #2d1c48;
}

.chat-input input {
  flex: 1;
  min-width: 0;
  border: 1px solid #3a2a55;
  border-radius: 12px;
  padding: 12px;
  background: #10081c;
  color: #fff;
}

.chat-input input::placeholder { color: #8d7aaa; }

.chat-input button {
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  min-width: 72px;
  color: #fff;
  font-weight: 700;
  background: var(--violet);
}

.download {
  padding: 20px;
  background: linear-gradient(160deg, #07040e, #1f1238 55%, #12081f);
}

.download a {
  color: var(--lilac);
  text-decoration: none;
  font-weight: 700;
}

.download .card {
  margin-top: 18vh;
  padding: 28px 22px;
  border-radius: 22px;
  background: #1a102c;
  color: #fff;
  text-align: center;
  border: 1px solid rgba(123, 92, 255, 0.35);
  box-shadow: var(--shadow);
}

.download .card img {
  width: 68px;
  height: 68px;
  border-radius: 18px;
}

@media (min-width: 600px) {
  body {
    display: grid;
    place-items: center;
    padding: 24px 0;
  }

  .shell, .chat, .download {
    min-height: min(920px, calc(100dvh - 48px));
    border-radius: 28px;
    overflow: hidden;
  }
}

@media (max-width: 380px) {
  .hero-stage {
    grid-template-columns: 1fr;
  }

  .feature-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-height: 720px) {
  .hero-stage { padding-top: 16px; }
  .feature-item { font-size: 10px; }
  .selection { max-height: calc(100dvh - 20px); }
  .tile-photo { height: clamp(100px, 20vh, 130px); }
}

@media (prefers-reduced-motion: reduce) {
  .shade, .panel, .step, .matching .bar span { animation: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes fill-bar {
  from { width: 12%; }
  to { width: 100%; }
}
