/* Night theme by default. Friendly, chunky controls; no reward animations. */
:root {
  --bg: #0e1330;
  --surface: #182049;
  --surface-2: #222b5e;
  --line: #34407f;
  --text: #eef0ff;
  --muted: #b3badf;
  --moon: #ffd166;
  --moon-deep: #c9952a;
  --moon-ink: #2b1d00;
  --lilac: #b9a7ff;
  --ok: #8fe3b6;
  --err: #ffb4a8;
  --r: 20px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "PingFang TC", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", "Noto Sans TC", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6.5rem; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
.defs { position: absolute; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 7vw, 2.25rem); line-height: 1.25; font-weight: 800; text-wrap: balance; white-space: pre-line; }
h2 { font-size: 1.375rem; line-height: 1.3; font-weight: 800; text-wrap: balance; }
h3 { font-size: 1.0625rem; font-weight: 700; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--lilac); outline-offset: 3px; border-radius: 8px; }

main, footer, .top-in, .free-note { max-width: 30rem; margin-inline: auto; padding-inline: 1.125rem; }
section { padding-block: 1.75rem; }
section > h2 { margin-bottom: .5rem; }
.sub, .lead { color: var(--muted); }
.sub { margin-bottom: 1rem; }
.meta, .hint { color: var(--muted); font-size: .9375rem; }
.eyebrow { color: var(--lilac); font-weight: 700; font-size: .875rem; letter-spacing: .04em; }
.stack { display: grid; gap: .75rem; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 2px solid var(--surface-2); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-block: .5rem; }
.brand { display: flex; align-items: center; gap: .4rem; color: inherit; text-decoration: none; min-height: 44px; min-width: 0; }
.brand-name { font-weight: 800; white-space: nowrap; }
.tag { font-size: .75rem; font-weight: 700; color: var(--lilac); border: 2px solid var(--line); border-radius: 99px; padding: 0 .5rem; white-space: nowrap; }
.langs { display: flex; gap: .25rem; }
.langs button { min-width: 44px; min-height: 44px; padding: 0 .5rem; background: none; border: 2px solid transparent; border-radius: 12px; color: var(--muted); font: 700 .875rem var(--font); cursor: pointer; }
.langs button[aria-pressed="true"] { color: var(--text); border-color: var(--line); background: var(--surface); }
.free-note { font-size: .8125rem; color: var(--ok); padding-bottom: .4rem; text-align: center; }
@media (max-width: 380px) { .brand-name { display: none; } }

/* Cards and buttons */
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); padding: 1.125rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px; padding: .6rem 1.25rem; width: 100%;
  border-radius: 16px; border: 2px solid transparent; cursor: pointer;
  font: 800 1.0625rem/1.2 var(--font); text-align: center;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn-primary { background: var(--moon); color: var(--moon-ink); box-shadow: 0 5px 0 var(--moon-deep); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--line); box-shadow: 0 4px 0 var(--line); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 transparent; }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }
.btn-xl { min-height: 64px; font-size: 1.1875rem; margin-top: .5rem; }
.btn-round { width: 84px; height: 84px; min-height: 0; border-radius: 50%; padding: 0; background: var(--moon); color: var(--moon-ink); box-shadow: 0 5px 0 var(--moon-deep); flex: none; }

/* Hero */
.hero { text-align: center; padding-top: 1.5rem; }
.hero-moon { display: block; margin: 0 auto .5rem; }
.hero .lead { margin: .75rem 0 1.5rem; }
.letter { text-align: left; display: grid; gap: .85rem; margin: 1rem 0 1.75rem; color: var(--text); line-height: 1.85; }
.letter .sign { text-align: right; color: var(--muted); }
.install-steps { margin: .25rem 0 1rem; }
.share-btn { margin-top: .25rem; }
#install-btn { margin-bottom: 1rem; }
.tonight { text-align: left; }
.tonight h2 { margin: .15rem 0; }
.tonight .hint { text-align: center; margin-top: .9rem; }
.opt { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
.opt legend { padding: 0; font-weight: 700; font-size: .9375rem; color: var(--muted); margin-bottom: .4rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  min-height: 44px; padding: .35rem .9rem; border-radius: 14px; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 2px solid var(--line);
  font: 700 .9375rem var(--font);
}
.chip[aria-pressed="true"] { background: #2e2a66; border-color: var(--lilac); color: #fff; box-shadow: inset 0 0 0 1px var(--lilac); }

/* Steps */
.steps { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .75rem; }
.steps li, .why li { display: flex; gap: .9rem; align-items: flex-start; }
.steps li { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); padding: 1rem; }
.num { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--lilac); color: #1b1247; font-weight: 800; font-variant-numeric: tabular-nums; }
.steps p, .why p { color: var(--muted); font-size: .9688rem; }

/* Samples */
.sample h3 { overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.badge { font-size: .8125rem; color: var(--muted); border: 2px dashed var(--line); border-radius: 99px; padding: .15rem .7rem; }

.sample { display: block; }
.sample-top { display: flex; align-items: center; gap: .9rem; }
.sample-top > div { flex: 1; min-width: 0; }
.sample .play-round { width: 56px; height: 56px; min-height: 0; padding: 0; border-radius: 50%; flex: none; }
.badge.mine { display: inline-block; margin-top: .35rem; color: var(--ok); border-color: var(--ok); border-style: solid; }
.notes { margin-top: .6rem; border-top: 2px solid var(--surface-2); }
.notes summary { cursor: pointer; font-weight: 700; color: var(--lilac); padding: .7rem 0; min-height: 44px; font-size: .9375rem; }
.notes p { color: var(--muted); font-size: .9375rem; padding-bottom: .5rem; }
.notes b { color: var(--text); }

/* Parent voice */
.pv-box { display: grid; gap: .75rem; margin-top: .9rem; }
.rec { display: grid; gap: .5rem; }
.rec-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.rec-row .btn { width: auto; flex: 1 1 auto; min-width: 6.5rem; font-size: .9375rem; padding-inline: .9rem; }
.upload { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 400; color: var(--lilac); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:focus-within { outline: 3px solid var(--lilac); outline-offset: 3px; border-radius: 8px; }
.stored-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 2px solid var(--surface-2); padding-bottom: .6rem; }
.stored-row > div { min-width: 0; }
.stored-row b { display: block; overflow-wrap: anywhere; }
.stored-row .btn { width: auto; min-width: 5.5rem; font-size: .9375rem; }
.limits { background: var(--bg); border-radius: 12px; padding: .6rem .8rem; }
.msg.live { color: var(--err); font-weight: 700; font-variant-numeric: tabular-nums; }
.script { background: var(--bg); border: 2px solid var(--surface-2); border-radius: 14px; padding: .8rem .9rem; line-height: 1.9; max-height: 14rem; overflow-y: auto; }
select, textarea {
  width: 100%; min-height: 52px; padding: .6rem .9rem; border-radius: 14px;
  background: var(--bg); color: var(--text); border: 2px solid var(--line); font: 1.0625rem var(--font);
}
textarea { resize: vertical; line-height: 1.6; }
textarea::placeholder { color: #8c94c4; }

/* Why */
.why { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: 1.1rem; }
.ico { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--moon); }

/* Forms */
form { display: grid; gap: .75rem; }
label { font-weight: 700; font-size: .9375rem; }
input[type="email"] {
  width: 100%; min-height: 52px; padding: .5rem .9rem; border-radius: 14px;
  background: var(--bg); color: var(--text); border: 2px solid var(--line); font: 1.0625rem var(--font);
}
input[type="email"]::placeholder { color: #8c94c4; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; color: var(--muted); cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; margin: .15rem 0 0; accent-color: var(--moon); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg { font-size: .9375rem; min-height: 0; }
.msg:empty { display: none; }
.msg.err { color: var(--err); }
.msg.good, .ok { color: var(--ok); }
.ok { font-weight: 700; margin-bottom: 1rem; }
.notice { font-size: .9375rem; color: var(--text); background: var(--surface-2); border-left: 4px solid var(--ok); border-radius: 10px; padding: .7rem .9rem; margin-top: 1rem; }

/* Pricing */
.plans { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; }
.plan .price.small { font-size: 1rem; color: var(--text); }
@media (max-width: 420px) { .plans { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; gap: .25rem; padding: 1rem; }
.plan .price { font-size: 1.25rem; font-weight: 800; color: var(--moon); font-variant-numeric: tabular-nums; }
.plan .btn { margin-top: auto; font-size: .9375rem; padding-inline: .5rem; }
.plan .meta { margin-bottom: .75rem; }
.plan.picked { border-color: var(--ok); }
@media (max-width: 360px) { .plans { grid-template-columns: 1fr; } }
#price-msg { margin-top: 1rem; }

/* FAQ, privacy, footer */
.faq details { border-bottom: 2px solid var(--surface-2); }
.faq summary, .del summary { cursor: pointer; font-weight: 700; padding: .9rem 0; min-height: 44px; }
.faq p { color: var(--muted); padding-bottom: 1rem; }
.plain { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--muted); display: grid; gap: .5rem; }
.del { margin-top: 1rem; }
.del summary { color: var(--lilac); }
footer { padding-block: 1.5rem 3rem; color: var(--muted); font-size: .875rem; border-top: 2px solid var(--surface-2); display: grid; gap: .35rem; }

/* Player: near-black so the phone does not light the room */
.player { position: fixed; inset: 0; z-index: 20; background: #05060f; --moon-cut: #05060f; overflow-y: auto; display: grid; }
.player[hidden], [hidden] { display: none !important; }
.pl-in { max-width: 26rem; width: 100%; margin: auto; padding: 2rem 1.25rem; text-align: center; display: grid; gap: .6rem; justify-items: center; transition: opacity 1.5s ease; }
.pl-moon { opacity: .85; }
.pl-phase { color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-hint, .pl-tip { color: #8c94c4; font-size: .9375rem; }
.bar { width: 100%; height: 8px; border-radius: 99px; background: #171b38; overflow: hidden; margin: .5rem 0; }
.bar i { display: block; height: 100%; width: 0; background: var(--lilac); border-radius: 99px; }
.pl-ctrl { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; width: 100%; }
.pl-ctrl .btn-ghost, .pl-ctrl .btn-primary { width: auto; min-width: 7.5rem; }
.vol { display: grid; gap: .25rem; width: 100%; margin-top: 1rem; color: var(--muted); font-weight: 400; }
.vol input { width: 100%; height: 44px; accent-color: var(--lilac); }
.pl-read { display: grid; gap: 1rem; text-align: left; width: 100%; }
.pl-read .story { font-size: 1.125rem; line-height: 1.9; color: var(--text); }
.player.dim .pl-in { opacity: .28; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .pl-in { transition: none; }
}
