/* ===== Royal Health – playful kids' show theme ===== */
:root {
  --sky-top: #4fb8ff;
  --sky-bottom: #bfe8ff;
  --cream: #fff7e8;
  --ink: #23264a;
  --ink-soft: #4a4e7a;
  --red: #ff5a6e;
  --yellow: #ffc93c;
  --blue: #3d8bff;
  --navy: #2b3a67;
  --green: #5cc152;
  --pink: #ffa6d2;
  --teal: #62d2f0;
  --purple: #8b6cff;
  --radius: 28px;
  --shadow: 0 8px 0 rgba(35, 38, 74, .15);
  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
main, .site-footer { transition: opacity .3s; }
body.loading main, body.loading .site-footer { opacity: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .5em; }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
a { color: inherit; }

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.section { padding: 90px 0; position: relative; }
.title { text-align: center; color: var(--navy); }
.title.light { color: #fff; }
.subtitle { text-align: center; margin: -10px 0 40px; color: var(--ink-soft); font-weight: 700; }
.eyebrow {
  display: inline-block; margin: 0 0 12px; padding: 4px 14px;
  background: var(--yellow); border-radius: 99px;
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 99px; border: 0;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-3px) rotate(-1deg); }
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(35, 38, 74, .15); }
.btn-primary { background: var(--red); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); }
.btn-sub { background: var(--yellow); color: var(--ink); }
.btn.big { font-size: 1.3rem; padding: 18px 36px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 4px solid var(--yellow);
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo span { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: var(--blue); }
.logo b { color: var(--red); font-weight: 700; }
.logo img { transition: transform .3s; width: 44px; height: 48px; object-fit: contain; }
.logo:hover img { transform: rotate(-12deg) scale(1.1); }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) {
  font-family: var(--font-display); font-weight: 600; text-decoration: none; color: var(--navy);
  padding: 4px 2px; border-bottom: 3px solid transparent;
}
.nav a:not(.btn):hover { border-color: var(--red); }
.nav .btn { padding: 10px 20px; font-size: 1rem; }
.menu-toggle {
  display: none; font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  background: var(--blue); color: #fff; border: 0; border-radius: 99px; padding: 8px 18px; cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  min-height: min(760px, 92vh);
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center;
  padding: 40px clamp(16px, 5vw, 80px) 170px;
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
}
.sky { position: absolute; inset: 0; pointer-events: none; }
.sun {
  position: absolute; top: 50px; right: 8%;
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 18px rgba(255, 201, 60, .3), 0 0 0 40px rgba(255, 201, 60, .15);
  animation: pulse 4s ease-in-out infinite;
}
.cloud {
  position: absolute; background: #fff; border-radius: 99px; height: 44px; opacity: .95;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 60px; height: 60px; top: -30px; left: 20px; }
.cloud::after { width: 44px; height: 44px; top: -20px; left: 70px; }
.c1 { width: 150px; top: 14%; animation-duration: 60s; animation-delay: -10s; }
.c2 { width: 120px; top: 32%; animation-duration: 80s; animation-delay: -45s; transform: scale(.8); }
.c3 { width: 170px; top: 8%; animation-duration: 95s; animation-delay: -70s; }

.hero-copy { position: relative; z-index: 2; max-width: 600px; }
.badge {
  display: inline-block; margin: 0 0 18px; padding: 6px 16px;
  background: #fff; color: var(--red); border-radius: 99px;
  font-family: var(--font-display); font-weight: 600; box-shadow: var(--shadow);
  transform: rotate(-2deg);
}
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); color: #fff; text-shadow: 0 5px 0 var(--navy); letter-spacing: .5px; }
.hero h1 .hl { color: var(--yellow); }
.lead { font-size: 1.25rem; font-weight: 700; color: var(--navy); max-width: 30ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

.hero-crew {
  position: relative; z-index: 2;
  display: flex; align-items: flex-end; justify-content: center; gap: 0;
  margin-bottom: -80px;
}
.hero-crew img { width: 30%; height: auto; aspect-ratio: 10 / 11; object-fit: contain; object-position: bottom; filter: drop-shadow(0 12px 0 rgba(35, 38, 74, .12)); }
.hero-crew img.big { width: 42%; margin: 0 -4%; z-index: 1; }
.bob { animation: bob 2.6s ease-in-out infinite; }
.d1 { animation-delay: -.6s; }
.d2 { animation-delay: -1.3s; }
.hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 220px; z-index: 1; }

/* ===== Watch ===== */
.watch { padding-top: 60px; }
.watch-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; align-items: center; }
.player {
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  border: 6px solid var(--navy); box-shadow: 10px 10px 0 var(--yellow);
  background: var(--navy);
}
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-cover {
  width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; position: relative;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .35) 0 40px, transparent 41px),
    radial-gradient(circle at 85% 75%, rgba(255, 255, 255, .25) 0 60px, transparent 61px),
    linear-gradient(135deg, color-mix(in srgb, var(--red), var(--yellow) 35%), var(--red));
}
.player-cover img { position: absolute; height: 85%; max-width: 90%; object-fit: contain; object-position: bottom; left: 50%; bottom: 0; transform: translateX(-50%); }
.player-cover img.photo { inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; transform: none; }
.player-cover img:not([src]), .player-cover img[src=""] { display: none; }
.player-cover .play {
  position: absolute; inset: 0; margin: auto; width: 90px; height: 90px; border-radius: 50%;
  display: grid; place-items: center; padding-left: 6px;
  background: #fff; color: var(--red); font-size: 2.2rem; box-shadow: var(--shadow);
  transition: transform .2s;
}
.player-cover:hover .play { transform: scale(1.12); }
.player-cover .tag {
  position: absolute; top: 16px; left: 16px; padding: 4px 14px; border-radius: 99px;
  background: var(--yellow); color: var(--ink); font-family: var(--font-display); font-weight: 600;
}
.watch-copy h2 { color: var(--red); }
.chips { list-style: none; padding: 0; margin: 18px 0 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { background: #fff; padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: .95rem; border: 3px solid color-mix(in srgb, var(--cream), #000 7%); }

/* ===== Crew ===== */
.crew-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.crew-card {
  border: 0; cursor: pointer; text-align: center; color: var(--ink); font: inherit;
  border-radius: var(--radius); padding: 22px 18px 24px;
  background: var(--c, #fff);
  box-shadow: var(--shadow);
  transition: transform .2s;
}
.crew-card:hover, .crew-card:focus-visible { transform: translateY(-8px) rotate(-1.5deg); }
.crew-card:nth-child(even):hover { transform: translateY(-8px) rotate(1.5deg); }
.crew-card .pic { background: rgba(255, 255, 255, .55); border-radius: 50%; aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 14px; }
.crew-card img { width: 78%; height: 78%; object-fit: contain; }
.crew-card.wiggle img { animation: wiggle .6s ease; }
.crew-card h3 { font-size: 1.5rem; margin-bottom: 2px; }
.crew-card .role { font-weight: 800; color: var(--ink-soft); margin: 0 0 8px; }
.crew-card .say {
  min-height: 3.2em; margin: 0; font-size: .98rem;
  background: #fff; border-radius: 16px; padding: 8px 12px; position: relative;
}
.crew-card .say::before {
  content: ""; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  border: 10px solid transparent; border-top: 0; border-bottom-color: #fff;
}

/* ===== Episodes ===== */
.episodes { background: var(--episodes-bg, var(--blue)); padding: 130px 0; }
.wave { position: absolute; left: 0; width: 100%; height: 80px; }
.wave.top { top: -1px; }
.wave.bottom { bottom: -1px; }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 36px; }
.filter {
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  border: 3px solid #fff; background: transparent; color: #fff;
  padding: 8px 18px; border-radius: 99px; cursor: pointer; transition: background .15s, color .15s;
}
.filter:hover { background: rgba(255, 255, 255, .2); }
.filter[aria-selected="true"] { background: #fff; color: var(--episodes-bg, var(--blue)); }
.ep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.ep {
  background: #fff; border-radius: var(--radius); overflow: hidden; text-decoration: none;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .15); transition: transform .2s;
  display: flex; flex-direction: column;
}
.ep:hover { transform: translateY(-6px); }
.ep-grid .empty { grid-column: 1 / -1; text-align: center; color: #fff; font-family: var(--font-display); font-size: 1.6rem; margin: 20px 0; }
.ep-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--c); overflow: hidden; }
.ep-thumb::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, .25) 2px, transparent 3px) 0 0 / 22px 22px;
}
.ep-thumb img.mascot { position: absolute; height: 92%; width: auto; max-width: 60%; object-fit: contain; object-position: bottom; right: 6%; bottom: -6%; transition: transform .3s; }
.ep:hover .ep-thumb img.mascot { transform: rotate(-6deg) scale(1.06); }
.ep-thumb img.photo { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.ep-num {
  position: absolute; top: 12px; left: 12px; background: #fff; color: var(--ink);
  font-family: var(--font-display); font-weight: 700; border-radius: 12px; padding: 2px 10px;
}
.ep-time { position: absolute; bottom: 10px; left: 12px; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 800; font-size: .85rem; border-radius: 8px; padding: 2px 8px; }
.ep-body { padding: 16px 20px 22px; }
.ep-body h3 { font-size: 1.3rem; margin-bottom: 4px; color: var(--navy); }
.ep-body p { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.ep-topic { display: inline-block; margin-top: 10px; font-weight: 800; font-size: .85rem; color: var(--blue); }

/* ===== Facts (flip cards) ===== */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.fact { perspective: 900px; border: 0; padding: 0; background: none; cursor: pointer; aspect-ratio: 3 / 4; font: inherit; }
.fact-inner { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); transform-style: preserve-3d; }
.fact.flipped .fact-inner { transform: rotateY(180deg); }
.fact-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 20px; text-align: center; box-shadow: var(--shadow);
}
.fact-front { background: var(--c); color: #fff; }
.fact-front .q { font-family: var(--font-display); font-size: 4rem; line-height: 1; }
.fact-front span:last-child { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.fact-back { background: #fff; transform: rotateY(180deg); border: 5px solid var(--c); font-weight: 700; font-size: 1.05rem; }
.fact-back b { font-family: var(--font-display); font-size: 2rem; color: var(--c); }

/* ===== Grown-ups ===== */
.grownups { background: color-mix(in srgb, var(--green) 14%, #fff); }
.grown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.grownups h2 { color: var(--navy); }
.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.perks li { display: flex; gap: 16px; align-items: center; background: #fff; padding: 16px 20px; border-radius: 20px; box-shadow: 0 5px 0 rgba(35, 38, 74, .08); }
.perks span { font-size: 2rem; }
.perks b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--green); }

/* ===== Subscribe ===== */
.sub-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 30px;
  background: var(--red); color: #fff; border-radius: 40px; padding: 30px 50px;
  box-shadow: 0 12px 0 color-mix(in srgb, var(--red), #000 20%);
}
.sub-card h2 { margin: 0; font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.sub-card p { margin: 6px 0 0; font-weight: 700; }
.sub-pal { width: 130px; height: 143px; object-fit: contain; object-position: bottom; margin: -70px 0 -20px; animation: bob 2.4s ease-in-out infinite; }

/* ===== Footer ===== */
.site-footer { position: relative; margin-top: 40px; background: var(--green); color: #fff; text-align: center; }
.site-footer .hills { position: absolute; top: -119px; height: 120px; }
.site-footer .hills path { fill: var(--green); }
.hill-a { fill: color-mix(in srgb, var(--green), #fff 30%); }
.hill-b { fill: var(--green); }
.hill-c { fill: var(--cream); }
.footer-inner { padding: 10px 16px 40px; }
.footer-inner p { margin: 6px 0; font-weight: 700; }
.logo.small { justify-content: center; }
.logo.small span { color: #fff; font-size: 1.8rem; }
.logo.small b { color: var(--yellow); }
.fine { font-size: .85rem; opacity: .9; }

/* ===== Animations ===== */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes drift { 0% { left: 46%; opacity: 0; } 8% { opacity: .95; } 100% { left: 110%; opacity: .95; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg) scale(1.08); } 75% { transform: rotate(10deg) scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-bottom: 150px; }
  .hero-copy { margin-inline: auto; }
  .lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-crew { max-width: 520px; margin: 30px auto -60px; }
  .sun { width: 80px; height: 80px; top: 24px; }
  .cloud { display: none; } /* no room for clouds next to the headline on small screens */
  .watch-grid, .grown-grid { grid-template-columns: 1fr; }
  .crew-grid, .facts { grid-template-columns: repeat(2, 1fr); }
  .ep-grid { grid-template-columns: repeat(2, 1fr); }
  .sub-card { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 30px 24px; }
  .sub-pal { margin: -80px 0 0; }
}
@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 6px; padding: 16px; background: #fff; border-bottom: 4px solid var(--yellow);
  }
  .nav.open { display: flex; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .section { padding: 64px 0; }
  .ep-grid { grid-template-columns: 1fr; }
  .crew-grid, .facts { gap: 14px; }
  .crew-card { padding: 14px 10px 16px; }
  .crew-card h3 { font-size: 1.2rem; }
  .crew-card .say { font-size: .85rem; }
}

/* ===== 404 page ===== */
.not-found {
  min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 6px;
  padding: 40px 16px; text-align: center;
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
}
.not-found img { width: 160px; height: auto; animation: bob 2.6s ease-in-out infinite; }
.not-found h1 { font-size: clamp(2rem, 6vw, 3.2rem); color: #fff; text-shadow: 0 4px 0 var(--navy); margin-top: 10px; }
.not-found p { font-weight: 700; color: var(--navy); margin: 0 0 18px; }
