:root {
  --bg: #FBFAF6; --ink: #18171C; --ink2: #3A3842; --muted: #5E5C66; --line: #E8E5DD; --soft: #F1EEE7;
  --lilac: #CDBEFF; --mint: #B5E8D0; --butter: #FFE38F; --peach: #FFC2AD; --sky: #BFE0FF;
  --link: #5B3FD6; --rec: #FF5A4E; --ok: #16794A;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
a { color: var(--link); } a:hover { color: #3E2A9E; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
.display { font-family: var(--display); letter-spacing: -0.035em; font-weight: 800; line-height: 1; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.center { text-align: center; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 10px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.logo i { width: 18px; height: 18px; background: var(--lilac); animation: morph 6s ease-in-out infinite; display: inline-block; }


/* buttons */
.btn { min-height: 56px; padding: 0 26px; border-radius: 999px; border: none; background: var(--ink); color: #fff; font-size: 17px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; transition: transform .2s var(--ease), background .2s, opacity .2s; }
.btn:hover { color: #fff; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.btn.ghost:hover { color: var(--ink); }
.btn.soft { background: var(--lilac); color: var(--ink); font-weight: 700; }
.btn.soft:hover { color: var(--ink); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:disabled, .btn.off { background: #ECE9E1; color: #6B6974; cursor: default; border-color: transparent; }
.linkbtn { background: none; border: none; color: var(--muted); font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 12px; font-size: 14px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--soft); }
.chip.y { background: #FFF3C4; } .chip.g { background: #DDF4E8; } .chip.p { background: #FFE3D9; } .chip.l { background: #EFEAFF; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ok { color: var(--ok); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

/* switch */
.switch { position: relative; flex: none; width: 56px; height: 34px; border-radius: 999px; border: none; cursor: pointer; background: #DCD8CF; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .22s var(--ease); }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::after { left: 26px; }

/* the blob */
.blob { --size: 140px; --color: var(--lilac); --lvl: 0; position: relative; width: var(--size); height: var(--size); flex: none; animation: bob 3.4s ease-in-out infinite; }
.blob-body { position: absolute; inset: 0; background: var(--color); animation: morph 7s ease-in-out infinite; transform: scale(calc(1 + var(--lvl) * .14)); transition: transform .11s linear; }
.blob-face { position: absolute; left: 0; right: 0; top: calc(var(--size) * .36); display: flex; flex-direction: column; align-items: center; gap: calc(var(--size) * .06); }
.blob-eyes { display: flex; gap: calc(var(--size) * .17); }
.blob-eyes i { display: block; width: calc(var(--size) * .075); height: calc(var(--size) * .11); border-radius: 99px; background: var(--ink); animation: blink 4.6s infinite; }
.blob-mouth { display: block; width: calc(var(--size) * .17); height: calc(4px + var(--lvl) * var(--size) * .13); border-radius: 0 0 99px 99px; background: var(--ink); transition: height .11s linear; }
.blob.sleepy .blob-eyes i { height: 3px; animation: none; }
.blob.sleepy .blob-mouth { height: 3px; }
.blob.hop { animation: hop .9s cubic-bezier(.3,.7,.3,1) infinite; }
.blob.happy .blob-mouth { height: calc(var(--size) * .1); }

.bubble { padding: 9px 13px; border-radius: 18px 18px 18px 4px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.bubble.dark { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 500; }
.bubble.warn { background: #FFF3C4; border-color: #FFF3C4; font-weight: 500; border-radius: 16px; }

.rec { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--rec); animation: pulse 1.4s ease-in-out infinite; }

/* entrance animations */
.rise { animation: rise .55s var(--ease) both; }
.pop { animation: pop .45s var(--ease) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .24s; } .d4 { animation-delay: .32s; } .d5 { animation-delay: .4s; } .d6 { animation-delay: .5s; }

/* waveform */
.wave { display: flex; align-items: center; gap: 2px; height: 26px; }
.wave span { display: block; width: 4px; flex: none; border-radius: 2px; background: #D9D5E3; transition: background .12s; }
.wave span.on { background: var(--ink); }

/* progress */
.bar { height: 12px; border-radius: 999px; background: #ECE9E1; overflow: hidden; }
.bar > div { height: 100%; width: 0%; border-radius: 999px; background: var(--ink); transition: width .2s linear; }

/* confetti */
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti span { position: absolute; left: 50%; top: 50%; margin: -5px 0 0 -5px; animation: confetti 1.5s cubic-bezier(.15,.7,.3,1) both; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 50; animation: pop .35s var(--ease) both; max-width: calc(100vw - 32px); text-align: center; }

@keyframes morph { 0%,100% { border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%; } 33% { border-radius: 58% 42% 40% 60% / 45% 58% 42% 55%; } 66% { border-radius: 40% 60% 55% 45% / 60% 40% 60% 40%; } }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes blink { 0%,93%,100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes rise { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
@keyframes pop { 0% { opacity: 0; scale: .6; } 60% { opacity: 1; scale: 1.06; } 100% { scale: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes ring { 0% { scale: .9; opacity: .55; } 100% { scale: 1.6; opacity: 0; } }
@keyframes hop { 0%,100% { translate: 0 0; } 40%,60% { translate: 0 -26px; } }
@keyframes micdrop { 0% { translate: 0 -140px; rotate: -25deg; opacity: 0; } 45% { translate: 0 0; rotate: 14deg; opacity: 1; } 65% { translate: 0 -22px; rotate: -8deg; } 82% { translate: 0 0; rotate: 4deg; } 100% { translate: 0 0; rotate: 0deg; } }
@keyframes confetti { 0% { translate: 0 0; opacity: 1; rotate: 0deg; } 100% { translate: var(--dx) var(--dy); opacity: 0; rotate: 220deg; } }
@keyframes spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---- Lou, the mascot: looks at your mouse, reacts when you boop him ---- */
.blob { --lx: 0px; --ly: 0px; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.blob-face { transform: translate(var(--lx), var(--ly)); transition: transform .2s var(--ease); }
.blob-eyes { transform: translate(calc(var(--lx) * .45), calc(var(--ly) * .45)); transition: transform .2s var(--ease); }
.blob.boop .blob-body { animation: morph 7s ease-in-out infinite, boop .55s var(--ease); }
.blob.joy .blob-eyes i { height: calc(var(--size) * .065); background: transparent; border: calc(2px + var(--size) * .012) solid var(--ink); border-bottom: none; border-radius: 99px 99px 0 0; animation: none; }
.blob.joy .blob-mouth { height: calc(var(--size) * .11); }
.blob-say { position: absolute; left: 50%; bottom: calc(100% + 8px); translate: -50% 0; z-index: 20; white-space: nowrap; pointer-events: none; padding: 8px 12px; border-radius: 16px; background: var(--ink); color: #fff; font: 600 13px/1.3 Inter, system-ui, sans-serif; letter-spacing: 0; animation: pop .35s var(--ease) both; }
.blob-say.below { bottom: auto; top: calc(100% + 8px); }
.blob-say.left { left: auto; right: 0; translate: 0 0; }
@keyframes boop { 0%,100% { scale: 1 1; } 25% { scale: 1.16 .84; } 50% { scale: .9 1.1; } 75% { scale: 1.05 .96; } }

/* ---- account sheet ---- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(24,23,28,.35); display: flex; align-items: flex-end; justify-content: center; padding: 16px; animation: fadein .2s ease both; }
.sheet-wrap.out { opacity: 0; transition: opacity .2s; }
.sheet { position: relative; width: 100%; max-width: 440px; background: var(--bg); border-radius: 28px; padding: 24px; display: flex; flex-direction: column; gap: 14px; animation: sheetup .35s var(--ease) both; max-height: calc(100dvh - 32px); overflow: auto; }
@media (min-width: 640px) { .sheet-wrap { align-items: center; } }
.sheet-x { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sheet-hero { display: flex; align-items: center; gap: 12px; }
.err { color: #B42318; font-weight: 600; }
.acct { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.savecard { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; background: #fff; border: 2px dashed var(--lilac); border-radius: 22px; padding: 16px 18px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetup { from { opacity: 0; translate: 0 30px; } to { opacity: 1; translate: 0 0; } }

/* longer brand name: keep the header on one line on small phones */
.logo { white-space: nowrap; }
@media (max-width: 420px) {
  .logo { font-size: 18px; gap: 7px; }
  .logo i { width: 15px; height: 15px; }
  .acct { gap: 6px; flex-wrap: nowrap; }
  .acct .btn.small { padding: 0 12px; min-height: 40px; font-size: 14px; white-space: nowrap; }
}
@media (max-width: 370px) {
  .logo { font-size: 16px; }
  .acct .btn.small { padding: 0 10px; }
}
