/* Melo — new-user onboarding funnel (steps 1–8: splash · questions · belief · account).
   Immersive, full-screen, premium-and-calm. Reuses the Expressive-Pop tokens from
   /engine/melo.css (--cream/--ink/--orange/--cobalt/--purple/--gold/--muted). One idea
   per screen, big type, lots of space, subtle motion. All motion off under
   prefers-reduced-motion. NO fake social proof anywhere — belief comes from the truth
   that music is patterns, feelings, and choices. Pairs with onboarding.js. */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font-ui, 'Inter', sans-serif);
  background: var(--cream, #FBF2E4); color: var(--ink, #2A1A0E);
  overflow: hidden; position: relative;
  min-height: 100vh; min-height: 100dvh;
}

/* ---- decorative background (calm brand wash; no nav — this is an experience) ---- */
.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg .s { position: absolute; border-radius: 50%; }
.bg .o1 { width: min(64vw, 560px); aspect-ratio: 1; background: radial-gradient(circle, rgba(255,90,31,.12), transparent 70%); top: -18vw; right: -14vw; animation: drift 15s ease-in-out infinite; }
.bg .o2 { width: min(54vw, 460px); aspect-ratio: 1; background: radial-gradient(circle, rgba(31,61,255,.09), transparent 70%); bottom: -18vw; left: -14vw; animation: drift 19s ease-in-out infinite reverse; }
.bg .o3 { width: 200px; height: 200px; background: radial-gradient(circle, rgba(122,63,242,.10), transparent 70%); top: 14%; right: 8%; animation: drift 13s ease-in-out infinite; }
@keyframes drift { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-20px) } }

/* ---- minimal chrome: wordmark + progress + low-key skip ---- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; pointer-events: none;
}
.brand { font-family: var(--font-serif, serif); font-weight: 900; font-size: 19px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; opacity: .6; flex: none; }
.brand .d { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); margin-top: 8px; animation: pulse 2.4s ease-in-out infinite; }
.prog { flex: 1; height: 5px; background: rgba(120,80,20,.10); border-radius: 999px; overflow: hidden; max-width: 460px; opacity: 0; transition: opacity .4s; }
.prog.show { opacity: 1; }
.prog i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--orange), var(--orange-soft, #FF8A4D)); border-radius: 999px; transition: width .5s var(--ease-out, cubic-bezier(.2,.8,.2,1)); }
.skip { pointer-events: auto; font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-decoration: none; opacity: .55; transition: opacity .2s; flex: none; }
.skip:hover { opacity: 1; }
.back { pointer-events: auto; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px 8px; opacity: .55; transition: opacity .2s; flex: none; }
.back:hover { opacity: 1; }
.back[hidden] { display: none; }

/* ---- the stage: one screen at a time ---- */
.stage { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 84px 24px 40px; }
.screen { display: none; width: 100%; min-width: 0; max-width: 640px; flex-direction: column; align-items: center; text-align: center; }
.screen.active { display: flex; }

/* generic intro/animation helpers (staggered rise) */
.r { opacity: 0; transform: translateY(16px); }
.screen.active .r { animation: rise .8s var(--ease-out, cubic-bezier(.2,.8,.2,1)) forwards; }
.screen.active .r.d1 { animation-delay: .08s } .screen.active .r.d2 { animation-delay: .22s }
.screen.active .r.d3 { animation-delay: .38s } .screen.active .r.d4 { animation-delay: .56s }
.screen.active .r.d5 { animation-delay: .78s }
@keyframes rise { to { opacity: 1; transform: translateY(0) } }

.eyebrow { font-family: var(--font-mono, monospace); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--eyebrow, #C2511F); margin-bottom: 18px; }
.headline { font-family: var(--font-serif, serif); font-weight: 600; letter-spacing: -.02em; line-height: 1.06; font-size: clamp(30px, 7vw, 52px); }
.headline em { font-style: italic; color: var(--orange); }
.lede { font-size: clamp(15px, 2.6vw, 18px); color: var(--sub, #6E5D49); line-height: 1.55; margin-top: 18px; max-width: 30ch; }

/* ---- splash (screen 1) ---- */
.splash .glowdot { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle, rgba(255,140,80,.95), transparent 70%); margin-bottom: 26px; animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .7 } 50% { transform: scale(1.14); opacity: 1 } }
.splash .headline { max-width: 16ch; }

/* ---- primary / ghost buttons ---- */
.cta {
  font-family: var(--font-ui, sans-serif); font-weight: 700; font-size: 16px;
  padding: 16px 34px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--orange); color: #fff; box-shadow: 0 6px 0 var(--orange2, #F0531A);
  transition: transform .1s, box-shadow .1s; margin-top: 30px;
}
.cta:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--orange2, #F0531A); }
.cta.ink { background: var(--ink); color: var(--cream); box-shadow: 0 6px 0 rgba(120,80,20,.30); }
.cta[disabled] { opacity: .4; cursor: default; box-shadow: none; transform: none; }
.ghostlink { margin-top: 18px; font-family: var(--font-serif, serif); font-style: italic; font-size: 15px; color: var(--muted); cursor: pointer; border: none; background: none; }
.ghostlink:hover { color: var(--ink); }

/* ---- question screens ---- */
.q .headline { font-size: clamp(26px, 5.4vw, 40px); max-width: 18ch; }
.options { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 460px; margin-top: 30px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card, #fff); border: 2px solid var(--line, #EFE3CF); border-radius: var(--r-lg, 22px);
  padding: 17px 20px; cursor: pointer; color: var(--ink);
  font-family: var(--font-serif, serif); font-weight: 600; font-size: 18px;
  transition: transform .12s var(--ease-out, ease), border-color .15s, background .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(120,60,10,.06);
}
.opt:hover { transform: translateY(-2px); border-color: var(--orange-l, #FFD9C2); }
.opt .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2, #E6DECF); flex: none; position: relative; transition: border-color .15s; }
.opt.sel { border-color: var(--orange); background: var(--orange-bg, #FFF3EB); }
.opt.sel .dot { border-color: var(--orange); background: var(--orange); }
.opt.sel .dot::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }

/* ---- belief screens ---- */
.belief { max-width: 720px; }
.belief .headline { font-size: clamp(30px, 6.6vw, 50px); max-width: 17ch; }
.belief .lede { max-width: 34ch; }

/* the four feelings (screen 4) */
.feelings { display: flex; gap: clamp(10px, 3vw, 26px); justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.feel { display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0; transform: translateY(14px) scale(.96); }
.screen.active .feel.in { animation: feelIn .7s var(--spring, cubic-bezier(.2,1.35,.35,1)) forwards; }
@keyframes feelIn { to { opacity: 1; transform: translateY(0) scale(1) } }
.feel .orb { width: clamp(60px, 16vw, 86px); height: clamp(60px, 16vw, 86px); border-radius: 50%; position: relative; }
.feel .orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; animation: orbPulse 2.6s ease-in-out infinite; }
.feel:nth-child(2) .orb::after { animation-delay: .3s } .feel:nth-child(3) .orb::after { animation-delay: .6s } .feel:nth-child(4) .orb::after { animation-delay: .9s }
@keyframes orbPulse { 0%,100% { box-shadow: 0 0 18px 2px var(--glow) } 50% { box-shadow: 0 0 40px 10px var(--glow) } }
.feel.home   .orb { background: radial-gradient(circle at 35% 30%, #FFB07A, #FF5A1F); --glow: rgba(255,90,31,.55); }
.feel.tension .orb { background: radial-gradient(circle at 35% 30%, #6E92FF, #1F3DFF); --glow: rgba(31,61,255,.45); }
.feel.lift   .orb { background: radial-gradient(circle at 35% 30%, #C7A6FF, #7A3FF2); --glow: rgba(122,63,242,.45); }
.feel.surprise .orb { background: radial-gradient(circle at 35% 30%, #FFD874, #E8A91E); --glow: rgba(232,169,30,.55); }
.feel b { font-family: var(--font-serif, serif); font-weight: 700; font-size: clamp(15px, 3.4vw, 20px); }
.feel span { font-family: var(--font-mono, monospace); font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---- account screen (step 8) ---- */
.account { max-width: 420px; }
.authbtns { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 360px; margin-top: 28px; }
.auth {
  display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%;
  padding: 15px 20px; border-radius: 999px; cursor: pointer; font-family: var(--font-ui, sans-serif);
  font-weight: 600; font-size: 15.5px; border: 1.5px solid transparent;
  transition: transform .12s var(--ease-out, ease), box-shadow .15s, background .15s, border-color .15s;
}
.auth:hover { transform: translateY(-2px); }
.auth.apple { background: var(--ink); color: #fff; }
.auth.google { background: #fff; color: var(--ink); border-color: var(--line, #EFE3CF); box-shadow: var(--shadow, 0 3px 0 rgba(120,80,20,.10)); }
.auth.email { background: var(--cream, #FBF2E4); color: var(--ink); border-color: var(--line, #EFE3CF); }
.auth .g { width: 18px; height: 18px; flex: none; }
.auth[disabled] { opacity: .5; cursor: not-allowed; }
.auth[disabled]:hover { transform: none; }
.auth .soon { font-family: var(--font-mono, monospace); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; background: rgba(120,80,20,.12); color: var(--muted); padding: 3px 7px; border-radius: 999px; margin-left: 2px; }
.emailform { display: none; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; margin-top: 14px; }
.emailform.open { display: flex; }
.emailform input { width: 100%; font-family: var(--font-ui, sans-serif); font-size: 15px; padding: 14px 16px; border: 1.5px solid var(--line, #EFE3CF); border-radius: var(--r-md, 16px); background: #fff; color: var(--ink); outline: none; transition: border-color .15s; }
.emailform input:focus { border-color: var(--orange); }
.autherr { display: none; font-size: 13px; color: var(--red-d, #cf3b40); text-align: left; line-height: 1.4; padding: 0 2px; }
.autherr.show { display: block; }
.autherr.ok { color: var(--green-d, #369a3d); }
.authtoggle { background: none; border: none; cursor: pointer; font-family: var(--font-ui, sans-serif); font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.authtoggle b { color: var(--cobalt); font-weight: 700; }
.authnote { font-size: 12px; color: var(--muted); margin-top: 16px; max-width: 32ch; }
.fineprint { font-size: 11.5px; color: var(--muted); margin-top: 14px; line-height: 1.5; max-width: 34ch; }
.fineprint a { color: var(--sub, #6E5D49); text-decoration: underline; }
.testbypass { position: fixed; bottom: 12px; right: 14px; z-index: 7; font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--label, #9A8A74); opacity: .4; cursor: pointer; border: 1px dashed var(--line-2, #E6DECF); background: rgba(255,255,255,.6); padding: 5px 9px; border-radius: 8px; transition: opacity .2s; }
.testbypass:hover { opacity: .9; }

@media (max-width: 560px) {
  .stage { padding-top: 76px; }
  .feelings { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .12s !important; }
  .r { opacity: 1 !important; transform: none !important; }
  .feel { opacity: 1 !important; transform: none !important; }
  .bg .s { animation: none !important; }
}
