/* Whim website: the same picture book as the app (sky, hills, paper, the buddies), opened up for parents.
   Light only, like the app's daytime; the night palette stays inside the app. */

:root {
  --sky-top: #9fd3ec;
  --sky-low: #fdf1dc;
  --paper: #fff8ec;
  --paper-2: #fbeed6;
  --ink: #2b2433;
  --ink-soft: #5e5566;
  --hill-back: #a7d27a;
  --hill-front: #7fbd55;
  --hill-shade: #5f9c3e;
  --sun: #ffc94a;
  --coral: #ff7a59;
  --coral-deep: #e85f3d;
  --sea: #3e8fb0;
  --line: #ead9bb;
  --font-play: "Sniglet", "ZCOOL KuaiLe", ui-rounded, system-ui, sans-serif;
  --font-zh: "ZCOOL KuaiLe", "Sniglet", sans-serif;
  --font-ui: "Atkinson Hyperlegible", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --gutter: max(16px, env(safe-area-inset-left));
  --measure: 68rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.nw { white-space: nowrap; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.06rem/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* The app's paper grain, so the site feels printed rather than flat */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[lang="zh"] { font-family: var(--font-zh); }
/* ZCOOL KuaiLe has one weight: no faux bold on Chinese headings (English words keep Sniglet's real 800) */
html:lang(zh) { font-synthesis: none; }
h1, h2, h3 { font-family: var(--font-play); font-weight: 800; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 6vw, 3.1rem); text-wrap: balance; }
h3 { font-size: 1.3rem; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--sea); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--ink); color: #fff; padding: 0.5rem 0.9rem; border-radius: 10px; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; border-radius: 8px; }

/* ---------- Header ---------- */
.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 0;
  max-width: calc(var(--measure) + 2 * 16px);
  margin: 0 auto;
}
.wordmark {
  flex: none;
  white-space: nowrap;
  font: 800 2.1rem/1 var(--font-play);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.wordmark.small { font-size: 1.6rem; }
/* The dot on the i is a little sun */
.wordmark .i { position: relative; display: inline-block; }
.wordmark .i b {
  position: absolute;
  left: 50%;
  top: 0.02em;
  width: 0.34em;
  height: 0.34em;
  margin-left: -0.17em;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 0.06em var(--ink);
}
.btn {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font: 800 1.1rem/1 var(--font-play);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--coral-deep);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--coral-deep); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--coral-deep); }
.btn-small { padding: 0.6rem 1rem; font-size: 0.95rem; box-shadow: 0 4px 0 var(--coral-deep); }
/* English / 中文: a two-way toy switch in the header */
.lang-switch {
  flex: none;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
}
.lang-switch button {
  min-width: 3.4rem;
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font: 800 1rem/1 var(--font-play);
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms, color 160ms;
}
.lang-switch button[lang="zh"] { font-family: var(--font-zh); font-weight: 400; font-size: 1.05rem; }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.btn-wide { width: 100%; padding: 1rem; font-size: 1.2rem; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  background: linear-gradient(180deg, var(--sky-top) 0%, #cfe9f2 45%, var(--sky-low) 100%);
  overflow: hidden;
}
.sky .sun {
  position: absolute;
  right: 9%;
  top: 14%;
  width: clamp(70px, 11vw, 120px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #ffe08a, var(--sun));
  box-shadow: 0 0 0 14px rgba(255, 201, 74, 0.22), 0 0 0 30px rgba(255, 201, 74, 0.1);
}
.cloud {
  position: absolute;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  opacity: 0.9;
  animation: drift 38s linear infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 46px; height: 46px; left: 18px; top: -22px; }
.cloud::after { width: 34px; height: 34px; left: 56px; top: -14px; }
.cloud.c1 { width: 120px; top: 22%; left: -140px; }
.cloud.c2 { width: 90px; top: 36%; left: -140px; animation-duration: 52s; animation-delay: -20s; opacity: 0.7; }
@keyframes drift { to { transform: translateX(calc(100vw + 300px)); } }

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: end;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: calc(96px + env(safe-area-inset-top)) var(--gutter) 1.5rem;
}
.eyebrow {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 1rem;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.9rem, 10.5vw, 6.2rem);
  max-width: 12ch;
  animation: rise 700ms cubic-bezier(.2, 1.3, .4, 1) both;
}
.lede {
  max-width: 34rem;
  margin-top: 1.1rem;
  font-size: clamp(1.1rem, 2.6vw, 1.3rem);
  color: #3b3343;
  animation: rise 700ms 120ms cubic-bezier(.2, 1.3, .4, 1) both;
}
.lede em { font-style: normal; background: linear-gradient(transparent 60%, rgba(255, 201, 74, 0.7) 60%); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.1rem; margin-top: 1.6rem; animation: rise 700ms 220ms cubic-bezier(.2, 1.3, .4, 1) both; }
.cta-note { font-size: 0.95rem; color: var(--ink-soft); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* The buddies peek over a hill and follow your finger with their eyes */
.hill-scene { position: relative; height: clamp(230px, 34vw, 340px); }
.hill { position: absolute; left: -10%; right: -10%; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.h-back { bottom: 0; height: 74%; background: var(--hill-back); }
.h-front { bottom: -34%; height: 58%; left: -25%; right: 35%; background: var(--hill-front); z-index: 3; }
.buddies {
  position: absolute;
  inset: auto 0 26% 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: clamp(4px, 2vw, 28px);
  padding: 0 var(--gutter);
}
.buddy {
  width: clamp(76px, 19vw, 170px);
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  transform: translateY(var(--peek, 38%));
  transition: transform 500ms cubic-bezier(.2, 1.4, .4, 1);
  animation: peek 900ms cubic-bezier(.2, 1.4, .4, 1) both;
  animation-delay: var(--delay, 0ms);
  -webkit-tap-highlight-color: transparent;
}
.buddy:hover, .buddy:focus-visible, .buddy.talking { --peek: 8%; }
.buddy svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.12)); }
@keyframes peek { from { transform: translateY(110%); } }
.eye .pupil { transition: transform 120ms ease-out; }
.eye { transform-box: fill-box; transform-origin: center; animation: blink 5.5s infinite; animation-delay: var(--blink, 0s); }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.08); } }
.say {
  position: absolute;
  z-index: 4;
  bottom: calc(100% - 10px);
  left: 50%;
  translate: -50% 0;
  transform: scale(0.6);
  transform-origin: 50% 100%;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 0.45rem 0.8rem;
  border-radius: 16px;
  background: #fff;
  font: 700 0.95rem/1.2 var(--font-play);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  transition: transform 220ms cubic-bezier(.2, 1.4, .4, 1), opacity 160ms;
}
.say::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; }
.buddy-wrap { position: relative; }
.buddy-wrap.talking .say { opacity: 1; transform: scale(1); }
/* The outer buddies' bubbles lean inwards, so they stay on screen */
.buddy-wrap:first-child .say { left: 0; translate: 0 0; transform-origin: 20% 100%; }
.buddy-wrap:first-child .say::after { left: 2.2rem; }
.buddy-wrap:last-child .say { left: auto; right: 0; translate: 0 0; transform-origin: 80% 100%; }
.buddy-wrap:last-child .say::after { left: auto; right: 2.2rem; margin-left: 0; margin-right: -7px; }

@media (max-width: 899px) {
  .sky .sun { top: auto; right: 7%; bottom: clamp(150px, 40vw, 250px); width: clamp(64px, 17vw, 96px); }
}

/* Wide screens: the hill runs along the bottom of the first screen, the buddies peek up on the right */
@media (min-width: 900px) {
  .hero { display: block; min-height: max(640px, min(100svh, 860px)); }
  .hero-copy { padding-bottom: clamp(230px, 30vh, 300px); }
  h1 { font-size: clamp(3.6rem, 7vw, 5.6rem); }
  .hill-scene { position: absolute; inset: auto 0 0; height: clamp(250px, 32vh, 320px); }
  .buddies { justify-content: flex-end; padding-right: max(4vw, calc((100vw - var(--measure)) / 2)); }
  .buddy { width: clamp(110px, 11vw, 150px); }
}

/* ---------- Sections ---------- */
main > section:not(.hero) { max-width: var(--measure); margin: 0 auto; padding: clamp(3.5rem, 9vw, 6.5rem) var(--gutter) 0; }
main > section:not(.hero):not(.bilingual) > h2, .join-card > h2 { text-align: center; }
.section-lede { max-width: 38rem; margin: 0.9rem auto 0; font-size: 1.12rem; color: var(--ink-soft); text-align: center; }
.mark { background: linear-gradient(transparent 62%, rgba(255, 122, 89, 0.35) 62%); }

/* The idea: one exchange, spoken out loud (a sound wave for the child, the buddy's head for Whim) */
.talk {
  max-width: 36rem;
  margin: 2.4rem auto 0;
  padding: clamp(1.2rem, 4vw, 1.8rem);
  border-radius: 28px;
  background: linear-gradient(180deg, #e9f5f9 0%, #fff 100%);
  border: 2px solid #d6ebf2;
}
.talk figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
  font: 800 0.8rem/1 var(--font-play);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sea);
}
.mic { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 0 rgba(255, 122, 89, 0.5); animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(255, 122, 89, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 122, 89, 0); } }
.line { display: grid; grid-template-columns: 4.2rem 1fr; gap: 0.8rem; align-items: center; padding: 0.55rem 0; }
.line + .line { border-top: 1.5px dashed #d6ebf2; }
.speaker { display: grid; justify-items: center; gap: 0.25rem; }
.speaker b { font: 800 0.72rem/1 var(--font-play); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.line p { font: 400 clamp(1.1rem, 3.4vw, 1.3rem)/1.35 var(--font-play); }
.line.kid p { color: var(--coral-deep); }
.mini-head { display: block; width: 2.6rem; }
.mini-head svg { width: 100%; aspect-ratio: 1; overflow: visible; }
/* Each line's sound wave pulses in turn, as if it's being said */
.wave { display: flex; align-items: center; gap: 3px; height: 2.6rem; }
.wave i { width: 4px; height: 30%; border-radius: 2px; background: var(--coral); animation: say 7.5s infinite; animation-delay: calc(var(--i) * 1.5s); }
.wave i:nth-child(2) { animation-name: say2; }
.wave i:nth-child(3) { animation-name: say3; }
.wave i:nth-child(4) { animation-name: say2; animation-direction: reverse; }
@keyframes say { 0%, 20%, 100% { height: 30%; } 4% { height: 70%; } 8% { height: 45%; } 12% { height: 85%; } 16% { height: 50%; } }
@keyframes say2 { 0%, 20%, 100% { height: 30%; } 4% { height: 90%; } 8% { height: 60%; } 12% { height: 100%; } 16% { height: 40%; } }
@keyframes say3 { 0%, 20%, 100% { height: 30%; } 5% { height: 55%; } 10% { height: 95%; } 15% { height: 65%; } }
.line.whim .mini-head { animation: nod 7.5s infinite; animation-delay: calc(var(--i) * 1.5s); }
@keyframes nod { 0%, 20%, 100% { transform: none; } 5% { transform: rotate(-6deg) translateY(-2px); } 12% { transform: rotate(5deg); } }
.steps { list-style: none; padding: 0; margin: 2.8rem 0 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.steps li { position: relative; text-align: center; padding: 1.4rem 1.3rem 1.3rem; border-radius: 22px; background: var(--paper-2); border: 2px solid var(--line); }
@media (min-width: 760px) {   /* a slight tilt, like cards on a table; text stays crisp on phones */
  .steps li:nth-child(2) { transform: rotate(-1deg); }
  .steps li:nth-child(3) { transform: rotate(0.8deg); }
}
.step-num { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; margin: 0 auto 0.7rem; border-radius: 50%; background: var(--ink); color: #fff; font: 800 1.1rem/1 var(--font-play); }
.steps p { margin-top: 0.4rem; color: var(--ink-soft); }

/* Bilingual */
.bilingual { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); align-items: stretch; }
.lang-card { padding: clamp(1.4rem, 4vw, 2.2rem); border-radius: 26px; background: #e6f3f8; }
.lang-card p { margin-top: 0.8rem; color: var(--ink-soft); }
.lang-card .amp { color: var(--coral); }
.lang-card.zh { display: flex; flex-direction: column; justify-content: center; background: var(--ink); color: #fff; transform: rotate(1deg); }
.zh-quote { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.3; color: #fff !important; margin: 0 !important; }
.zh-small { margin-top: 0.7rem !important; color: #cfc6d6 !important; font-family: var(--font-ui); }

/* Stories */
.tales { list-style: none; padding: 0; margin: 1.8rem auto 0; max-width: 52rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.tales li { padding: 0.55rem 1rem; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 700; }
.tales li span { margin-left: 0.35rem; color: var(--coral-deep); font-weight: 400; }
.tales li:last-child { background: none; border-style: dashed; color: var(--ink-soft); }

/* Buddies */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); margin-top: 1.8rem; }
.card { padding: 1.2rem 1rem 1.1rem; border-radius: 24px; text-align: center; background: var(--bg, #fff); }
.card svg { width: 72%; aspect-ratio: 1; overflow: visible; }
.card h3 { margin-top: 0.5rem; }
.card p { color: var(--ink-soft); font-size: 0.95rem; }
.card .other-name { font-size: 1.05rem; color: var(--ink-soft); }
.card .other-name[lang="zh"] { font-family: var(--font-zh); }

/* Parents */
.facts { list-style: none; padding: 0; margin: 2rem auto 0; max-width: 58rem; display: grid; gap: 1.6rem 2rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.facts li { padding-left: 1.1rem; border-left: 4px solid var(--hill-front); }
.facts p { margin-top: 0.35rem; color: var(--ink-soft); }

/* Waitlist */
.join-card {
  position: relative;
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 2.8rem);
  border-radius: 30px;
  background: linear-gradient(180deg, #fff 0%, var(--paper-2) 100%);
  border: 2px solid var(--line);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.05);
}
form { margin: 1.6rem auto 0; display: grid; gap: 1rem; max-width: 36rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.field { display: grid; gap: 0.35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, legend { font-weight: 700; font-size: 0.95rem; padding: 0; }
.field small { font-weight: 400; color: var(--ink-soft); }
input:not([type="checkbox"]), select, textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: 400 1.05rem/1.3 var(--font-ui);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sea); }
.check { display: inline-flex; align-items: center; gap: 0.5rem; margin-right: 1.2rem; font-size: 1rem; }
.check input { width: 1.3rem; height: 1.3rem; accent-color: var(--coral); }
.consent { align-items: flex-start; margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.consent input { flex: none; margin-top: 0.15rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { min-height: 1.4em; font-weight: 700; color: var(--coral-deep); }
.thanks { text-align: center; padding: 1.5rem 0 0.5rem; }
.thanks-head { width: 120px; margin: 0 auto 0.6rem; }
.thanks-head svg { width: 100%; aspect-ratio: 1; overflow: visible; }
.thanks h3 { font-size: 2rem; }
.thanks p { margin-top: 0.5rem; color: var(--ink-soft); }

/* FAQ and privacy */
.faq details { max-width: 44rem; margin: 0 auto; border-bottom: 2px solid var(--line); padding: 1rem 0; }
.faq details:first-of-type { margin-top: 1.2rem; }
.faq details p { margin-left: 0; }
.faq summary { cursor: pointer; font: 800 1.2rem/1.3 var(--font-play); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; color: var(--coral); font-size: 1.5rem; line-height: 1; transition: transform 200ms; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin-top: 0.6rem; color: var(--ink-soft); max-width: 42rem; }
.privacy p { margin: 0.9rem auto 0; max-width: 44rem; color: var(--ink-soft); }
.privacy b { color: var(--ink); }

/* Footer: back on the hill */
.foot {
  margin-top: clamp(4rem, 10vw, 7rem);
  padding: 3rem var(--gutter) calc(2rem + env(safe-area-inset-bottom));
  background: var(--hill-front);
  border-radius: 50% 50% 0 0 / 60px 60px 0 0;
  text-align: center;
  color: #18310c;
}
.foot p { margin-top: 0.5rem; font-size: 0.95rem; }
.foot a:not(.wordmark) { color: #18310c; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
