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

:root {
  /* palette from the app screenshots */
  --bg:         #fff2ec;
  --pink:       #fde0d8;
  --pink-soft:  #ffe8e0;
  --pink-chip:  #fff0eb;
  --cream:      #fff3e0;
  --card:       #ffffff;
  --red:        #f13332;
  --red-dark:   #b71616;
  --red-bottom: #d42b2a;
  --text:       #4a2020;
  --text-muted: #8a6f6f;
  --text-dim:   #b8a3a3;
  --green:      #8fba3f;
  --yellow:     #ffba18;
  --yellow-bg:  #fff3b8;     /* row background tint */
  --yellow-card:#fff3e0;     /* nested visual card tint (old cream) */
  --orange:     #ff8c42;
  --purple:     #a466e8;
  --teal:       #3cc2c2;
  --blue:       #4a90e2;
  --shadow-tint:         rgba(241,51,50,0.08);
  --shadow-tint-strong:  rgba(241,51,50,0.14);

  --content-max: 1080px;
}

html, body {
  min-height: 100%;
  font-family: 'Fredoka', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }

.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* hero kicker — same treatment as method-text .kicker */
.hero-text .kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}

/* ================================================================
   HERO — responsive: left/right on web, stacked on mobile
   ================================================================ */
.hero-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 32px;
  align-items: stretch;
}
.hero-grid > * { min-width: 0; }

.hero {
  background: var(--pink);
  border-radius: 28px;
  padding: 36px 0 36px 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 0 var(--shadow-tint);
  overflow: hidden;
}
.hero-text {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 14px;
}
.hero-title em {
  font-style: normal;
  color: var(--red);
}
.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 400;
}
.hero-mascot {
  width: 260px;
  height: 260px;
  flex-shrink: 0;
  position: relative;
  margin-right: -16px;
}
.hero-mascot canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ---- signup card (right side on web) ---- */
.signup {
  background: var(--card);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: 0 8px 0 var(--shadow-tint-strong);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.signup-footnote {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.4;
}
.signup-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}
form { display: flex; flex-direction: column; gap: 12px; }
.email-input {
  width: 100%;
  border: 3px solid var(--pink-soft);
  border-radius: 16px;
  padding: 16px 18px;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: #fffafa;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.email-input::placeholder { color: var(--text-dim); }
.email-input:focus        { border-color: var(--red); background: #fff; }
.email-input.error        { border-color: var(--red); background: #fff0f0; }

.cta-btn-wrap {
  background: var(--red-bottom);
  border-radius: 999px;
  padding-bottom: 5px;
  transition: transform 0.08s, padding-bottom 0.08s;
}
.cta-btn-wrap:active { transform: translateY(3px); padding-bottom: 2px; }
.cta-btn {
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 16px 20px;
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
}
.cta-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.status {
  min-height: 20px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
}
.status.error   { color: var(--red); }
.status.success { color: var(--green); }
.status.info    { color: var(--text-muted); }

.success-burst {
  font-size: 48px;
  display: block;
  margin-bottom: 10px;
  animation: pop 0.5s ease-out;
}
@keyframes pop {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* ================================================================
   METHOD SECTION — alternating rows
   ================================================================ */
.method h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 36px;
}
.method h2 em { font-style: normal; color: var(--red); }
.method-intro {
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 40px;
}

.method-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 48px 36px;
  border-radius: 28px;
  margin-bottom: 24px;
}
/* alternating surfaces for visual rhythm */
.method-row.surface-white { background: var(--card); box-shadow: 0 8px 0 var(--shadow-tint); }
.method-row.surface-cream { background: var(--cream); box-shadow: 0 8px 0 rgba(255,169,77,0.15); }
.method-row.reverse .method-visual { order: 2; }
.method-row.reverse .method-text   { order: 1; }

.method-text h3 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.2;
}
.method-text p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}
.method-text .kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.method-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

/* ---- visual 1: example lesson card (soft light gray on white row) ---- */
.lesson-card {
  background: var(--cream);
  border-radius: 22px;
  padding: 22px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 6px 0 rgba(255,169,77,0.22);
}
.lesson-card .instruct {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.lesson-card .instruct span { color: var(--red); font-weight: 600; }
.lesson-card .phrase {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 12px;
  font-weight: 500;
}
.lesson-card .pinyin {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 8px 0 16px;
}
.lesson-card .pinyin .blank {
  display: inline-block;
  border-bottom: 4px solid var(--red);
  width: 72px;
  margin-left: 6px;
  border-radius: 2px;
  vertical-align: -3px;
  animation: blink 1.6s ease-in-out infinite;
}
.lesson-card .word-chip { background: #fff; }
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.word-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.word-chip {
  background: var(--pink-chip);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.word-chip .emoji { font-size: 18px; }
.word-chip .py    { color: var(--red); font-weight: 600; }
.word-chip .en    { color: var(--text-muted); margin-left: auto; font-size: 12px; }

/* ---- visual 2: fluency graph ---- */
.graph-card {
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 6px 0 var(--shadow-tint);
}
.graph-card .graph-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}
.graph-card svg { display: block; width: 100%; height: auto; }
.graph-path    { stroke: var(--yellow); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.graph-fill    { fill: rgba(255,186,24,0.15); }
.graph-dot     { fill: var(--yellow); }
.graph-axis    { stroke: #e8ded5; stroke-width: 1; }
.graph-label   { font-family: 'Fredoka'; font-size: 10px; fill: var(--text-muted); }

/* ---- visual 3: grammar structures ---- */
.grammar-visual {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.grammar-boxes {
  background: var(--cream);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 6px 0 rgba(255,169,77,0.22);
}
.grammar-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.gbox {
  border-radius: 12px;
  padding: 14px 10px;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}
.gbox-subject { background: var(--yellow); color: #4a2020; }
.gbox-verb    { background: var(--purple); }
.gbox-object  { background: var(--teal); }
.gbox-sub {
  background: #fff;
  color: var(--text-muted);
  font-size: 11px;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
  margin-top: 4px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.grammar-examples {
  background: var(--cream);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 6px 0 rgba(255,169,77,0.22);
  font-size: 14px;
}
.grammar-example {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.grammar-example:last-child { border-bottom: none; }
.gex-icon { color: var(--red); font-size: 12px; }
.gex-phrase { color: var(--text); font-weight: 600; }
.stripe {
  display: inline-block;
  padding-bottom: 0;
  border-bottom: 3px solid transparent;
  margin-right: 2px;
  line-height: 1.05;
}
.stripe-subject { border-bottom-color: var(--yellow); }
.stripe-verb    { border-bottom-color: var(--purple); }
.stripe-object  { border-bottom-color: var(--teal); }
.gex-arrow { color: var(--text-muted); font-size: 13px; }
.gex-en { color: var(--text-muted); font-size: 13px; }

/* ---- visual 4: dynamic curriculum tiles ---- */
.curriculum-card {
  background: var(--cream);
  border-radius: 22px;
  padding: 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 6px 0 rgba(255,169,77,0.22);
}
.curriculum-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.curriculum-head .title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.curriculum-head .edit {
  background: var(--pink-soft);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.topic {
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  position: relative;
}
.topic.active {
  background: #fff;
  border: 2px solid var(--green);
  box-shadow: 0 3px 0 rgba(143,186,63,0.22);
}
.topic .emoji { font-size: 18px; }
.topic .name { flex: 1; }
.topic .toggle {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  color: var(--green);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--green);
}
.topic.active .toggle { background: var(--green); color: #fff; }

/* ---- visual: practice in real places (town map with rounded mask) ----
   Aspect ratio (380 ÷ 265) is chosen so the card renders at the same height
   as the fluency-graph card on the preceding row, at any width. */
.town-map-card {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 380 / 265;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08);
  background: #fff;
  line-height: 0;
}
.town-map-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- visual: red panda + food ---- */
.panda-food {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.panda-hero {
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.panda-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.panda-hero .placeholder {
  font-size: 110px;
  line-height: 1;
}
.health-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--shadow-tint);
}
.health-icon { font-size: 20px; line-height: 1; }
.health-track {
  flex: 1;
  background: var(--pink);
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
}
.health-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8b4d, var(--red));
  border-radius: 999px;
}
.health-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  min-width: 36px;
  text-align: right;
}
.food-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.food-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: 0 5px 0 var(--shadow-tint);
}
.food-card .food-emoji {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
}
.food-card .food-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 4px;
}
.food-card .food-count {
  font-size: 14px;
  color: var(--red);
  font-weight: 700;
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer-note {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 0 12px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  /* Mobile: panda sits ABOVE the pink hero card, not inside it. Pulled up
     via negative margin, and the hero is given top margin to leave room. */
  .hero {
    padding: 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: visible;
    margin-top: 40px;
    text-align: center;
  }
  .hero-text {
    text-align: center;
    align-self: auto;
  }
  .hero-title em { display: inline; }
  .hero-mascot {
    order: -1;
    width: 220px;
    height: 220px;
    margin: -90px auto 0;
  }
  .hero-title  { font-size: 28px; }

  .signup      { padding: 28px 22px; }

  .method h2 { font-size: 26px; margin-bottom: 18px; }

  .method-row {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 20px;
    margin-bottom: 24px;
  }
  /* On mobile, all rows stack in source order (text above visual) regardless
     of whether the row is .reverse. Overriding the desktop order here would
     flip cream rows, which is the opposite of the white rows. */
  .method-row.reverse .method-visual,
  .method-row.reverse .method-text { order: initial; }
  .method-text h3 { font-size: 22px; }
  .method-visual  { min-height: auto; }
}

@media (max-width: 420px) {
  .page { padding: 22px 14px 48px; gap: 40px; }
  .hero { padding: 20px; margin-top: 30px; }
  .hero-mascot { width: 180px; height: 180px; margin: -75px auto 0; }
  .hero-title  { font-size: 24px; }
  .method-row  { padding: 24px 16px; }
}
