/* Landing (index.html) + 404.html. Palette is the app's
   (happy-hanzi-app lib/core/theme/app_colors.dart); dark teal is the
   promo's accessible text tone for teal on light grounds. */
:root {
  color-scheme: light;
  --orange: #ff6b35;
  --orange-ink: #c2410c;
  --teal: #2ec4b6;
  --teal-ink: #126b63;
  --bg: #fff8f0;
  --paper: #fffdf8;
  --paper-border: #eadfcb;
  --ink: #2d2d2d;
  --muted: #6f6558;
  --card: #fff;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(111, 101, 88, .14);
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Zen Maru Gothic", -apple-system, BlinkMacSystemFont,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}
main { flex: 1; }

:lang(zh-Hans) {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 600;
}

a { color: var(--orange-ink); }
img, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.4; margin: 0; }

/* Break Japanese at phrase boundaries rather than mid-word where supported. */
h1, h2, h3, p, li, figcaption, summary { word-break: auto-phrase; text-wrap: pretty; }

/* ---- top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 248, 240, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--paper-border);
}
.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  font-size: 1.15rem;
}
.brand img { border-radius: 10px; }
.topnav { display: flex; gap: 4px 20px; flex-wrap: wrap; justify-content: flex-end; }
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .92rem;
}
.topnav a:hover { color: var(--orange-ink); }
@media (max-width: 720px) { .topnav { display: none; } }

/* ---- intro (hero) ---- */
.intro {
  overflow-x: clip; /* the decorative bubbles sit outside the phone */
  background:
    radial-gradient(70% 60% at 85% 20%, rgba(46, 196, 182, .18), transparent 70%),
    radial-gradient(60% 50% at 0% 0%, #fff 0%, transparent 70%);
}
.intro-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px 24px 64px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 40px;
  align-items: center;
}
.pill {
  display: inline-block;
  margin: 0 0 18px;
  padding: 4px 14px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--teal-ink);
  background: #e6f8f6;
  border: 1px solid #a8e6df;
  border-radius: 999px;
}
.intro h1 {
  font-size: clamp(2rem, 5.2vw, 3.3rem);
  font-weight: 900;
  letter-spacing: .01em;
  margin-bottom: 20px;
}
.lead {
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  font-weight: 500;
  margin: 0 0 28px;
  max-width: 34em;
}
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex;
  flex-direction: column;
  min-width: 168px;
  padding: 10px 22px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
  opacity: .85;
  cursor: default;
}
.store small { font-size: .72rem; font-weight: 500; opacity: .8; }
.fineprint { margin: 14px 0 0; font-size: .88rem; color: var(--muted); }

.intro-visual { position: relative; justify-self: center; width: min(300px, 78vw); }
.phone {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 10px;
  border-radius: 40px;
  background: var(--ink);
  box-shadow: 0 24px 60px rgba(45, 45, 45, .25);
}
.phone video {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 31px;
  background: var(--bg);
  object-fit: cover;
}
.intro-mascot {
  position: absolute;
  z-index: 2;
  width: 46%;
  left: -34%;
  bottom: -6%;
  filter: drop-shadow(0 8px 14px rgba(45, 45, 45, .18));
}
.bubbles { position: absolute; inset: 0; z-index: 0; }
.bubble {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px rgba(46, 196, 182, .35);
  animation: float 6s ease-in-out infinite;
}
.b1 { width: 76px; height: 76px; font-size: 2.2rem; top: 4%; right: -22%; }
.b2 { width: 62px; height: 62px; font-size: 1.8rem; top: 38%; right: -30%; animation-delay: -2s; }
.b3 { width: 58px; height: 58px; font-size: 1.7rem; top: 10%; left: -24%; animation-delay: -4s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) { .bubble { animation: none; } }

@media (max-width: 820px) {
  .intro-inner { grid-template-columns: 1fr; padding-top: 36px; text-align: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .stores { justify-content: center; }
  .store { min-width: 148px; padding: 10px 18px; }
  .intro-visual { width: min(260px, 64vw); margin-top: 8px; }
  .intro-mascot { left: -30%; }
}

/* ---- facts strip ---- */
.facts { background: var(--teal-ink); color: #fff; }
.facts ul {
  list-style: none;
  margin: 0 auto;
  padding: 26px 24px;
  max-width: var(--wrap);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
  font-size: .88rem;
  font-weight: 500;
}
.facts strong {
  display: block;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 900;
  line-height: 1.2;
}
.facts strong small { font-size: .9rem; margin-left: 2px; }
@media (max-width: 600px) { .facts ul { grid-template-columns: repeat(2, 1fr); } }

/* ---- sections ---- */
.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 88px 24px;
}
.section-paper {
  max-width: none;
  background: var(--paper);
  border-top: 1px solid var(--paper-border);
  border-bottom: 1px solid var(--paper-border);
}
.section-paper > * { max-width: calc(var(--wrap) - 48px); margin-left: auto; margin-right: auto; }
.section-head { text-align: center; max-width: 40em; margin: 0 auto 48px; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--orange-ink);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .08em;
}
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 900; margin-bottom: 14px; }
.section-head p { margin: 0; color: var(--muted); font-weight: 500; }
.note { color: var(--muted); font-size: .9rem; }
.center { text-align: center; max-width: 46em; margin-left: auto; margin-right: auto; }

.shot {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--paper-border);
  box-shadow: var(--shadow);
  background: var(--card);
}

/* ---- learning steps ---- */
.steps { display: grid; gap: 72px; }
.step {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: center;
}
.step:nth-child(even) { grid-template-columns: 1fr 300px; }
.step:nth-child(even) > :first-child { order: 2; }
.shot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.step:has(.shot-pair) { grid-template-columns: 1fr 420px; }
.step-copy { max-width: 32em; }
.step-num { margin: 0 0 6px; color: var(--teal-ink); font-weight: 900; }
.step h3 { font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 900; margin-bottom: 14px; }
.step-copy p:not(.step-num) { margin: 0 0 18px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 2px 12px;
  border-radius: 999px;
  background: #fff1ea;
  color: var(--orange-ink);
  font-size: .85rem;
  font-weight: 700;
}
@media (max-width: 760px) {
  .step, .step:nth-child(even), .step:has(.shot-pair) { grid-template-columns: 1fr; gap: 24px; }
  .step:nth-child(even) > :first-child { order: 0; }
  .step > .shot { width: min(260px, 70vw); margin: 0 auto; }
  .shot-pair { width: min(420px, 100%); margin: 0 auto; }
}

/* review rule diagram (step 4) */
.review-card {
  padding: 24px 22px 26px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--paper-border);
  box-shadow: var(--shadow);
  text-align: center;
}
.review-card img { width: 96px; margin: 0 auto 4px; }
.review-title { margin: 0 0 16px; font-weight: 900; }
.review-card dl { margin: 0; display: grid; gap: 10px; text-align: left; }
.review-card dl div {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--paper);
  font-size: .9rem;
}
.review-card dt { font-weight: 900; }
.review-card dd { margin: 0; color: var(--muted); }
.review-card dt::before { content: "●"; margin-right: 6px; font-size: .75em; }
.r-easy dt { color: var(--teal-ink); }
.r-hard dt { color: #a15c00; }
.r-miss dt { color: var(--orange-ink); }
@media (max-width: 760px) {
  .step > .review-card { width: min(340px, 100%); margin: 0 auto; }
  .review-card dl div { grid-template-columns: 1fr; gap: 0; }
}

/* one session */
.session {
  margin-top: 88px;
  padding: 36px 28px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--paper-border);
  text-align: center;
}
.session h3 { font-size: 1.3rem; font-weight: 900; margin-bottom: 22px; }
.flow {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  counter-reset: flow;
}
.flow li { position: relative; font-size: .92rem; color: var(--muted); font-weight: 500; }
.flow li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -28px;
  top: 10px;
  color: var(--teal);
  font-weight: 900;
  font-size: 1.3rem;
}
.flow-label {
  display: block;
  margin: 0 auto 8px;
  padding: 8px 0;
  max-width: 180px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
}
.flow li:nth-child(2) .flow-label { background: var(--orange); }
.flow li:nth-child(3) .flow-label { background: var(--teal-ink); }
.session .note { margin: 0 auto; max-width: 40em; }
@media (max-width: 600px) {
  .flow { grid-template-columns: 1fr; gap: 28px; }
  .flow li:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -30px; transform: translateX(-50%); }
}

/* ---- curriculum levels ---- */
.levels {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.levels li {
  padding: 22px 22px 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--paper-border);
}
.lv { margin: 0; font-weight: 900; color: var(--teal-ink); font-size: .9rem; }
.lv-chars { margin: 4px 0 6px; font-size: 2.2rem; letter-spacing: .12em; line-height: 1.3; }
.lv-themes { margin: 0; color: var(--muted); font-size: .9rem; font-weight: 500; }
@media (max-width: 820px) { .levels { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .levels { grid-template-columns: 1fr; } }

/* ---- parents ---- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 900px;
  margin: 0 auto 56px;
}
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 14px; font-size: .88rem; color: var(--muted); text-align: center; }
.gallery figcaption strong { display: block; color: var(--ink); font-size: 1rem; }
@media (max-width: 720px) {
  .gallery { grid-template-columns: 1fr; max-width: 280px; }
}
.assurances {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.assurances li {
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--paper-border);
}
.assurances h3 { font-size: 1.05rem; font-weight: 900; margin-bottom: 6px; }
.assurances h3::before { content: "✓"; color: var(--teal-ink); margin-right: 8px; }
.assurances p { margin: 0; font-size: .92rem; color: var(--muted); }
@media (max-width: 640px) { .assurances { grid-template-columns: 1fr; } }

/* ---- plans ---- */
.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 780px;
  margin: 0 auto 24px;
}
.plan {
  position: relative;
  padding: 28px 28px 22px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--paper-border);
}
.plan-premium { border: 2px solid var(--orange); }
.plan h3 { font-size: 1.35rem; font-weight: 900; margin-bottom: 14px; }
.plan-premium h3 { color: var(--orange-ink); }
.plan ul { list-style: none; margin: 0; padding: 0; }
.plan li { padding: 9px 0 9px 26px; border-top: 1px dashed var(--paper-border); position: relative; }
.plan li::before { content: "●"; position: absolute; left: 4px; color: var(--teal); font-size: .7rem; top: 15px; }
.plan li span { display: block; font-size: .82rem; color: var(--muted); }
.plan-mascot { position: absolute; width: 96px; right: 14px; top: -44px; }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } .plan-premium { margin-top: 30px; } }

/* ---- faq ---- */
.faq { max-width: 760px; margin: 0 auto 24px; display: grid; gap: 12px; }
.faq details {
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--paper-border);
  padding: 0 22px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 28px 16px 0;
  font-weight: 700;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 12px;
  font-size: 1.4rem;
  color: var(--teal-ink);
  font-weight: 900;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; color: var(--muted); }

/* ---- closing ---- */
.closing {
  text-align: center;
  padding: 72px 24px 88px;
  background: radial-gradient(60% 80% at 50% 100%, rgba(46, 196, 182, .2), transparent 70%);
}
.closing img { width: 180px; margin: 0 auto 8px; }
.closing h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 900; }
.closing-zh { margin: 4px 0 24px; font-size: 1.4rem; color: var(--teal-ink); }
.closing .stores { justify-content: center; }

/* ---- 404 ---- */
.hero {
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 72px 24px 48px;
  text-align: center;
}
.logo {
  font-size: clamp(2.6rem, 9vw, 4rem);
  font-weight: 900;
  margin: 0 0 16px;
  color: var(--orange-ink);
}
.tagline { font-size: clamp(1.05rem, 3.5vw, 1.3rem); font-weight: 500; margin: 0 auto 36px; }

/* ---- footer (shared with 404.html) ---- */
.site-footer {
  border-top: 1px solid var(--paper-border);
  background: var(--card);
  padding: 28px 24px;
  text-align: center;
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
}
.legal-links a {
  color: var(--orange-ink);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
}
.legal-links a:hover { text-decoration: underline; }
.copyright { color: #8a8178; font-size: .8rem; margin: 16px 0 0; }
