/* WhyForKids home — premium kids-book brand (aligned with dinosaurs topic) */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --cream: #FFF6E5;
  --cream-2: #FCEBC8;
  --paper: #FFFAF0;
  --ink: #2B2118;
  --ink-2: #6B5A48;
  --muted: #7A6856;
  --green: #2F7D4F;
  --green-2: #4FB477;
  --leaf: #DDF2D2;
  --orange: #FF8A3D;
  --orange-2: #FFD3A8;
  --sun: #FFC83D;
  --blue: #3A9BC9;
  --blue-2: #D3EEFA;
  --purple: #2A1E3F;
  --pink: #F06C9B;
  --r: 28px;
  --shadow: 0 6px 0 rgba(43, 33, 24, 0.9);
  --shadow-soft: 0 14px 32px rgba(43, 33, 24, 0.1);
  --font-d: "ZCOOL KuaiLe", "Fredoka", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-b: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --topbar-h: 72px;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-b);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 12% 8%, rgba(255, 200, 61, 0.28), transparent 55%),
    radial-gradient(ellipse 55% 45% at 92% 4%, rgba(58, 155, 201, 0.18), transparent 50%),
    radial-gradient(ellipse 50% 40% at 80% 92%, rgba(79, 180, 119, 0.16), transparent 50%),
    radial-gradient(ellipse 45% 35% at 8% 88%, rgba(240, 108, 155, 0.12), transparent 48%),
    var(--cream);
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  font-size: 17px;
  font-weight: 600;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }

.sr,
.skip {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.skip:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  width: auto;
  height: auto;
  clip: auto;
  padding: 10px 16px;
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-d);
  font-weight: 400;
  text-decoration: none;
}

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

/* ——— Sticky top bar: brand left, lang toggle top-right ——— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 12px 0;
  padding: 8px 10px 8px 14px;
  background: rgba(255, 246, 229, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.topbar.is-scrolled {
  background: rgba(255, 246, 229, 0.98);
  box-shadow: 0 5px 0 var(--ink), 0 12px 28px rgba(43, 33, 24, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}
.logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-d);
  font-size: 1.55rem;
  font-weight: 400;
  color: #fff;
  background: linear-gradient(145deg, var(--orange), #ff5d7a);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  flex-shrink: 0;
  line-height: 1;
}
.logo.sm {
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
  box-shadow: 0 2px 0 var(--ink);
}
.wordmark {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0;
}
.wordmark .name {
  font-family: var(--font-d);
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
}
.wordmark .tagline {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  flex: none;
  margin-left: auto;
  box-shadow: 0 2px 0 rgba(43, 33, 24, 0.15);
}
.lang-toggle button {
  font-family: var(--font-d);
  font-size: 0.92rem;
  font-weight: 400;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.15s ease;
}
.lang-toggle button:hover { background: rgba(255, 200, 61, 0.35); }
.lang-toggle button.on { background: var(--sun); }
.lang-toggle button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

@media (max-width: 420px) {
  .wordmark .tagline { display: none; }
  .topbar { margin: 8px 8px 0; padding: 6px 8px 6px 10px; }
  .logo { width: 40px; height: 40px; font-size: 1.35rem; }
  .lang-toggle button { padding: 0.32rem 0.72rem; font-size: 0.85rem; }
}

/* ——— Hero ——— */
main { flex: 1; width: 100%; }

.hero {
  position: relative;
  padding: clamp(2.2rem, 6vw, 3.6rem) clamp(1.1rem, 4vw, 2rem) clamp(2rem, 5vw, 3rem);
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.hero-kicker {
  display: inline-block;
  font-family: var(--font-d);
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 400;
  color: var(--green);
  background: rgba(255, 246, 229, 0.92);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 0.2rem 1.05rem;
  margin: 0 0 1rem;
  box-shadow: 0 3px 0 var(--ink);
}
.hero-title {
  margin: 0;
  font-family: var(--font-d);
  font-weight: 400;
  font-size: clamp(2.1rem, 7.5vw, 3.6rem);
  line-height: 1.18;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.hero-lead {
  margin: 1.15rem auto 0;
  max-width: 34em;
  font-size: clamp(1.05rem, 2.6vw, 1.2rem);
  font-weight: 700;
  color: var(--ink);
  opacity: 0.92;
}
.hero-mission {
  margin: 0.75rem auto 0;
  max-width: 32em;
  font-size: clamp(0.92rem, 2.2vw, 1.02rem);
  font-weight: 600;
  color: var(--ink-2);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 1.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-d);
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  font-weight: 400;
  padding: 0.65rem 1.35rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--ink);
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}
.btn-primary {
  background: var(--orange);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.btn-ghost {
  background: #fff;
  color: var(--ink);
}

.hero-deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
}
.blob.b1 {
  width: min(280px, 48vw);
  height: min(280px, 48vw);
  top: -8%;
  left: -6%;
  background: radial-gradient(circle, var(--orange-2), transparent 70%);
}
.blob.b2 {
  width: min(220px, 40vw);
  height: min(220px, 40vw);
  top: 10%;
  right: -4%;
  background: radial-gradient(circle, var(--blue-2), transparent 70%);
}
.blob.b3 {
  width: min(200px, 36vw);
  height: min(200px, 36vw);
  bottom: 0;
  left: 35%;
  background: radial-gradient(circle, var(--leaf), transparent 70%);
}
.float {
  position: absolute;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  filter: drop-shadow(0 6px 8px rgba(43, 33, 24, 0.18));
  animation: bob 3.4s ease-in-out infinite;
}
.float.f1 { top: 18%; left: 6%; animation-delay: 0s; }
.float.f2 { top: 12%; right: 8%; animation-delay: -0.8s; font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.float.f3 { bottom: 12%; left: 10%; animation-delay: -1.6s; }
.float.f4 { bottom: 18%; right: 7%; animation-delay: -2.2s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (max-width: 560px) {
  .float.f1, .float.f3 { left: 2%; opacity: 0.7; }
  .float.f2, .float.f4 { right: 2%; opacity: 0.7; }
}

/* ——— Catalog ——— */
.catalog {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0.5rem clamp(1.1rem, 4vw, 1.75rem) 2.5rem;
}
.catalog-head {
  text-align: center;
  margin-bottom: 1.25rem;
}
.catalog-head h2 {
  margin: 0;
  font-family: var(--font-d);
  font-weight: 400;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.2;
}
.catalog-sub {
  margin: 0.45rem 0 0;
  color: var(--ink-2);
  font-size: 1.02rem;
  font-weight: 700;
}

.toolbar {
  display: flex;
  justify-content: center;
  margin-bottom: 1.4rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.65);
  border: 3px solid rgba(43, 33, 24, 0.12);
  border-radius: 999px;
}
.filter {
  border: 3px solid transparent;
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.42rem 1rem;
  font-family: var(--font-d);
  font-weight: 400;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.filter:hover { background: rgba(255, 200, 61, 0.35); }
.filter.is-on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.filter:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}
@media (min-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
}
@media (min-width: 980px) {
  .cards { grid-template-columns: 1fr 1fr 1fr; gap: 1.35rem; }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.4rem 1.25rem 1.25rem;
  border-radius: var(--r);
  background: #fff;
  text-decoration: none;
  color: inherit;
  border: 4px solid var(--ink);
  box-shadow: 0 8px 0 var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  min-height: 240px;
  overflow: hidden;
}
.card[hidden] { display: none !important; }
.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 12px 0 var(--ink);
  outline: none;
}
.card:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--ink);
}

.badge {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  font-family: var(--font-d);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  z-index: 1;
}
.badge-live { background: var(--leaf); }
.badge-new { background: var(--sun); }
.badge-explore { background: #fff; color: var(--ink-2); border-color: rgba(43, 33, 24, 0.35); }

.emoji {
  font-size: 2.55rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 4px 0 rgba(43, 33, 24, 0.08));
}
.card h3 {
  margin: 0;
  font-family: var(--font-d);
  font-weight: 400;
  font-size: clamp(1.28rem, 3vw, 1.48rem);
  line-height: 1.25;
  padding-right: 3.5rem;
}
.card .blurb {
  margin: 0.4rem 0 0;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  flex: 1;
}
.cta {
  margin-top: auto;
  padding-top: 1rem;
  font-family: var(--font-d);
  font-weight: 400;
  font-size: 1.05rem;
}

.card-dino { background: linear-gradient(165deg, #e7f6e2 0%, #fff 55%); }
.card-moon { background: linear-gradient(165deg, #e9ecff 0%, #fff 55%); }
.card-body { background: linear-gradient(165deg, #ffe4ea 0%, #fff 55%); }
.card-weather { background: linear-gradient(165deg, #e3f4ff 0%, #fff 55%); }
.card-ocean { background: linear-gradient(165deg, #d9f3f5 0%, #fff 55%); }
.card-insects { background: linear-gradient(165deg, #fff0cc 0%, #fff 55%); }
.card-volcano { background: linear-gradient(165deg, #ffe0d2 0%, #fff 55%); }
.card-solar { background: linear-gradient(165deg, #efe6ff 0%, #fff 55%); }
.card-plants { background: linear-gradient(165deg, #e5f8d8 0%, #fff 55%); }
.card-daynight { background: linear-gradient(165deg, #dfe8ff 0%, #fff4d8 48%, #fff 80%); }
.card-sleep { background: linear-gradient(165deg, #e8e0ff 0%, #fff 55%); }
.card-vehicles { background: linear-gradient(165deg, #e4f0ff 0%, #fff 55%); }
.card-halloween { background: linear-gradient(165deg, #fff0d6 0%, #fff 55%); }

.card-dino .cta { color: #2f6b28; }
.card-moon .cta { color: #3b46b0; }
.card-body .cta { color: #c23b5c; }
.card-weather .cta { color: #1f6fa8; }
.card-ocean .cta { color: #187f84; }
.card-insects .cta { color: #9a6d00; }
.card-volcano .cta { color: #b4451f; }
.card-solar .cta { color: #6a3fad; }
.card-plants .cta { color: #2f7a28; }
.card-daynight .cta { color: #3a4db0; }
.card-sleep .cta { color: #5b49a8; }
.card-vehicles .cta { color: #2a6cb0; }
.card-halloween .cta { color: #c45a00; }

/* ——— Promise / mission ——— */
.promise {
  width: min(1120px, 100%);
  margin: 0 auto 1rem;
  padding: 0 clamp(1.1rem, 4vw, 1.75rem) 2.5rem;
}
.promise-inner {
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: var(--r);
  box-shadow: 0 8px 0 var(--ink);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}
.promise-inner h2 {
  margin: 0 0 1.25rem;
  text-align: center;
  font-family: var(--font-d);
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2rem);
}
.promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
@media (min-width: 720px) {
  .promise-list { grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
}
.promise-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  background: var(--cream);
  border: 3px solid rgba(43, 33, 24, 0.12);
  border-radius: 20px;
}
.p-icon {
  font-size: 1.65rem;
  line-height: 1;
  flex-shrink: 0;
}
.promise-list strong {
  display: block;
  font-family: var(--font-d);
  font-weight: 400;
  font-size: 1.12rem;
  margin-bottom: 0.25rem;
}
.promise-list p {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ——— Footer ——— */
.site-footer {
  margin-top: auto;
  padding: 0 1.1rem 1.75rem;
}
.footer-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  padding: 1.15rem 1.35rem;
  background: rgba(255, 255, 255, 0.72);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 4px 0 var(--ink);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.footer-brand strong {
  display: block;
  font-family: var(--font-d);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.15;
}
.footer-brand p {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-2);
}
.footer-note {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

/* ——— i18n ——— */
html.lang-en .zh { display: none !important; }
html.lang-zh .en,
html:not(.lang-en) .en { display: none !important; }
html.lang-en .en { display: initial !important; }
html.lang-zh .zh,
html:not(.lang-en) .zh { display: initial !important; }

/* Prefer Latin display font weight when EN */
html.lang-en .hero-title,
html.lang-en .catalog-head h2,
html.lang-en .card h3,
html.lang-en .wordmark .name,
html.lang-en .btn,
html.lang-en .filter,
html.lang-en .hero-kicker,
html.lang-en .promise-inner h2,
html.lang-en .promise-list strong,
html.lang-en .cta,
html.lang-en .badge {
  font-family: "Fredoka", "Nunito", var(--font-d);
}
