/*
Theme Name: Hands-On Math Kids
Theme URI: https://mrsshandsonmath.org
Author: Mrs. S' Hands-On Math
Description: A modern, playful, kid-friendly theme for Mrs. S' Hands-On Math with animated math doodles, SVG shapes, and extensive Customizer options (colors, hero, about, gallery, contact, testimonials).
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: hands-on-math-kids
*/

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: 'Baloo 2';
  src: url('assets/fonts/baloo2.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'Caveat Brush';
  src: url('assets/fonts/caveat-brush.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Droid Sans';
  src: url('assets/fonts/droid-sans.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* ---------- Design tokens (overridden by Customizer via inline CSS vars) ---------- */
:root {
  --c-primary: #e63946;   /* coral red   */
  --c-secondary: #2a9d8f; /* teal        */
  --c-accent: #ffc93c;    /* sunny yellow*/
  --c-purple: #7c5cbf;
  --c-ink: #2b2d42;
  --c-cream: #fff8ef;
  --c-white: #ffffff;
  --font-display: 'Baloo 2', 'Comic Sans MS', cursive, sans-serif;
  --font-hand: 'Caveat Brush', cursive;
  --font-body: 'Droid Sans', 'Trebuchet MS', sans-serif;
  --radius: 24px;
  --shadow: 0 10px 30px rgba(43, 45, 66, .10);
  --shadow-lift: 0 18px 40px rgba(43, 45, 66, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--c-ink);
  background: var(--c-cream);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  color: var(--c-ink);
  margin: 0 0 .5em;
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; position: relative; }
.text-center { text-align: center; }

.section-kicker {
  font-family: var(--font-hand);
  font-size: 26px;
  color: var(--c-secondary);
  display: block;
  margin-bottom: 4px;
}
.section-title { font-size: clamp(30px, 4.5vw, 46px); }
.squiggle { width: 160px; margin: 4px auto 28px; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: var(--c-white);
  background: var(--c-primary);
  border: 0;
  border-radius: 999px;
  padding: 14px 34px;
  box-shadow: 0 6px 0 rgba(0,0,0,.12);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s;
}
.btn:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 9px 0 rgba(0,0,0,.12); }
.btn:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.btn.btn-secondary { background: var(--c-secondary); }
.btn.btn-ghost {
  background: transparent;
  color: var(--c-primary);
  box-shadow: inset 0 0 0 3px var(--c-primary);
}
.btn.btn-ghost:hover { background: var(--c-primary); color: var(--c-white); }

/* ---------- Announcement ---------- */
.announcement {
  background: var(--c-accent);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-weight: 700;
  text-align: center;
  padding: 8px 16px;
  font-size: 15px;
}
.announcement .megaphone { display: inline-block; animation: wiggle 2.5s ease-in-out infinite; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 239, .92);
  backdrop-filter: blur(8px);
  border-bottom: 3px dashed rgba(43,45,66,.12);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.site-brand .brand-badge { width: 48px; height: 48px; flex: none; }
.site-brand .brand-badge svg { animation: spin-slow 24s linear infinite; }
.site-brand .brand-text {
  font-family: var(--font-hand);
  font-size: 30px;
  line-height: 1;
  color: var(--c-primary);
}
.site-nav ul { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  color: var(--c-ink);
  padding: 8px 18px;
  border-radius: 999px;
  transition: background .2s, color .2s, transform .15s;
  display: inline-block;
}
.site-nav a:hover { background: var(--c-accent); transform: rotate(-2deg); }
.site-nav .current-menu-item a,
.site-nav .current_page_item a { background: var(--c-primary); color: var(--c-white); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 140px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(38px, 5.5vw, 62px);
  margin-bottom: 18px;
}
.hero h1 .highlight {
  color: var(--c-primary);
  position: relative;
  white-space: nowrap;
}
.hero h1 .highlight svg {
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 100%;
  height: 14px;
}
.hero .hero-sub { font-size: 20px; max-width: 480px; margin-bottom: 30px; }
.hero .hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-photo { position: relative; }
.hero-photo .blob {
  position: absolute;
  inset: -10% -8%;
  width: 116%;
  height: 120%;
  z-index: 0;
  animation: blob-float 9s ease-in-out infinite;
}
.hero-photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 42% 58% 55% 45% / 48% 44% 56% 52%;
  border: 8px solid var(--c-white);
  box-shadow: var(--shadow-lift);
}

/* floating math symbols */
.math-doodles { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.math-doodles span {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  opacity: .16;
  animation: float-up-down 6s ease-in-out infinite;
}
.math-doodles span:nth-child(odd) { animation-duration: 8s; }
.math-doodles span:nth-child(3n) { animation-delay: 1.2s; }
.math-doodles span:nth-child(4n) { animation-delay: 2.4s; animation-name: float-rotate; }

/* ---------- Wave dividers ---------- */
.wave { display: block; width: 100%; height: 70px; margin-bottom: -1px; }

/* ---------- Cards ---------- */
.card {
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }

/* ---------- About ---------- */
.about-band { background: var(--c-white); }
.about-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 56px;
  align-items: center;
}
.about-photo { position: relative; }
.about-photo img {
  border-radius: var(--radius);
  transform: rotate(-2deg);
  border: 8px solid var(--c-cream);
  box-shadow: var(--shadow);
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.about-photo .sticker {
  position: absolute;
  top: -26px;
  right: -18px;
  width: 92px;
  height: 92px;
  animation: spin-slow 18s linear infinite;
}
.about-mission {
  font-size: 19px;
  border-left: 6px solid var(--c-accent);
  padding-left: 22px;
  font-style: italic;
}

/* ---------- Feature tiles ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 40px; }
.feature { text-align: center; padding: 36px 26px; }
.feature .icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.feature:nth-child(1) .icon { background: color-mix(in srgb, var(--c-primary) 14%, white); }
.feature:nth-child(2) .icon { background: color-mix(in srgb, var(--c-secondary) 14%, white); }
.feature:nth-child(3) .icon { background: color-mix(in srgb, var(--c-purple) 14%, white); }
.feature:hover .icon svg { animation: wiggle 0.6s ease-in-out; }
.feature h3 { font-size: 22px; }

/* ---------- Gallery (polaroids) ---------- */
.polaroids {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
}
.polaroid {
  background: var(--c-white);
  padding: 12px 12px 40px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt, -2deg));
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
}
.polaroid:nth-child(2n) { --tilt: 2.2deg; }
.polaroid:nth-child(3n) { --tilt: -1.2deg; }
.polaroid:hover { transform: rotate(0deg) scale(1.04); box-shadow: var(--shadow-lift); z-index: 2; }
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.polaroid .tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 90px;
  height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--c-accent) 55%, white);
  opacity: .85;
  border-radius: 3px;
}

/* ---------- Classes ---------- */
.class-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.class-card { position: relative; overflow: hidden; }
.class-card .price-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--c-accent);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  border-radius: 999px;
  padding: 8px 18px;
  transform: rotate(4deg);
  box-shadow: 0 4px 0 rgba(0,0,0,.08);
}
.class-card.is-new::before {
  content: 'NEW!';
  position: absolute;
  top: 26px;
  left: -40px;
  width: 150px;
  text-align: center;
  background: var(--c-secondary);
  color: var(--c-white);
  font-family: var(--font-display);
  font-weight: 800;
  padding: 5px 0;
  transform: rotate(-45deg);
  font-size: 13px;
  letter-spacing: 2px;
  box-shadow: 0 3px 8px rgba(43,45,66,.18);
}
.class-card h3 { font-size: 24px; padding-right: 90px; }
.class-card.is-new .class-emoji { margin: 26px 0 0 40px; }
.class-card .class-emoji { font-size: 40px; line-height: 1; margin-bottom: 10px; display: inline-block; }
.class-card:hover .class-emoji { animation: bounce .6s ease; }

/* ---------- Schedule ---------- */
.schedule-band { background: var(--c-white); }
.schedule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.schedule-card img { border-radius: 14px; width: 100%; }
.schedule-card h3 { font-size: 21px; margin-top: 16px; }

/* ---------- Free class / QR ---------- */
.free-class-card {
  background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 70%, var(--c-purple)));
  color: var(--c-white);
  text-align: center;
  border-radius: var(--radius);
  padding: 56px 32px;
  position: relative;
  overflow: hidden;
}
.free-class-card h2 { color: var(--c-white); font-size: clamp(28px, 4vw, 40px); }
.free-class-card .qr {
  background: var(--c-white);
  border-radius: 18px;
  padding: 14px;
  width: 190px;
  margin: 26px auto;
  transition: transform .2s;
}
.free-class-card .qr:hover { transform: scale(1.05) rotate(2deg); }
.free-class-card .confetti { position: absolute; inset: 0; pointer-events: none; opacity: .25; }

/* ---------- Testimonials ---------- */
.testimonial-grid {
  columns: 2;
  column-gap: 30px;
}
.testimonial-card {
  break-inside: avoid;
  margin-bottom: 30px;
  position: relative;
}
.testimonial-card::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 44px;
  border: 10px solid transparent;
  border-top-color: var(--c-white);
  filter: drop-shadow(0 6px 4px rgba(43,45,66,.06));
}
.testimonial-card .stars { color: var(--c-accent); font-size: 20px; letter-spacing: 3px; margin-bottom: 10px; }
.testimonial-card .t-quote { margin: 0 0 14px; }
.testimonial-card .t-author {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.testimonial-card .t-author .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: color-mix(in srgb, var(--c-secondary) 16%, white);
  flex: none;
}
.testimonial-card .t-date {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(43,45,66,.55);
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-weight: 700;
}

/* ---------- Subscribe ---------- */
.subscribe-band { background: var(--c-white); }
.subscribe-card {
  background: color-mix(in srgb, var(--c-secondary) 10%, white);
  border: 3px dashed var(--c-secondary);
  border-radius: var(--radius);
  text-align: center;
  padding: 52px 28px;
}
.subscribe-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  max-width: 520px;
  margin: 24px auto 0;
}
.subscribe-form input[type="email"] {
  flex: 1;
  font-family: var(--font-body);
  font-size: 16px;
  border: 3px solid var(--c-ink);
  border-radius: 999px;
  padding: 12px 22px;
  outline: none;
  background: var(--c-white);
}
.subscribe-form input[type="email"]:focus { border-color: var(--c-secondary); }
.subscribe-msg {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 26px;
  margin: 4px 0 0;
}
.subscribe-msg.is-success { background: color-mix(in srgb, var(--c-secondary) 18%, white); color: var(--c-secondary); }
.subscribe-msg.is-error { background: color-mix(in srgb, var(--c-primary) 14%, white); color: var(--c-primary); }

/* ---------- Contact strip ---------- */
.contact-strip { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--c-white);
  border-radius: 999px;
  padding: 10px 22px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--c-ink);
  font-family: var(--font-display);
  font-weight: 700;
  transition: transform .15s;
}
.contact-chip:hover { transform: translateY(-3px); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--c-ink);
  color: rgba(255,255,255,.85);
  text-align: center;
  padding: 56px 24px 40px;
  position: relative;
}
.site-footer .footer-brand {
  font-family: var(--font-hand);
  font-size: 32px;
  color: var(--c-accent);
  margin-bottom: 10px;
}
.site-footer .footer-nav { margin-bottom: 16px; }
.site-footer .footer-nav a {
  color: var(--c-white);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 14px;
}
.site-footer .footer-nav a:hover { color: var(--c-accent); }
.site-footer .footer-copy { font-size: 14px; opacity: .7; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { text-align: center; padding: 72px 0 40px; position: relative; overflow: hidden; }
.page-hero h1 { font-size: clamp(34px, 5vw, 52px); }

/* ---------- Scroll animations ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes float-up-down { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes float-rotate { 0%,100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-14px) rotate(8deg); } }
@keyframes blob-float { 0%,100% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(4deg) scale(1.04); } }
@keyframes wiggle { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-14px); } 70% { transform: translateY(-6px); } }

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

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 100px; }
  .hero-photo { max-width: 420px; margin: 0 auto; }
  .features, .polaroids { grid-template-columns: repeat(2, 1fr); }
  .class-cards, .schedule-grid { grid-template-columns: 1fr; }
  .testimonial-grid { columns: 1; }
}
@media (max-width: 560px) {
  .features, .polaroids { grid-template-columns: 1fr; }
  .subscribe-form { flex-direction: column; }
  .site-header .wrap { justify-content: center; }
}
