:root {
  --cream: #FBF8F1;
  --cream-card: #FFFDF7;
  --cream-border: #EAE3D2;
  --oolong: #2F4A3C;
  --oolong-pressed: #263F33;
  --ink: #22362C;
  --ink-secondary: #5C6B5E;
  --amber: #C08A3E;
  --on-green: #FBF8F1;
  --focus: rgba(47,74,60,0.18);
  --edge: clamp(20px, 3vw, 48px); /* side padding shared by the top bar and all content */
  --content: 1200px;               /* content column on every page; the top bar stays full width */
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--edge));
  margin: 0 auto;
  padding: 96px var(--edge) 48px;
}
main:not(.home) > * { max-width: 560px; }
.brand {
  margin: 0 0 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--oolong);
}
.brand:hover { text-decoration: none; }
.brand img, .brand svg {
  display: block;
  width: auto;
  height: 30px;
}
.brand-name { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
h1 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 16px;
}
.sub {
  font-size: 18px;
  color: var(--ink-secondary);
  margin: 0 0 40px;
}
p { margin: 0 0 16px; }
a { color: var(--oolong); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

form { display: flex; flex-wrap: wrap; gap: 12px; }
input[type="email"] {
  flex: 1 1 240px;
  font: inherit;
  padding: 14px 16px;
  border: 1px solid #E0D8C6;
  border-radius: 12px;
  background: var(--cream-card);
  color: var(--ink);
}
input[type="email"]:focus {
  outline: none;
  border-color: var(--oolong);
  box-shadow: 0 0 0 4px var(--focus);
}
button {
  font: inherit;
  font-weight: 600;
  padding: 14px 24px;
  border: 0;
  border-radius: 12px;
  background: var(--oolong);
  color: var(--on-green);
  cursor: pointer;
}
button:hover { background: var(--oolong-pressed); }
button:disabled { opacity: 0.6; cursor: default; }
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.status { min-height: 24px; margin-top: 16px; color: var(--ink-secondary); }
.status.done { color: var(--ink); font-weight: 600; }

footer {
  border-top: 1px solid var(--cream-border);
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-secondary);
}
footer a { margin: 0 8px; display: inline-block; white-space: nowrap; }
.foot-links { display: block; margin-top: 8px; line-height: 2; }
.foot-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

/* ---- Home page (index.html). Scoped to .home so privacy/support keep their layout. ---- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
main.home { max-width: none; padding: 0; }
.wrap { width: 100%; max-width: calc(var(--content) + 2 * var(--edge)); margin: 0 auto; padding: 0 var(--edge); }
.home section { padding: 72px 0; }
.home section + section { border-top: 1px solid var(--cream-border); }
.home section { scroll-margin-top: 60px; }
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 12px;
}
.home h2 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin: 0 0 16px;
  max-width: 22ch;
}
.home h3 { font-size: 19px; line-height: 1.3; margin: 0 0 8px; }
:where(.home) p { max-width: 65ch; } /* lowest specificity: tighter caps (.lede, .caption, ...) still win */
.lede { font-size: 18px; color: var(--ink-secondary); margin: 0 0 32px; max-width: 46ch; }
.muted { color: var(--ink-secondary); }
.small { font-size: 14px; }
.button {
  display: inline-block;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 12px;
  background: var(--oolong);
  color: var(--on-green);
}
.button:hover { background: var(--oolong-pressed); text-decoration: none; }

/* Top bar (the intro lands on the logo here) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-border);
}
.topbar .wrap { max-width: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 60px; }
.topbar .brand { margin: 0; justify-self: start; }
@media (max-width: 479px) {
  .topbar .brand img, .topbar .brand svg { height: 26px; }
  .topbar .brand-name { font-size: 20px; }
}
.topbar .button { padding: 9px 16px; font-size: 14px; border-radius: 10px; }
.topnav { display: flex; align-items: center; gap: 20px; white-space: nowrap; } /* centered column; right column stays empty */
.topnav a:not(.button) { font-size: 14px; font-weight: 600; color: var(--ink); }
.topnav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
/* Phones: logo and the button only; the page links live in the footer. The button reads "Join" below 480px. */
.topnav .nav-link { display: none; }
.btn-more { display: none; }
@media (min-width: 480px) { .btn-more { display: inline; } }
@media (min-width: 640px) {
  .topnav .nav-link { display: inline; }
}

/* Hero */
.home .hero { padding: 56px 0 72px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(28px, 8.5vw, 32px); margin: 0 0 16px; text-wrap: balance; max-width: 13em; } /* 13em: two sentences never share a line */
@media (min-width: 480px) { .hero h1 { font-size: clamp(32px, 1rem + 3.2vw, 60px); } }
.hero .sub { margin: 0 0 20px; }
.hero .desc { margin: 0 0 32px; max-width: 44ch; }
.hero-visual { display: flex; justify-content: center; }
.hero .phone { width: 260px; }

/* Phone frame around real screenshots */
.phone {
  position: relative;
  width: 240px;
  border: 9px solid var(--ink);
  border-radius: 40px;
  background: var(--cream);
  overflow: hidden;
  flex: none;
}
.phone::before { /* status-bar strip + island; the real status bars were cropped out */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 26px;
  background: var(--cream);
  z-index: 1;
}
.phone::after {
  content: "";
  position: absolute;
  top: 8px; left: 50%;
  width: 72px; height: 20px;
  margin-left: -36px;
  border-radius: 12px;
  background: var(--ink);
  z-index: 2;
}
.phone picture, .phone img { display: block; width: 100%; height: auto; }
.phone img { margin-top: 26px; }

@media (min-width: 800px) {
  .home section { padding: 112px 0; }
  .home h2 { font-size: 40px; }
  .home .hero { padding: 72px 0 112px; }
  .hero h1 { letter-spacing: -1px; }
  .phone { width: clamp(240px, 22vw, 320px); }
}
@media (min-width: 900px) {
  /* two-column hero from 900px: text and phone sit together as one centered block */
  .hero-grid { grid-template-columns: minmax(0, max-content) auto; justify-content: center; gap: clamp(48px, 5vw, 72px); }
  .hero h1 { max-width: 10.6em; } /* just wider than the longest sentence, so the column hugs the headline */
  .hero .phone { width: clamp(260px, 24vw, 340px); }
}

/* Problem */
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.points li {
  background: var(--cream-card);
  border: 1px solid var(--cream-border);
  border-radius: 16px;
  padding: 24px;
}
.points .num { display: block; font-size: 13px; font-weight: 700; color: var(--amber); margin-bottom: 12px; }
.points p { margin: 0; color: var(--ink-secondary); }
@media (min-width: 800px) {
  .points { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* How it works */
.steps { list-style: none; margin: 48px 0 0; padding: 0; display: grid; gap: 72px; }
.step { display: grid; gap: 32px; justify-items: center; }
.step-text { max-width: 30rem; justify-self: start; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--oolong); color: var(--on-green);
  font-size: 14px; font-weight: 700; margin-bottom: 16px;
}
.step-text p { color: var(--ink-secondary); }
.fineprint { font-size: 13px; color: var(--ink-secondary); border-left: 2px solid var(--cream-border); padding-left: 12px; }
@media (min-width: 800px) {
  .steps { gap: 112px; }
  .step { grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; }
  .step-text { justify-self: end; }
  .step:nth-child(even) .step-text { order: 2; justify-self: start; }
  .step:nth-child(even) .phone { order: 1; }
}

/* Honest by design */
.honest-grid { display: grid; gap: 48px; align-items: center; }
.honest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.honest-list li { padding-left: 20px; border-left: 2px solid var(--oolong); }
.honest-list p { margin: 4px 0 0; color: var(--ink-secondary); }
.advisory-wrap { display: grid; justify-items: center; gap: 12px; }
.advisory {
  width: 100%;
  max-width: 360px;
  background: var(--cream-card);
  border: 1px solid var(--cream-border);
  border-radius: 20px;
  padding: 24px;
}
.advisory .eyebrow { color: var(--oolong); }
.advisory .rule { font-weight: 600; margin: 0 0 20px; }
.routine { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--cream-border); }
.routine li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--cream-border);
}
.routine .when { font-size: 13px; color: var(--ink-secondary); }
/* Final (static) state is the default: skipped row dimmed and struck. JS pre-state below. */
.routine .skip .name, .routine .skip .when { opacity: 0.45; transition: opacity 0.5s ease 0.6s; }
.routine .skip .name { position: relative; }
.routine .skip .name::after {
  content: ""; position: absolute; left: 0; right: 0; top: 52%;
  height: 1.5px; background: var(--ink);
  transform-origin: left center;
  transition: transform 0.5s ease 0.6s;
}
.js .advisory:not(.is-in) .skip .name, .js .advisory:not(.is-in) .skip .when { opacity: 1; }
.js .advisory:not(.is-in) .skip .name::after { transform: scaleX(0); }
.caption { font-size: 13px; color: var(--ink-secondary); text-align: center; max-width: 360px; margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .routine .skip .name, .routine .skip .when, .routine .skip .name::after { transition: none; }
}
@media (min-width: 800px) {
  .honest-grid { grid-template-columns: 1.1fr 0.9fr; gap: 64px; }
}

/* Steeping journey */
.journey-list { list-style: none; margin: 48px 0 0; padding: 0; max-width: 640px; }
.stage { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 20px; padding-bottom: 44px; }
.stage:last-child { padding-bottom: 0; }
.stage::before { /* connector to the next stage; final state drawn */
  content: ""; position: absolute; left: 27px; top: 60px; bottom: 4px; width: 2px;
  background: var(--oolong); transform-origin: top center;
  transition: transform 0.8s ease 0.25s;
}
.stage:last-child::before { display: none; }
.node {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--cream-card); border: 1px solid var(--cream-border);
  display: flex; align-items: center; justify-content: center;
}
.node svg { height: 38px; width: auto; transform: scale(var(--s, 1)); transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s; }
.stage-days { font-size: 13px; font-weight: 600; color: var(--amber); margin: 4px 0 4px; }
.stage p { margin: 0; color: var(--ink-secondary); }
.js .stage:not(.is-in)::before { transform: scaleY(0); }
.js .stage:not(.is-in) .node svg { transform: scale(0.3); }
@media (prefers-reduced-motion: reduce) {
  .stage::before, .node svg { transition: none; }
}

/* Steeping journey teacup. Frames (brand/mascot/steep) are 275x374 and pre-aligned, so the
   sticky stage stacks them. They are low-res: shown at most 200px wide (100px stacked) so
   retina screens don't upscale them much; higher-res exports would allow larger sizes.
   The effects SVG shares their 275x374 coordinates.
   At rest (JS off, script failed, reduced motion, small or short screens) each stage shows
   its own frame beside its text and the sticky stage is not rendered. */
.journey { overflow-x: clip; } /* clip, not hidden: hidden would break the sticky stage */
.stage > div:last-child { display: flow-root; } /* the text column contains the floated frame; .node stays flex */
.stage-frame {
  float: right; position: relative;
  width: clamp(84px, 24vw, 100px); margin: 0 0 8px 12px;
}
.stage-frame img, .cup-frame { display: block; width: 100%; height: auto; }
.steep-fx {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible; pointer-events: none;
}
.steep-fx .wisp, .steep-fx .ripple, .steep-fx .bubble, .steep-fx .spk {
  opacity: 0; transform-box: fill-box; transform-origin: 50% 50%;
}
.steep-fx .wisp { fill: none; stroke: var(--ink-secondary); stroke-width: 3; stroke-linecap: round; transform-origin: 50% 100%; }
.steep-fx .ripple { fill: none; stroke: var(--cream-card); stroke-width: 2.6; vector-effect: non-scaling-stroke; }
.steep-fx .bubble { fill: var(--cream-card); stroke: var(--oolong); stroke-width: 1.2; }
.steep-fx .spk { fill: var(--amber); }
.journey-stage { display: none; }

/* Full Steep, stacked: the sparkle reveal plays once when the stage scrolls in */
.motion .stage.is-in .stage-frame img { animation: steep-bounce 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.55s both; transform-origin: 50% 97%; }
.motion .stage.is-in .stage-frame .spk { animation: steep-spark 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(0.6s + var(--i) * 60ms); }
.motion .stage:not(:last-child) .stage-frame img { animation: none; }

/* Pinned (same conditions as How Wenro Skin works): list left, sticky teacup right.
   The stage counts as current once the journey line reaches its node (index.html script). */
@media (min-width: 768px) and (min-height: 610px) {
  .motion.steep-ready .journey-layout {
    display: grid;
    grid-template-columns: minmax(0, 640px) clamp(160px, 16vw, 200px);
    justify-content: space-between;
    gap: clamp(32px, 6vw, 96px);
  }
  .motion.steep-ready .journey-list { max-width: none; }
  .motion.steep-ready .stage { min-height: 55vh; padding-bottom: 0; }
  .motion.steep-ready .stage:last-child { min-height: 80vh; } /* teacup stays pinned while Full Steep is current */
  .motion.steep-ready .stage-frame { display: none; }
  .motion.steep-ready .journey-stage {
    display: flex; align-items: center; align-self: start;
    position: sticky; top: 60px; height: calc(100vh - 60px);
  }
  .motion.steep-ready .cup { position: relative; display: grid; width: 100%; max-width: 200px; }
  .motion.steep-ready .cup-frame { grid-area: 1 / 1; opacity: 0; transition: opacity 0.3s ease; }
  .journey-stage[data-frame="1"] .cup-frame[data-f="1"],
  .journey-stage[data-frame="2"] .cup-frame[data-f="2"],
  .journey-stage[data-frame="3"] .cup-frame[data-f="3"],
  .journey-stage[data-frame="4"] .cup-frame[data-f="4"],
  .journey-stage[data-frame="5"] .cup-frame[data-f="5"] { opacity: 1; }

  /* Current stage: a ring around its node */
  .motion.steep-ready .node { position: relative; }
  .motion.steep-ready .node::after {
    content: ""; position: absolute; inset: -6px; border-radius: 50%;
    border: 2px solid var(--oolong); box-shadow: 0 0 0 4px var(--focus);
    opacity: 0; transform: scale(0.85);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .motion.steep-ready .stage.is-current .node::after { opacity: 1; transform: none; }

  /* Steam from frame 2 on; runs only while the section is on screen */
  .motion.steep-ready .journey-stage:not([data-frame="1"]) .wisp {
    animation: steep-steam 3.3s ease-in-out infinite paused;
    animation-delay: calc(var(--i) * -1.1s);
  }
  .motion.steep-ready .journey-stage.is-vis:not([data-frame="1"]) .wisp { animation-play-state: running; }
  /* The dunk (frame 3) and the reveal (frame 5): JS replays the class each time */
  .motion.steep-ready .journey-stage.is-dunk .ripple {
    animation: steep-ripple 1.4s cubic-bezier(0.3, 0.6, 0.4, 1) both;
    animation-delay: calc(var(--i) * 200ms);
  }
  .motion.steep-ready .journey-stage.is-dunk .bubble {
    animation: steep-bubble 1.3s ease-out both;
    animation-delay: calc(150ms + var(--i) * 140ms);
  }
  .motion.steep-ready .journey-stage.is-reveal .cup-frame[data-f="5"] {
    animation: steep-bounce 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; transform-origin: 50% 97%;
  }
  .motion.steep-ready .journey-stage.is-reveal .spk {
    animation: steep-spark 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(120ms + var(--i) * 60ms);
  }
}
@keyframes steep-steam {
  0% { opacity: 0; transform: translateY(6px) scaleX(0.8); }
  35% { opacity: 0.35; }
  100% { opacity: 0; transform: translateY(-26px) scaleX(1.2); }
}
@keyframes steep-ripple {
  0% { opacity: 0; transform: scale(0.4); }
  15% { opacity: 1; }
  65% { opacity: 0.75; }
  100% { opacity: 0; transform: scale(1.9); }
}
@keyframes steep-bubble {
  0% { opacity: 0; transform: translateY(0) scale(0.8); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-34px) scale(1); }
}
@keyframes steep-bounce {
  0%, 100% { transform: none; }
  30% { transform: scale(1.03, 0.95); }
  60% { transform: scale(0.98, 1.04); }
  80% { transform: scale(1.01, 0.99); }
}
@keyframes steep-spark {
  0% { opacity: 0; transform: scale(0) rotate(-40deg); }
  40% { opacity: 1; transform: scale(1.15) rotate(0deg); }
  100% { opacity: 0; transform: scale(0.6) rotate(20deg); }
}
@media (prefers-reduced-motion: reduce) {
  .steep-fx * , .stage-frame img, .cup-frame { animation: none !important; transition: none !important; }
}

/* Where we are */
.status-grid { display: grid; gap: 40px; margin-top: 40px; }
.status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.status-list li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; }
.status-list .mark {
  width: 22px; height: 22px; border-radius: 50%; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.status-list .done { background: var(--oolong); color: var(--on-green); }
.status-list .next { border: 2px solid var(--amber); }
.status-head { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-secondary); margin: 0 0 16px; }
@media (min-width: 800px) {
  .status-grid { grid-template-columns: 1fr 1fr; gap: 64px; }
}

/* Waitlist CTA */
.join .cta {
  max-width: 640px; margin: 0 auto; text-align: center;
  background: var(--cream-card); border: 1px solid var(--cream-border);
  border-radius: 24px; padding: 40px 24px;
}
.join .cta h2 { margin: 0 auto 12px; }
.join .cta .lede { margin: 0 auto 28px; }
.join form { justify-content: center; text-align: left; }
.join .status { text-align: center; }
@media (min-width: 800px) {
  .join .cta { padding: 56px 48px; }
}

.join .cta { position: relative; margin-top: 72px; }

/* ==== Mascot (poses in brand/mascot/poses, state from mascot.js) ====
   The default CSS is every pose's final, static state: visible and still. Anything
   hidden before an entrance needs html.mascot-ready, which mascot.js adds only after it
   has wired everything up; anything that moves also needs html.motion. So with JS off,
   mascot.js failing, or reduced motion, every mascot is simply there. Loops (.m-loop)
   pause while their section is off screen. Transform and opacity only. */
.m-btn, .m-link, .skip-btn {
  font: inherit; color: inherit; background: none; padding: 0; border-radius: 12px;
}
.m-btn:hover, .m-link:hover, .skip-btn:hover { background: none; }
.m-btn:focus-visible, .m-link:focus-visible, .skip-btn:focus-visible, .noise-bubble:focus-visible {
  outline: 2px solid var(--oolong); outline-offset: 3px;
}
.m-say {
  display: inline-block;
  background: var(--cream-card);
  border: 1px solid var(--cream-border);
  border-radius: 14px;
  padding: 6px 11px;
  font-size: 13px; line-height: 1.3; font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* Hero: sip, beside the phone (in the flow, so it can't land on the headline or CTA) */
.hero-visual { align-items: flex-end; }
.m-hero { flex: none; width: 76px; margin: 0 -8px 10px 0; position: relative; z-index: 3; }
.m-hero-btn { display: block; width: 100%; position: relative; }
.m-hero-pose { display: block; position: relative; transform-origin: 50% 100%; }
.m-hero-pose img { display: block; width: 100%; height: auto; }
.m-steam {
  position: absolute; left: -8%; top: 21%; width: 46%; height: auto; overflow: visible;
  fill: none; stroke: var(--ink-secondary); stroke-width: 2.4; stroke-linecap: round;
  opacity: 0.4; transform-origin: 50% 100%;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.5s ease;
}
.m-hero-say {
  position: absolute; right: 10px; bottom: 100%; margin-bottom: 6px;
  white-space: normal; width: max-content; max-width: 6.6em; text-align: left;
  opacity: 0; transform: translateY(4px) scale(0.9); transform-origin: 100% 100%;
  transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none;
}
.m-hero-btn.is-on .m-hero-say, .m-hero-btn:focus-visible .m-hero-say { opacity: 1; transform: none; }
.m-hero-btn.is-on .m-steam, .m-hero-btn:focus-visible .m-steam { opacity: 0.75; transform: scale(1.35); }
@media (hover: hover) {
  .m-hero-btn:hover .m-hero-say { opacity: 1; transform: none; }
  .m-hero-btn:hover .m-steam { opacity: 0.75; transform: scale(1.35); }
}
@media (min-width: 800px) { .m-hero { width: 96px; } }
@media (min-width: 900px) {
  /* side by side the phone can be taller than a laptop screen: sit level with its lower middle so he's in view on load */
  .m-hero { width: 120px; align-self: center; margin: 220px -8px 0 0; }
  .m-hero-say { max-width: none; white-space: nowrap; }
}

/* Problem: overwhelmed, with five poppable noise bubbles (bubbles need mascot.js) */
.problem-head { display: grid; gap: 8px; margin-bottom: 16px; }
.noise { display: grid; justify-items: center; width: 100%; max-width: 560px; margin: 8px auto 16px; }
.noise > * { grid-column: 1; }
.noise-bubbles, .noise-after { grid-row: 1; display: none; }
.noise-fig { grid-row: 2; display: grid; justify-items: center; align-items: end; pointer-events: none; }
.noise-fig > span { grid-area: 1 / 1; display: block; }
.noise-fig img { display: block; height: 150px; width: auto; }
.noise-calm img { height: 128px; }
.noise-calm { opacity: 0; }
.noise.is-clear .noise-over { opacity: 0; }
.noise.is-clear .noise-calm { opacity: 1; }
.mascot-ready .noise-bubbles {
  display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-end;
  gap: 10px 8px; max-width: 340px; padding-bottom: 14px;
}
.noise-bubble { cursor: pointer; }
.noise-bubble:hover { background: var(--cream-card); border-color: var(--oolong); }
.noise-bubble:nth-child(1) { rotate: -3deg; }
.noise-bubble:nth-child(2) { rotate: 2deg; }
.noise-bubble:nth-child(3) { rotate: 2deg; }
.noise-bubble:nth-child(4) { rotate: -2deg; }
.noise-bubble:nth-child(5) { rotate: -1deg; }
.noise-bubble.is-gone { visibility: hidden; }
.mascot-ready .noise-after {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center; padding-bottom: 14px; visibility: hidden; opacity: 0;
  position: relative; z-index: 2;
}
.mascot-ready .noise.is-clear .noise-after { visibility: visible; opacity: 1; }
.noise-line { font-weight: 600; margin: 0 0 2px; max-width: 24ch; text-wrap: balance; }
.m-link {
  padding: 6px 6px; font-size: 14px; font-weight: 600; color: var(--oolong);
  text-decoration: underline; text-underline-offset: 3px; border-radius: 8px;
}
.m-link:hover { color: var(--oolong-pressed); }
@media (min-width: 640px) {
  .noise-fig img { height: 200px; }
  .noise-calm img { height: 172px; }
  .mascot-ready .noise { position: relative; height: 300px; }
  .mascot-ready .noise > * { grid-row: 1; }
  .mascot-ready .noise-fig { align-self: end; }
  .mascot-ready .noise-bubbles { position: absolute; inset: 0; display: block; max-width: none; padding: 0; pointer-events: none; }
  .mascot-ready .noise-bubble { position: absolute; pointer-events: auto; }
  .noise-bubble:nth-child(1) { left: 0; top: 58px; }
  .noise-bubble:nth-child(2) { right: 12px; top: 40px; }
  .noise-bubble:nth-child(3) { left: 24px; top: 156px; }
  .noise-bubble:nth-child(4) { right: 44px; top: 146px; }
  .noise-bubble:nth-child(5) { left: 50%; margin-left: -62px; top: 0; }
  .mascot-ready .noise-after { align-self: start; justify-content: flex-start; padding: 36px 0 0; }
}
@media (min-width: 1100px) {
  .problem-head { grid-template-columns: minmax(0, 1fr) 560px; align-items: center; column-gap: 48px; margin-bottom: 32px; }
  .noise { margin: 0; }
}

/* How it works: a small pose beside each step; when pinned, it peeks from behind the phone */
.how { overflow-x: clip; } /* clip, not hidden: hidden would break the sticky phone */
.step-mascot { float: right; width: 56px; height: auto; margin: 0 0 8px 16px; }
@media (min-width: 800px) { .step-mascot { width: 64px; } }
.stack-wrap { position: relative; isolation: isolate; }
.how-peek { display: none; }
@media (min-width: 768px) and (min-height: 610px) {
  .motion .step-mascot { display: none; }
  /* Peeked: the left ~22% of the pose (hands and prop) stays behind the phone's edge; the
     face, cheeks and curl are clear of it. The column reserves that visible part. */
  .motion .stack-wrap { margin-right: 90px; }
  .motion .stack { z-index: 1; }
  .motion .how-peek {
    display: block; position: absolute; z-index: 0;
    left: 100%; bottom: 12%; width: 120px; height: 194px; margin-left: -26px;
  }
  .motion .how-peek img {
    position: absolute; left: 0; bottom: 0; width: 100%; height: auto;
    opacity: 0; transform: translateX(-85%); transform-origin: 30% 100%;
  }
  /* without mascot.js: simply the pose for the current step, peeked */
  .motion:not(.mascot-ready) .how-layout:not([data-current]) .peek-phone,
  .motion:not(.mascot-ready) .how-layout[data-current="0"] .peek-phone,
  .motion:not(.mascot-ready) .how-layout[data-current="1"] .peek-check,
  .motion:not(.mascot-ready) .how-layout[data-current="2"] .peek-check { opacity: 1; transform: none; }
  /* with mascot.js: .on is the pose, .is-out slides it out (tucks back in when removed) */
  .motion.mascot-ready .how-peek img { transition: transform 0.2s ease-in; }
  .motion.mascot-ready .how-peek img.on { opacity: 1; }
  .motion.mascot-ready .how-peek.is-out img.on {
    transform: none;
    animation: m-peek-out 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}
@keyframes m-peek-out {
  0% { transform: translateX(-85%) rotate(0deg); }
  55% { transform: translateX(7%) rotate(6deg); }
  80% { transform: translateX(-2%) rotate(-2deg); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .how-peek img { transition: none !important; animation: none !important; }
}

/* Tonight, do less: rest, breathing, with z's; the skipped row is a button */
.m-rest { position: relative; z-index: 1; width: 132px; justify-self: end; margin: 0 12px -26px 0; }
.m-rest-snug { transform-origin: 50% 100%; }
.m-rest img { display: block; width: 100%; height: auto; transform-origin: 50% 100%; }
.m-zs {
  position: absolute; right: -10px; top: -14px; width: 34px; height: auto; overflow: visible;
  fill: none; stroke: var(--oolong); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.m-zs path { transform-box: fill-box; transform-origin: center; }
@media (min-width: 800px) { .m-rest { width: 150px; margin-bottom: -30px; } }
.routine .skip-btn {
  display: flex; justify-content: space-between; gap: 12px; width: 100%;
  font-weight: inherit; text-align: left; border-radius: 6px; cursor: pointer;
}
.routine .skip.is-restrike .name::after { animation: m-strike 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes m-strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  /* still works, just instantly: the line drops out for a moment and is back */
  .routine .skip.is-restrike .name::after { animation-duration: 0.4s; animation-timing-function: step-end; }
}

/* Waitlist: wave, rising from behind the card's top edge */
.m-wave { position: absolute; left: 50%; bottom: 100%; width: 96px; margin: 0 0 1px -48px; }
.m-wave-clip { height: 112px; overflow: hidden; }
.m-wave-lean, .m-wave-rise { transform-origin: 50% 100%; }
.m-wave img { display: block; width: 100%; height: auto; transform-origin: 50% 80%; }
.m-wave-say {
  position: absolute; left: calc(100% - 2px); bottom: 64px; margin: 0;
  white-space: normal; width: max-content; max-width: 6.5em; text-align: left;
  opacity: 0; transform: translateY(4px) scale(0.9); transform-origin: 0 100%;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.m-wave.is-lean .m-wave-say { opacity: 1; transform: none; }
@media (min-width: 640px) { .m-wave-say { max-width: none; white-space: nowrap; } }

/* ---- Mascot motion (html.motion only) ---- */
.motion.mascot-ready .m-hero:not(.m-in) .m-hero-pose,
.motion.mascot-ready .noise:not(.m-in) .noise-over img,
.motion.mascot-ready .noise:not(.m-in) .noise-bubble,
.motion.mascot-ready .m-rest:not(.m-in) { opacity: 0; }
.motion.mascot-ready .m-wave:not(.m-in) .m-wave-rise { transform: translateY(100%); }

.motion .m-hero.m-in .m-hero-pose { animation: m-pop-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.motion .m-steam path { transform-box: fill-box; transform-origin: 50% 100%; animation: m-steam 3.6s ease-in-out infinite; }
.motion .m-steam path:nth-child(2) { animation-delay: -1.2s; }
.motion .m-steam path:nth-child(3) { animation-delay: -2.4s; }

.motion .noise.m-in .noise-over img {
  transform-origin: 50% 100%;
  animation: m-pop-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both, m-wobble 0.7s ease-in-out 0.6s;
}
.motion .noise.m-in .noise-bubble {
  animation: m-pop-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(900ms + var(--i) * 160ms);
}
.motion .noise .noise-bubble.is-popped,
.motion .noise.m-in .noise-bubble.is-popped { animation: m-pop-out 0.28s ease-in both; pointer-events: none; }
.motion .noise-over, .motion .noise-calm { transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.motion .noise-calm { transform: scale(0.92); transform-origin: 50% 100%; }
.motion .noise.is-clear .noise-calm { transform: none; }
.motion.mascot-ready .noise-after { transition: opacity 0.3s ease, visibility 0s 0.3s; }
.motion.mascot-ready .noise.is-clear .noise-after { transition: opacity 0.5s ease 0.35s, visibility 0s 0.35s; }

.motion .m-rest.m-in { transform-origin: 50% 100%; animation: m-pop-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.motion .m-rest img { animation: m-breathe 4.2s ease-in-out infinite; }
.motion .m-zs path { animation: m-z 3.6s ease-in-out infinite; }
.motion .m-zs path:nth-child(2) { animation-delay: -1.2s; }
.motion .m-zs path:nth-child(3) { animation-delay: -2.4s; }
.motion .m-rest.is-snug .m-rest-snug { animation: m-snug 0.8s ease-in-out; }

.motion .m-wave.m-in .m-wave-rise { animation: m-rise 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) 0.2s both; }
.motion .m-wave.m-in img { animation: m-wave 1.2s ease-in-out 0.9s; }
.motion .m-wave-lean { transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1); }
.motion .m-wave.is-lean .m-wave-lean { transform: translateY(-4px) rotate(7deg); }

/* loops rest while their section is off screen (mascot.js toggles .m-vis) */
.motion.mascot-ready [data-mascot]:not(.m-vis) .m-loop { animation-play-state: paused; }

@keyframes m-pop-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.5); }
  55% { opacity: 1; transform: translateY(0) scale(1.07); }
  78% { transform: scale(0.97); }
  100% { opacity: 1; transform: none; }
}
@keyframes m-pop-out {
  0% { opacity: 1; transform: none; }
  40% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(0.3); }
}
@keyframes m-wobble {
  0%, 100% { transform: none; }
  20% { transform: rotate(-3deg); }
  40% { transform: rotate(3deg); }
  60% { transform: rotate(-2deg); }
  80% { transform: rotate(2deg); }
}
@keyframes m-steam {
  0% { opacity: 0; transform: translateY(8px) scaleY(0.8); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px) scaleY(1.1); }
}
@keyframes m-breathe { 0%, 100% { transform: none; } 50% { transform: scaleY(1.02); } }
@keyframes m-z {
  0% { opacity: 0; transform: translate(-4px, 8px) scale(0.6); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(4px, -12px) scale(1); }
}
@keyframes m-snug {
  0%, 100% { transform: none; }
  25% { transform: rotate(-4deg) translateY(2px); }
  55% { transform: rotate(3deg) translateY(1px); }
  80% { transform: rotate(-1.5deg); }
}
@keyframes m-rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes m-wave {
  0%, 100% { transform: none; }
  16% { transform: rotate(-5deg); } 33% { transform: rotate(4deg); }
  50% { transform: rotate(-5deg); } 66% { transform: rotate(4deg); }
  83% { transform: rotate(-5deg); }
}

/* ==== Motion foundation (driven by motion.js) ====
   html.js     JS is running (set in <head>)
   html.motion JS + IntersectionObserver + no reduced-motion (set in <head>)
   .reveal     hidden until motion.js adds .is-in as it enters view. Variants: .rise,
               .reveal-phone, .reveal-grow, .reveal-pop; --d sets a delay.
   Transform and opacity only. With JS off nothing is hidden; with reduced motion
   everything shows at once and nothing moves. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
.js .reveal.reveal-phone { transform: translateY(40px) rotate(3deg); }
.js .reveal.reveal-grow { transform: scale(0.9); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.reveal-phone, .js .reveal.reveal-grow {
    opacity: 1; transform: none; transition: none;
  }
}

/* Everything below needs html.motion, so the page is static and complete without it. */

/* Problem cards and "Where we are" items rise further than the default reveal */
.motion .reveal.rise { transform: translateY(48px); }

/* Section headings: words rise in, staggered (spans are added by JS) */
.motion .split .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em);
  transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i) * 60ms);
}
.motion .split.is-in .word { opacity: 1; transform: none; }

/* Hero phone: JS moves .hero-visual for parallax; the phone inside floats */
.motion .hero-visual { will-change: transform; }
.motion .phone.float { animation: float 6s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Steeping journey: each connector follows scroll progress (--c, set by JS) instead of a one-off draw */
.motion .stage::before { transform: scaleY(var(--c, 0)); transition: none; }

/* How it works, pinned: the phone stays put while the three steps scroll beside it; the
   step crossing the middle of the screen is current (motion.js), its screenshot fades in
   and the progress indicator marks it. Only on screens wide AND tall enough:
   smallest pinned phone = 240px wide x 494px tall, + 60px top bar + 24px above and below
   = 602px, so pinning starts at 610px tall. Narrower or shorter screens, JS off and
   reduced motion keep the stacked steps, each with its own screenshot. */
.how-sticky { display: none; }
@media (min-width: 768px) and (min-height: 610px) {
  .motion .how-layout {
    display: grid;
    grid-template-columns: minmax(0, 32rem) auto; /* text and phone centered together, like the hero */
    justify-content: center;
    gap: clamp(40px, 7vw, 120px);
    margin-top: 24px;
  }
  .motion .steps { margin: 0; gap: 0; }
  .motion .step { display: flex; align-items: center; min-height: 75vh; }
  .motion .step:last-child { min-height: 100vh; } /* phone stays pinned until the last step has passed the middle */
  .motion .step-text { max-width: 32rem; }
  .motion .step .step-text.is-in {
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
    transform-origin: 0 50%;
  }
  .motion .step:not(.is-current) .step-text.is-in { opacity: 0.3; transform: scale(0.97); }
  .motion .step .phone { /* kept for screen readers (it carries the alt text), hidden visually */
    position: absolute; width: 1px; height: 1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .motion .how-sticky {
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
  }
  .motion .stack {
    display: grid;
    /* Height is capped to the viewport: phone height = 44px + (width - 18px) x 2.028, and it
       must fit in 100vh - 60px top bar - 48px, so width <= (100vh - 152px) x 0.493 + 18px. */
    width: min(clamp(240px, 24vw, 320px), calc((100vh - 152px) * 0.493 + 18px));
  }
  .motion .stack .screen {
    grid-area: 1 / 1;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.6s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .motion .stack .screen.is-active { opacity: 1; transform: none; }

  /* Progress: three thin segments beside the phone; done and current ones fill top-down */
  .motion .how-progress { display: grid; gap: 8px; width: 3px; }
  .motion .how-progress .seg {
    position: relative;
    height: 40px;
    border-radius: 2px;
    background: var(--cream-border);
    overflow: hidden;
  }
  .motion .how-progress .seg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--oolong);
    transform: scaleY(0);
    transform-origin: 50% 0;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .motion .how-progress .seg.is-done::after { transform: none; opacity: 0.35; }
  .motion .how-progress .seg.is-current::after { transform: none; }
}

/* ---- Legal pages (privacy.html). Scoped to .legal; wider column for tables. ---- */
main.legal > * { max-width: 720px; }
.legal .updated { color: var(--ink-secondary); margin: 0 0 32px; }
.legal h2 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  margin: 40px 0 12px;
}
.legal h3 { font-size: 16px; font-weight: 700; margin: 24px 0 8px; }
.legal ul, .legal ol { margin: 0 0 16px; padding-left: 22px; }
.legal li { margin: 0 0 8px; }
.legal .table-wrap { overflow-x: auto; margin: 0 0 16px; }
.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--cream-card);
  border: 1px solid var(--cream-border);
  border-radius: 12px;
}
.legal th, .legal td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--cream-border);
}
.legal th { font-weight: 700; }
.legal tr:last-child td { border-bottom: 0; }
.legal td:first-child { font-weight: 600; white-space: nowrap; }
@media (max-width: 600px) { .legal td:first-child { white-space: normal; } }
.legal .toc { padding-left: 22px; }
