/* ============================================================
   Milo & Pip — style.css
   Plain CSS, no frameworks, no external fonts or CDNs.
   Palette taken from the show's own art: sky blue, sunny
   yellow, grass green, Pip orange and rainbow accents.
   ============================================================ */

:root {
  --sky: #2ea3e8;
  --sky-dark: #1b7ec2;
  --sky-light: #e9f7ff;
  --sun: #ffd83d;
  --sun-dark: #f5b921;
  --grass: #58b368;
  --grass-dark: #3d9950;
  --grass-light: #eafaf0;
  --pip: #ff8c42;
  --pink: #ff6b9d;
  --ink: #20415e;
  --ink-soft: #4a6a84;
  --paper: #fffdf7;
  --card: #ffffff;
  --radius: 26px;
  --radius-sm: 18px;
  --shadow: 0 10px 30px rgba(32, 65, 94, 0.13);
  --shadow-lg: 0 18px 44px rgba(32, 65, 94, 0.18);
  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN",
    "Segoe UI Rounded", "Segoe UI", system-ui, -apple-system, Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--sky-dark);
}

section {
  scroll-margin-top: 96px;
}

.wrap {
  width: min(1120px, 92%);
  margin: 0 auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 247, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(32, 65, 94, 0.08);
}

.header-in {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.brand-name {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-name .amp {
  color: var(--pip);
}

.main-nav {
  margin-left: auto;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.main-nav a {
  display: inline-block;
  padding: 9px 13px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.98rem;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: var(--sky-light);
  color: var(--sky-dark);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-weight: 800;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-fb {
  background: #1877f2;
  color: #fff;
  box-shadow: 0 8px 20px rgba(24, 119, 242, 0.35);
  margin-left: 10px;
  white-space: nowrap;
}

.btn-sun {
  background: var(--sun);
  color: #6b4e00;
  box-shadow: 0 8px 20px rgba(245, 185, 33, 0.4);
}

.btn-grass {
  background: var(--grass);
  color: #fff;
  box-shadow: 0 8px 20px rgba(88, 179, 104, 0.4);
}

.btn-ghost {
  background: #fff;
  color: var(--sky-dark);
  box-shadow: var(--shadow);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--sky-light);
  border: none;
  border-radius: 12px;
  width: 46px;
  height: 46px;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, #aee3ff 0%, #d8f2ff 55%, #fffdf7 100%);
  padding: 44px 0 30px;
  overflow: hidden;
}

.hero-in {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 34px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  background: #fff;
  color: var(--grass-dark);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.hero h1 .c-sky { color: var(--sky-dark); }
.hero h1 .c-pip { color: var(--pip); }
.hero h1 .c-grass { color: var(--grass-dark); }

.hero p {
  margin: 18px 0 26px;
  font-size: 1.13rem;
  color: var(--ink-soft);
  max-width: 34rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-art {
  position: relative;
}

.hero-art img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 6px solid #fff;
}

.hero-badge {
  position: absolute;
  bottom: -14px;
  left: 18px;
  background: var(--sun);
  color: #6b4e00;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
}

/* rainbow divider */
.rainbow {
  height: 12px;
  background: linear-gradient(90deg,
    #ef3f36 0 16.6%, #ff8c1a 16.6% 33.3%, #ffd83d 33.3% 50%,
    #43b02a 50% 66.6%, #2f80ed 66.6% 83.3%, #8e44ad 83.3% 100%);
}

/* ---------- Sections ---------- */
.section {
  padding: 58px 0 10px;
}

.section-head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 30px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 900;
  margin-bottom: 8px;
}

.section-head p {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.pill-sky { background: var(--sky-light); color: var(--sky-dark); }
.pill-grass { background: var(--grass-light); color: var(--grass-dark); }
.pill-sun { background: #fff6d8; color: #9a7200; }
.pill-pink { background: #ffe9f1; color: #c2437a; }

/* ---------- Episode cards ---------- */
.ep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.ep-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ep-card.featured {
  grid-column: 1 / -1;
}

.ep-media {
  position: relative;
  background: #0d2f47;
}

.ep-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.ep-media iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

.ep-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--sun);
  color: #6b4e00;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 2;
}

.ep-body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.ep-body h3 {
  font-size: 1.35rem;
  font-weight: 900;
}

.ep-body p {
  color: var(--ink-soft);
  flex: 1;
}

.ep-meta {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--grass-dark);
}

.ep-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.ep-soon {
  margin-top: 24px;
  background: repeating-linear-gradient(45deg, #fff6d8, #fff6d8 16px, #fffaf0 16px, #fffaf0 32px);
  border: 3px dashed var(--sun-dark);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  font-weight: 700;
  color: #7a5b00;
}

/* ---------- Character cards ---------- */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.friend {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: center;
  padding-bottom: 22px;
}

.friend img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.friend h3 {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 16px 0 4px;
}

.friend .who {
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.friend p {
  color: var(--ink-soft);
  padding: 6px 22px 0;
}

.friend.milo .who { color: var(--sky-dark); }
.friend.pip .who { color: #d96f1e; }
.friend.sunny .who { color: #9a7200; }

/* ---------- Learn activities ---------- */
.learn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.play-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px 30px;
  text-align: center;
}

.play-card h3 {
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.play-card .hint {
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.color-stage {
  min-height: 128px;
  border-radius: var(--radius-sm);
  background: var(--sky-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 16px;
  margin-bottom: 20px;
  transition: background 0.25s ease;
}

.color-name {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 900;
  line-height: 1.05;
}

.color-thing {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.color-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.color-dot {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(32, 65, 94, 0.25);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.color-dot:hover,
.color-dot:focus-visible {
  transform: scale(1.14);
}

.count-stage {
  min-height: 128px;
  border-radius: var(--radius-sm);
  background: var(--grass-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  margin-bottom: 20px;
}

.count-number {
  font-size: clamp(3rem, 8vw, 4.2rem);
  font-weight: 900;
  line-height: 1;
  color: var(--grass-dark);
}

.count-word {
  font-size: 1.15rem;
  font-weight: 800;
}

.count-stars {
  font-size: 1.25rem;
  color: var(--sun-dark);
  letter-spacing: 3px;
  min-height: 1.6em;
}

.count-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--sun);
  color: #6b4e00;
  border: none;
  font-family: inherit;
  font-weight: 900;
  font-size: 1.05rem;
  padding: 10px 22px 10px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(245, 185, 33, 0.45);
  transition: transform 0.12s ease;
}

.count-btn:hover { transform: translateY(-2px) scale(1.02); }
.count-btn:active { transform: scale(0.97); }

.count-btn img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
}

.link-btn {
  background: none;
  border: none;
  color: var(--sky-dark);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 12px;
}

/* ---------- Free Printables ---------- */
.print-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.print-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 2px solid #f0ead8;
  margin-bottom: 16px;
}

.print-actions {
  text-align: center;
  margin-top: 28px;
}

/* ---------- Support ---------- */
.soon-badge {
  display: inline-block;
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: 3px dashed var(--sun-dark);
  background: #fff6d8;
  color: #7a5b00;
  cursor: not-allowed;
  opacity: 0.85;
}

/* ---------- Books ---------- */
.books-banner {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.books-banner img {
  width: 100%;
  aspect-ratio: 21 / 8;
  object-fit: cover;
  object-position: center 30%;
}

.books-body {
  text-align: center;
  max-width: 42rem;
  margin: 26px auto 0;
}

.books-body h3 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.books-body p {
  color: var(--ink-soft);
  margin-bottom: 20px;
}

/* ---------- For Parents ---------- */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.trust-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.trust-ico {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--sky-light);
}

.trust-item h3 {
  font-size: 1.08rem;
  font-weight: 900;
  margin-bottom: 3px;
}

.trust-item p {
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 70px;
  background: linear-gradient(180deg, #7ec850, #58b368);
  color: #fff;
  padding: 38px 0 30px;
  text-align: center;
}

.site-footer .foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.site-footer .foot-brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.site-footer p {
  opacity: 0.95;
}

.foot-links {
  margin: 16px 0 6px;
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.foot-links a {
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.foot-small {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 10px;
}

/* ---------- Privacy page ---------- */
.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: 40px 0 10px;
}

.doc h1 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.doc .updated {
  color: var(--ink-soft);
  margin-bottom: 24px;
  font-weight: 700;
}

.doc h2 {
  font-size: 1.2rem;
  font-weight: 900;
  margin: 26px 0 8px;
}

.doc p, .doc li {
  color: var(--ink-soft);
}

.doc ul {
  padding-left: 22px;
  margin: 6px 0;
}

.back-link {
  display: inline-block;
  margin-top: 30px;
  font-weight: 800;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-art { max-width: 520px; }
  .ep-grid, .learn-grid { grid-template-columns: 1fr; }
  .friends-grid, .print-grid { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
  .trust-grid { grid-template-columns: 1fr; }
  .books-banner img { aspect-ratio: 16 / 9; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .btn-fb.header-fb { display: none; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    box-shadow: var(--shadow);
    padding: 10px 4%;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .main-nav a { display: block; padding: 12px 14px; }
  .site-header .wrap { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .color-dot, .count-btn { transition: none; }
}
