/* ==========================================================================
   LittleOcho.com — The Learning Lagoon
   Sunshine above, ocean below. Every token comes from claude.md §3.
   ========================================================================== */

:root {
  --sunshine: #FFD93D;
  --coral: #EF5350;
  --meadow: #66BB6A;
  --lavender: #9C6FD6;
  --lagoon: #26A69A;
  --sky: #E0F7FA;
  --navy: #1A1A2E;
  --white: #FAFAFA;
  --grey: #6B7280;
  --font-display: "Fredoka One", "Comic Sans MS", cursive;
  --font-body: "Nunito", "Segoe UI", sans-serif;
  --radius: 20px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lift: 0 12px 32px rgba(0, 0, 0, 0.14);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--navy);
  background: var(--sky);
}

img { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); }
h3 { font-size: 1.4rem; }

.container {
  width: min(1200px, 100% - 2.5rem);
  margin-inline: auto;
}

.section { padding: 4.5rem 0; }

.section-sub {
  color: var(--grey);
  margin-top: -0.25rem;
  margin-bottom: 2rem;
}

/* --- Accessibility ------------------------------------------------------ */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 12px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--lagoon);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-decoration: none;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-sun { background: var(--sunshine); color: var(--navy); box-shadow: var(--shadow); }
.btn-navy { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  color: var(--navy);
  border: 3px solid var(--navy);
  padding: 0.7rem 1.65rem;
}
.btn-small { font-size: 0.95rem; padding: 0.5rem 1.2rem; }

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(8px);
  transition: box-shadow 0.25s ease;
}
.site-header.scrolled { box-shadow: 0 2px 16px rgba(26, 26, 46, 0.12); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
}

.logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1;
}
.logo-little {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.45em;
  color: var(--grey);
  margin-left: 0.3rem;
}
.logo-word {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.9rem;
}
.logo-sunny {
  width: 1.7rem;
  height: 1.7rem;
  margin-right: 0.1rem;
  animation: wiggle 0.9s ease-in-out 0.4s 1;
}
.lc { color: var(--coral); }
.lh { color: var(--meadow); }
.lo { color: var(--lavender); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.site-nav > a:not(.btn) {
  font-weight: 800;
  text-decoration: none;
  color: var(--navy);
  transition: color 0.2s ease;
}
.site-nav > a:not(.btn):hover { color: var(--lavender); }

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #FFF6D8 0%, #D9F4F7 78%, #C9EEF2 100%);
  padding: 4rem 0 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 2rem;
  padding-bottom: 5.5rem;
}

.hero-text { animation: fadeUp 0.6s ease both; }
.hero-sub { font-size: 1.25rem; max-width: 34rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.75rem; }

.hero-art { position: relative; text-align: center; }
.hero-ocho {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 18px 22px rgba(26, 26, 46, 0.18));
  animation: float 3s ease-in-out infinite;
}
.hero-rojo {
  position: absolute;
  bottom: -6px;
  left: -2%;
  z-index: 1;
  width: 190px;
  height: auto;
  filter: drop-shadow(0 12px 16px rgba(26, 26, 46, 0.16));
  animation: float 3.8s ease-in-out 0.4s infinite;
}
.hero-sun {
  position: absolute;
  top: -2.5rem;
  right: 8%;
  z-index: 1;
  animation: float 4.5s ease-in-out 0.7s infinite;
}

.wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  line-height: 0;
}
.wave svg { width: 100%; height: 64px; display: block; }

/* Floating bubbles */
.bubble {
  position: absolute;
  border-radius: 50%;
  border: 3px solid rgba(38, 166, 154, 0.25);
  background: rgba(255, 255, 255, 0.25);
  animation: rise 9s linear infinite;
}
.b1 { width: 26px; height: 26px; left: 6%;  bottom: -30px; animation-duration: 11s; }
.b2 { width: 14px; height: 14px; left: 16%; bottom: -20px; animation-delay: 2.5s; }
.b3 { width: 34px; height: 34px; left: 45%; bottom: -40px; animation-delay: 1.2s; animation-duration: 13s; }
.b4 { width: 18px; height: 18px; left: 70%; bottom: -20px; animation-delay: 4s; }
.b5 { width: 24px; height: 24px; left: 86%; bottom: -28px; animation-delay: 0.6s; animation-duration: 10s; }
.b6 { width: 12px; height: 12px; left: 58%; bottom: -16px; animation-delay: 5.5s; }

/* --- Shows grid ----------------------------------------------------------- */

.shows { background: var(--sky); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
}

.filter-pill {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--navy);
  background: #fff;
  border: 3px solid transparent;
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.filter-pill:hover { border-color: var(--sunshine); transform: translateY(-2px); }
.filter-pill.is-active {
  background: var(--sunshine);
  animation: bounce 0.35s ease;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.75rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover, .card:focus-within {
  transform: scale(1.04);
  box-shadow: var(--shadow-lift);
}
.card.is-hidden { display: none; }

.card-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  cursor: pointer;
  background: var(--navy);
  aspect-ratio: 16 / 9;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-thumb .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3rem;
  color: #fff;
  background: rgba(26, 26, 46, 0);
  transition: background 0.2s ease;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.card-thumb:hover .play, .card-thumb:focus-visible .play { background: rgba(26, 26, 46, 0.28); }

.card-body {
  padding: 1.1rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  font-weight: 800;
}
.badge {
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.badge-lavender { background: var(--lavender); }
.badge-coral { background: var(--coral); }
.badge-meadow { background: var(--meadow); }
.badge-lagoon { background: var(--lagoon); }
.card-count { color: var(--grey); }

.card h3 { margin: 0; }
.card-blurb { margin: 0; font-size: 1rem; color: var(--grey); flex: 1; }

.card-watch {
  align-self: flex-start;
  margin-top: 0.75rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--coral);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}
.card-watch:hover { color: var(--lavender); }

/* --- Featured (deeper water) ---------------------------------------------- */

.featured {
  background: linear-gradient(180deg, #14606B 0%, #1A1A2E 100%);
  color: #fff;
}
.featured .section-sub { color: #B5DDE2; }

.video-frame {
  max-width: 880px;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* --- About ----------------------------------------------------------------- */

.about { background: var(--white); }

.about-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 3rem;
}
.about-art img { animation: float 4s ease-in-out infinite; }
.about-photo {
  border-radius: 36px;
  box-shadow: var(--shadow-lift);
  object-fit: cover;
  display: block;
}

/* Ocho comes alive: 3D tilt follows the cursor, dance on arrival/click */
.tilt-card {
  display: inline-block;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 36px;
  transition: transform 0.18s ease-out;
  will-change: transform;
}
.tilt-card:focus-visible {
  outline: 3px solid var(--lagoon);
  outline-offset: 4px;
}
.tilt-card.is-dancing .about-photo {
  animation: ochoDance 0.9s ease;
}

@keyframes ochoDance {
  0%, 100% { transform: rotate(0deg) scale(1); }
  15% { transform: rotate(-7deg) scale(1.05, 0.95); }
  30% { transform: rotate(6deg) scale(0.96, 1.06); }
  45% { transform: rotate(-5deg) scale(1.04, 0.97); }
  60% { transform: rotate(4deg) scale(0.98, 1.03); }
  78% { transform: rotate(-2deg) scale(1.01, 0.99); }
}
.about-kids { font-size: 1.25rem; font-weight: 700; }
.about-parents { color: var(--grey); max-width: 44rem; }

/* --- Subscribe banner -------------------------------------------------------- */

.subscribe { background: var(--sunshine); }
.subscribe-inner { text-align: center; }
.subscribe h2 { margin-bottom: 0.25rem; }
.subscribe p { margin-top: 0; font-weight: 700; }

/* --- Footer ------------------------------------------------------------------ */

.site-footer {
  background: var(--navy);
  color: #C9CCE3;
  font-size: 0.875rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.6rem 0;
}
.footer-logo { font-family: var(--font-display); font-size: 1.2rem; color: #fff; }
.footer-badge {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-weight: 800;
}

/* --- Friends (character page) --------------------------------------------------- */

.friends-intro { background: linear-gradient(180deg, #FFF6D8 0%, #E0F7FA 100%); padding-bottom: 2.5rem; }

.char-section:nth-of-type(odd) { background: var(--white); }
.char-section:nth-of-type(even) { background: var(--sky); }

.char-inner {
  display: grid;
  grid-template-columns: 340px 1fr;
  align-items: center;
  gap: 3rem;
}
.char-flip { grid-template-columns: 1fr 340px; }
.char-flip .char-art { order: 2; }
.char-flip .char-text { order: 1; }

.char-art { text-align: center; }
.char-art img { animation: float 4s ease-in-out infinite; filter: drop-shadow(0 14px 18px rgba(26, 26, 46, 0.14)); }

.char-text .badge { display: inline-block; margin-bottom: 0.5rem; }
.char-bio { font-size: 1.15rem; max-width: 40rem; }

.fact-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 0.4rem;
}
.fact-list li {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  max-width: 38rem;
}
.char-section:nth-of-type(odd) .fact-list li { background: var(--sky); }

.catchphrase {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--navy);
  background: var(--sunshine);
  border-radius: 999px;
  padding: 0.5rem 1.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .char-inner, .char-flip { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }
  .char-flip .char-art { order: 0; }
  .char-art img { width: min(240px, 64vw); height: auto; }
  .fact-list li { text-align: left; }
}

/* --- Video modal -------------------------------------------------------------- */

.modal { position: fixed; inset: 0; z-index: 300; }
.modal[hidden] { display: none; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.85);
}

.modal-box {
  position: relative;
  width: min(900px, 92vw);
  margin: 8vh auto 0;
  animation: fadeUp 0.3s ease both;
}

.modal-player {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.modal-player iframe { width: 100%; height: 100%; border: 0; display: block; }

.modal-close {
  position: absolute;
  top: -3.2rem;
  right: 0;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--navy);
  background: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.modal-close:hover { transform: scale(1.1) rotate(90deg); }

body.modal-open { overflow: hidden; }

/* --- Reveal on scroll ------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* --- Animations -------------------------------------------------------------------- */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}
@keyframes bounce {
  0% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes rise {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(-560px); opacity: 0; }
}

/* --- Reduced motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  .bubble { display: none; }
}

/* --- Responsive ----------------------------------------------------------------------- */

@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding-bottom: 4.5rem;
  }
  .hero-text { order: 1; }
  .hero-art { order: 0; margin-top: -1rem; }
  .hero-ocho { width: min(280px, 68vw); height: auto; }
  .hero-rojo { width: 120px; left: 0; bottom: 0; }
  .hero-sun { width: 80px; height: 80px; top: -1.25rem; right: 4%; }
  .hero-ctas { justify-content: center; }
  .about-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }
  .about-art img { width: 180px; height: 180px; }
  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .section { padding: 3.25rem 0; }
  .header-inner { gap: 0.5rem; }
  .site-nav { gap: 0.6rem; }
  .nav-about { display: none; }
  .site-nav > a:not(.btn) { font-size: 0.9rem; }
  .site-nav .btn-small { font-size: 0.85rem; padding: 0.4rem 0.85rem; }
  .logo-word { font-size: 1.45rem; }
  .logo-little { font-size: 0.6rem; letter-spacing: 0.38em; }
  .hero { padding-top: 2.5rem; }
  .btn { font-size: 1rem; padding: 0.75rem 1.5rem; }
  .modal-box { margin-top: 12vh; }
  .modal-close { top: -3rem; }
}
