/*
  Mochi: companion app landing page (Screenery template)
  Cute 3D toy world: candy pastel grounds in rounded toy trays, a cocoa ink, glossy pill chips that squash under a
  thumb and spring back, and Grandstander, a round chunky hand-lettered face, for every word.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Components: buttons, toy chips, fields, checks, switch, notes, toast
   4. Header
   5. Hero: copy, stage (WebGL canvas over the drawn blob), mood bar
   6. The phone and the app: status bar, today's goals, garden, settings, tab bar
   7. How it works
   8. Moods
   9. Widgets
  10. Privacy and the erase dialog
  11. Pricing
  12. Download
  13. Questions
  14. Footer
  15. Motion
  16. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* Grounds */
  --ground: #e9f5fc;       /* page ground: sky milk, the inside of a toy box */
  --ground-2: #d6ecf8;     /* deeper sky for wells */
  --paper: #fffaf4;        /* the app screen and form surfaces: warm, like the blob */
  --white: #ffffff;

  /* Ink: warm cocoa, never black */
  --ink: #3a2620;          /* 13:1 on the sky ground */
  --ink-2: #66463b;        /* secondary, 7.4:1 */
  --ink-3: #7d5a4d;        /* tertiary, 5.5:1 */
  --line: rgb(58 38 32 / 0.16);
  --line-strong: rgb(58 38 32 / 0.32);

  /* Candy: the four mood colours plus mint, each with a soft tint for grounds */
  --peach: #ffa48a;  --peach-soft: #ffe2d7;  --peach-deep: #f07e5f;
  --lilac: #b8a9ec;  --lilac-soft: #ece7ff;  --lilac-deep: #8f7ddc;
  --aqua: #8fd3ec;   --aqua-soft: #ddf2fb;   --aqua-deep: #5fb7dd;
  --butter: #ffd166; --butter-soft: #fff0c4; --butter-deep: #f2b630;
  --mint: #a8e6c4;   --mint-soft: #ddf6e8;   --mint-deep: #7fd4a6;
  --blush: #ff8fa6;

  /* Signal colours */
  --danger: #b3261e;       /* 6:1 on the ground */
  --danger-soft: #ffe1dc;
  --ok: #1f6b43;           /* 6.4:1 on mint-soft */

  /* The current mood, set on <html> by the script */
  --mood: var(--peach);
  --mood-soft: var(--peach-soft);

  /* Type */
  --font: "Grandstander", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.45rem, 1.2rem + 0.9vw, 1.8rem);
  --fs-2xl: clamp(2rem, 1.4rem + 2.2vw, 3.1rem);
  --fs-hero: clamp(2.4rem, 1.5rem + 2.6vw, 4.1rem);

  /* Space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1260px;

  /* Radius: everything is rounded like a toy */
  --r-sm: 12px; --r-md: 20px; --r-lg: 32px; --r-xl: 48px; --r-pill: 999px;

  /* Depth: soft offset shadows with real blur, plus a plastic top highlight */
  --shadow-toy: 0 10px 18px -10px rgb(58 38 32 / 0.45), 0 2px 4px rgb(58 38 32 / 0.12);
  --shadow-lift: 0 24px 40px -22px rgb(58 38 32 / 0.5), 0 4px 10px rgb(58 38 32 / 0.1);
  --gloss: inset 0 2px 1px rgb(255 255 255 / 0.65);

  /* Motion: a spring that overshoots, and a calm exponential ease-out */
  --spring: cubic-bezier(0.34, 1.7, 0.5, 1);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; scrollbar-color: var(--peach-deep) var(--ground); accent-color: var(--peach-deep); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ground);
  caret-color: var(--peach-deep);
  overflow-x: clip;
}
::selection { background: var(--butter); color: var(--ink); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: var(--peach); border-radius: 99px; border: 3px solid var(--ground); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 10px; }
h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 2px; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num, .goal__count, .timer__time, .widget__big, .status__time { font-variant-numeric: tabular-nums; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--ink); color: var(--ground); border-radius: var(--r-pill); }
.skip:focus { top: 12px; }
.h2 { font-size: var(--fs-2xl); }
[hidden] { display: none !important; }

/* ---------- 3. Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: var(--r-pill);
  font-weight: 700; font-size: var(--fs-md); text-decoration: none; white-space: nowrap;
  box-shadow: var(--gloss), var(--shadow-toy);
  transition: transform 0.35s var(--spring), box-shadow 0.25s var(--ease), background-color 0.2s;
}
.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn:active { transform: translateY(1px) scale(0.96, 0.92); transition-duration: 0.08s; }
.btn--ink { background: var(--ink); color: var(--ground); box-shadow: inset 0 2px 1px rgb(255 255 255 / 0.18), var(--shadow-toy); }
.btn--ink:hover { background: #4a3129; }
.btn--soft { background: var(--white); color: var(--ink); }
.btn--small { min-height: 44px; padding: 0 18px; font-size: var(--fs-sm); }
.btn--wide { width: 100%; }
.btn--danger { color: var(--danger); }
.btn--danger-ink { background: var(--danger); }
.btn--danger-ink:hover { background: #962018; }
.btn[aria-busy="true"] { pointer-events: none; }

/* toy chips: glossy pills in a candy colour */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 2px solid var(--ink); border-radius: var(--r-pill);
  background: linear-gradient(to bottom, color-mix(in oklab, var(--chip, var(--white)) 55%, white), var(--chip, var(--white)) 70%);
  color: var(--ink); font-weight: 700; font-size: var(--fs-sm);
  box-shadow: var(--gloss), 0 6px 12px -6px rgb(58 38 32 / 0.5);
  transition: transform 0.4s var(--spring), box-shadow 0.2s var(--ease);
}
.chip:hover { transform: translateY(-2px) rotate(-1.5deg); }
.chip:active { transform: scale(0.94, 0.86); transition-duration: 0.08s; }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { box-shadow: var(--gloss), 0 0 0 3px var(--ground), 0 0 0 6px var(--ink), 0 8px 14px -6px rgb(58 38 32 / 0.5); }
.chip--boop { --chip: var(--white); }

/* fields */
.field, .tf { display: grid; gap: 6px; font-weight: 700; font-size: var(--fs-sm); }
.field input, .tf input, .tf select {
  width: 100%; min-height: 50px; padding: 0 16px;
  border: 2px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--white); color: var(--ink); font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tf input, .tf select { min-height: 44px; padding: 0 12px; border-radius: 14px; font-size: var(--fs-sm); }
.field input::placeholder { color: var(--ink-3); opacity: 1; }
.field input:focus-visible, .tf input:focus-visible, .tf select:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--butter); }
[aria-invalid="true"] { border-color: var(--danger) !important; background: var(--danger-soft) !important; }
.err { display: flex; gap: 6px; color: var(--danger); font-weight: 700; font-size: var(--fs-sm); line-height: 1.35; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-sm); line-height: 1.4; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; }
.note { min-height: 1.4em; font-size: var(--fs-sm); font-weight: 700; color: var(--ok); }
.note.is-error { color: var(--danger); }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks .i { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--mint); stroke-width: 2.5; margin-top: 1px; }

/* switch */
.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; position: relative; font-weight: 600; font-size: var(--fs-sm); }
.switch input { position: absolute; opacity: 0; width: 52px; height: 32px; margin: 0; cursor: pointer; }
.switch__track { width: 52px; height: 32px; flex: none; border-radius: 99px; background: var(--line-strong); position: relative; transition: background 0.2s; }
.switch__track::after { content: ""; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--white); box-shadow: 0 2px 4px rgb(58 38 32 / 0.3); transition: transform 0.4s var(--spring); }
.switch input:checked + .switch__track { background: var(--lilac-deep); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--ink); outline-offset: 3px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; translate: -50% 0;
  max-width: min(92vw, 420px); padding: 12px 20px;
  background: var(--ink); color: var(--ground); border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-sm);
  box-shadow: var(--shadow-lift);
  opacity: 0; transform: translateY(16px) scale(0.9); pointer-events: none;
  transition: opacity 0.2s, transform 0.45s var(--spring);
}
.toast.is-on { opacity: 1; transform: none; }

/* ---------- 4. Header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--s5);
  padding: 12px var(--gutter);
  background: color-mix(in oklab, var(--ground) 97%, transparent);
  border-bottom: 2px solid transparent;
}
.top.is-stuck { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900; font-size: 1.6rem; letter-spacing: -0.01em; }
.brand__blob { width: 44px; height: 42px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 10px 14px; border-radius: var(--r-pill); text-decoration: none; font-weight: 700; font-size: var(--fs-sm); transition: background 0.2s, transform 0.35s var(--spring); }
.nav a:hover { background: var(--white); transform: translateY(-1px); }
.top__menu { display: none; }

/* ---------- 5. Hero ---------- */
.hero-wrap { position: relative; overflow: clip; }
.hero {
  position: relative;
  max-width: var(--max); margin: 0 auto;
  padding: var(--s6) var(--gutter) var(--s8);
  display: grid; gap: var(--s5) var(--s6);
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) 360px;
  grid-template-areas: "title title phone" "copy stage phone" "copy moods phone";
  grid-template-rows: auto auto 1fr;
  align-items: start;
}
/* candy ground: soft lumps of colour behind everything, like jelly sweets on a tray */
.hero-wrap::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 75%, transparent);
  background:
    radial-gradient(26% 30% at 8% 88%, var(--mint-soft), transparent 70%),
    radial-gradient(30% 36% at 92% 12%, var(--lilac-soft), transparent 70%),
    radial-gradient(24% 26% at 70% 96%, var(--butter-soft), transparent 70%);
  transition: background 0.8s var(--ease);
}
.hero__title { grid-area: title; align-self: end; padding-top: var(--s5); font-size: var(--fs-hero); font-weight: 900; letter-spacing: -0.02em; line-height: 1.02; max-width: 16ch; }
.hero__copy { grid-area: copy; padding-top: var(--s5); display: grid; gap: var(--s5); align-content: start; }
.hero__lead { font-size: var(--fs-lg); color: var(--ink-2); max-width: 34ch; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__facts { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 600; }

.stage { grid-area: stage; position: relative; height: 480px; touch-action: manipulation; isolation: isolate; }
/* a soft glow of the current mood behind the blob */
.stage::before { content: ""; position: absolute; left: 50%; top: 58%; width: min(560px, 130%); aspect-ratio: 1; translate: -50% -50%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in oklab, var(--mood) 55%, transparent), transparent); transition: background 0.8s var(--ease); pointer-events: none; }
.stage__gl { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.6s var(--ease); cursor: pointer; }
.stage__svg { position: absolute; left: 50%; top: 54%; width: min(78%, 400px); height: auto; translate: -50% -50%; transition: opacity 0.4s; }
.stage__svg, .stage__svg * { transition: fill 0.6s var(--ease); }
html.gl .stage__gl { opacity: 1; }
html.gl .stage__svg { opacity: 0; pointer-events: none; }
.stage[data-mood="happy"]   { --blob: var(--peach); }
.stage[data-mood="sleepy"]  { --blob: var(--lilac); }
.stage[data-mood="thirsty"] { --blob: var(--aqua); }
.stage[data-mood="proud"]   { --blob: var(--butter); }
.bubble {
  position: absolute; left: 50%; top: 4px; translate: -50% 0; z-index: 2;
  width: max-content; max-width: min(92%, 330px);
  padding: 12px 18px; border: 2.5px solid var(--ink); border-radius: 22px;
  background: var(--white); font-weight: 700; font-size: var(--fs-sm); line-height: 1.35; text-align: center;
  box-shadow: var(--shadow-toy);
}
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -11px; width: 18px; height: 18px; translate: -50% 0; rotate: 45deg; background: var(--white); border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); border-bottom-right-radius: 4px; }
.bubble.is-pop { animation: pop 0.5s var(--spring); }
.stage__boop { position: absolute; right: 8px; bottom: 8px; z-index: 2; }

.moodbar { grid-area: moods; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.moodbar__label { font-weight: 700; color: var(--ink-2); font-size: var(--fs-sm); margin-right: 4px; }

/* ---------- 6. The phone and the app ---------- */
.phone {
  grid-area: phone;
  width: 360px; height: 744px;
  padding: 11px; border-radius: 56px;
  background: linear-gradient(150deg, #5a3d33, var(--ink) 40%, #2a1b16);
  box-shadow: inset 0 2px 2px rgb(255 255 255 / 0.25), 0 40px 60px -30px rgb(58 38 32 / 0.6), 0 8px 18px rgb(58 38 32 / 0.18);
}
.phone__screen { height: 100%; border-radius: 46px; background: var(--paper); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.status { display: flex; align-items: center; justify-content: space-between; padding: 14px 26px 6px; font-size: var(--fs-xs); font-weight: 800; }
.status__island { width: 92px; height: 26px; border-radius: 99px; background: var(--ink); }
.status__icons { display: flex; align-items: flex-end; gap: 2px; }
.status__icons i { width: 3px; background: var(--ink); border-radius: 1px; }
.status__icons i:nth-child(1) { height: 5px; } .status__icons i:nth-child(2) { height: 8px; } .status__icons i:nth-child(3) { height: 11px; }
.status__icons b { width: 20px; height: 10px; margin-left: 5px; border: 1.8px solid var(--ink); border-radius: 3px; background: linear-gradient(90deg, var(--ink) 70%, transparent 70%); background-clip: content-box; padding: 1px; }

.app { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.panel { padding: 8px 18px 18px; display: grid; gap: 12px; align-content: start; }
.app__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app__date { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); }
.app__title { font-size: 1.45rem; font-weight: 800; }
.app__mini { width: 52px; height: 50px; flex: none; }
.app__summary { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.4; }
.app__summary strong { color: var(--ink); }

.goal { --g: var(--aqua); --g-soft: var(--aqua-soft); padding: 14px; border-radius: 24px; background: var(--g-soft); display: grid; gap: 10px; transition: transform 0.45s var(--spring), background 0.3s; }
.goal--stretch { --g: var(--lilac); --g-soft: var(--lilac-soft); }
.goal--steps { --g: var(--mint); --g-soft: var(--mint-soft); }
.goal.is-fed { animation: fed 0.6s var(--spring); }
.goal.is-done { background: color-mix(in oklab, var(--g) 55%, var(--white)); }
.goal__top { display: flex; align-items: center; gap: 10px; }
.goal__top h3 { font-size: 1.05rem; font-weight: 800; }
.goal__icon { display: grid; place-items: center; }
.goal__icon .i { width: 24px; height: 24px; stroke-width: 2.2; }
.goal__count { margin-left: auto; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); }
.goal.is-done .goal__count { color: var(--ink); }
.goal__actions { display: flex; gap: 8px; }
.goal__actions .tbtn--feed { flex: 1; }
.goal__actions--split .tbtn { flex: 1; padding: 0 8px; }

.tbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 0 14px;
  border: 2px solid var(--ink); border-radius: var(--r-pill);
  font-weight: 800; font-size: 0.875rem; color: var(--ink);
  background: linear-gradient(to bottom, color-mix(in oklab, var(--g, var(--peach)) 50%, white), var(--g, var(--peach)) 70%);
  box-shadow: var(--gloss), 0 5px 10px -6px rgb(58 38 32 / 0.55);
  transition: transform 0.4s var(--spring);
}
.tbtn .i { width: 18px; height: 18px; stroke-width: 2.4; }
.tbtn:active { transform: scale(0.92, 0.84); transition-duration: 0.08s; }
.tbtn--ghost { background: var(--white); padding: 0; }
.tbtn:disabled { opacity: 0.55; cursor: not-allowed; }
.tbtn--wide { width: 100%; --g: var(--peach); min-height: 48px; }
.linkish { justify-self: start; min-height: 32px; padding: 0; border: 0; background: none; font-weight: 700; font-size: var(--fs-xs); color: var(--ink-2); text-decoration: underline; text-underline-offset: 0.25em; }

.glasses { display: flex; justify-content: space-between; }
.glass { width: 26px; height: 32px; }
.glass { --gy: 0; }
.glass.is-full { --gy: 1; }

.timer { display: flex; align-items: center; gap: 12px; }
.timer__time { font-size: 1.6rem; font-weight: 800; min-width: 3.2ch; }
.timer__track { flex: 1; height: 14px; border-radius: 99px; background: var(--white); border: 2px solid var(--ink); overflow: hidden; }
.timer__fill { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: repeating-linear-gradient(-45deg, var(--lilac-deep) 0 6px, var(--lilac) 6px 12px); transition: width 0.3s linear; }
.lengths { display: flex; gap: 6px; }
.minichip { min-height: 32px; padding: 0 12px; border: 2px solid var(--line-strong); border-radius: 99px; background: var(--white); font-size: var(--fs-xs); font-weight: 800; position: relative; }
.minichip::before { content: ""; position: absolute; inset: -6px -2px; } /* 44px hit area */
.minichip[aria-pressed="true"] { border-color: var(--ink); background: var(--lilac); }
.minichip:disabled { opacity: 0.5; }

.path { position: relative; height: 16px; border-radius: 99px; background: repeating-linear-gradient(90deg, var(--white) 0 10px, transparent 10px 16px); border: 2px solid var(--ink); }
.path__fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); border-radius: 99px; background: var(--mint-deep); transition: width 0.6s var(--spring); }
.path__dot { position: absolute; top: 50%; left: calc(var(--p) * 100%); width: 22px; height: 22px; translate: -50% -50%; border-radius: 50%; background: var(--butter); border: 2px solid var(--ink); transition: left 0.6s var(--spring); }

.garden { list-style: none; margin: 4px 0 0; padding: 12px 8px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; border-radius: 20px; background: linear-gradient(to bottom, var(--aqua-soft) 0 55%, var(--mint-soft) 55%); }
.garden li { display: grid; justify-items: center; gap: 2px; padding: 4px 0; border-radius: 12px; }
.garden svg { width: 100%; max-width: 40px; height: auto; aspect-ratio: 40 / 48; }
.garden li:nth-child(odd) { --bloom: var(--blush); --bud: #ffb3c3; }
.garden li:nth-child(even) { --bloom: var(--lilac-deep); --bud: var(--lilac); }
.garden span { font-size: 0.75rem; font-weight: 800; color: var(--ink-2); }
.garden .is-today { background: var(--white); box-shadow: 0 0 0 2px var(--ink); }
.garden .is-today span { color: var(--ink); }
.garden .is-later svg { opacity: 0.4; }
.garden .is-grow svg { animation: grow 0.7s var(--spring); transform-origin: 50% 90%; }
.legend { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend dt svg { width: 26px; height: 31px; }
.legend dd { margin: 0; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.garden__note { font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.45; }

.settings { display: grid; gap: 12px; }
.settings fieldset { margin: 0; padding: 12px; border: 0; border-radius: 20px; background: var(--ground); display: grid; gap: 10px; }
.settings legend { float: left; width: 100%; padding: 0; font-weight: 800; font-size: 0.95rem; }
.settings legend + * { clear: both; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.settings .tf span { font-size: var(--fs-xs); color: var(--ink-2); }
.settings .err { font-size: var(--fs-xs); }
.settings.is-quiet-off #quiet-times { opacity: 0.45; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 8px 12px 20px; border-top: 2px solid var(--line); background: var(--paper); }
.tab { display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 0; border: 0; border-radius: 18px; background: none; font-weight: 800; font-size: var(--fs-xs); color: var(--ink-2); transition: background 0.2s, transform 0.35s var(--spring); }
.tab[aria-selected="true"] { background: var(--mood-soft); color: var(--ink); }
.tab:active { transform: scale(0.92); }

/* ---------- 7. How it works ---------- */
.how, .moods, .widgets, .pricing, .download__card, .privacy, .faq { max-width: var(--max); margin: 0 auto; }
.how {
  margin: 0 max(var(--gutter), calc((100% - var(--max)) / 2));
  padding: var(--s8) var(--gutter);
  border-radius: var(--r-xl); background: var(--mint-soft);
  display: grid; gap: var(--s7);
}
.how__intro { display: grid; gap: var(--s4) var(--s7); grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: end; }
.how__intro p { color: var(--ink-2); font-size: var(--fs-lg); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s6); counter-reset: step; }
.step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); align-items: center; counter-increment: step; }
.step:nth-child(even) .step__text { order: 2; }
.step__text { display: grid; gap: 10px; max-width: 46ch; }
.step__text h3 { font-size: var(--fs-xl); display: flex; align-items: center; gap: 14px; }
.step__text h3::before { content: counter(step); flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--white); border: 2.5px solid var(--ink); font-size: 1.3rem; box-shadow: var(--gloss), var(--shadow-toy); }
.step__text p { color: var(--ink-2); }
.step__art { min-height: 200px; position: relative; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; padding: var(--s5); }
.toy { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 2.5px solid var(--ink); border-radius: var(--r-pill); font-weight: 800; box-shadow: var(--gloss), var(--shadow-toy); }
.toy--aqua { background: var(--aqua); rotate: -4deg; } .toy--lilac { background: var(--lilac); rotate: 3deg; } .toy--mint { background: var(--mint); rotate: -2deg; }
.notif { display: flex; gap: 12px; align-items: center; width: min(100%, 340px); padding: 12px 16px; border-radius: 22px; background: var(--ground); box-shadow: var(--shadow-toy); position: relative; z-index: 1; }
.notif--back { scale: 0.94; rotate: 2deg; margin-top: -8px; z-index: 0; background: var(--white); }
.step--nudge .step__art { flex-direction: column; gap: 0; }
.notif__blob { width: 44px; height: 42px; flex: none; }
.notif__app { font-weight: 800; font-size: var(--fs-sm); }
.notif__app span { font-weight: 600; color: var(--ink-3); margin-left: 6px; }
.notif__text { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.35; }
.feed-blob { width: 150px; height: auto; }
.feed-plant { width: 64px; height: 77px; --bloom: var(--blush); }

/* ---------- 8. Moods ---------- */
.moods { padding: var(--s9) var(--gutter) var(--s8); display: grid; gap: var(--s6); grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.moods__intro { display: grid; gap: var(--s4); max-width: 60ch; }
.moodpanels { grid-column: 1 / -1; }
.moods__intro p { color: var(--ink-2); font-size: var(--fs-lg); }
.moodtabs { display: flex; flex-wrap: wrap; gap: 12px; }
.moodpanels { display: grid; gap: var(--s5); }
.moodpanel { display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr); gap: var(--s6); align-items: center; padding: var(--s6); border-radius: var(--r-xl); background: var(--tint); }
.moodpanel__blob { width: 100%; max-width: 320px; height: auto; justify-self: center; }
.moodpanel__text { display: grid; gap: var(--s4); justify-items: start; }
.moodpanel h3 { font-size: var(--fs-2xl); }
.moodpanel__line { font-size: var(--fs-lg); color: var(--ink-2); }
.moodpanel dl { margin: 0; display: grid; gap: 12px; max-width: 58ch; }
.moodpanel dl div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding-top: 12px; border-top: 2px dashed var(--line-strong); }
.moodpanel dt { font-weight: 800; }
.moodpanel dd { margin: 0; color: var(--ink-2); }
html.js .moodpanel.is-in { animation: panelIn 0.55s var(--spring); }

/* ---------- 9. Widgets ---------- */
.widgets { padding: var(--s8) var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s7); align-items: center; }
.widgets__intro { display: grid; gap: var(--s5); }
.widgets__intro p { color: var(--ink-2); font-size: var(--fs-lg); max-width: 46ch; }
.homescreen { padding: var(--s5); border-radius: var(--r-xl); display: grid; gap: var(--s4); background: linear-gradient(160deg, var(--aqua-soft), var(--lilac-soft) 55%, var(--peach-soft)); border: 3px solid var(--ink); }
.lockline { justify-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px; background: rgb(255 255 255 / 0.8); font-weight: 700; font-size: var(--fs-sm); }
.lockline .i { width: 18px; height: 18px; }
.wgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
.widget { border-radius: 28px; background: var(--white); padding: 16px; box-shadow: var(--gloss), var(--shadow-toy); position: relative; }
.widget--s { grid-column: span 2; aspect-ratio: 1; display: grid; align-content: space-between; background: var(--aqua); }
.widget__label { font-weight: 800; }
.widget__big { font-size: 3rem; font-weight: 900; line-height: 1; }
.widget__big small { font-size: 1.1rem; font-weight: 700; }
.widget__plus { position: absolute; right: 14px; bottom: 14px; width: 48px; height: 48px; display: grid; place-items: center; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--white); box-shadow: var(--gloss), var(--shadow-toy); transition: transform 0.4s var(--spring); }
.widget__plus:active { transform: scale(0.85); transition-duration: 0.08s; }
.widget__plus .i { stroke-width: 2.6; }
.widget--m { grid-column: span 4; display: flex; align-items: center; gap: 16px; }
.widget__blob { width: 96px; height: auto; flex: none; }
.widget__goals { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 6px; }
.widget__goals li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 14px; background: var(--ground); font-weight: 700; font-size: var(--fs-sm); }
.widget__goals li .i { width: 18px; height: 18px; }
.widget__goals li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.widget__goals li.is-done { background: var(--mint); }
.app-icons { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); align-content: center; }
.app-icons--row { grid-column: span 4; grid-template-columns: repeat(4, 1fr); }
.app-icons i { aspect-ratio: 1; border-radius: 22px; background: rgb(255 255 255 / 0.65); }
.app-icons i:nth-child(2) { background: rgb(255 209 102 / 0.6); } .app-icons i:nth-child(3) { background: rgb(168 230 196 / 0.7); }
.widget.is-fed, .widget__plus.is-fed { animation: fed 0.6s var(--spring); }

/* ---------- 10. Privacy ---------- */
.privacy { padding: var(--s8) var(--gutter); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s7); align-items: start; }
.privacy__text { display: grid; gap: var(--s4); max-width: 62ch; }
.privacy__text > p { color: var(--ink-2); }
.never { margin: var(--s3) 0 0; display: grid; gap: 12px; }
.never div { padding: 14px 18px; border-radius: var(--r-md); background: var(--ground-2); }
.never dt { font-weight: 800; }
.never dd { margin: 0; color: var(--ink-2); }
.lunchbox { border: 3px solid var(--ink); border-radius: var(--r-lg); background: var(--white); overflow: hidden; box-shadow: var(--shadow-lift); }
.lunchbox__lid { display: flex; align-items: center; gap: 10px; padding: 16px 20px; background: var(--peach); border-bottom: 3px solid var(--ink); box-shadow: inset 0 3px 1px rgb(255 255 255 / 0.5); }
.lunchbox__lid h3 { font-size: var(--fs-lg); }
.lunchbox__list { list-style: none; margin: 0; padding: 8px 20px; }
.lunchbox__list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 2px dashed var(--line); font-size: var(--fs-sm); }
.lunchbox__list li span { color: var(--ink-2); font-weight: 600; }
.lunchbox__list li b { text-align: right; font-variant-numeric: tabular-nums; }
.lunchbox__size { padding: 4px 20px 0; font-size: var(--fs-sm); color: var(--ink-2); }
.lunchbox__actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 20px 6px; }
.lunchbox .note { padding: 0 20px 16px; }

.dialog { width: min(92vw, 420px); padding: 0; border: 3px solid var(--ink); border-radius: var(--r-lg); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lift); }
.dialog::backdrop { background: rgb(58 38 32 / 0.45); }
.dialog form { padding: var(--s6) var(--s5) var(--s5); display: grid; gap: 12px; justify-items: center; text-align: center; }
.dialog__blob { width: 110px; height: auto; }
.dialog h3 { font-size: var(--fs-xl); }
.dialog p { color: var(--ink-2); }
.dialog__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.dialog[open] { animation: pop 0.5s var(--spring); }

/* ---------- 11. Pricing ---------- */
.pricing { padding: var(--s8) var(--gutter); margin: 0 max(var(--gutter), calc((100% - var(--max)) / 2)); border-radius: var(--r-xl); background: var(--lilac-soft); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: var(--s7); align-items: start; }
.pricing__intro { display: grid; gap: var(--s4); }
.pricing__intro p { color: var(--ink-2); font-size: var(--fs-lg); }
.billing { display: inline-flex; justify-self: start; padding: 5px; gap: 4px; border-radius: 99px; background: var(--white); border: 2px solid var(--ink); }
.billing label { position: relative; cursor: pointer; }
.billing input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.billing span { display: grid; place-items: center; min-height: 40px; padding: 0 18px; border-radius: 99px; font-weight: 800; font-size: var(--fs-sm); transition: background 0.25s, transform 0.4s var(--spring); }
.billing input:checked + span { background: var(--lilac); }
.billing input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: var(--s4); padding: var(--s6); border-radius: var(--r-lg); background: var(--white); box-shadow: var(--shadow-toy); }
.plan .btn { margin-top: auto; align-self: end; }
.plan--supporter { background: var(--butter-soft); border: 3px solid var(--ink); }
.plan__blob { position: absolute; right: 18px; top: -46px; width: 96px; height: auto; rotate: 8deg; }
.plan h3 { font-size: var(--fs-xl); }
.plan__price .num { font-size: 2.6rem; font-weight: 900; line-height: 1; }
.plan__per { display: block; margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; }
.plan__fine { font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------- 12. Download ---------- */
.download { padding: var(--s8) var(--gutter); }
.download__card { padding: var(--s7); border-radius: var(--r-xl); background: var(--peach); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s7); align-items: center; box-shadow: inset 0 4px 2px rgb(255 255 255 / 0.45), var(--shadow-lift); }
.download__text { display: grid; gap: var(--s4); }
.download__text p { font-size: var(--fs-lg); max-width: 40ch; }
.download__blob { width: 170px; height: auto; margin-top: var(--s4); --blob: var(--butter) !important; }
.dlform { display: grid; gap: 14px; padding: var(--s6); border-radius: var(--r-lg); background: var(--paper); border: 3px solid var(--ink); }
.seg { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: var(--fs-sm); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 2px solid var(--line-strong); border-radius: var(--r-md); background: var(--white); font-weight: 800; transition: transform 0.4s var(--spring), background 0.2s, border-color 0.2s; }
.seg input:checked + span { border-color: var(--ink); background: var(--butter); box-shadow: var(--gloss); }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.seg input:active + span { transform: scale(0.95); }
.seg[data-invalid] span { border-color: var(--danger); }
.outcome:empty { display: none; }
.outcome { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-weight: 600; font-size: var(--fs-sm); line-height: 1.45; }
.outcome.is-ok { background: var(--mint-soft); color: var(--ok); }
.outcome.is-error { background: var(--danger-soft); color: var(--danger); }
.outcome svg.mini { width: 48px; height: 46px; flex: none; }
.outcome b { color: var(--ink); }
.spinner { width: 18px; height: 18px; border: 3px solid rgb(255 243 228 / 0.35); border-top-color: var(--ground); border-radius: 50%; animation: spin 0.7s linear infinite; }

/* ---------- 13. Questions ---------- */
.faq { padding: var(--s8) var(--gutter) var(--s9); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: var(--s7); align-items: start; }
.faq__list { display: grid; gap: 12px; }
.faq__intro { display: grid; gap: var(--s4); justify-items: start; }
.faq__intro p { color: var(--ink-2); max-width: 40ch; }
.faq__intro a { color: var(--ink); font-weight: 700; }
.faq__blob { width: 150px; height: auto; margin-top: var(--s4); }
.faq details { border-radius: var(--r-md); background: var(--white); box-shadow: var(--shadow-toy); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 14px 22px; font-weight: 800; font-size: var(--fs-md); cursor: pointer; list-style: none; border-radius: var(--r-md); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { transition: transform 0.4s var(--spring); }
.faq details[open] summary .i { transform: rotate(180deg); }
.faq details p { padding: 0 22px 20px; color: var(--ink-2); max-width: 65ch; }

/* ---------- 14. Footer ---------- */
.foot { background: var(--ink); color: var(--ground); padding: var(--s7) var(--gutter) var(--s6); border-radius: var(--r-xl) var(--r-xl) 0 0; display: grid; grid-template-columns: 1fr auto; gap: var(--s5) var(--s7); align-items: center; }
.foot__brand { display: flex; align-items: center; gap: 16px; font-size: var(--fs-sm); line-height: 1.5; }
.foot__blob { width: 70px; height: auto; flex: none; }
.foot__links { display: flex; flex-wrap: wrap; gap: 4px 6px; justify-content: flex-end; }
.foot__links a { padding: 10px 12px; font-weight: 700; font-size: var(--fs-sm); border-radius: 99px; text-decoration: none; }
.foot__links a:hover { background: rgb(255 243 228 / 0.12); text-decoration: underline; }
.foot :focus-visible { outline-color: var(--butter); }
.foot__fine { grid-column: 1 / -1; padding-top: var(--s5); border-top: 2px solid rgb(255 243 228 / 0.16); font-size: var(--fs-xs); color: #e9d6c5; }

/* ---------- 15. Motion ---------- */
@keyframes pop { 0% { transform: scale(0.85); } 100% { transform: scale(1); } }
@keyframes fed { 0% { transform: scale(1); } 30% { transform: scale(1.04, 0.95); } 60% { transform: scale(0.98, 1.03); } 100% { transform: scale(1); } }
@keyframes grow { 0% { transform: scale(0.4, 0.2); } 100% { transform: scale(1); } }
@keyframes panelIn { 0% { transform: translateY(14px) scale(0.98); opacity: 0.4; } 100% { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes squish { 0%, 100% { transform: scale(1, 1); } 35% { transform: scale(1.12, 0.86); } 65% { transform: scale(0.95, 1.07); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }

/* The drawn blob, when it stands in for WebGL with motion allowed, still blinks and squishes once when fed */
@media (prefers-reduced-motion: no-preference) {
  .stage__svg.is-squish { animation: squish 0.6s var(--spring); transform-origin: 50% 90%; }
  .stage__svg .stage__face, .app__mini .mini__face { transform-origin: 50% 52%; animation: blink 4.5s infinite; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
}

/* ---------- 16. Narrow screens ---------- */
@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "title title" "copy copy" "stage phone" "moods phone"; grid-template-rows: auto auto auto 1fr; }
  .hero__copy { padding-top: 0; max-width: 720px; }
  .hero__lead { max-width: 52ch; }
  .stage { height: 520px; }
}
@media (max-width: 1020px) {
  .nav { display: none; position: absolute; top: 100%; right: var(--gutter); left: var(--gutter); flex-direction: column; padding: 10px; border-radius: var(--r-lg); background: var(--white); box-shadow: var(--shadow-lift); }
  .nav.is-open { display: flex; }
  .nav a { min-height: 48px; display: flex; align-items: center; }
  .top__menu { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; min-height: 44px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 99px; background: var(--white); font-weight: 800; font-size: var(--fs-sm); }
  html:not(.js) .nav { display: flex; position: static; flex-direction: row; flex-wrap: wrap; padding: 0; background: none; box-shadow: none; }
  html:not(.js) .top { flex-wrap: wrap; }
  html:not(.js) .top__menu { display: none; }
  .pricing, .faq, .how__intro, .moods { grid-template-columns: 1fr; }
  .faq__blob { display: none; }
  .widgets, .privacy { grid-template-columns: 1fr; }
  .download__card { grid-template-columns: 1fr; padding: var(--s6); }
  .download__blob { display: none; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "stage" "moods" "copy" "phone"; grid-template-rows: auto; padding-bottom: var(--s7); }
  .stage { height: min(440px, 108vw); }
  .hero__copy { padding-top: var(--s4); }
  .phone { justify-self: center; }
  .step, .moodpanel { grid-template-columns: 1fr; }
  .step:nth-child(even) .step__text { order: 0; }
  .moodpanel { padding: var(--s5); gap: var(--s4); }
  .moodpanel__blob { max-width: 220px; }
  .moodpanel dl div { grid-template-columns: 1fr; gap: 2px; }
  .plans { grid-template-columns: 1fr; gap: var(--s7); }
  .foot { grid-template-columns: 1fr; }
  .foot__links { justify-content: flex-start; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .top { gap: 10px; }
  .top__cta { display: none; }
  .hero__title { font-size: clamp(2.2rem, 9.6vw, 2.8rem); }
  .hero__lead { font-size: var(--fs-md); }
  .hero__ctas .btn { flex: 1 1 100%; }
  .how, .pricing { margin: 0 8px; padding: var(--s7) 16px; border-radius: var(--r-lg); }
  .step__art { min-height: 0; padding: var(--s4); }
  .toy { min-height: 46px; padding: 0 14px; font-size: var(--fs-sm); }
  .phone { width: 100%; max-width: 360px; height: 732px; border-radius: 50px; padding: 9px; }
  .phone__screen { border-radius: 42px; }
  .panel { padding: 6px 14px 16px; }
  .widgets, .privacy, .download, .faq, .moods { padding-left: 16px; padding-right: 16px; }
  .homescreen { padding: var(--s4); }
  .wgrid { gap: 12px; }
  .widget__big { font-size: 2.4rem; }
  .widget--m { gap: 10px; padding: 12px; }
  .widget__blob { width: 64px; }
  .widget__goals li { padding: 6px 8px; font-size: var(--fs-xs); }
  .lockline { font-size: var(--fs-xs); text-align: center; }
  .download__card { padding: var(--s5) 16px; }
  .dlform { padding: var(--s5) 16px; }
  .lunchbox__list li { flex-direction: column; gap: 2px; }
  .lunchbox__list li b { text-align: left; }
  .faq summary { padding: 14px 16px; }
  .faq details p { padding: 0 16px 18px; }
  .stage__boop { right: 50%; translate: 50% 0; }
}

/* Without JavaScript: the page reads top to bottom, and controls that need the script step aside */
html:not(.js) .stage__boop, html:not(.js) .moodbar, html:not(.js) [data-show-mood], html:not(.js) .moodtabs,
html:not(.js) .lunchbox__actions, html:not(.js) .widget__plus { display: none; }
@media (max-width: 1020px) { html:not(.js) .top { position: static; } }
