/* ==========================================================================
   Merorme — website styles
   The Memory Atlas palette (Merorme/Design/Solstice.swift → Solstice.Atlas),
   the Solstice radii, and Mero's eight states (Mero V5), on system fonts only.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Memory Atlas — light (the brief's literals, as Solstice.Atlas carries them) */
  --paper: #F4F1EB;
  --raised: #FFFEFA;
  --ink: #18201D;
  --muted: #65706A;
  --rule: #D7D5CC;
  --moss: #315B50;
  --lagoon: #1E6E79;
  --persimmon: #DF6B4B;
  --bloom: #F4C9B8;
  --gold: #C9953D;
  --iris: #6E5AA8;
  --mist: #DCE7E2;
  --well: #DCE7E2;      /* Solstice.well — mist by day, the night rule by night */
  --line2: #DCE7E2;     /* Solstice.line2 */

  /* Fills a mood draws with — the same in both appearances, always carrying ink */
  --fill-primary: #FFB387;
  --fill-peach: #FFC7AC;
  --fill-mint: #C4D9A4;
  --fill-sky: #B7D7E7;
  --fill-lav: #D5C5E8;
  --fill-dim: #CECFC7;

  /* Fixed literals the app never flips (Solstice.Surface) */
  --night: #18201D;          /* the tab bar, the green-black */
  --night-rule: #34423C;
  --night-ink: #B9C6BE;
  --hero-ink: #FFFEFA;

  /* Roles */
  --bg: var(--paper);
  --surface: var(--raised);
  --text: var(--ink);
  --text-2: var(--muted);
  --brand: var(--moss);
  --accent: var(--persimmon);
  --focus: #B8492B;
  --btn-bg: var(--ink);
  --btn-ink: var(--raised);
  --glow-warm: rgb(223 107 75 / .16);
  --glow-cool: rgb(30 110 121 / .12);
  --shadow-float: 0 8px 24px rgb(0 0 0 / .13);
  --shadow-lift: 0 16px 40px rgb(0 0 0 / .07);

  /* Mero's bubble — the one gradient in the system (bloom → mist) */
  --bubble-mero: linear-gradient(120deg, #F4C9B8, #DCE7E2);
  --bubble-mero-ink: #18201D;

  /* Type — system faces only, nothing leaves the visitor's browser */
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, Cambria, "Times New Roman", serif;
  --rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-hero: clamp(2.6rem, 1.25rem + 5vw, 5.75rem);
  --fs-h2: clamp(2.05rem, 1.15rem + 3.2vw, 4rem);
  --fs-h3: clamp(1.25rem, 1.08rem + .55vw, 1.6rem);
  --fs-lede: clamp(1.125rem, 1.02rem + .42vw, 1.375rem);
  --fs-body: 1.0625rem;
  --fs-small: .9375rem;
  --fs-micro: .8125rem;

  /* Solstice radii */
  --r-card: 26px;
  --r-ctl: 24px;
  --r-chip: 20px;
  --r-sheet: 36px;
  --r-hero: 44px;
  --r-tabbar: 29px;
  --r-tab: 23px;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --header-h: 72px;
}

/* Memory Atlas — dark ("a grounded green-black night") */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --paper: #121816;
    --raised: #1B2420;
    --ink: #EFF4EE;
    --muted: #B9C6BE;
    --rule: #34423C;
    --moss: #89BCA8;
    --lagoon: #72C8D2;
    --persimmon: #FF9A78;
    --bloom: #60382F;
    --gold: #E6BA64;
    --iris: #B7A8F3;
    --well: #34423C;
    --line2: #34423C;
    --btn-bg: #EFF4EE;
    --btn-ink: #121816;
    --focus: #FF9A78;
    --glow-warm: rgb(255 154 120 / .12);
    --glow-cool: rgb(114 200 210 / .10);
    --shadow-float: 0 8px 24px rgb(0 0 0 / .45);
    --shadow-lift: 0 16px 40px rgb(0 0 0 / .35);
    --bubble-mero: linear-gradient(120deg, #F4C9B8, #DCE7E2);
  }
}
:root[data-scheme="dark"] {
  color-scheme: dark;
  --paper: #121816;
  --raised: #1B2420;
  --ink: #EFF4EE;
  --muted: #B9C6BE;
  --rule: #34423C;
  --moss: #89BCA8;
  --lagoon: #72C8D2;
  --persimmon: #FF9A78;
  --bloom: #60382F;
  --gold: #E6BA64;
  --iris: #B7A8F3;
  --well: #34423C;
  --line2: #34423C;
  --btn-bg: #EFF4EE;
  --btn-ink: #121816;
  --focus: #FF9A78;
  --glow-warm: rgb(255 154 120 / .12);
  --glow-cool: rgb(114 200 210 / .10);
  --shadow-float: 0 8px 24px rgb(0 0 0 / .45);
  --shadow-lift: 0 16px 40px rgb(0 0 0 / .35);
}
:root[data-scheme="light"] { color-scheme: light; }

/* ---------- 2. Base ------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  accent-color: var(--persimmon);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  min-height: 100vh;
}
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p, li, dd, blockquote { text-wrap: pretty; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--fill-peach); color: #18201D; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  left: 16px; top: 12px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: none; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* ---------- 3. Type ------------------------------------------------------ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  margin: 0 0 18px;
  font: 650 var(--fs-micro)/1.2 var(--sans);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow::before {
  content: "";
  width: 9px; height: 9px;
  flex: none;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.h-hero, .h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.0;
}
.h-hero { font-size: var(--fs-hero); }
.h2 { font-size: var(--fs-h2); }
.h3 {
  font: 650 var(--fs-h3)/1.2 var(--display);
  letter-spacing: -.018em;
}
.serif-em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.02em;
}
.lede {
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: var(--text-2);
  max-width: 34em;
}
.lede strong { color: var(--text); font-weight: 600; }
.h2 + .lede, .h-hero + .lede { margin-top: 22px; }
.small { font-size: var(--fs-small); }
.muted { color: var(--text-2); }

.section {
  position: relative;
  padding-block: clamp(84px, 9vw, 152px);
}
.section-head { max-width: 46rem; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head .lede { margin-top: 22px; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .lede { margin-inline: auto; }
.section-head--center .eyebrow { justify-content: center; }

/* ---------- 4. Header and the tab bar ------------------------------------ */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header[data-solid] {
  background: var(--bg);
  border-bottom-color: var(--rule);
}
.header-inner {
  width: min(100% - 2 * var(--gutter), 1360px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 700 1.1875rem/1 var(--display);
  letter-spacing: -.03em;
  border-radius: 12px;
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { border-color: var(--text-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-scheme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-scheme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-scheme="light"]) .theme-toggle .i-moon { display: none; }
}

/* The website's navigation is the app's own tab bar: a floating green-black pill,
   the selected tab a mist pill carrying ink (Solstice.Surface.tabBar / tabSelected). */
.tabbar {
  justify-self: center;
  display: flex;
  gap: 1px;
  padding: 6px;
  border-radius: var(--r-tabbar);
  background: var(--night);
  border: 1px solid var(--night-rule);
  box-shadow: var(--shadow-float);
}
.tabbar ul { display: flex; gap: 1px; margin: 0; padding: 0; list-style: none; }
.tabbar li { display: flex; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--r-tab);
  color: var(--night-ink);
  text-decoration: none;
  font: 600 .9375rem/1 var(--sans);
  letter-spacing: -.005em;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.tab svg { width: 18px; height: 18px; flex: none; }
.tab:hover { color: #EFF4EE; }
.tab[aria-current] {
  background: var(--mist);
  color: #18201D;
}
.tab:focus-visible { outline-color: #FF9A78; outline-offset: 2px; }
.tab .tab-ico { display: none; }

.btn {
  --btn-pad: 14px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: var(--btn-pad);
  border-radius: 999px;
  border: 1px solid transparent;
  font: 650 1rem/1.1 var(--sans);
  letter-spacing: -.005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s, color .25s, border-color .25s, box-shadow .25s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover { box-shadow: 0 10px 24px -10px rgb(0 0 0 / .45); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--rule);
}
.btn-ghost:hover { border-color: var(--text-2); }
.btn-small { --btn-pad: 10px 16px; min-height: 44px; font-size: .9375rem; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* The App Store button. No URL exists yet: the button says so plainly. */
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 22px 10px 16px;
  border-radius: 18px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s;
}
.store-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -12px rgb(0 0 0 / .5); }
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn span { display: grid; line-height: 1.15; text-align: left; }
.store-btn small { font: 500 .75rem/1.2 var(--sans); opacity: .78; letter-spacing: .01em; }
.store-btn b { font: 650 1.0625rem/1.2 var(--display); letter-spacing: -.01em; }

/* On phones the tab bar does what the app's does: it floats at the bottom, in reach */
@media (max-width: 899.98px) {
  :root { --header-h: 64px; }
  .header-inner { grid-template-columns: 1fr auto; }
  .tabbar {
    position: fixed;
    z-index: 50;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    translate: -50% 0;
    width: min(100% - 20px, 470px);
    padding: 5px;
  }
  .tabbar ul { width: 100%; }
  .tabbar li { flex: 1 1 0; min-width: 0; }
  .tab {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 54px;
    padding: 6px 2px 5px;
    font-size: .6875rem;
    letter-spacing: 0;
  }
  .tab .tab-ico { display: block; width: 22px; height: 22px; }
  .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
}
.header-cta { white-space: nowrap; }
@media (max-width: 479.98px) {
  .header-cta { display: none; }
}
@media (max-width: 400px) {
  .tab { font-size: .625rem; }
}

/* ---------- Footer ------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(40px, 6vw, 72px);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px 48px;
  align-items: start;
}
.footer-brand .small { margin-top: 14px; max-width: 26rem; }
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 6px;
}
.footer-nav a {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-small);
}
.footer-nav a:hover { background: var(--surface); }
.footer-legal { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid var(--rule); }
@media (max-width: 699.98px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-nav ul { justify-content: flex-start; margin-left: -12px; }
}

/* ---------- 5. Mero (V5, ported) ----------------------------------------- */

.mero {
  --face: #3D2B1F;
  --peach: #FFD6A5; --peach2: #FFE9CE;
  --lav: #DCC6FF; --lav2: #EFE4FF;
  --amber: #FFB66B; --amber2: #FFD3A3;
  --sky: #A8DBFF; --sky2: #D2EDFF;
  --dim: #BBA9CE; --dim2: #D6CBE3;
  --primary: #FFB66B; --primary2: #FFCF96;
  --concern: #C9BCAE; --concern2: #DED4C9;
  --hue: var(--peach); --hue2: var(--peach2); --rim: #D99A4E;

  /* Light treatment (on a pale ground): depth, not emission — the rim carries the silhouette */
  --aura-blend: multiply; --aura-op: .30; --aura-filter: saturate(1.15);
  --tendril-blend: normal; --tendril-op: 1; --tendril-filter: saturate(1.25) brightness(.97);
  --rim-op: 1; --rim-w: 3;
  --shade-op: .95; --shade-blend: multiply;
  --kick-op: .9; --depth-op: 1;
  --fx-zzz: #6D5B85; --fx-ripple: #4E93C9; --fx-think: #8B6FC4; --fx-spark: #B4661A; --fx-sweat: #4E93C9;

  display: block;
  position: relative;
  aspect-ratio: 1;
}
/* Dark treatment (on a dark ground): emission, untouched — no shade, no depth, a quiet rim */
.mero[data-ground="dark"] {
  --aura-blend: screen; --aura-op: .55; --aura-filter: none;
  --tendril-blend: screen; --tendril-op: .85; --tendril-filter: none;
  --rim-op: .5; --rim-w: 2.6;
  --shade-op: 0; --kick-op: 0; --depth-op: 0; --shade-display: none; --kick-display: none;
  --fx-zzz: #EFE4FF; --fx-ripple: #A8DBFF; --fx-think: #EFE4FF; --fx-spark: #FFD3A3; --fx-sweat: #D2EDFF;
}
:root[data-scheme="dark"] .mero:not([data-ground="light"]) {
  --aura-blend: screen; --aura-op: .55; --aura-filter: none;
  --tendril-blend: screen; --tendril-op: .85; --tendril-filter: none;
  --rim-op: .5; --rim-w: 2.6;
  --shade-op: 0; --kick-op: 0; --depth-op: 0; --shade-display: none; --kick-display: none;
  --fx-zzz: #EFE4FF; --fx-ripple: #A8DBFF; --fx-think: #EFE4FF; --fx-spark: #FFD3A3; --fx-sweat: #D2EDFF;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) .mero:not([data-ground="light"]) {
    --aura-blend: screen; --aura-op: .55; --aura-filter: none;
    --tendril-blend: screen; --tendril-op: .85; --tendril-filter: none;
    --rim-op: .5; --rim-w: 2.6;
    --shade-op: 0; --kick-op: 0; --depth-op: 0; --shade-display: none; --kick-display: none;
    --fx-zzz: #EFE4FF; --fx-ripple: #A8DBFF; --fx-think: #EFE4FF; --fx-spark: #FFD3A3; --fx-sweat: #D2EDFF;
  }
}

.mero svg { width: 100%; height: 100%; overflow: visible; }
.mero * { transform-box: fill-box; }
.mero .aura { transform-origin: center; mix-blend-mode: var(--aura-blend); opacity: var(--aura-op); filter: var(--aura-filter); }
.mero .tendril { mix-blend-mode: var(--tendril-blend); opacity: var(--tendril-op); filter: var(--tendril-filter); transform-origin: center; }
.mero .t1 { transform-origin: 100% 100%; }
.mero .body { transform-origin: center; }
.mero .gem { mix-blend-mode: screen; }
.mero .shade { opacity: var(--shade-op); mix-blend-mode: var(--shade-blend); display: var(--shade-display, inline); }
.mero .kick { opacity: var(--kick-op); display: var(--kick-display, inline); }
.mero .depth { opacity: var(--depth-op); mix-blend-mode: multiply; }
.mero .rim { opacity: var(--rim-op); stroke-width: var(--rim-w); }
.mero .eye-open ellipse { fill: var(--face); }
.mero .eye-open circle { fill: #fff; opacity: .9; }
.mero .eye-happy, .mero .eye-closed { fill: none; stroke: var(--face); stroke-width: 3.4; stroke-linecap: round; opacity: 0; }
.mero .brow { fill: none; stroke: var(--face); stroke-width: 3; stroke-linecap: round; opacity: 0; }
.mero .cheeks ellipse { fill: var(--primary); opacity: 0; }
.mero .mouth { opacity: 0; fill: none; stroke: var(--face); stroke-width: 3.4; stroke-linecap: round; }
.mero .mouth.m-big, .mero .mouth.m-o { fill: var(--face); stroke: none; }
.mero .fx { opacity: 0; }
.mero .fx-zzz text { fill: var(--fx-zzz); font-weight: 700; font-family: var(--sans); }
.mero .fx-think circle { fill: var(--fx-think); }
.mero .fx-sparks circle { fill: var(--fx-spark); }
.mero .fx-ripples circle { fill: none; stroke: var(--fx-ripple); stroke-width: 2.4; }
.mero .fx-sweat path { fill: var(--fx-sweat); }
.mero .eye-open { transform-origin: center; animation: m-blink 4.6s ease-in-out infinite; }

/* IDLE — home, at rest */
.mero[data-state="idle"] { --hue: var(--peach); --hue2: var(--peach2); --rim: #D99A4E; }
.mero[data-state="idle"] :is(.aura, .shade, .kick) { animation: m-aura 4s ease-in-out infinite; }
.mero[data-state="idle"] .body { animation: m-breathe 4s ease-in-out infinite; }
.mero[data-state="idle"] .t1 { animation: m-sway-a 3.5s ease-in-out infinite; }
.mero[data-state="idle"] .t2 { animation: m-sway-b 3.8s ease-in-out infinite; }
.mero[data-state="idle"] .t3 { animation: m-sway-c 4.1s ease-in-out infinite; }
.mero[data-state="idle"] .t4 { animation: m-sway-d 3.6s ease-in-out infinite; }
.mero[data-state="idle"] .m-smile { opacity: 1; }
.mero[data-state="idle"] .cheeks ellipse { opacity: .22; }
.mero[data-state="idle"] .gem { animation: m-gem 3s ease-in-out infinite; }

/* THINKING — inward, focused */
.mero[data-state="thinking"] { --hue: var(--lav); --hue2: var(--lav2); --rim: #8B6FC4; }
.mero[data-state="thinking"] :is(.aura, .shade, .kick) { animation: m-aura 5s ease-in-out infinite; }
.mero[data-state="thinking"] .body { animation: m-breathe-think 5s ease-in-out infinite; }
.mero[data-state="thinking"] .face { transform: rotate(-3deg); }
.mero[data-state="thinking"] .eyes { transform: translate(2.5px, -2.5px); }
.mero[data-state="thinking"] .eye-open { animation-duration: 6s; }
.mero[data-state="thinking"] .tendril { animation: m-curl 6s ease-in-out infinite; }
.mero[data-state="thinking"] .t2 { animation-delay: -1.5s; }
.mero[data-state="thinking"] .t3 { animation-delay: -3s; }
.mero[data-state="thinking"] .t4 { animation-delay: -4.5s; }
.mero[data-state="thinking"] .m-o { opacity: 1; }
.mero[data-state="thinking"] .fx-think { opacity: 1; }
.mero[data-state="thinking"] .fx-think circle { animation: m-tdot 1.6s ease-in-out infinite; }
.mero[data-state="thinking"] .fx-think circle:nth-child(2) { animation-delay: .25s; }
.mero[data-state="thinking"] .fx-think circle:nth-child(3) { animation-delay: .5s; }
.mero[data-state="thinking"] .gem { animation: m-gem 2s ease-in-out infinite; }

/* TYPING — the reply on its way */
.mero[data-state="typing"] { --hue: var(--amber); --hue2: var(--amber2); --rim: #C87F28; }
.mero[data-state="typing"] :is(.aura, .shade, .kick) { animation: m-aura-fast .83s ease-in-out infinite; }
.mero[data-state="typing"] .body { animation: m-micro .33s ease-in-out infinite; transform: scale(.97); }
.mero[data-state="typing"] .eye-open { animation: m-blink 2.2s ease-in-out infinite; }
.mero[data-state="typing"] .eyes { animation: m-read 1.4s ease-in-out infinite; }
.mero[data-state="typing"] .tendril { animation: m-tight 1.5s ease-in-out infinite; transform: scale(.9); }
.mero[data-state="typing"] .m-flat { opacity: 1; }
.mero[data-state="typing"] .gem { animation: m-gem .8s ease-in-out infinite; }

/* LISTENING — voice input active */
.mero[data-state="listening"] { --hue: var(--sky); --hue2: var(--sky2); --rim: #4E93C9; }
.mero[data-state="listening"] :is(.aura, .shade, .kick) { animation: m-sonar 2.5s ease-out infinite; }
.mero[data-state="listening"] .body { animation: m-lean 4.5s ease-in-out infinite; }
.mero[data-state="listening"] .eyes { transform: scale(1.1); }
.mero[data-state="listening"] :is(.t1, .t3) { animation: m-fwd 2.5s ease-in-out infinite; }
.mero[data-state="listening"] :is(.t2, .t4) { animation: m-fwd 2.5s ease-in-out infinite -1.25s; }
.mero[data-state="listening"] .m-o { opacity: 1; }
.mero[data-state="listening"] .fx-ripples { opacity: 1; }
.mero[data-state="listening"] .fx-ripples .r1 { animation: m-ripple 2.4s ease-out infinite; }
.mero[data-state="listening"] .fx-ripples .r2 { animation: m-ripple 2.4s ease-out infinite -1.2s; }
.mero[data-state="listening"] .gem { animation: m-gem 1.5s ease-in-out infinite; }

/* SLEEPING — away, or night */
.mero[data-state="sleeping"] { --hue: var(--dim); --hue2: var(--dim2); --rim: #6D5B85; }
.mero[data-state="sleeping"] :is(.aura, .shade, .kick) { animation: m-aura 8s ease-in-out infinite; opacity: .3; }
.mero[data-state="sleeping"] .body { animation: m-sleepb 8s ease-in-out infinite; transform: translateY(10px) scale(.95); }
.mero[data-state="sleeping"] .eye-open { opacity: 0; animation: none; }
.mero[data-state="sleeping"] .eye-closed { opacity: 1; }
.mero[data-state="sleeping"] .tendril { animation: m-droop 10s ease-in-out infinite; opacity: .5; }
.mero[data-state="sleeping"] .m-o { opacity: 1; transform: scale(.8); }
.mero[data-state="sleeping"] .fx-zzz { opacity: 1; }
.mero[data-state="sleeping"] .fx-zzz text { animation: m-zzz 3.2s ease-in-out infinite; }
.mero[data-state="sleeping"] .fx-zzz text:nth-child(2) { animation-delay: 1.05s; }
.mero[data-state="sleeping"] .fx-zzz text:nth-child(3) { animation-delay: 2.1s; }
.mero[data-state="sleeping"] .gem { animation: m-gem 6s ease-in-out infinite; opacity: .5; }

/* WAVING — the app opened, hello */
.mero[data-state="waving"] { --hue: var(--peach); --hue2: var(--primary); --rim: #D99A4E; }
.mero[data-state="waving"] :is(.aura, .shade, .kick) { animation: m-aura 3.5s ease-in-out infinite; }
.mero[data-state="waving"] .body { animation: m-waveb 3.5s ease-in-out infinite; }
.mero[data-state="waving"] .face { transform: rotate(3deg); }
.mero[data-state="waving"] .eye-l .eye-open { opacity: 0; animation: none; }
.mero[data-state="waving"] .eye-l .eye-happy { opacity: 1; }
.mero[data-state="waving"] .t1 { animation: m-wave-arm 1.1s ease-in-out infinite; }
.mero[data-state="waving"] .t2 { animation: m-sway-b 2.2s ease-in-out infinite; }
.mero[data-state="waving"] .t3 { animation: m-sway-c 2.4s ease-in-out infinite; }
.mero[data-state="waving"] .t4 { animation: m-sway-d 2s ease-in-out infinite; }
.mero[data-state="waving"] .m-big { opacity: 1; }
.mero[data-state="waving"] .cheeks ellipse { opacity: .5; }
.mero[data-state="waving"] .gem { animation: m-gem 1.2s ease-in-out infinite; }

/* CELEBRATING */
.mero[data-state="celebrating"] { --hue: var(--primary); --hue2: var(--primary2); --rim: #B4661A; }
.mero[data-state="celebrating"] :is(.aura, .shade, .kick) { animation: m-aura-big 1.2s ease-in-out infinite; }
.mero[data-state="celebrating"] .body { animation: m-bigb 1.2s ease-in-out infinite; transform: scale(1.07); }
.mero[data-state="celebrating"] .eye-open { opacity: 0; animation: none; }
.mero[data-state="celebrating"] .eye-happy { opacity: 1; }
.mero[data-state="celebrating"] .brow { opacity: .9; transform: translateY(-3px); }
.mero[data-state="celebrating"] .tendril { animation: m-spread .9s ease-in-out infinite; }
.mero[data-state="celebrating"] .t2 { animation-delay: -.22s; }
.mero[data-state="celebrating"] .t3 { animation-delay: -.45s; }
.mero[data-state="celebrating"] .t4 { animation-delay: -.67s; }
.mero[data-state="celebrating"] .m-big { opacity: 1; }
.mero[data-state="celebrating"] .cheeks ellipse { opacity: .6; }
.mero[data-state="celebrating"] .fx-sparks { opacity: 1; }
.mero[data-state="celebrating"] .fx-sparks circle { animation: m-spark 1.6s ease-out infinite; }
.mero[data-state="celebrating"] .fx-sparks circle:nth-child(2) { animation-delay: .25s; }
.mero[data-state="celebrating"] .fx-sparks circle:nth-child(3) { animation-delay: .5s; }
.mero[data-state="celebrating"] .fx-sparks circle:nth-child(4) { animation-delay: .75s; }
.mero[data-state="celebrating"] .fx-sparks circle:nth-child(5) { animation-delay: 1s; }
.mero[data-state="celebrating"] .fx-sparks circle:nth-child(6) { animation-delay: 1.25s; }
.mero[data-state="celebrating"] .gem { animation: m-gem .5s ease-in-out infinite; }

/* CONCERNED — an error or a lost connection, never a judgement of the person */
.mero[data-state="concerned"] { --hue: var(--concern); --hue2: var(--concern2); --rim: #7A6B5C; }
.mero[data-state="concerned"] .aura { opacity: .25; }
.mero[data-state="concerned"] .body { animation: m-slowb 6s ease-in-out infinite; transform: translateY(8px) scale(.96); }
.mero[data-state="concerned"] .face { transform: rotate(-2deg); }
.mero[data-state="concerned"] .eyes { transform: scale(.9) translateY(1px); }
.mero[data-state="concerned"] .eye-open { animation-duration: 7s; }
.mero[data-state="concerned"] .brow { opacity: 1; }
.mero[data-state="concerned"] .brow.bl { transform: rotate(-14deg) translate(1px, 2px); }
.mero[data-state="concerned"] .brow.br { transform: rotate(14deg) translate(-1px, 2px); }
.mero[data-state="concerned"] .tendril { animation: m-droop 12s ease-in-out infinite; opacity: .55; }
.mero[data-state="concerned"] .m-wavy { opacity: 1; }
.mero[data-state="concerned"] .fx-sweat { opacity: 1; }
.mero[data-state="concerned"] .fx-sweat path { animation: m-sweat 3.4s ease-in-out infinite; }
.mero[data-state="concerned"] .gem { animation: m-gem 8s ease-in-out infinite; opacity: .6; }

/* Still faces for Mero's cards (Register B), drawn from the same parts */
.mero[data-face] .eye-open { animation: none; }
.mero[data-face="joy"] .eye-open, .mero[data-face="grin"] .eye-open,
.mero[data-face="calm"] .eye-open, .mero[data-face="rest"] .eye-open, .mero[data-face="gentle"] .eye-open { opacity: 0; }
.mero[data-face="joy"] .eye-happy, .mero[data-face="grin"] .eye-happy { opacity: 1; }
.mero:is([data-face="calm"], [data-face="rest"], [data-face="gentle"]) .eye-closed { opacity: 1; }
.mero[data-face="joy"] .m-big, .mero[data-face="bright"] .m-big { opacity: 1; }
.mero[data-face="grin"] .m-smile, .mero[data-face="gentle"] .m-smile { opacity: 1; }
.mero[data-face="calm"] .m-flat { opacity: 1; }
.mero[data-face="rest"] .m-o { opacity: 1; }
.mero[data-face] .cheeks ellipse { opacity: .35; }
.mero[data-face="calm"] .cheeks ellipse { opacity: 0; }
.mero[data-variant="card"] { --hue: #FFF1D6; --hue2: #FFFFFF; --rim: #E9C77B; --face: #3D3530; }
.mero[data-variant="card"] .tendril { opacity: .5; mix-blend-mode: screen; filter: none; }
.mero[data-variant="card"] .aura { opacity: .45; mix-blend-mode: screen; }
.mero[data-variant="card"] :is(.shade, .kick, .depth) { display: none; }
.mero[data-variant="card"] .rim { opacity: .9; stroke-width: 2.4; }

@keyframes m-blink { 0%, 91%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.08); } 97% { transform: scaleY(1); } }
@keyframes m-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04) translateY(-2px); } }
@keyframes m-breathe-think { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.02) translateY(-1px) rotate(-2deg); } }
@keyframes m-micro { 0%, 100% { transform: scale(.97); } 50% { transform: scale(.98) translateY(-1px); } }
@keyframes m-lean { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.02) translateY(2px) rotate(3deg); } }
@keyframes m-sleepb { 0%, 100% { transform: scale(.95) translateY(10px); } 50% { transform: scale(.98) translateY(12px); } }
@keyframes m-waveb { 0%, 100% { transform: scale(1) rotate(-1deg); } 50% { transform: scale(1.03) translateY(-2px) rotate(1deg); } }
@keyframes m-bigb { 0%, 100% { transform: scale(1.07); } 50% { transform: scale(1.11) translateY(-4px); } }
@keyframes m-slowb { 0%, 100% { transform: scale(.96) translateY(8px); } 50% { transform: scale(.98) translateY(9px); } }
@keyframes m-aura { 0%, 100% { transform: scale(1); opacity: .45; } 50% { transform: scale(1.08); opacity: .65; } }
@keyframes m-aura-fast { 0%, 100% { transform: scale(.98); opacity: .5; } 50% { transform: scale(1.02); opacity: .7; } }
@keyframes m-aura-big { 0%, 100% { transform: scale(1); opacity: .6; } 50% { transform: scale(1.2); opacity: .9; } }
@keyframes m-sonar { 0% { transform: scale(.7); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes m-gem { 0%, 100% { transform: scale(1); opacity: .75; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes m-sway-a { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes m-sway-b { 0%, 100% { transform: rotate(5deg); } 50% { transform: rotate(-5deg); } }
@keyframes m-sway-c { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(5deg) scale(1.03); } }
@keyframes m-sway-d { 0%, 100% { transform: rotate(3deg); } 50% { transform: rotate(-4deg) scale(1.02); } }
@keyframes m-curl { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(-12deg) scale(.85); } }
@keyframes m-tight { 0%, 100% { transform: scale(.9); } 50% { transform: scale(.92); } }
@keyframes m-fwd { 0%, 100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(6px) rotate(8deg); } }
@keyframes m-droop { 0%, 100% { transform: translateY(8px) scale(.9) rotate(3deg); } 50% { transform: translateY(12px) scale(.88) rotate(5deg); } }
@keyframes m-wave-arm { 0%, 100% { transform: rotate(38deg); } 50% { transform: rotate(58deg); } }
@keyframes m-spread { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.15) rotate(6deg); } }
@keyframes m-read { 0%, 100% { transform: translateX(-2px) scale(1.1); } 50% { transform: translateX(2px) scale(1.1); } }
@keyframes m-zzz { 0% { opacity: 0; transform: translate(0, 6px) scale(.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(7px, -16px) scale(1.15); } }
@keyframes m-tdot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
@keyframes m-ripple { 0% { opacity: .7; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.45); } }
@keyframes m-spark { 0% { opacity: 0; transform: translate(calc(var(--sx) * -.5), calc(var(--sy) * -.5)) scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(0, 0) scale(1); } }
@keyframes m-sweat { 0%, 55% { opacity: 0; transform: translateY(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(11px); } }

.mero[data-offscreen] *, .mero[data-still] * { animation-play-state: paused !important; }

/* Reduce Motion: identity survives — every state still reads from pose, face and colour */
@media (prefers-reduced-motion: reduce) {
  .mero * { animation: none !important; }
  .mero[data-state="sleeping"] .fx-zzz text { opacity: .85; }
  .mero[data-state="thinking"] .fx-think circle { opacity: .85; }
  .mero[data-state="celebrating"] .fx-sparks circle { opacity: .85; }
  .mero[data-state="listening"] .fx-ripples circle { opacity: .4; }
  .mero[data-state="concerned"] .fx-sweat path { opacity: .85; }
  .mero[data-state="waving"] .t1 { transform: rotate(48deg); }
}

/* ---------- Document pages: privacy, support -------------------------------- */

.doc-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 clamp(8px, 1.6vw, 22px);
  border-radius: 0 0 var(--r-hero) var(--r-hero);
  padding: calc(var(--header-h) + clamp(40px, 7vw, 100px)) 0 clamp(40px, 6vw, 76px);
  background: #315B50;
  color: #FFFEFA;
}
.doc-hero-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.doc-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(18 24 22 / .84) 0%, rgb(18 24 22 / .62) 46%, rgb(18 24 22 / .12) 86%);
}
.doc-eyebrow {
  margin-bottom: 14px;
  font: 650 var(--fs-micro)/1.2 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #DCE7E2;
}
.doc-title {
  max-width: 18ch;
  font: 700 clamp(2.2rem, 1.35rem + 3.6vw, 4.25rem)/1.02 var(--display);
  letter-spacing: -.035em;
}
.doc-effective, .doc-sub { margin-top: 18px; color: #EAF1EC; max-width: 40rem; font-size: var(--fs-lede); line-height: 1.5; }
.doc-effective { font-size: 1.0625rem; }
.doc-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 46rem);
  gap: clamp(32px, 5vw, 84px);
  justify-content: center;
  padding-block: clamp(40px, 6vw, 84px);
}
.doc-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100svh - var(--header-h) - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.doc-toc-title {
  margin-bottom: 12px;
  font: 650 var(--fs-micro)/1.2 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-2);
}
.doc-toc ol { list-style: none; margin: 0; padding: 0; display: grid; border-left: 1px solid var(--rule); }
.doc-toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 12px;
  border-left: 2px solid transparent;
  color: var(--text-2);
  text-decoration: none;
  font-size: .875rem;
  line-height: 1.35;
}
.doc-toc a:hover { color: var(--text); }
.doc-toc a[aria-current] { color: var(--text); border-left-color: var(--moss); font-weight: 600; }
.doc-toc-mobile { display: none; }
.doc {
  margin: 0 0 22px;
  padding: clamp(24px, 4vw, 46px);
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--line2);
}
.doc.subs { border-left: 4px solid var(--persimmon); }
.doc .lede { max-width: none; margin: 0 0 4px; font-size: 1rem; color: var(--text-2); }
.doc h2 {
  margin: 36px 0 10px;
  font: 650 1.375rem/1.25 var(--display);
  letter-spacing: -.012em;
  color: var(--moss);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.doc > h2:first-child { margin-top: 0; }
.doc .lede + h2 { margin-top: 26px; }
.doc h3 { margin: 26px 0 6px; font: 650 1.125rem/1.3 var(--display); letter-spacing: -.01em; }
.doc p { margin: 0 0 14px; font-size: 1.0625rem; line-height: 1.72; }
.doc p:last-child { margin-bottom: 0; }
.doc strong { font-weight: 650; }
.doc-foot { margin-top: 8px; }
.doc-foot .contact { margin: 0 0 14px; padding: 16px 18px; border-radius: var(--r-chip); background: var(--well); color: var(--text); }
.doc-foot p { color: var(--text-2); font-size: var(--fs-small); }
:is(.doc, .doc-foot, .faq, .contact-card) code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1px 6px;
}
@media (max-width: 899.98px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { display: none; }
  .doc-toc-mobile {
    display: block;
    border-radius: var(--r-chip);
    background: var(--surface);
    border: 1px solid var(--rule);
  }
  .doc-toc-mobile summary {
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 650;
    list-style-position: inside;
  }
  .doc-toc-mobile ol { margin: 0; padding: 0 18px 14px 36px; display: grid; gap: 2px; }
  .doc-toc-mobile a { display: block; padding: 6px 0; color: var(--text-2); font-size: .9375rem; text-decoration: none; }
}
@media print {
  .site-header, .tabbar, .doc-toc, .doc-toc-mobile, .skip-link, .site-footer { display: none !important; }
  .doc-hero { color: #000; background: none; padding-top: 0; }
  .doc-hero::after, .doc-hero-art { display: none; }
  .doc-layout { display: block; }
  .doc { border: 0; padding: 0; }
}

/* Over a document page's dark masthead, the header's words are light until it turns solid */
.page-doc .site-header:not([data-solid]) .brand { color: #FFFEFA; }
.page-doc .site-header:not([data-solid]) .brand-mark rect { stroke: rgb(255 254 250 / .25); stroke-width: 1; }

/* A visitor can stop every ambient animation, whatever their system setting */
:root[data-motion="paused"] *, :root[data-motion="paused"] *::before, :root[data-motion="paused"] *::after {
  animation-play-state: paused !important;
}
.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--text-2);
  font: 600 var(--fs-small)/1 var(--sans);
  cursor: pointer;
}
.motion-toggle:hover { color: var(--text); border-color: var(--text-2); }
.motion-toggle svg { width: 16px; height: 16px; }
.motion-toggle .i-play { display: none; }
.motion-toggle[aria-pressed="true"] .i-play { display: block; }
.motion-toggle[aria-pressed="true"] .i-pause { display: none; }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
