/**
 * Manchas Universe — Main Stylesheet
 * v0.1.0
 *
 * Design philosophy: Storybook warmth. PBS Kids / Beatrix Potter / Eric Carle.
 * NOT corporate SaaS. NOT generic AI gradient.
 * Warm cream paper background, hand-drawn touches, generous whitespace.
 *
 * Palette extracted from the Flagstaff hero scene Maestra approved.
 *
 * Sections:
 *   1. Design tokens
 *   2. Base & reset
 *   3. Typography
 *   4. Layout primitives
 *   5. Skip link & focus
 *   6. Header & nav
 *   7. Footer
 *   8. Homepage — hero
 *   9. Homepage — family cards
 *  10. Homepage — mission band
 *  11. Buttons
 *  12. Utilities
 *  13. Responsive
 */

/* ─── 1. Design tokens ────────────────────────────────────────── */
:root {
  /* Core palette (locked by Maestra from Flagstaff scene) */
  --mu-sky-vivid:   #4ea8d9;
  --mu-sky-soft:    #b7dcf0;
  --mu-grass:       #5a8a4a;
  --mu-grass-deep:  #467139;
  --mu-honey:       #e6b54a;
  --mu-sun-gold:    #f4cd6a;
  --mu-terracotta:  #d97757;
  --mu-terracotta-deep: #b95c3f;
  --mu-wood-brown:  #8a6440;
  --mu-wood-deep:   #5c4128;
  --mu-cream:       #faf6ec;
  --mu-cream-warm:  #f4ecd8;
  --mu-paper-shadow: #ead9b5;

  /* Pop accents (sparingly) */
  --mu-pop-red:    #d9534f;
  --mu-pop-purple: #8a6db5;
  --mu-pop-pink:   #e89090;
  --mu-pop-orange: #e88a3d;

  /* Functional roles */
  --mu-bg:         var(--mu-cream);
  --mu-bg-soft:    var(--mu-cream-warm);
  --mu-ink:        #2d2118;             /* warm near-black */
  --mu-ink-soft:   #5a4a38;
  --mu-ink-muted:  #8a7558;
  --mu-rule:       #d8c9a8;
  --mu-cta-bg:     var(--mu-terracotta);
  --mu-cta-bg-hover: var(--mu-terracotta-deep);
  --mu-cta-ink:    #fffaf0;

  /* Type */
  --mu-display: 'Fraunces', 'Cooper Black', 'Georgia', serif;
  --mu-body:    'Quicksand', 'Avenir Next', 'Avenir', system-ui, sans-serif;

  /* Spacing scale */
  --mu-s1: 0.25rem;
  --mu-s2: 0.5rem;
  --mu-s3: 0.75rem;
  --mu-s4: 1rem;
  --mu-s5: 1.5rem;
  --mu-s6: 2rem;
  --mu-s7: 3rem;
  --mu-s8: 4rem;
  --mu-s9: 6rem;

  /* Radius — soft, hand-drawn feel */
  --mu-r1: 6px;
  --mu-r2: 12px;
  --mu-r3: 18px;
  --mu-r4: 26px;
  --mu-r-pill: 999px;

  /* Shadows — warm, paper-like, never blue/cold */
  --mu-shadow-sm: 0 2px 6px rgba(92, 65, 40, 0.08);
  --mu-shadow-md: 0 6px 18px rgba(92, 65, 40, 0.12);
  --mu-shadow-lg: 0 14px 38px rgba(92, 65, 40, 0.16);
  --mu-shadow-card: 0 4px 14px rgba(92, 65, 40, 0.10),
                    0 1px 2px rgba(92, 65, 40, 0.06);

  /* Layout */
  --mu-max-w: 1180px;
  --mu-content-w: 720px;
}

/* ─── 2. Base & reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.mu-body {
  margin: 0;
  background: var(--mu-bg);
  /* Subtle paper texture — radial vignette + tiny grain feel via noise */
  background-image:
    radial-gradient(ellipse at top left,  rgba(244, 205, 106, 0.08), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(217, 119, 87, 0.06), transparent 55%);
  color: var(--mu-ink);
  font-family: var(--mu-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 500;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg, video { max-width: 100%; display: block; }

a {
  color: var(--mu-terracotta-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--mu-wood-deep); }

button { font: inherit; cursor: pointer; }

::selection { background: var(--mu-honey); color: var(--mu-wood-deep); }

/* ─── 3. Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--mu-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--mu-ink);
  margin: 0 0 var(--mu-s4);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 5vw + 1rem, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3vw + 1rem, 2.6rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 var(--mu-s4); }

.mu-eyebrow {
  font-family: var(--mu-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--mu-terracotta-deep);
  margin: 0 0 var(--mu-s3);
}

/* ─── 4. Layout primitives ────────────────────────────────────── */
.mu-shell {
  width: 100%;
  max-width: var(--mu-max-w);
  margin: 0 auto;
  padding-left: var(--mu-s5);
  padding-right: var(--mu-s5);
}

.mu-main {
  flex: 1 0 auto;
  display: block;
}

.mu-section {
  padding: var(--mu-s8) 0;
}

/* ─── 5. Skip link & focus ────────────────────────────────────── */
.mu-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--mu-ink);
  color: var(--mu-cream);
  padding: var(--mu-s3) var(--mu-s4);
  z-index: 999;
  border-radius: 0 0 var(--mu-r2) 0;
}
.mu-skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--mu-honey);
  outline-offset: 3px;
  border-radius: var(--mu-r1);
}

/* ─── 6. Header & nav ─────────────────────────────────────────── */
.mu-header {
  background: var(--mu-cream);
  border-bottom: 1px solid var(--mu-rule);
  position: sticky;
  top: 0;
  z-index: 50;
  /* Slight warm shadow so it lifts from page */
  box-shadow: 0 1px 0 var(--mu-paper-shadow);
}

.mu-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--mu-s2);
  padding-bottom: var(--mu-s2);
  gap: var(--mu-s5);
}

.mu-brand {
  display: flex;
  align-items: center;
  gap: var(--mu-s3);
  text-decoration: none;
  color: inherit;
}
.mu-brand:hover .mu-brand__name { color: var(--mu-terracotta-deep); }

.mu-brand__mark {
  display: inline-flex;
  filter: drop-shadow(0 2px 5px rgba(92, 65, 40, 0.25));
  flex-shrink: 0;
  position: relative;
  z-index: 51;
}
.mu-brand__mark img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: block;
  /* Let the big logo hang DOWNWARD into the hero below, not up off-screen.
     Small top margin keeps the roundel's top edge clear of the browser edge;
     larger negative bottom margin keeps the bar itself thin. */
  margin-top: 2px;
  margin-bottom: -46px;
}

.mu-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.mu-brand__name {
  font-family: var(--mu-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--mu-ink);
  letter-spacing: -0.01em;
  transition: color 160ms ease;
}
.mu-brand__tagline {
  font-size: 0.78rem;
  color: var(--mu-ink-muted);
  font-weight: 500;
  margin-top: 3px;
}

.mu-nav {
  display: flex;
  align-items: center;
  gap: var(--mu-s5);
}

.mu-nav__link {
  font-family: var(--mu-body);
  font-weight: 600;
  text-decoration: none;
  color: var(--mu-ink-soft);
  padding: var(--mu-s2) 0;
  position: relative;
  transition: color 160ms ease;
}
.mu-nav__link:hover { color: var(--mu-terracotta-deep); }
.mu-nav__link.is-active {
  color: var(--mu-ink);
}
.mu-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 3px;
  background: var(--mu-honey);
  border-radius: var(--mu-r-pill);
}

.mu-lang {
  display: inline-flex;
  align-items: center;
  gap: var(--mu-s2);
  padding: 4px 12px;
  background: var(--mu-cream-warm);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r-pill);
  font-size: 0.85rem;
  font-weight: 700;
}
.mu-lang__opt {
  text-decoration: none;
  color: var(--mu-ink-muted);
  padding: 2px 4px;
  border-radius: var(--mu-r1);
  transition: color 160ms ease;
}
.mu-lang__opt:hover { color: var(--mu-ink); }
.mu-lang__opt.is-active {
  color: var(--mu-ink);
  position: relative;
}
.mu-lang__opt.is-active::after {
  content: "";
  position: absolute;
  left: 4px; right: 4px; bottom: -3px;
  height: 2px;
  background: var(--mu-terracotta);
  border-radius: var(--mu-r-pill);
}
.mu-lang__sep { color: var(--mu-ink-muted); opacity: 0.5; }

/* ─── 7. Footer ───────────────────────────────────────────────── */
.mu-footer {
  background: var(--mu-cream-warm);
  border-top: 1px solid var(--mu-rule);
  padding: var(--mu-s7) 0 var(--mu-s5);
  margin-top: var(--mu-s8);
}

.mu-footer__mission {
  text-align: center;
  font-family: var(--mu-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--mu-wood-deep);
  margin-bottom: var(--mu-s7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--mu-s3);
}
.mu-footer__star { color: var(--mu-honey); font-size: 1.1em; }

.mu-footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--mu-s6);
  margin-bottom: var(--mu-s6);
}

.mu-footer__heading {
  font-family: var(--mu-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mu-ink);
  margin: 0 0 var(--mu-s3);
}
.mu-footer__line, .mu-footer__list {
  margin: 0 0 var(--mu-s2);
  font-size: 0.92rem;
  color: var(--mu-ink-soft);
}
.mu-footer__list { list-style: none; padding: 0; }
.mu-footer__list li { margin-bottom: 6px; }
.mu-footer__list a {
  color: var(--mu-ink-soft);
  text-decoration: none;
}
.mu-footer__list a:hover { color: var(--mu-terracotta-deep); text-decoration: underline; }

.mu-footer__legal {
  text-align: center;
  font-size: 0.78rem;
  color: var(--mu-ink-muted);
  padding-top: var(--mu-s5);
  border-top: 1px dashed var(--mu-rule);
  margin: 0;
}

/* ─── 8. Homepage — hero ──────────────────────────────────────── */
.mu-hero {
  position: relative;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
}

.mu-hero__scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1694 / 929;
  max-height: 70vh;
  overflow: hidden;
}

.mu-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

/* Soft cream fade at bottom edge so the greeting card blends */
.mu-hero__scene::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, var(--mu-cream) 95%);
  pointer-events: none;
}

/* Episode caption — small tag at bottom of hero scene */
.mu-hero__caption {
  position: absolute;
  left: var(--mu-s5);
  bottom: var(--mu-s4);
  z-index: 3;
  margin: 0;
  padding: 6px 14px;
  background: rgba(45, 33, 24, 0.72);
  color: var(--mu-cream);
  border-radius: var(--mu-r-pill);
  font-family: var(--mu-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mu-hero__greeting {
  position: relative;
  margin: -110px auto 0;
  max-width: 540px;
  background: var(--mu-cream);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r4);
  padding: var(--mu-s6) var(--mu-s6) var(--mu-s5);
  box-shadow: var(--mu-shadow-lg);
  text-align: left;
  z-index: 2;
}

.mu-hero__title {
  font-family: var(--mu-display);
  font-size: clamp(2rem, 4vw + 1rem, 2.8rem);
  font-weight: 800;
  margin: 0 0 var(--mu-s2);
  line-height: 1.05;
  color: var(--mu-ink);
}
.mu-hero__subtitle {
  font-family: var(--mu-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--mu-wood-brown);
  margin: 0 0 var(--mu-s4);
}
.mu-hero__lines {
  margin: 0 0 var(--mu-s5);
  font-size: 1.05rem;
  color: var(--mu-ink-soft);
}
.mu-hero__lines strong {
  color: var(--mu-terracotta-deep);
  font-weight: 700;
}
.mu-hero__cta {
  display: flex;
  gap: var(--mu-s3);
  flex-wrap: wrap;
  align-items: stretch;
}
.mu-hero__cta .mu-btn {
  flex: 0 1 auto;
}

/* ─── 9. Homepage — three pillars ────────────────────────────── */
.mu-pillars {
  padding: var(--mu-s8) 0 var(--mu-s7);
}

.mu-pillars__header {
  text-align: center;
  max-width: 660px;
  margin: 0 auto var(--mu-s7);
}

.mu-pillars__title {
  margin-bottom: var(--mu-s3);
  font-weight: 800;
}
.mu-pillars__title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--mu-honey);
  border-radius: var(--mu-r-pill);
  margin: var(--mu-s3) auto 0;
}

.mu-pillars__intro {
  font-size: 1.05rem;
  color: var(--mu-ink-soft);
  margin: 0;
}

.mu-pillars__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--mu-s6);
}

.mu-pillar {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--mu-s6);
  align-items: center;
  background: var(--mu-cream);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r3);
  padding: var(--mu-s6);
  box-shadow: var(--mu-shadow-card);
  position: relative;
  overflow: hidden;
}

/* Distinct tint background per pillar — soft, paper-like */
.mu-pillar--manchas { background:
  linear-gradient(135deg, var(--mu-cream) 0%, #fbeac8 100%); }
.mu-pillar--nico    { background:
  linear-gradient(135deg, var(--mu-cream) 0%, #f4ebd6 100%); }
.mu-pillar--bibi    { background:
  linear-gradient(135deg, var(--mu-cream) 0%, #fff3c8 100%); }

/* Alternate the layout direction for visual rhythm */
.mu-pillar:nth-child(even) {
  grid-template-columns: 1fr 240px;
}
.mu-pillar:nth-child(even) .mu-pillar__art {
  order: 2;
}

.mu-pillar__art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}
.mu-pillar__art img,
.mu-pillar__art svg {
  width: 100%;
  max-width: 240px;
  height: auto;
}
.mu-pillar__art picture img {
  filter: drop-shadow(0 4px 10px rgba(92, 65, 40, 0.15));
}

/* Small Happy Llama Club badge — tucked in corner of Manchas art */
.mu-pillar__badge {
  position: absolute;
  right: -8px;
  bottom: 4px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--mu-cream);
  padding: 4px;
  box-shadow: var(--mu-shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-6deg);
}
.mu-pillar__badge img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.mu-pillar__tagline {
  font-family: var(--mu-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: var(--mu-terracotta-deep);
  margin: 0 0 var(--mu-s2);
}

.mu-pillar__name {
  font-family: var(--mu-display);
  font-size: clamp(1.4rem, 2vw + 0.8rem, 1.85rem);
  font-weight: 800;
  margin: 0 0 var(--mu-s3);
  line-height: 1.1;
  color: var(--mu-ink);
}

.mu-pillar__text {
  font-size: 1rem;
  color: var(--mu-ink-soft);
  margin: 0;
  line-height: 1.65;
}

/* ─── Explore strip ──────────────────────────────────────────── */
.mu-explore {
  padding: var(--mu-s7) 0 var(--mu-s8);
  background: var(--mu-bg-soft);
  border-top: 1px solid var(--mu-rule);
  border-bottom: 1px solid var(--mu-rule);
}

.mu-explore__title {
  text-align: center;
  margin-bottom: var(--mu-s6);
  font-weight: 700;
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
}
.mu-explore__title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--mu-honey);
  border-radius: var(--mu-r-pill);
  margin: var(--mu-s3) auto 0;
}

.mu-explore__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--mu-s4);
}

.mu-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--mu-cream);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r3);
  padding: var(--mu-s5) var(--mu-s5) var(--mu-s4);
  box-shadow: var(--mu-shadow-card);
  transition: transform 220ms cubic-bezier(0.4, 0.0, 0.2, 1),
              box-shadow 220ms ease;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.mu-card:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: var(--mu-shadow-lg);
}
.mu-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--mu-r2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--mu-s4);
}
.mu-card--books      .mu-card__icon { background: rgba(230, 181, 74, 0.18); color: var(--mu-wood-brown); }
.mu-card--printables .mu-card__icon { background: rgba(90, 138, 74, 0.18); color: var(--mu-grass-deep); }
.mu-card--teachers   .mu-card__icon { background: rgba(217, 119, 87, 0.18); color: var(--mu-terracotta-deep); }
.mu-card--free       .mu-card__icon { background: rgba(138, 109, 181, 0.18); color: var(--mu-pop-purple); }

.mu-card__name {
  font-family: var(--mu-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 var(--mu-s2);
}
.mu-card__sub {
  font-size: 0.88rem;
  color: var(--mu-ink-muted);
  margin: 0;
}

/* ─── 10. Homepage — mission band ─────────────────────────────── */
.mu-mission {
  background: var(--mu-grass);
  color: var(--mu-cream);
  padding: var(--mu-s8) 0;
  position: relative;
  overflow: hidden;
}
.mu-mission::before {
  /* Soft scallop on top edge to feel like grass / pasture */
  content: "";
  position: absolute;
  top: -18px;
  left: 0; right: 0;
  height: 36px;
  background:
    radial-gradient(circle at 20px 18px, var(--mu-grass) 14px, transparent 15px),
    radial-gradient(circle at 60px 18px, var(--mu-grass) 14px, transparent 15px);
  background-size: 80px 36px;
  background-repeat: repeat-x;
}

.mu-mission__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.mu-mission__title {
  color: var(--mu-cream);
  font-weight: 800;
  margin-bottom: var(--mu-s4);
}
.mu-mission__body {
  font-size: 1.1rem;
  color: rgba(250, 246, 236, 0.95);
  margin: 0 0 var(--mu-s6);
}

.mu-mission__quote {
  margin: var(--mu-s5) auto 0;
  max-width: 520px;
  background: rgba(250, 246, 236, 0.96);
  border-radius: var(--mu-r3);
  padding: var(--mu-s5) var(--mu-s6);
  box-shadow: 0 8px 24px rgba(45, 33, 24, 0.18);
  position: relative;
  transform: rotate(-0.4deg);
}
.mu-mission__quote::before {
  content: "“";
  position: absolute;
  top: -22px;
  left: 16px;
  font-family: var(--mu-display);
  font-size: 5rem;
  line-height: 1;
  color: var(--mu-honey);
  font-weight: 800;
}
.mu-mission__quote blockquote {
  margin: 0;
  padding: 0;
}
.mu-mission__quote blockquote p {
  font-family: var(--mu-display);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 600;
  color: var(--mu-wood-deep);
  margin: 0 0 var(--mu-s2);
  line-height: 1.3;
}
.mu-mission__quote figcaption {
  font-family: var(--mu-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--mu-ink-soft);
  text-align: right;
}

/* ─── 11. Buttons ─────────────────────────────────────────────── */
.mu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mu-s2);
  padding: var(--mu-s3) var(--mu-s5);
  font-family: var(--mu-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--mu-r-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 140ms ease,
              background-color 160ms ease,
              box-shadow 160ms ease;
  white-space: nowrap;
}
.mu-btn:active { transform: translateY(1px); }

.mu-btn--primary {
  background: var(--mu-cta-bg);
  color: var(--mu-cta-ink);
  box-shadow: 0 2px 0 var(--mu-cta-bg-hover),
              var(--mu-shadow-sm);
}
.mu-btn--primary:hover {
  background: var(--mu-cta-bg-hover);
  color: var(--mu-cta-ink);
}

.mu-btn--secondary {
  background: var(--mu-cream);
  color: var(--mu-ink);
  border-color: var(--mu-ink);
  box-shadow: 0 2px 0 var(--mu-ink),
              var(--mu-shadow-sm);
}
.mu-btn--secondary:hover {
  background: var(--mu-ink);
  color: var(--mu-cream);
}

.mu-btn--ghost {
  background: transparent;
  color: var(--mu-ink);
  border-color: var(--mu-rule);
}
.mu-btn--ghost:hover {
  background: var(--mu-cream-warm);
  color: var(--mu-ink);
}

/* ─── 12. Utilities ───────────────────────────────────────────── */
.mu-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.mu-text-center { text-align: center; }

/* ─── 14. Inner-page components ───────────────────────────────── */

/* Page header — used by /story, /shop, /books, /free, /teachers */
.mu-page-header {
  padding: var(--mu-s8) 0 var(--mu-s7);
  background:
    radial-gradient(ellipse at top, rgba(244, 205, 106, 0.16), transparent 65%),
    var(--mu-cream);
  border-bottom: 1px solid var(--mu-rule);
  text-align: center;
}
.mu-page-header__inner {
  max-width: 760px;
  margin: 0 auto;
}
.mu-page-header__title {
  font-size: clamp(2rem, 4vw + 1rem, 3rem);
  font-weight: 800;
  margin: 0 0 var(--mu-s4);
}
.mu-page-header__title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--mu-honey);
  border-radius: var(--mu-r-pill);
  margin: var(--mu-s4) auto 0;
}
.mu-page-header__intro {
  font-size: 1.1rem;
  color: var(--mu-ink-soft);
  margin: 0;
  line-height: 1.6;
}

/* Section heading — within an inner page */
.mu-section-h {
  text-align: center;
  margin: 0 auto var(--mu-s6);
  max-width: 680px;
}
.mu-section-h__title {
  font-family: var(--mu-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2vw + 1rem, 2.1rem);
  margin: 0 0 var(--mu-s3);
}
.mu-section-h__title::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: var(--mu-honey);
  border-radius: var(--mu-r-pill);
  margin: var(--mu-s3) auto 0;
}
.mu-section-h__intro {
  font-size: 1.02rem;
  color: var(--mu-ink-soft);
  margin: 0;
}

/* Character cards grid */
.mu-chars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--mu-s5);
}
.mu-char {
  background: var(--mu-cream);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r3);
  padding: var(--mu-s5);
  box-shadow: var(--mu-shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.mu-char:hover {
  transform: translateY(-3px);
  box-shadow: var(--mu-shadow-md);
}
.mu-char__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--mu-honey);
  color: var(--mu-wood-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mu-display);
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: var(--mu-s3);
  box-shadow: var(--mu-shadow-sm);
  border: 2px solid var(--mu-cream);
  outline: 1px solid var(--mu-rule);
}
.mu-char__name {
  font-family: var(--mu-display);
  font-weight: 800;
  font-size: 1.3rem;
  margin: 0 0 4px;
  color: var(--mu-ink);
}
.mu-char__heritage {
  font-size: 0.82rem;
  color: var(--mu-ink-muted);
  margin: 0 0 var(--mu-s3);
  font-style: italic;
}
.mu-char__power {
  display: inline-block;
  background: rgba(217, 119, 87, 0.12);
  color: var(--mu-terracotta-deep);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: var(--mu-r-pill);
  margin-bottom: var(--mu-s3);
}
.mu-char__body {
  font-size: 0.95rem;
  color: var(--mu-ink-soft);
  margin: 0;
  line-height: 1.55;
}

/* Distinct avatar tints per character */
.mu-char--juan    .mu-char__avatar { background: #f4cd6a; }
.mu-char--rosa    .mu-char__avatar { background: #e89090; }
.mu-char--maya    .mu-char__avatar { background: #8a6db5; color: #fffaf0; }
.mu-char--benny   .mu-char__avatar { background: #4ea8d9; color: #fffaf0; }
.mu-char--mateo   .mu-char__avatar { background: #5a8a4a; color: #fffaf0; }
.mu-char--sofia   .mu-char__avatar { background: #d97757; color: #fffaf0; }
.mu-char--annie   .mu-char__avatar { background: #b7dcf0; }
.mu-char--leo     .mu-char__avatar { background: #e88a3d; color: #fffaf0; }
.mu-char--nico    .mu-char__avatar { background: #e6b54a; }
.mu-char--manchas .mu-char__avatar { background: #c89665; color: #fffaf0; }
.mu-char--bibi    .mu-char__avatar { background: #f4cd6a; }

/* Place cards (Setting section) */
.mu-places {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--mu-s5);
}
.mu-place {
  background: var(--mu-cream-warm);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r3);
  padding: var(--mu-s5);
  box-shadow: var(--mu-shadow-sm);
}
.mu-place__icon {
  font-size: 1.6rem;
  margin-bottom: var(--mu-s3);
  display: inline-block;
}
.mu-place__name {
  font-family: var(--mu-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 var(--mu-s2);
  color: var(--mu-ink);
}
.mu-place__body {
  font-size: 0.92rem;
  color: var(--mu-ink-soft);
  margin: 0;
}

/* Value chips strip */
.mu-values-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mu-s3);
  justify-content: center;
  margin-top: var(--mu-s5);
}
.mu-value-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--mu-s2);
  padding: var(--mu-s3) var(--mu-s4);
  background: var(--mu-cream);
  border: 1.5px solid var(--mu-honey);
  border-radius: var(--mu-r-pill);
  font-family: var(--mu-body);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--mu-wood-deep);
  box-shadow: var(--mu-shadow-sm);
}
.mu-value-chip::before {
  content: "★";
  color: var(--mu-honey);
  font-size: 1em;
}

/* Creator note callout */
.mu-creator-note {
  max-width: 640px;
  margin: var(--mu-s7) auto 0;
  background: linear-gradient(135deg, var(--mu-cream) 0%, var(--mu-cream-warm) 100%);
  border: 1px solid var(--mu-rule);
  border-left: 6px solid var(--mu-terracotta);
  border-radius: var(--mu-r3);
  padding: var(--mu-s6);
  box-shadow: var(--mu-shadow-card);
}
.mu-creator-note p {
  font-family: var(--mu-display);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--mu-ink);
  margin: 0 0 var(--mu-s3);
}
.mu-creator-note__sig {
  font-family: var(--mu-body);
  font-weight: 700;
  text-align: right;
  color: var(--mu-terracotta-deep);
  font-size: 0.95rem;
  margin: 0;
}

/* Lead-magnet card (Free page) */
.mu-leadmag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--mu-s5);
}
.mu-leadmag {
  display: flex;
  flex-direction: column;
  background: var(--mu-cream);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r3);
  padding: var(--mu-s6);
  box-shadow: var(--mu-shadow-card);
  position: relative;
  overflow: hidden;
}
.mu-leadmag__art {
  margin: 0 auto var(--mu-s4);
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mu-leadmag__art img, .mu-leadmag__art svg { width: 100%; height: auto; }
.mu-leadmag__name {
  font-family: var(--mu-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 0 4px;
  text-align: center;
}
.mu-leadmag__sub {
  font-size: 0.85rem;
  color: var(--mu-ink-muted);
  text-align: center;
  margin: 0 0 var(--mu-s3);
}
.mu-leadmag__body {
  font-size: 0.95rem;
  color: var(--mu-ink-soft);
  text-align: center;
  margin: 0 0 var(--mu-s5);
  flex: 1;
}
.mu-leadmag__cta {
  margin: 0 auto;
}
.mu-leadmag__free-flag {
  position: absolute;
  top: 14px;
  right: -34px;
  background: var(--mu-grass);
  color: var(--mu-cream);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  padding: 4px 40px;
  transform: rotate(35deg);
  box-shadow: var(--mu-shadow-sm);
}

/* Book card */
.mu-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--mu-s5);
}
.mu-book {
  display: flex;
  flex-direction: column;
  background: var(--mu-cream);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r3);
  padding: var(--mu-s5);
  box-shadow: var(--mu-shadow-card);
  transition: transform 220ms ease;
}
.mu-book:hover { transform: translateY(-3px); }
.mu-book__cover {
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, var(--mu-cream-warm) 0%, #f8e3bf 100%);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--mu-s4);
  text-align: center;
  margin-bottom: var(--mu-s4);
  position: relative;
  overflow: hidden;
}
.mu-book__cover-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--mu-terracotta);
  color: var(--mu-cream);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--mu-r-pill);
  letter-spacing: 0.06em;
}
.mu-book__cover-num {
  font-family: var(--mu-display);
  font-weight: 800;
  font-size: 4rem;
  color: var(--mu-honey);
  line-height: 1;
  margin-bottom: var(--mu-s3);
  filter: drop-shadow(0 2px 4px rgba(92, 65, 40, 0.2));
}
.mu-book__cover-title {
  font-family: var(--mu-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--mu-wood-deep);
  line-height: 1.2;
}
.mu-book__sub {
  font-family: var(--mu-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mu-terracotta-deep);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 var(--mu-s2);
}
.mu-book__title {
  font-family: var(--mu-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 var(--mu-s3);
}
.mu-book__body {
  font-size: 0.93rem;
  color: var(--mu-ink-soft);
  margin: 0 0 var(--mu-s4);
  flex: 1;
}
.mu-book__cta {
  align-self: flex-start;
}
.mu-book__amazon-note {
  text-align: center;
  font-size: 0.86rem;
  color: var(--mu-ink-muted);
  margin: var(--mu-s6) 0 0;
  padding-top: var(--mu-s5);
  border-top: 1px dashed var(--mu-rule);
}

/* Shop — filter chips + product grid */
.mu-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mu-s2);
  justify-content: center;
  margin-bottom: var(--mu-s6);
}
.mu-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--mu-cream);
  border: 1.5px solid var(--mu-rule);
  border-radius: var(--mu-r-pill);
  font-family: var(--mu-body);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--mu-ink-soft);
  cursor: pointer;
  transition: all 160ms ease;
  text-decoration: none;
}
.mu-filter-chip:hover {
  background: var(--mu-cream-warm);
  border-color: var(--mu-honey);
}
.mu-filter-chip.is-active {
  background: var(--mu-ink);
  color: var(--mu-cream);
  border-color: var(--mu-ink);
}
.mu-filter-chip--free {
  background: rgba(90, 138, 74, 0.12);
  color: var(--mu-grass-deep);
  border-color: var(--mu-grass);
}
.mu-filter-chip--free.is-active {
  background: var(--mu-grass);
  color: var(--mu-cream);
  border-color: var(--mu-grass);
}

.mu-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--mu-s5);
}
.mu-product {
  background: var(--mu-cream);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r3);
  padding: var(--mu-s5);
  box-shadow: var(--mu-shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 220ms ease, box-shadow 220ms ease;
  position: relative;
  overflow: hidden;
}
.mu-product:hover {
  transform: translateY(-3px);
  box-shadow: var(--mu-shadow-md);
}
.mu-product__cover {
  aspect-ratio: 1 / 1;
  background: var(--mu-cream-warm);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--mu-s4);
  position: relative;
  overflow: hidden;
}
.mu-product__cover img, .mu-product__cover svg {
  width: 65%;
  height: 65%;
  object-fit: contain;
}
.mu-product__bag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--mu-terracotta);
  color: var(--mu-cream);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--mu-r-pill);
}
.mu-product__free {
  background: var(--mu-grass);
}
.mu-product__title {
  font-family: var(--mu-display);
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 4px;
  line-height: 1.25;
}
.mu-product__cat {
  font-size: 0.78rem;
  color: var(--mu-ink-muted);
  margin: 0 0 var(--mu-s3);
}
.mu-product__footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--mu-s2);
  padding-top: var(--mu-s3);
}
.mu-product__price {
  font-family: var(--mu-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--mu-ink);
}
.mu-product__price--free {
  color: var(--mu-grass-deep);
}

.mu-shop-note {
  background: var(--mu-cream-warm);
  border: 1px dashed var(--mu-honey);
  border-radius: var(--mu-r3);
  padding: var(--mu-s4) var(--mu-s5);
  text-align: center;
  font-size: 0.95rem;
  color: var(--mu-wood-deep);
  margin-bottom: var(--mu-s6);
}

/* Teachers page — promise list */
.mu-promise {
  background: var(--mu-cream);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r3);
  padding: var(--mu-s6);
  box-shadow: var(--mu-shadow-card);
  max-width: 720px;
  margin: 0 auto;
}
.mu-promise__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--mu-s3);
}
.mu-promise__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--mu-s3);
  font-size: 1.02rem;
  color: var(--mu-ink-soft);
}
.mu-promise__list li::before {
  content: "✓";
  color: var(--mu-grass-deep);
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* TF cross-promo banner */
.mu-tf-banner {
  background: linear-gradient(135deg, var(--mu-grass) 0%, var(--mu-grass-deep) 100%);
  color: var(--mu-cream);
  border-radius: var(--mu-r3);
  padding: var(--mu-s7) var(--mu-s6);
  text-align: center;
  margin: var(--mu-s7) auto 0;
  max-width: 760px;
  box-shadow: var(--mu-shadow-md);
}
.mu-tf-banner h3 {
  color: var(--mu-cream);
  margin: 0 0 var(--mu-s3);
  font-size: clamp(1.4rem, 2vw + 1rem, 1.9rem);
}
.mu-tf-banner p {
  color: rgba(250, 246, 236, 0.95);
  margin: 0 0 var(--mu-s5);
  font-size: 1.02rem;
}

/* Thank-you page (post-Stripe) */
.mu-thanks {
  padding: var(--mu-s9) 0 var(--mu-s8);
  text-align: center;
  background:
    radial-gradient(ellipse at top, rgba(244, 205, 106, 0.18), transparent 60%),
    var(--mu-cream);
}
.mu-thanks__inner {
  max-width: 620px;
  margin: 0 auto;
}
.mu-thanks__art {
  margin: 0 auto var(--mu-s5);
  width: 220px;
  height: 220px;
}
.mu-thanks__art img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 16px rgba(92, 65, 40, 0.18));
  animation: mu-gentle-bob 3s ease-in-out infinite;
}
@keyframes mu-gentle-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.mu-thanks__title {
  font-size: clamp(2rem, 4vw + 1rem, 3rem);
  font-weight: 800;
  margin: 0 0 var(--mu-s4);
}
.mu-thanks__body {
  font-size: 1.15rem;
  color: var(--mu-ink-soft);
  margin: 0 0 var(--mu-s6);
  line-height: 1.6;
}
.mu-thanks__heart {
  background: var(--mu-bg-soft);
  border: 1px solid var(--mu-rule);
  border-radius: var(--mu-r3);
  padding: var(--mu-s5);
  margin: 0 0 var(--mu-s6);
}
.mu-thanks__heart span {
  font-size: 1.6rem;
  display: block;
  margin-bottom: var(--mu-s2);
}
.mu-thanks__heart p {
  font-family: var(--mu-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--mu-wood-deep);
  margin: 0;
}
.mu-thanks__cta {
  display: flex;
  gap: var(--mu-s3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── 13. Responsive ──────────────────────────────────────────── */
@media (max-width: 760px) {
  .mu-header__inner {
    flex-wrap: wrap;
    gap: var(--mu-s3);
  }
  .mu-nav {
    width: 100%;
    justify-content: space-between;
    gap: var(--mu-s3);
    flex-wrap: wrap;
  }
  .mu-brand__tagline { display: none; }
  .mu-brand__name { font-size: 1.15rem; }
  .mu-brand__mark img { width: 88px; height: 88px; margin-top: 2px; margin-bottom: 2px; }

  .mu-hero__scene { max-height: 56vh; }
  /* On mobile the greeting card no longer overlaps the scene — it sits
     just below it, so the title can never collide with the episode caption. */
  .mu-hero__greeting {
    margin: var(--mu-s4) var(--mu-s4) 0;
    padding: var(--mu-s5);
  }
  .mu-hero__greeting::before,
  .mu-hero__greeting::after { display: none; }
  /* Caption pinned to the scene bottom, but the scene fade keeps it readable
     and it's now clear of the card entirely. */
  .mu-hero__caption {
    left: var(--mu-s3);
    bottom: var(--mu-s3);
    font-size: 0.66rem;
    padding: 4px 10px;
    max-width: calc(100% - var(--mu-s5));
  }
  .mu-hero__title { font-size: 1.9rem; }

  /* Pillars collapse to single-column with art on top */
  .mu-pillar,
  .mu-pillar:nth-child(even) {
    grid-template-columns: 1fr;
    gap: var(--mu-s4);
    padding: var(--mu-s5);
    text-align: center;
  }
  .mu-pillar:nth-child(even) .mu-pillar__art {
    order: 0;
  }
  .mu-pillar__art {
    min-height: 0;
  }
  .mu-pillar__art img,
  .mu-pillar__art svg {
    max-width: 200px;
  }
  .mu-pillar__badge {
    width: 64px;
    height: 64px;
    right: 12px;
    bottom: -8px;
  }

  .mu-section { padding: var(--mu-s6) 0; }
  .mu-pillars,
  .mu-explore { padding: var(--mu-s6) 0; }
  .mu-footer__cols { gap: var(--mu-s5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  html { scroll-behavior: auto; }
}
