/* Bao Bao Bedtime Stories — night-to-lamplight design system */

:root {
  --night: #201d3f;
  --night-deep: #16142e;
  --twilight: #38325f;
  --moon: #f3d488;
  --moon-bright: #ffe9b3;
  --blush: #e9aab8;
  --paper: #fbf7ef;
  --card: #ffffff;
  --ink: #322d4d;
  --muted: #7d7695;
  --line: #e7e0d2;
  --radius: 20px;
  --display: "Yeseva One", Georgia, serif;
  --body: "Karla", "Helvetica Neue", sans-serif;
  --hanzi: "Noto Serif TC", "PingFang TC", serif;
  --mono: "Spline Sans Mono", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 17px;
}

img { max-width: 100%; }

a { color: inherit; }

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

/* ---------- night header / hero ---------- */

.night {
  background:
    radial-gradient(1200px 500px at 70% -10%, var(--twilight), transparent 70%),
    linear-gradient(180deg, var(--night-deep) 0%, var(--night) 78%, #2b2650 100%);
  color: #efeaf7;
  position: relative;
  overflow: hidden;
}

.night::after {
  /* soft horizon glow where night meets the paper page */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background: linear-gradient(180deg, transparent, rgba(243, 212, 136, 0.10));
  pointer-events: none;
}

.nav {
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__brand {
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--moon);
}

.nav__links {
  display: flex;
  gap: 26px;
  align-items: center;
}

.nav__links a {
  text-decoration: none;
  color: #cdc5e6;
  font-size: 0.95rem;
}

.nav__links a:hover { color: var(--moon-bright); }

/* the CTA pill in the nav must keep dark text (beats .nav__links a) */
.nav__links a.btn--moon { color: var(--night-deep); }
.nav__links a.btn--moon:hover { color: var(--night-deep); }

.hero {
  max-width: 1040px;
  margin: 0 auto;
  padding: 64px 24px 110px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
  position: relative;
}

.hero__eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blush);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.16;
  color: #f7f3ff;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--moon);
}

.hero__lede {
  color: #c9c1e2;
  max-width: 46ch;
  margin-bottom: 32px;
  font-size: 1.06rem;
}

.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 15px 30px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn--moon {
  background: linear-gradient(140deg, var(--moon-bright), var(--moon));
  color: var(--night-deep);
  box-shadow: 0 6px 24px rgba(243, 212, 136, 0.28);
}

.btn--moon:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(243, 212, 136, 0.4); }

.btn--ghost {
  color: #d9d2ef;
  padding: 15px 8px;
  background: none;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: rgba(233, 170, 184, 0.6);
}

/* --- the signature: trilingual lullaby specimen --- */

.specimen {
  position: relative;
  background: rgba(22, 20, 46, 0.55);
  border: 1px solid rgba(243, 212, 136, 0.22);
  border-radius: var(--radius);
  padding: 40px 36px 34px;
  backdrop-filter: blur(4px);
}

.specimen__moon {
  position: absolute;
  top: -34px;
  right: 30px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff3cf, var(--moon-bright) 45%, var(--moon) 80%);
  box-shadow: 0 0 52px 14px rgba(243, 212, 136, 0.45);
  z-index: 1;
  animation: moonrise 1.2s ease-out both;
}

@keyframes moonrise {
  from { transform: translateY(26px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.specimen__label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blush);
  margin-bottom: 20px;
}

.specimen__hanzi {
  font-family: var(--hanzi);
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  line-height: 1.5;
  color: #fdf9ef;
  font-weight: 600;
}

.specimen__jyutping {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--moon);
  margin: 12px 0 16px;
  letter-spacing: 0.01em;
}

.specimen__english {
  color: #b9b0d6;
  font-size: 1rem;
}

.specimen__source {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(233, 170, 184, 0.2);
  font-size: 0.82rem;
  color: #8f86b3;
}

.stars { position: absolute; inset: 0; pointer-events: none; }

.stars i {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #efe6ff;
  opacity: 0.7;
  animation: twinkle 3.4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stars i, .specimen__moon { animation: none; }
  .btn--moon:hover { transform: none; }
}

/* ---------- lamplight sections ---------- */

.section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 84px 24px 20px;
}

.section__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #b0693f;
  margin-bottom: 12px;
}

.section h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--ink);
  margin-bottom: 14px;
}

.section__lede { color: var(--muted); max-width: 60ch; margin-bottom: 44px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px 30px;
}

.step__n {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #b0693f;
  display: block;
  margin-bottom: 14px;
}

.step h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.12rem;
  margin-bottom: 10px;
}

.step p { color: var(--muted); font-size: 0.97rem; }

/* --- sample story: mirrors the nightly email format --- */

.sample {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: 0 18px 50px rgba(50, 45, 77, 0.08);
}

.sample__head {
  background: var(--night);
  color: var(--moon);
  padding: 22px 30px;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sample__head span { color: #a79fc9; }

.sample__body { padding: 32px 30px 26px; }

.sample__hanzi {
  font-family: var(--hanzi);
  font-size: 1.28rem;
  line-height: 1.9;
  color: #2c2844;
}

.sample__jyutping {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #9a92b5;
  margin: 6px 0 20px;
}

.sample__english {
  color: var(--muted);
  font-size: 0.99rem;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.sample__note {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 18px;
}

/* --- pricing --- */

.pricing {
  background: var(--card);
  border: 1.5px solid var(--night);
  border-radius: var(--radius);
  max-width: 460px;
  margin: 0 auto;
  padding: 40px 38px;
  text-align: center;
}

.pricing__price {
  font-family: var(--display);
  font-size: 2.6rem;
  color: var(--ink);
}

.pricing__price small { font-size: 1rem; color: var(--muted); font-family: var(--body); }

.pricing ul {
  list-style: none;
  margin: 22px 0 28px;
  text-align: left;
}

.pricing li {
  padding: 9px 0 9px 30px;
  position: relative;
  color: var(--ink);
  font-size: 0.97rem;
  border-bottom: 1px dashed var(--line);
}

.pricing li:last-child { border-bottom: none; }

.pricing li::before {
  content: "🌙";
  position: absolute;
  left: 0;
  font-size: 0.85rem;
}

.btn--night {
  background: var(--night);
  color: var(--moon-bright);
  width: 100%;
}

.btn--night:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(32, 29, 63, 0.28); }

.pricing__fine { margin-top: 14px; font-size: 0.83rem; color: var(--muted); }

/* ---------- footer ---------- */

.footer {
  margin-top: 96px;
  background: var(--night-deep);
  color: #8f86b3;
  text-align: center;
  padding: 40px 24px 46px;
  font-size: 0.9rem;
}

.footer strong { color: var(--moon); font-family: var(--display); font-weight: 400; }

/* ---------- forms (signup) ---------- */

.form-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 90px;
}

.form-page h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  margin-bottom: 10px;
}

.form-page__lede { color: var(--muted); margin-bottom: 36px; max-width: 56ch; }

.fieldset {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  margin-bottom: 22px;
}

.fieldset > legend, .fieldset__title {
  font-family: var(--display);
  font-size: 1.08rem;
  margin-bottom: 18px;
  color: var(--ink);
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.field .hint { font-weight: 400; color: var(--muted); font-size: 0.83rem; margin-top: 4px; }

.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field select {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--ink);
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--twilight);
  box-shadow: 0 0 0 3px rgba(56, 50, 95, 0.14);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.vibes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.vibe input { position: absolute; opacity: 0; }

.vibe span {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 0.9rem;
  cursor: pointer;
  background: #fffdf8;
}

.vibe input:checked + span {
  border-color: var(--night);
  background: var(--night);
  color: var(--moon-bright);
}

.vibe input:focus-visible + span { outline: 3px solid var(--moon); outline-offset: 2px; }

.child-card { position: relative; }

.child-card .remove-child {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

.add-child {
  background: none;
  border: 1.5px dashed var(--muted);
  border-radius: 12px;
  width: 100%;
  padding: 13px;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 26px;
}

.add-child:hover { border-color: var(--night); color: var(--night); }

.form-error {
  display: none;
  background: #fbecec;
  border: 1px solid #e5b8b8;
  color: #8c3535;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 0.95rem;
}

.form-error.visible { display: block; }

.notice {
  background: #fdf4e0;
  border: 1px solid #ecd9a8;
  color: #7a5c1e;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
  font-size: 0.95rem;
}

/* ---------- success page ---------- */

.success-card {
  max-width: 560px;
  margin: 70px auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 50px 42px;
  text-align: center;
}

.success-card .moon-icon { font-size: 2.6rem; }

.success-card h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.7rem;
  margin: 14px 0 12px;
}

.success-card p { color: var(--muted); margin-bottom: 12px; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-bottom: 84px; gap: 44px; }
  .steps { grid-template-columns: 1fr; }
  .nav__links { display: none; }
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .vibes { grid-template-columns: 1fr; }
  .specimen { padding: 34px 24px 28px; }
}
