/* Melo — post-magic conversion flow (steps 10–13). Shown right after Session 1.
   conversion+paywall (one continuous screen, no cooldown/extra tap) → mock checkout →
   welcome. Hard-gate decline = a polite dead-end (no app access without the trial).
   Reuses the Expressive-Pop tokens from /engine/melo.css. NO fake social proof — the
   value is Melo's real differentiation. All motion off under prefers-reduced-motion. */

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

/* ---- decorative background ---- */
.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,.13), 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(122,63,242,.10), transparent 70%); bottom: -18vw; left: -14vw; animation: drift 19s ease-in-out infinite reverse; }
@keyframes drift { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-20px) } }

/* SCOPED to span.brand (the funnel's own faded wordmark) so these never leak onto the shared
   header's <a class="brand"> — a bare `.brand{position:fixed}` used to pull the header logo out of
   flow, so the first nav link ("Learn") rendered on top of it. */
span.brand { position: fixed; top: 16px; left: 20px; z-index: 6; font-family: var(--font-serif, serif); font-weight: 900; font-size: 18px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; opacity: .55; }
span.brand .d { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); margin-top: 8px; }
/* cold/nav entry mounts the shared header (which carries its own brand) — hide the funnel's
   own faded wordmark (a <span>; the header's brand is an <a>, so it's untouched) and let the
   sticky header take the top instead of the 72px funnel gap */
.has-melo-header span.brand { display: none; }
.has-melo-header .stage { min-height: auto; padding-top: 30px; }

/* ---- stage / screens ---- */
.stage { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 72px 22px 48px; }
.screen { display: none; width: 100%; min-width: 0; max-width: 560px; flex-direction: column; align-items: center; text-align: center; margin: auto 0; }
.screen.active { display: flex; }

.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: .1s } .screen.active .r.d2 { animation-delay: .28s }
.screen.active .r.d3 { animation-delay: .5s } .screen.active .r.d4 { animation-delay: .72s }
.screen.active .r.d5 { animation-delay: .94s } .screen.active .r.d6 { animation-delay: 1.16s }
@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: 16px; }
.headline { font-family: var(--font-serif, serif); font-weight: 600; letter-spacing: -.02em; line-height: 1.08; font-size: clamp(28px, 6vw, 46px); }
.headline em { font-style: italic; color: var(--orange); }
.lede { font-size: clamp(15px, 2.6vw, 18px); color: var(--sub, #6E5D49); line-height: 1.6; margin-top: 16px; max-width: 34ch; }

/* ---- buttons ---- */
.cta { font-family: var(--font-ui, sans-serif); font-weight: 700; font-size: 16px; padding: 16px 30px; 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; width: 100%; max-width: 360px; }
.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: .55; cursor: default; }
.ghostlink { margin-top: 16px; font-family: var(--font-serif, serif); font-style: italic; font-size: 14.5px; color: var(--muted); cursor: pointer; border: none; background: none; }
.ghostlink:hover { color: var(--ink); }

/* ===== ⑩+⑪ CONVERSION + PAYWALL (one continuous screen) ===== */
.offer { max-width: 600px; }
.conversion { margin-bottom: 30px; }
.conversion .line { font-family: var(--font-serif, serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.16; font-size: clamp(22px, 4.6vw, 32px); margin: 0 auto; max-width: 20ch; }
.conversion .line em { font-style: italic; color: var(--orange); }
.conversion .promise { margin-top: 16px; font-size: clamp(19px, 4vw, 26px); max-width: 24ch; }
.conversion .kick { font-family: var(--font-mono, monospace); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--green-d, #369a3d); margin-bottom: 16px; display: inline-flex; align-items: center; gap: 8px; }
.conversion .kick::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green, #46b34d); }

.paydivider { width: 46px; height: 3px; border-radius: 2px; background: var(--orange-l, #FFD9C2); margin: 4px auto 26px; }

.paywall .headline { font-size: clamp(26px, 5.2vw, 38px); }
.unlocks { list-style: none; width: 100%; max-width: 420px; margin: 26px auto 4px; display: flex; flex-direction: column; gap: 11px; text-align: left; }
.unlocks li { display: flex; align-items: flex-start; gap: 13px; background: var(--card, #fff); border: 1px solid var(--line, #EFE3CF); border-radius: var(--r-md, 16px); padding: 13px 16px; box-shadow: 0 3px 0 rgba(120,80,20,.06); }
/* one clean, consistent mark for every item — no emojis, let the copy carry it */
.unlocks .mk { width: 22px; height: 22px; border-radius: 50%; flex: none; margin-top: 1px; background: var(--orange-bg, #FFF3EB); color: var(--orange); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.unlocks .mk::before { content: "✓"; }
.unlocks b { font-family: var(--font-serif, serif); font-weight: 700; font-size: 16px; display: block; }
.unlocks span { font-size: 12.5px; color: var(--muted); }

.trialcard { width: 100%; max-width: 420px; margin: 24px auto 0; background: var(--ink); color: var(--cream); border-radius: var(--r-lg, 22px); padding: 22px; box-shadow: var(--soft, 0 26px 56px rgba(120,60,10,.20)); }
.trialcard .badge { font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: #ffd9c2; background: rgba(255,90,31,.22); border: 1px solid rgba(255,138,77,.4); padding: 5px 12px; border-radius: 999px; display: inline-block; margin-bottom: 14px; }
.trialcard .price { font-family: var(--font-serif, serif); font-weight: 700; font-size: 32px; line-height: 1; }
.trialcard .price em { font-style: normal; font-size: 14px; color: #cdbca6; font-family: var(--font-ui, sans-serif); font-weight: 600; }
.trialcard .terms { font-size: 12px; color: #cdbca6; margin-top: 8px; }
.trialcard .cta { margin-top: 18px; max-width: none; }
.trialcard .ghostlink { color: #b6a48c; display: block; width: 100%; text-align: center; margin: 14px auto 0; }

/* ===== ⑫ CHECKOUT (mock) ===== */
.checkout { max-width: 460px; }
.checkout .headline { font-size: clamp(24px, 4.8vw, 32px); }
.summary { width: 100%; background: var(--card, #fff); border: 1px solid var(--line, #EFE3CF); border-radius: var(--r-md, 16px); padding: 14px 18px; margin: 22px 0 18px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow, 0 3px 0 rgba(120,80,20,.10)); }
.summary .l b { font-family: var(--font-serif, serif); font-weight: 700; font-size: 15px; display: block; text-align: left; }
.summary .l span { font-size: 12px; color: var(--muted); }
.summary .r { font-family: var(--font-serif, serif); font-weight: 700; font-size: 18px; text-align: right; }
.summary .r em { font-style: normal; font-size: 12px; color: var(--muted); font-family: var(--font-ui, sans-serif); display: block; }

.wallets { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.wallet { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 15px 18px; border-radius: 14px; cursor: pointer; font-family: var(--font-ui, sans-serif); font-weight: 700; font-size: 15.5px; border: 1.5px solid transparent; transition: transform .12s var(--ease-out, ease), box-shadow .15s; }
.wallet:hover { transform: translateY(-2px); }
.wallet svg { height: 20px; }
.wallet.apple { background: #000; color: #fff; }
.wallet.gpay { background: #fff; color: #3c4043; border-color: var(--line, #EFE3CF); box-shadow: var(--shadow); }
.wallet.shop { background: #5a31f4; color: #fff; }

.divider { display: flex; align-items: center; gap: 12px; width: 100%; margin: 18px 0; color: var(--label, #9A8A74); font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line, #EFE3CF); }

/* card form (Stripe-style; non-functional) */
.cardform { width: 100%; text-align: left; }
.cardform .field { margin-bottom: 12px; }
.cardform label { display: block; font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--label, #9A8A74); margin-bottom: 5px; }
.cardwrap { display: flex; align-items: center; background: #fff; border: 1.5px solid var(--line, #EFE3CF); border-radius: var(--r-md, 16px); padding: 0 14px; transition: border-color .15s; }
.cardwrap:focus-within { border-color: var(--orange); }
.cardwrap input { flex: 1; border: none; outline: none; background: none; font-family: var(--font-ui, sans-serif); font-size: 15px; padding: 13px 0; color: var(--ink); min-width: 0; }
.cardwrap .brandmark { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--label); letter-spacing: .04em; flex: none; }
.cardrow { display: flex; gap: 10px; }
.cardrow .field { flex: 1; min-width: 0; }
.paybtn { margin-top: 6px; }

.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; }

/* processing overlay (mock success) */
.processing { position: fixed; inset: 0; z-index: 20; background: rgba(36,22,8,.72); backdrop-filter: blur(6px); display: none; flex-direction: column; align-items: center; justify-content: center; color: var(--cream, #FBF2E4); gap: 18px; }
.processing.on { display: flex; }
.spinner { width: 52px; height: 52px; border-radius: 50%; border: 4px solid rgba(255,255,255,.22); border-top-color: var(--orange); animation: spin 1s linear infinite; }
.processing.done .spinner { border: none; animation: none; color: var(--green, #46b34d); display: flex; align-items: center; justify-content: center; font-size: 40px; }
@keyframes spin { to { transform: rotate(360deg) } }
.processing .ptxt { font-family: var(--font-serif, serif); font-weight: 700; font-size: 20px; }

/* ===== ⑬ WELCOME ===== */
.welcome .seal { width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFB07A, #FF5A1F); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 36px; margin-bottom: 24px; box-shadow: 0 0 40px 6px rgba(255,90,31,.4); }
.welcome .headline { font-size: clamp(30px, 6.4vw, 48px); }
.nextstep { width: 100%; max-width: 420px; margin: 26px auto 0; background: var(--card, #fff); border: 1px solid var(--line, #EFE3CF); border-radius: var(--r-lg, 22px); padding: 18px 20px; display: flex; align-items: center; gap: 14px; box-shadow: var(--soft); text-align: left; text-decoration: none; color: var(--ink); transition: transform .15s var(--ease-out, ease), box-shadow .15s; }
.nextstep:hover { transform: translateY(-2px); }
.nextstep b, .nextstep span { text-decoration: none; }
.nextstep .ico { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #FF8A4D, #EF4F18); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.nextstep b { font-family: var(--font-serif, serif); font-weight: 700; font-size: 16px; display: block; }
.nextstep span { font-size: 12.5px; color: var(--muted); }

/* ===== hard-gate dead end ===== */
.deadend { max-width: 460px; }
.deadend .lock { width: 66px; height: 66px; border-radius: 50%; background: #FFF3EB; border: 1px solid var(--orange-l, #FFD9C2); color: var(--orange); display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 22px; }
.deadend .btns { display: flex; flex-direction: column; gap: 11px; width: 100%; max-width: 360px; margin-top: 26px; }
.deadend .btns .cta { max-width: none; }
.btn-secondary { font-family: var(--font-ui, sans-serif); font-weight: 600; font-size: 15px; padding: 14px 22px; border-radius: 999px; border: 1.5px solid var(--line, #EFE3CF); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; text-align: center; transition: transform .12s, border-color .15s; }
.btn-secondary:hover { transform: translateY(-2px); border-color: var(--orange); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 12; overflow: hidden; }
.confetti i { position: absolute; width: 11px; height: 11px; border-radius: 2px; top: -20px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(112vh) rotate(720deg); opacity: .9; } }

@media (max-width: 560px) { .stage { padding-top: 64px; } }

@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; }
  .bg .s { animation: none !important; }
  .confetti { display: none; }
  .spinner { border-top-color: var(--orange); }
}
