:root {
  --bg: #000;
  --ink: #f4f7fc;
  --muted: #8a94a6;
  --blue: #a9c6ee;
  --blue-strong: #cfe0f8;
  --line: rgba(169, 198, 238, 0.18);
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(169, 198, 238, 0.07);
  --picked: rgba(169, 198, 238, 0.14);
  --glow: 0 0 18px rgba(169, 198, 238, 0.45), 0 0 2px rgba(255, 255, 255, 0.8);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* ---- background: a slow blue glow and faint drifting dots ---- */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.glow {
  position: absolute; left: 50%; top: 18%; width: 720px; height: 720px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(120, 160, 230, 0.16), transparent 62%);
  animation: breathe 9s ease-in-out infinite;
}
.dots {
  position: absolute; inset: -50%;
  background-image: radial-gradient(rgba(169, 198, 238, 0.22) 1px, transparent 1.5px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0, transparent 55%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0, transparent 55%);
  animation: drift 60s linear infinite;
}
@keyframes breathe { 50% { opacity: .65; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes drift { to { transform: translate(46px, -46px); } }

/* ---- layout ---- */
.shell {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}

.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; transition: all .6s var(--ease); }
.brand .cart { width: 92px; height: auto; animation: rise .9s var(--ease) both; }
.wordmark { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; animation: rise .9s .12s var(--ease) both; }
.wordmark span { color: var(--blue); }
.brand.small { flex-direction: row; justify-content: center; gap: 10px; }
.brand.small .cart { width: 40px; }
.brand.small .wordmark { font-size: 18px; }

.progress { height: 3px; background: var(--line); border-radius: 3px; margin: 22px 0 6px; overflow: hidden; opacity: 0; transition: opacity .4s; }
.progress.on { opacity: 1; }
.bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), #fff); box-shadow: var(--glow); border-radius: 3px; transition: width .6s var(--ease); }

.stage { flex: 1; position: relative; padding-top: 18px; }

.nav { display: flex; justify-content: space-between; align-items: center; min-height: 40px; padding-top: 12px; }
.back { background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px; padding: 8px 4px; cursor: pointer; transition: color .2s; }
.back:hover { color: var(--ink); }
.step { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-left: auto; }

/* ---- screens and their transitions ---- */
.screen { animation: inRight .5s var(--ease) both; }
.screen.from-left { animation-name: inLeft; }
.screen.out { animation: outLeft .32s ease-in both; }
.screen.out-right { animation: outRight .32s ease-in both; }
@keyframes inRight { from { opacity: 0; transform: translateX(28px); filter: blur(3px); } }
@keyframes inLeft  { from { opacity: 0; transform: translateX(-28px); filter: blur(3px); } }
@keyframes outLeft  { to { opacity: 0; transform: translateX(-28px); filter: blur(3px); } }
@keyframes outRight { to { opacity: 0; transform: translateX(28px); filter: blur(3px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.screen > * { animation: rise .55s var(--ease) both; }
.screen > *:nth-child(2) { animation-delay: .05s; }
.screen > *:nth-child(3) { animation-delay: .1s; }

.eyebrow { color: var(--blue); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; }
h1 { font-size: clamp(22px, 6vw, 28px); line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 22px; text-wrap: balance; }
.lede { color: var(--muted); font-size: 16px; line-height: 1.55; margin: 0 0 28px; }
.center { text-align: center; }

/* ---- options ---- */
.options { display: grid; gap: 10px; }
.opt {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 16px 16px; min-height: 56px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px;
  font: inherit; font-size: 16px; text-align: left; cursor: pointer;
  transition: background .25s, border-color .25s, transform .15s var(--ease), box-shadow .3s;
  animation: rise .5s var(--ease) both;
}
.opt:hover { background: var(--card-hover); border-color: rgba(169, 198, 238, 0.35); }
.opt:active { transform: scale(.985); }
.opt:focus-visible, .btn:focus-visible, .back:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.opt .tick {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid rgba(169, 198, 238, 0.45);
  display: grid; place-items: center; transition: all .3s var(--ease);
}
.opt .tick svg { width: 12px; height: 12px; stroke: #000; stroke-width: 3; fill: none; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .35s .08s var(--ease); }
.opt[aria-checked="true"] { background: var(--picked); border-color: var(--blue); box-shadow: var(--glow); }
.opt[aria-checked="true"] .tick { background: var(--blue-strong); border-color: var(--blue-strong); box-shadow: var(--glow); transform: scale(1.08); }
.opt[aria-checked="true"] .tick svg { stroke-dashoffset: 0; }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  background: radial-gradient(circle, rgba(207, 224, 248, .55), rgba(207, 224, 248, 0) 70%);
  animation: ripple .6s ease-out forwards;
}
@keyframes ripple { to { transform: scale(40); opacity: 0; } }

/* ---- text inputs ---- */
.field { margin-top: 12px; overflow: hidden; max-height: 0; opacity: 0; transition: max-height .4s var(--ease), opacity .3s; }
.field.open { max-height: 200px; opacity: 1; }
textarea, input[type="text"] {
  width: 100%; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; font: inherit; font-size: 16px; resize: vertical;
  transition: border-color .25s, box-shadow .3s;
}
textarea { min-height: 130px; }
textarea:focus, input[type="text"]:focus { outline: none; border-color: var(--blue); box-shadow: var(--glow); }
.count { text-align: right; color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---- buttons ---- */
.actions { margin-top: 24px; display: grid; gap: 10px; }
.btn {
  position: relative; overflow: hidden;
  width: 100%; min-height: 54px; padding: 0 20px;
  background: var(--ink); color: #000;
  border: 0; border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 600;
  transition: transform .15s var(--ease), box-shadow .3s, opacity .3s;
  box-shadow: 0 0 0 rgba(169, 198, 238, 0);
}
.btn:hover { box-shadow: var(--glow); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .35; cursor: default; box-shadow: none; }
.btn .shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(169, 198, 238, .55) 50%, transparent 70%);
  transform: translateX(-100%); animation: shine 3.2s 1s ease-in-out infinite;
}
@keyframes shine { 40%, 100% { transform: translateX(100%); } }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--ink); box-shadow: none; }
.btn.sending { color: transparent; }
.btn.sending::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px;
  border: 2px solid rgba(0, 0, 0, .25); border-top-color: #000; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: #ffb4b4; font-size: 14px; margin: 12px 0 0; text-align: center; }

/* ---- thank-you ---- */
.thanks { text-align: center; padding-top: 24px; }
.thanks .cart-run { position: relative; width: 140px; margin: 0 auto 26px; }
.thanks .cart-run img { width: 140px; animation: roll 1.1s var(--ease) both; }
.thanks .cart-run::before {
  content: ""; position: absolute; left: -40px; top: 42%; width: 70px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue));
  box-shadow: 0 12px 0 rgba(169, 198, 238, .6), 0 -12px 0 rgba(169, 198, 238, .35);
  animation: lines 1.1s var(--ease) both;
}
@keyframes roll { from { opacity: 0; transform: translateX(-90px); } }
@keyframes lines { 0% { opacity: 0; transform: translateX(-60px); } 60% { opacity: 1; } 100% { opacity: 0; transform: translateX(10px); } }

/* ---- the submit burst: the dots behind the cart in the logo ---- */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.spark {
  position: absolute; border-radius: 50%; background: var(--blue-strong);
  box-shadow: 0 0 8px rgba(169, 198, 238, .9);
  animation: spark .9s var(--ease) forwards;
}
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .burst { display: none; }
}
.hint { color: var(--muted); font-size: 14px; margin: -12px 0 18px; }
.name { text-align: center; margin-bottom: 4px; animation: rise .55s .1s var(--ease) both; }

/* ---- start page: two choices (public/index.html) ---- */
.choices { display: grid; gap: 12px; margin-top: 8px; }
.choice {
  position: relative; overflow: hidden; display: block; text-align: left; text-decoration: none;
  padding: 18px 46px 18px 18px; border-radius: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line);
  transition: background .25s, border-color .25s, box-shadow .3s, transform .15s var(--ease);
  animation: rise .55s var(--ease) both;
}
.choice:nth-child(2) { animation-delay: .06s; }
.choice:nth-child(3) { animation-delay: .12s; }
.choice:nth-child(4) { animation-delay: .18s; }
.choice::after {
  content: "→"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  color: var(--blue); font-size: 20px; transition: transform .25s var(--ease);
}
.choice:hover { background: var(--card-hover); border-color: var(--blue); box-shadow: var(--glow); }
.choice:hover::after { transform: translate(4px, -50%); }
.choice:active { transform: scale(.985); }
.choice:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.choice-title { display: block; font-size: 17px; font-weight: 600; }
.choice-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.home-link { color: var(--muted); font-size: 14px; text-decoration: none; }
.home-link:hover { color: var(--ink); }
.home-link[hidden] { display: none; }
