/* The app at work (index.html #live, #week, #day, #calc, #find). Pure CSS loops, like the Reels; each one only runs
   while it's on screen (.on, set by motion.js) and everything holds still for reduced motion. */

html, body { overflow-x: clip; } /* glows and the tilted phone may reach past the edge; the page never scrolls sideways */
.muted-p { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.kicker { display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--violet); margin-bottom: 8px; }
h3 em, .find em, .calc em { font-style: normal; color: var(--violet); }

/* ---------- Feature rows: copy on one side, a live demo on the other ---------- */
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; margin-top: 64px; }
.feat.flip .show-copy { order: 2; }
.show-copy h3 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -1px; margin: 0 0 12px; font-weight: 700; }
.show-copy p { color: var(--muted); font-size: 17px; margin: 0; max-width: 440px; }
.demo { text-align: left; position: relative; min-height: 330px; border-radius: 32px; padding: 26px; background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid var(--line); overflow: hidden; display: grid; align-content: center; gap: 12px; box-shadow: 0 30px 80px -40px rgba(124,58,237,.6); }
.demo::before { content: ''; position: absolute; inset: auto -30% -50% auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.35), transparent 65%); pointer-events: none; }
.demo * { animation-play-state: paused; }
.demo.on * { animation-play-state: running; }

/* 01 · Log it: amount and name type in, Dining is picked, Add is pressed, the toast lands. Loop 7s. */
.sheet { position: relative; border-radius: 24px; padding: 18px; background: #16141d; border: 1px solid var(--line); display: grid; gap: 12px; }
.sheet-top { display: flex; justify-content: space-between; font-size: 14px; }
.sheet-top .x { color: var(--muted); }
.amount { font-size: 40px; font-weight: 700; letter-spacing: -1.5px; color: var(--violet); display: flex; align-items: center; height: 52px; }
.typed { display: inline-block; white-space: nowrap; overflow: hidden; }
.t1 { animation: type1 7s infinite steps(1); }
.t2 { animation: type2 7s infinite steps(1); }
@keyframes type1 { 0%, 8% { max-width: 0; } 10% { max-width: .6em; } 12% { max-width: 1.2em; } 14% { max-width: 1.6em; } 16% { max-width: 2.2em; } 18%, 100% { max-width: 3em; } }
@keyframes type2 { 0%, 26% { max-width: 0; } 28% { max-width: .7em; } 30% { max-width: 1.4em; } 32% { max-width: 2.1em; } 34% { max-width: 2.8em; } 36%, 100% { max-width: 4em; } }
.caret { width: 2px; height: 34px; margin-left: 3px; background: var(--violet); animation: blink .9s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.field { height: 44px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--line); display: flex; align-items: center; padding: 0 14px; font-size: 15px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips span { padding: 7px 12px; border-radius: 999px; font-size: 13px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--muted); }
.chips .pick { animation: pick 7s infinite; }
@keyframes pick { 0%, 42% { background: rgba(255,255,255,.05); color: var(--muted); transform: none; } 45% { transform: scale(1.12); } 48%, 100% { background: var(--violet-strong); color: #fff; border-color: transparent; transform: none; } }
.hint { font-size: 12.5px; color: var(--violet); font-weight: 600; animation: fadeHold 7s infinite; }
@keyframes fadeHold { 0%, 46% { opacity: 0; transform: translateY(4px); } 50%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.add { height: 48px; border-radius: 999px; display: grid; place-items: center; font-weight: 600; background: var(--gradient); animation: press 7s infinite; }
@keyframes press { 0%, 58% { transform: none; } 60% { transform: scale(.95); } 63%, 100% { transform: none; } }
.toast-d { position: absolute; left: 50%; bottom: 18px; padding: 10px 16px; border-radius: 999px; background: #f4f2fa; color: #121016; font-size: 13px; font-weight: 600; white-space: nowrap; animation: toast 7s infinite; }
@keyframes toast { 0%, 62% { opacity: 0; transform: translate(-50%, 16px); } 66%, 90% { opacity: 1; transform: translate(-50%, 0); } 96%, 100% { opacity: 0; transform: translate(-50%, 8px); } }

/* 02 · Alerts drop in one by one. Loop 7s. */
.demo-alerts .note { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 20px; background: #f6f5fa; color: #121016; box-shadow: 0 18px 40px -18px rgba(0,0,0,.7); }
.demo-alerts .note .ic { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; background: #f0ecf8; font-size: 18px; }
.demo-alerts .note b { display: block; font-size: 15px; letter-spacing: -.2px; }
.demo-alerts .note small { color: #6e6880; font-size: 13px; }
.n1 { animation: drop 7s infinite; }
.n2 { animation: drop 7s infinite .5s; }
.n3 { animation: drop 7s infinite 1s; }
@keyframes drop { 0%, 4% { opacity: 0; transform: translateY(-26px) scale(.96); } 10%, 86% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; transform: translateY(10px); } }

/* 03 · Subscriptions: the yearly total rolls up (motion.js), the rows slide in. */
.total { border-radius: 24px; padding: 20px; background: linear-gradient(150deg, #a78bfa, #7c3aed 55%, #4c1d95); }
.total small { display: block; font-size: 11.5px; letter-spacing: 1.5px; font-weight: 600; opacity: .85; }
.total b { font-size: 44px; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.total .per { margin-left: 6px; opacity: .85; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: #16141d; border: 1px solid var(--line); font-size: 15px; }
.row div { flex: 1; }
.row small { display: block; color: var(--muted); font-size: 12.5px; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: #fff; }
.r1 { animation: slide 6s infinite .2s; }
.r2 { animation: slide 6s infinite .5s; }
@keyframes slide { 0%, 6% { opacity: 0; transform: translateX(26px); } 14%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* 04 · Lilac AI: the question, the typing dots, the answer. Loop 8s. */
.bub { max-width: 86%; padding: 14px 16px; border-radius: 22px; font-size: 15px; line-height: 1.45; }
.bub.me { justify-self: end; border-bottom-right-radius: 8px; background: var(--gradient); color: #fff; animation: pop 8s infinite; }
.bub.ai { justify-self: start; position: relative; border-bottom-left-radius: 8px; background: rgba(255,255,255,.08); border: 1px solid var(--line); animation: pop 8s infinite .9s; min-height: 50px; }
@keyframes pop { 0%, 3% { opacity: 0; transform: translateY(14px) scale(.96); } 9%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
.bub mark { padding: 1px 8px; border-radius: 8px; background: var(--violet-strong); color: #fff; font-weight: 600; }
.bub .dots { position: absolute; left: 16px; top: 18px; display: flex; gap: 5px; animation: gone 8s infinite .9s; }
.bub .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); animation: bounce 1s infinite; }
.bub .dots i:nth-child(2) { animation-delay: .15s; } .bub .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-5px); opacity: .5; } }
@keyframes gone { 0%, 20% { opacity: 1; } 24%, 100% { opacity: 0; } }
.bub .say { animation: say 8s infinite .9s; }
@keyframes say { 0%, 22% { opacity: 0; } 27%, 100% { opacity: 1; } }

/* 05 · A goal fills. */
.goal-card { border-radius: 24px; padding: 20px; background: #16141d; border: 1px solid var(--line); display: grid; gap: 16px; }
.goal-top { display: flex; align-items: center; gap: 12px; }
.goal-top .ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: rgba(167,139,250,.14); font-size: 22px; }
.goal-top div { flex: 1; }
.goal-top b { font-size: 17px; }
.goal-top small { display: block; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pct { font-weight: 700; color: var(--violet); font-size: 18px; }
.goal-track { height: 14px; border-radius: 14px; background: rgba(255,255,255,.08); overflow: hidden; }
.goal-track i { display: block; height: 100%; width: 45%; border-radius: 14px; background: linear-gradient(90deg, #c4b5fd, #8b5cf6); transition: width 1.6s cubic-bezier(.2,.8,.2,1) .3s; }
.demo-goal.on .goal-track i { width: 64%; }

/* ---------- The week, as the app's Insights card (frosted glass) ---------- */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.week-card { border-radius: 30px; padding: 22px; background: linear-gradient(160deg, rgba(167,139,250,.16), rgba(76,29,149,.12)); border: 1px solid rgba(167,139,250,.28); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 30px 80px -36px rgba(124,58,237,.75), inset 0 1px 0 rgba(255,255,255,.08); }
.two .week-card { order: -1; } /* card on the left, keeping the left/right rhythm of the rows above */
.seg { display: flex; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.06); margin-bottom: 18px; }
.seg span { flex: 1; text-align: center; padding: 7px 0; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg .on { background: var(--gradient); color: #fff; }
.wk-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wk-head b { font-size: 34px; letter-spacing: -1.2px; font-variant-numeric: tabular-nums; }
.wk-badge { padding: 4px 10px; border-radius: 999px; background: rgba(74,222,128,.14); color: var(--good); font-size: 12.5px; font-weight: 600; }
.wk-sub { color: var(--muted); font-size: 13.5px; margin: 2px 0 18px; }
.wk-bars { display: flex; align-items: flex-end; gap: 10px; height: 190px; }
.wk-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; cursor: default; }
.wk-col i { display: block; flex-shrink: 0; width: 100%; max-width: 46px; height: 8px; border-radius: 14px; background: rgba(255,255,255,.12); transition: height .9s cubic-bezier(.2,.8,.2,1), background .4s; }
.week-card.in .wk-col i { height: calc(var(--h) * var(--wk-max, 140px)); }
.week-card.in .wk-col:nth-child(2) i { transition-delay: .055s; } .week-card.in .wk-col:nth-child(3) i { transition-delay: .11s; }
.week-card.in .wk-col:nth-child(4) i { transition-delay: .165s; } .week-card.in .wk-col:nth-child(5) i { transition-delay: .22s; }
.week-card.in .wk-col:nth-child(6) i { transition-delay: .275s; } .week-card.in .wk-col:nth-child(7) i { transition-delay: .33s; }
.wk-col small { font-size: 12px; font-weight: 600; color: var(--muted); transition: color .3s; }
.wk-val { font-size: 12.5px; font-weight: 700; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.wk-col.sel i { background: linear-gradient(180deg, #8b5cf6, #6d28d9); }
.wk-col.sel small { color: var(--ink); }
.week-card.in .wk-col.sel .wk-val { opacity: 1; transform: none; transition-delay: .2s; }
.wk-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); color: var(--muted); font-size: 13px; }

/* ---------- A day with Lilac ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; position: relative; }
.timeline li { position: relative; padding: 22px; border-radius: var(--radius); background: linear-gradient(160deg, rgba(139,92,246,.2), rgba(76,29,149,.1)); border: 1px solid rgba(167,139,250,.3); box-shadow: 0 24px 60px -34px rgba(124,58,237,.8); }
.timeline .time { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(167,139,250,.14); color: var(--violet); font-size: 12.5px; font-weight: 600; }
.timeline b { display: block; margin: 14px 0 6px; font-size: 32px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.timeline b.down { color: #fda4af; }
.timeline b.up { color: var(--good); }
.timeline p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Calculator ---------- */
.calc { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 40px; border-radius: 36px; background: var(--surface); border: 1px solid var(--line); }
.slider { display: grid; gap: 10px; margin-top: 8px; }
.slider span { color: var(--muted); font-size: 14px; }
.slider b { font-size: 30px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.slider input { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #8b5cf6 var(--fill, 24%), rgba(255,255,255,.1) var(--fill, 24%)); outline: none; }
.slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 6px solid var(--violet-strong); box-shadow: 0 6px 20px rgba(124,58,237,.6); cursor: grab; }
.slider input::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 6px solid var(--violet-strong); cursor: grab; }
.calc-card { position: relative; overflow: hidden; border-radius: 30px; padding: 26px; background: linear-gradient(150deg, #a78bfa, #7c3aed 55%, #4c1d95); box-shadow: 0 30px 70px -26px rgba(124,58,237,.9); display: grid; gap: 4px; }
.calc-card small { font-size: 12px; letter-spacing: 1.5px; font-weight: 600; opacity: .85; }
.calc-n { font-size: 60px; font-weight: 700; letter-spacing: -2px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.calc-n span { font-size: 28px; }
.calc-l { opacity: .9; font-size: 14.5px; margin-bottom: 14px; }
.calc-card .btn { background: #fff; color: #4c1d95; box-shadow: none; }
.calc-f { text-align: center; font-size: 12.5px; opacity: .85; margin-top: 6px; }

/* ---------- The big quiz card ---------- */
.find { display: block; position: relative; overflow: hidden; padding: 56px 40px; border-radius: 40px; text-decoration: none; text-align: center; background: linear-gradient(150deg, #a78bfa, #7c3aed 50%, #4c1d95); box-shadow: 0 40px 90px -36px rgba(124,58,237,.95); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.find:hover { transform: translateY(-4px); }
.find::after { content: ''; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.45) 1.5px, transparent 1.8px) 0 0 / 12px 12px; -webkit-mask: radial-gradient(circle, #000 55%, transparent 70%); mask: radial-gradient(circle, #000 55%, transparent 70%); opacity: .6; }
.find-k { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 12.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.find h2 { margin: 16px 0 10px; color: #fff; }
.find em { color: #f5d0fe; }
.find p { margin: 0 auto 26px; max-width: 520px; opacity: .92; font-size: 17px; }
.find-go { display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 28px; border-radius: 999px; background: #fff; color: #4c1d95; font-weight: 600; }
.find-go svg { width: 18px; height: 18px; }

@media (max-width: 900px) {
  .feat, .two, .calc { grid-template-columns: 1fr; gap: 26px; }
  .feat.flip .show-copy { order: 0; }
  .feat { margin-top: 48px; text-align: center; }
  .show-copy p { margin-inline: auto; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .two { text-align: center; }
  .two .week-card { order: 0; }
}
@media (max-width: 640px) {
  .demo { min-height: 0; padding: 18px; border-radius: 26px; }
  .amount { font-size: 34px; }
  .timeline { grid-template-columns: 1fr; }
  .wk-bars { height: 170px; gap: 7px; --wk-max: 110px; }
  .calc { padding: 24px; border-radius: 28px; }
  .find { padding: 40px 22px; border-radius: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo * { animation: none !important; }
  .typed { max-width: none !important; }
  .hint, .toast-d, .bub, .bub .say, .demo-alerts .note, .row { opacity: 1 !important; transform: none !important; }
  .bub .dots { display: none; }
  .wk-col i { height: calc(var(--h) * var(--wk-max, 140px)) !important; }
  .wk-col.sel .wk-val { opacity: 1; transform: none; }
}
