/* ==========================================================================
   Moymer house style: tokens + base + components
   Source of truth: falou-ios (SUI3DButton, Colors.xcassets, SmartMainView),
   cross-checked with falou.com, falou-ios-chats, Chessmigo, legacy SpeakTrip.
   Copy this file into the project. Change product tokens, never the recipes.
   ========================================================================== */

/* Copied from the moymer-design skill (moymer.css). The only change: the Nunito @import was removed, because the page
   shell already loads the font with a <link> (an @import inside a stylesheet delays first paint). */

:root {
  /* ---- Brand ------------------------------------------------------------ */
  --mm-blue: #3983F8;        /* Lou blue: logo, mascot body, primary CTA, highlighted headline words */
  --mm-sky: #41AEFF;         /* brighter "button blue" / chapter-1 colour */
  --mm-cyan: #00C5FF;        /* lesson / "smart" accent */
  --mm-lou-face: #94CCFD;    /* Lou's face, soft highlight blue */

  /* ---- Candy rotation: ONE per section / card / character, never all at once */
  --mm-candy-sky: #41AEFF;
  --mm-candy-lime: #9BC940;
  --mm-candy-coral: #FF6060;
  --mm-candy-mustard: #EBC20A;
  --mm-candy-lavender: #C67CFF;
  --mm-candy-tangerine: #FFAB48;

  /* Language set (flags, language-specific pages) */
  --mm-lang-red: #F84B55;
  --mm-lang-yellow: #FFC300;
  --mm-lang-pink: #EB7CFF;
  --mm-lang-orange: #FF7700;

  /* Pastel sticker set (legacy flashcards widget): card grids, tilted tiles */
  --mm-pastel-green: #CEFDBC;
  --mm-pastel-peach: #FFCD7C;
  --mm-pastel-pink: #F5BCFF;
  --mm-pastel-purple: #CBBCFF;
  --mm-pastel-red: #FFA3A3;
  --mm-pastel-aqua: #BCFCFF;
  --mm-pastel-blue: #BCCBFF;
  --mm-pastel-yellow: #FDEDBC;

  /* ---- Feedback / gamification ------------------------------------------ */
  --mm-correct: #3ED34F;
  --mm-wrong: #FA6786;
  --mm-streak: #FFA64D;
  --mm-gold: #FFC41C;
  --mm-highlight: #F08C00;   /* "Falou orange": bold key words inside speech bubbles */
  --mm-karaoke-from: #CCFFEA; /* spoken-word fill ramp */
  --mm-karaoke-to: #15DE89;

  /* ---- Neutrals (always blue-tinted, never plain grey) ------------------ */
  --mm-bg: #FFFFFF;
  --mm-ice: #F7FAFF;         /* section bands, testimonial cards, footer */
  --mm-band: #C1E7FF;        /* the one saturated band (e.g. Business) */
  --mm-line: #EFF1F7;        /* 2px borders AND the lip under white elements */
  --mm-bubble-line: #F0F4FA;
  --mm-soft: #DFE3EF;        /* typing blob, inactive fills */
  --mm-ink: #000000;         /* text is pure black, not navy */
  --mm-ink-soft: rgb(0 0 0 / 0.55);
  --mm-slate: #748296;       /* secondary text */
  --mm-proof: #A5B2C7;       /* monochrome credentials strip */
  --mm-foot-title: #5774A2;
  --mm-foot-link: #9BAECA;

  /* ---- Product theme (override per product, see references/products.md) - */
  --brand: var(--mm-blue);
  --on-brand: #FFFFFF;
  /* Lip recipe: lip = face mixed into --lip-into at --lip-mix.
     Falou (app + falou.com): LIGHTER lip = face 60% into the page bg (#3983F8 -> #88B4FB).
     Chessmigo: DARKER lip = face 88% into black (#FFC42E -> ~#E0AD28). */
  --lip-mix: 60%;
  --lip-into: var(--mm-bg);

  /* ---- Type ------------------------------------------------------------- */
  --mm-font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --mm-display: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem);  /* hero */
  --mm-h2: clamp(2rem, 1.5rem + 2vw, 3rem);
  --mm-h3: clamp(1.375rem, 1.2rem + .6vw, 1.75rem);
  --mm-lead: 1.25rem;
  --mm-body: 1.0625rem;
  --mm-small: .9375rem;
  --mm-eyebrow: .8125rem;

  /* ---- Shape ------------------------------------------------------------ */
  --mm-r: 15px;          /* THE radius: buttons, chips, option cards */
  --mm-r-card: 20px;     /* big cards, icon buttons */
  --mm-r-bubble: 14px;   /* speech bubbles */
  --mm-r-bar: 10px;      /* progress bars, number wells */
  --mm-r-mic: 30px;      /* giant mic / record button */
  --mm-depth: 6px;       /* lip depth for primary elements */
  --mm-depth-sm: 4px;    /* chips, small buttons */
  --mm-border: 2px;

  /* ---- Space ------------------------------------------------------------ */
  --mm-gutter: clamp(20px, 5vw, 40px);
  --mm-max: 1120px;
  --mm-section: clamp(64px, 9vw, 120px);

  /* ---- Motion (from SwiftUI springs; see references/rive-and-motion.md) - */
  --mm-ease-settle: cubic-bezier(.22, .9, .32, 1);     /* entrance, no overshoot (spring ~0.45/0.92) */
  --mm-ease-pop: cubic-bezier(.34, 1.56, .64, 1);      /* emphasis pop (spring ~0.32/0.6) */
  --mm-ease-ui: cubic-bezier(.45, 0, .55, 1);          /* easeInOut */
  --mm-t-press: 70ms;
  --mm-t-fast: 200ms;
  --mm-t-ui: 300ms;
  --mm-t-enter: 420ms;
  --mm-stagger-inner: 40ms;
  --mm-stagger-section: 150ms;

  color-scheme: light;
}

/* LIGHT IS CANONICAL. Dark is opt-in only: set data-theme="dark" on <html> when the user asks for a
   dark theme. It never follows the OS automatically (pages, art and Rive files are designed on white). */
:root[data-theme="dark"] {
  --mm-bg: #141A1F; --mm-ice: #1A2027; --mm-band: #16324A; --mm-line: #232B32;
  --mm-bubble-line: #20262C; --mm-soft: #34404E; --mm-ink: #FFFFFF;
  --mm-ink-soft: rgb(255 255 255 / .6); --mm-slate: #9BA7B3; --mm-proof: #566572;
  --mm-foot-title: #9BAECA; --mm-foot-link: #748296;
  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mm-bg);
  color: var(--mm-ink);
  font-family: var(--mm-font);
  font-size: var(--mm-body);
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 900; line-height: 1.08; letter-spacing: 0; text-wrap: balance; }
h1 { font-size: var(--mm-display); }
h2 { font-size: var(--mm-h2); }
h3 { font-size: var(--mm-h3); line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
b, strong { font-weight: 900; }
img { max-width: 100%; display: block; }
a { color: inherit; }

.mm-wrap { width: 100%; max-width: var(--mm-max); margin-inline: auto; padding-inline: var(--mm-gutter); }
.mm-section { padding-block: var(--mm-section); }
.mm-band--ice { background: var(--mm-ice); }
.mm-band--sky { background: var(--mm-band); }
.mm-band--brand { background: var(--brand); color: var(--on-brand); }

.mm-lead { font-size: var(--mm-lead); font-weight: 500; color: var(--mm-ink-soft); }
.mm-muted { color: var(--mm-slate); }

/* Eyebrow: UPPERCASE, heavy, tracked (app: "CHAPTER 3", 13.5pt, kerning 1.1) */
.mm-eyebrow {
  display: inline-block;
  font-size: var(--mm-eyebrow); font-weight: 900;
  text-transform: uppercase; letter-spacing: .08em;
  /* darkened so any candy colour stays legible at 13px */
  color: color-mix(in srgb, var(--eyebrow, var(--brand)) 62%, black);
}

/* Candy colours are FILLS. When one must colour text on white, darken it. */
.mm-tint-text { color: color-mix(in srgb, var(--tint, var(--brand)) 72%, black); }

/* Headline highlight: one key phrase in brand colour (falou.com) */
.mm-hl { color: var(--brand); }
/* Highlighter bar behind a phrase (Chessmigo store art). Max one per page. */
.mm-marker {
  background: var(--marker, var(--mm-gold));
  color: var(--mm-ink);
  padding: 0 .18em; border-radius: 8px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ==========================================================================
   The 3D "lip" button: the identity component (SUI3DButton)
   Face sits on a solid, unblurred copy of itself; press drops the face onto it.
   ========================================================================== */
.mm-btn {
  --face: var(--brand);
  --on-face: var(--on-brand);
  --lip: color-mix(in srgb, var(--face) var(--lip-mix), var(--lip-into));
  --edge: transparent;
  --d: var(--mm-depth);

  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px;
  margin-bottom: var(--d);                         /* reserve room for the lip */
  border: var(--mm-border) solid var(--edge);
  border-radius: var(--mm-r);
  background: var(--face); color: var(--on-face);
  font: 900 1.0625rem/1 var(--mm-font);
  text-decoration: none; text-align: center; white-space: nowrap;
  box-shadow: 0 var(--d) 0 var(--lip);
  transform: translateY(0);
  transition: transform var(--mm-t-press) ease-out, box-shadow var(--mm-t-press) ease-out, background-color var(--mm-t-fast) ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mm-btn:hover { background: color-mix(in srgb, var(--face) 92%, white); }
.mm-btn:active, .mm-btn[aria-pressed="true"] {
  transform: translateY(var(--d));
  box-shadow: 0 0 0 var(--lip);
}
.mm-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--face) 55%, transparent); outline-offset: 4px; }
.mm-btn[disabled], .mm-btn[aria-disabled="true"] {
  --face: var(--mm-ice); --on-face: var(--mm-ink-soft); --lip: var(--mm-line); --edge: var(--mm-line);
  cursor: not-allowed;
}
.mm-btn--block { display: flex; width: 100%; }
.mm-btn--lg { min-height: 64px; padding: 0 36px; font-size: 1.1875rem; }
.mm-btn--sm { --d: var(--mm-depth-sm); min-height: 44px; padding: 0 18px; font-size: .9375rem; }

/* White / neutral: white face, 2px #EFF1F7 border, #EFF1F7 lip */
.mm-btn--white { --face: var(--mm-bg); --on-face: var(--mm-ink); --lip: var(--mm-line); --edge: var(--mm-line); }
.mm-btn--white:hover { background: var(--mm-ice); }
/* Any candy / feedback colour: set --face inline, e.g. style="--face: var(--mm-candy-coral)" */
.mm-btn--correct { --face: var(--mm-correct); }
.mm-btn--wrong { --face: var(--mm-wrong); }
/* Light faces (yellow, gold, pastel) need a DARK lip and ink text */
.mm-btn--light-face { --on-face: var(--mm-ink); --lip: color-mix(in srgb, var(--face) 80%, black); }

/* Square icon button (home top bar: flag | streak | settings) */
.mm-icon-btn {
  --d: var(--mm-depth-sm);
  width: 48px; height: 48px; padding: 0; min-height: 0;
  border-radius: var(--mm-r);
}

/* Store button: black lip button, never the generic flat badge in a row of pills */
.mm-store {
  --face: #000; --on-face: #fff; --lip: #3A3F47; --d: 5px;
  min-height: 56px; padding: 0 20px; gap: 12px; font-size: 1rem;
}
.mm-store small { display: block; font-size: .6875rem; font-weight: 700; opacity: .75; line-height: 1.1; }
.mm-store span { text-align: left; line-height: 1.1; }

/* ==========================================================================
   Cards & tiles
   ========================================================================== */
/* 3D white card: border + lip of the same pale tint */
.mm-card {
  background: var(--mm-bg);
  border: var(--mm-border) solid var(--mm-line);
  border-radius: var(--mm-r-card);
  box-shadow: 0 var(--mm-depth) 0 var(--mm-line);
  padding: 24px;
}
/* Tinted card: feature colour at ~14% fill, no border, no shadow */
.mm-card--tint {
  --tint: var(--brand);
  background: color-mix(in srgb, var(--tint) 14%, var(--mm-bg));
  border: 0; box-shadow: none;
}
.mm-card--tint .mm-card__title { color: color-mix(in srgb, var(--tint) 75%, black); }
.mm-card--ice { background: var(--mm-ice); border: 0; box-shadow: none; border-radius: var(--mm-r); }

/* Selectable option card (onboarding / quiz) */
.mm-option {
  --accent: var(--brand);
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 18px; margin-bottom: var(--mm-depth);
  background: var(--mm-bg); color: var(--mm-ink);
  border: 3px solid var(--mm-line); border-radius: var(--mm-r);
  box-shadow: 0 var(--mm-depth) 0 var(--mm-line);
  font: 900 1.0625rem/1.2 var(--mm-font); text-align: left; cursor: pointer;
  transition: transform var(--mm-t-press) ease-out, box-shadow var(--mm-t-press) ease-out;
}
.mm-option:active { transform: translateY(var(--mm-depth)); box-shadow: 0 0 0 var(--mm-line); }
.mm-option[aria-checked="true"], .mm-option.is-selected {
  background: color-mix(in srgb, var(--accent) 18%, var(--mm-bg));
  border-color: color-mix(in srgb, var(--accent) 50%, white);
  box-shadow: 0 var(--mm-depth) 0 color-mix(in srgb, var(--accent) 50%, white);
}

/* Chip (language / flag chip from falou.com) */
.mm-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; margin-bottom: var(--mm-depth-sm);
  background: var(--mm-bg); color: var(--mm-ink);
  border: 2px solid var(--mm-line); border-radius: var(--mm-r);
  box-shadow: 0 var(--mm-depth-sm) 0 var(--mm-line);
  font: 900 1rem/1 var(--mm-font); text-decoration: none; white-space: nowrap;
}
.mm-chip img { width: 30px; height: 20px; border-radius: 4px; object-fit: cover; }

/* Tag / sticker (home tags: premium, league, offer) */
.mm-tag {
  --face: var(--brand);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 12px;
  background: var(--face); color: #fff;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--face) 70%, black);
  font: 900 .75rem/1 var(--mm-font); text-transform: uppercase; letter-spacing: .06em;
}

/* Topic tile: pastel rounded square, slightly rotated, holding an illustration */
.mm-tile {
  aspect-ratio: 1; border-radius: 22%;
  background: var(--tile, var(--mm-pastel-blue));
  display: grid; place-items: center;
  rotate: var(--tilt, 0deg);
}

/* ==========================================================================
   Speech & chat
   ========================================================================== */
/* Mascot speech bubble (Lou): surface fill, 2px pale stroke, radius 14, tail */
.mm-bubble {
  --tail: left;
  position: relative;
  display: inline-block; max-width: 34ch;
  padding: 14px 18px;
  background: var(--mm-bg);
  border: 2px solid var(--mm-bubble-line);
  border-radius: var(--mm-r-bubble);
  font-size: 1.125rem; font-weight: 700; line-height: 1.35;
}
.mm-bubble b, .mm-bubble strong { color: var(--mm-highlight); }
.mm-bubble::before, .mm-bubble::after {
  content: ""; position: absolute; top: 62%; width: 0; height: 0;
  border-style: solid;
}
.mm-bubble::before { left: -14px; border-width: 9px 14px 9px 0; border-color: transparent var(--mm-bubble-line) transparent transparent; }
.mm-bubble::after  { left: -10px; border-width: 7px 11px 7px 0; border-color: transparent var(--mm-bg) transparent transparent; margin-top: 2px; }
.mm-bubble--right::before { left: auto; right: -14px; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent var(--mm-bubble-line); }
.mm-bubble--right::after  { left: auto; right: -10px; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent var(--mm-bg); }
.mm-bubble--down::before { top: auto; bottom: -14px; left: 32px; border-width: 14px 9px 0 9px; border-color: var(--mm-bubble-line) transparent transparent transparent; }
.mm-bubble--down::after  { top: auto; bottom: -10px; left: 34px; border-width: 11px 7px 0 7px; border-color: var(--mm-bg) transparent transparent transparent; margin-top: 0; }

/* Conversation bubbles (legacy "Situation" chat): radius 30, 7px tail corner */
.mm-chat { display: flex; flex-direction: column; gap: 10px; }
.mm-msg {
  max-width: 80%; padding: 12px 20px;
  font-weight: 700; font-size: 1rem; line-height: 1.35;
  background: var(--mm-ice); color: var(--mm-ink);
  border-radius: 30px 30px 30px 7px;
  align-self: flex-start;
}
.mm-msg--me {
  align-self: flex-end;
  background: var(--lesson, var(--brand)); color: #fff;
  border-radius: 30px 30px 7px 30px;
}
.mm-msg__tr { display: block; font-size: .875rem; opacity: .55; font-weight: 600; margin-top: 2px; }
.mm-typing {
  width: 70px; height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--mm-soft); border-radius: 23px 23px 23px 6px;
}
.mm-typing i { width: 10px; height: 10px; border-radius: 50%; background: #808698; animation: mm-typing .4s ease-in-out infinite alternate; }
.mm-typing i:nth-child(2) { animation-delay: .2s; }
.mm-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes mm-typing { to { transform: translateY(-8px); } }

/* ==========================================================================
   Progress, stats, proof
   ========================================================================== */
/* Chunky inset progress bar (ColorfulProgressBar): track = colour @10%, 3px inset fill */
.mm-progress {
  --c: var(--brand);
  height: 26px; padding: 3px; border-radius: var(--mm-r-bar);
  background: color-mix(in srgb, var(--c) 12%, var(--mm-bg));
}
.mm-progress > span {
  display: block; height: 100%; width: var(--value, 40%);
  background: var(--c); border-radius: calc(var(--mm-r-bar) - 3px);
  transition: width var(--mm-t-ui) var(--mm-ease-ui);
}

/* Stat card (celebration card): tinted, big 900 number in a white well */
.mm-stat {
  --tint: var(--brand);
  display: grid; gap: 10px; justify-items: center; text-align: center;
  padding: 18px 16px 16px; border-radius: var(--mm-r-bubble);
  background: color-mix(in srgb, var(--tint) 18%, var(--mm-bg));
}
.mm-stat__label { font-weight: 900; font-size: .9375rem; color: color-mix(in srgb, var(--tint) 70%, black); }
.mm-stat__value {
  min-width: 100%; padding: 8px 14px; border-radius: var(--mm-r-bar);
  background: var(--mm-bg); border: 3px solid var(--tint);
  font-weight: 900; font-size: 1.875rem; line-height: 1.1; font-variant-numeric: tabular-nums;
}

/* Monochrome credentials strip: quiet colour, loud quantity */
.mm-proof {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 40px;
  color: var(--mm-proof);
  font-size: .8125rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; line-height: 1.2;
  text-align: center;
}
.mm-proof strong { display: block; font-size: 1.375rem; letter-spacing: .02em; }

/* Testimonial card */
.mm-review { background: var(--mm-ice); border-radius: var(--mm-r); padding: 20px; display: grid; gap: 12px; }
.mm-review__head { display: flex; align-items: center; gap: 12px; }
.mm-review__head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.mm-review__name { font-weight: 900; }
.mm-review__verified { margin-left: auto; font-size: .6875rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--mm-proof); }

/* Footer: ice band, everything 900, characters sit on its top edge */
.mm-footer { background: var(--mm-ice); padding-block: 96px 48px; font-weight: 900; }
.mm-footer h4 { font-size: 1rem; color: var(--mm-foot-title); margin-bottom: 12px; }
.mm-footer a { color: var(--mm-foot-link); text-decoration: none; }
.mm-footer a:hover { color: var(--brand); }
.mm-sit-on-footer { margin-bottom: -6px; position: relative; z-index: 1; } /* characters' feet touch the band */

/* ==========================================================================
   Rive slots (see rive-slot.js and references/rive-and-motion.md)
   ========================================================================== */
.rive-slot { position: relative; width: 100%; }
.rive-slot > canvas, .rive-slot > img, .rive-slot > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom center; }
.rive-slot.is-placeholder {
  display: grid; place-items: center; text-align: center;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, color-mix(in srgb, var(--brand) 6%, transparent) 14px 28px),
    var(--mm-ice);
  border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--mm-line));
  border-radius: var(--mm-r-card);
  color: var(--mm-slate);
}
.rive-slot__label { padding: 16px; font-size: .8125rem; font-weight: 800; line-height: 1.4; }
.rive-slot__label strong { display: block; color: var(--brand); font-size: .9375rem; }
.rive-slot__label code { font-family: ui-monospace, Menlo, monospace; font-size: .75rem; }

/* ==========================================================================
   Motion helpers: for moments, not for every block on scroll
   ========================================================================== */
.mm-enter { animation: mm-enter var(--mm-t-enter) var(--mm-ease-settle) both; animation-delay: calc(var(--i, 0) * var(--mm-stagger-section)); }
@keyframes mm-enter { from { opacity: 0; transform: translateY(14px) scaleY(.96); } }
.mm-pop { animation: mm-pop 360ms var(--mm-ease-pop) both; animation-delay: calc(var(--i, 0) * var(--mm-stagger-inner)); }
@keyframes mm-pop { from { opacity: 0; transform: scale(.4) rotate(-12deg); } }
.mm-cta-last { animation: mm-enter 500ms var(--mm-ease-pop) both; animation-delay: var(--cta-delay, 900ms); }

/* Idle "tap me" pulse (mic button ghost ripple) */
.mm-pulse { position: relative; isolation: isolate; }
.mm-pulse::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--face, var(--brand)); opacity: .5;
  animation: mm-ripple 1.4s ease-out infinite;
}
@keyframes mm-ripple { to { transform: scale(1.12, 1.5); opacity: 0; } }

/* ==========================================================================
   Alive toolkit (see references/alive.md, behaviour in moymer-alive.js)
   Physical and game-like: hops, presses, deals, bursts. Never atmospheric.
   ========================================================================== */

/* Floating header island */
.mm-island {
  display: flex; align-items: center; gap: 20px;
  width: fit-content; max-width: calc(100% - 2 * var(--mm-gutter));
  margin: 16px auto 0; padding: 10px 12px 10px 18px;
  background: var(--mm-bg); border: 2px solid var(--mm-line); border-radius: 20px;
  box-shadow: 0 var(--mm-depth) 0 var(--mm-line);
  font-weight: 900;
}
.mm-island a:not(.mm-btn) { text-decoration: none; color: var(--mm-slate); }
.mm-island a:not(.mm-btn):hover { color: var(--mm-ink); }
.mm-island .mm-btn { margin-bottom: var(--mm-depth-sm); }

/* Lesson-path node (app: circle on a 7px lip) */
.mm-node {
  --c: var(--mm-line); --on: var(--mm-slate);
  width: 74px; height: 70px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--mm-bg); color: var(--on);
  border: 2px solid var(--c);
  box-shadow: 0 7px 0 var(--c);
  font-weight: 900; font-size: 1.375rem;
  transition: transform 160ms var(--mm-ease-pop), box-shadow 160ms ease-out, background-color var(--mm-t-fast) ease, border-color var(--mm-t-fast) ease;
}
.mm-node.is-done, .mm-node.is-current {
  background: var(--brand); color: var(--on-brand);
  --c: color-mix(in srgb, var(--brand) var(--lip-mix), var(--lip-into));
}
.mm-node.is-current { transform: translateY(-4px) scale(1.06); box-shadow: 0 11px 0 var(--c); }

/* Mic / record button: the app's 80pt mic, a square-ish slab. Add .mm-pulse while idle. */
.mm-mic { width: 92px; height: 92px; min-height: 0; padding: 0; border-radius: var(--mm-r-mic); }
.mm-mic.mm-pulse::before { animation-name: mm-ripple-even; }
@keyframes mm-ripple-even { to { transform: scale(1.4); opacity: 0; } }

/* Rolling word: a tappable word inside a headline (white lip slab, brand-coloured text) */
.mm-roll {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: .25em;
  padding: .04em .32em; margin-bottom: var(--mm-depth-sm); vertical-align: baseline;
  background: var(--mm-bg); color: var(--brand); font: inherit;
  border: 2px solid var(--mm-line); border-radius: var(--mm-r); box-shadow: 0 var(--mm-depth-sm) 0 var(--mm-line);
  transition: transform var(--mm-t-press) ease-out, box-shadow var(--mm-t-press) ease-out;
}
.mm-roll:active { transform: translateY(var(--mm-depth-sm)); box-shadow: 0 0 0 var(--mm-line); }
.mm-roll__word { display: inline-block; }
.mm-roll__word.is-rolling { animation: mm-roll 320ms var(--mm-ease-pop); }
@keyframes mm-roll { from { transform: translateY(60%); opacity: 0; } }

/* Sticky stage: one visual stays pinned while 3-4 short steps scroll past (stacks on mobile) */
.mm-sticky-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.mm-sticky-stage__pin { position: sticky; top: 96px; }
.mm-sticky-stage__steps > * { min-height: 46vh; display: grid; align-content: center; }
@media (max-width: 860px) {
  .mm-sticky-stage { grid-template-columns: minmax(0, 1fr); }
  .mm-sticky-stage__pin { position: static; }
  .mm-sticky-stage__steps > * { min-height: 0; padding-block: 20px; }
}

/* Tilted things that straighten when touched */
.mm-tilt { rotate: var(--tilt, -4deg); transition: rotate 320ms var(--mm-ease-pop), scale 320ms var(--mm-ease-pop), translate 320ms var(--mm-ease-pop); }
.mm-tilt:hover, .mm-tilt:focus-visible, .mm-tilt.is-active { rotate: 0deg; scale: 1.04; translate: 0 -4px; }

/* Idle + reactions for characters and pieces */
.mm-bob { animation: mm-bob 3.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -700ms); }
@keyframes mm-bob { 50% { transform: translateY(-5%); } }
.mm-hop { animation: mm-hop 520ms var(--mm-ease-ui) 1; }
@keyframes mm-hop { 30% { transform: translateY(-16%) rotate(-3deg); } 62% { transform: translateY(0) rotate(2deg); } 80% { transform: translateY(-4%); } }
.mm-shake { animation: mm-shake 360ms ease-in-out 1; }
@keyframes mm-shake { 20%, 60% { transform: translateX(-2.5%); } 40%, 80% { transform: translateX(2.5%); } }
.mm-hover-hop:hover > * { animation: mm-hop 520ms var(--mm-ease-ui) 1; }

/* Eyes follow the cursor: moymer-alive.js sets --lx / --ly (-1..1) on [data-mm-look] */
[data-mm-look] .pupil { translate: calc(var(--lx, 0) * 1.7px) calc(var(--ly, 0) * 1.7px); transition: translate 120ms ease-out; }

/* Dealt entrance: items land like cards, once, when their group scrolls into view.
   Only hidden when JS is running (html.mm-js), so no-JS pages show everything. */
.mm-js [data-mm-inview]:not(.is-in) .mm-deal { opacity: 0; transform: translateY(26px) rotate(var(--deal-rot, -5deg)) scale(.92); }
.mm-deal { transition: opacity 260ms ease-out, transform 460ms var(--mm-ease-pop); transition-delay: calc(var(--i, 0) * 70ms); }

/* Sparkle burst particles (MoymerAlive.burst) */
.mm-spark {
  position: fixed; z-index: 50; pointer-events: none; left: 0; top: 0;
  width: var(--s, 12px); height: var(--s, 12px); background: var(--c, var(--brand));
  animation: mm-spark var(--t, 700ms) cubic-bezier(.15, .8, .3, 1) forwards;
}
.mm-spark--star { clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); }
.mm-spark--dot { border-radius: 50%; }
.mm-spark--sq { border-radius: 3px; }
@keyframes mm-spark {
  from { transform: translate(var(--x0), var(--y0)) scale(.4) rotate(0deg); opacity: 1; }
  70% { opacity: 1; }
  to { transform: translate(var(--x1), var(--y1)) scale(1) rotate(var(--r, 180deg)); opacity: 0; }
}

/* Marquee: duplicate the children once inside .mm-marquee__track */
.mm-marquee { overflow: hidden; }
.mm-marquee__track { display: flex; gap: var(--gap, 16px); width: max-content; animation: mm-marquee var(--speed, 40s) linear infinite; }
.mm-marquee--reverse .mm-marquee__track { animation-direction: reverse; }
.mm-marquee:hover .mm-marquee__track { animation-play-state: paused; }
@keyframes mm-marquee { to { transform: translateX(calc(-50% - var(--gap, 16px) / 2)); } }

/* Scroll-linked progress fill (static full bar where scroll timelines are unsupported) */
@supports (animation-timeline: scroll()) {
  .mm-scroll-fill > span { width: 100%; transform-origin: 0 50%; animation: mm-scroll-fill linear both; animation-timeline: scroll(root); transition: none; }
  @keyframes mm-scroll-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* Colour takeover: sections that change --tint animate their background */
.mm-takeover { background: color-mix(in srgb, var(--tint, var(--brand)) 12%, var(--mm-bg)); transition: background-color var(--mm-t-ui) var(--mm-ease-ui); }

/* Rive stand-in badge (dev only): the slot shows its static stand-in plus this chip */
.rive-slot__badge {
  position: absolute; left: -4px; top: -4px; z-index: 2;
  padding: 3px 6px; border-radius: 6px;
  background: var(--mm-ink); color: var(--mm-bg);
  font: 800 .5625rem/1 ui-monospace, Menlo, monospace; letter-spacing: .04em;
  opacity: .55; cursor: help;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .mm-pulse::before { display: none; }
  .mm-bob, .mm-marquee__track { animation: none !important; }
  .mm-js [data-mm-inview]:not(.is-in) .mm-deal { opacity: 1; transform: none; }
}
