/* ============================================================
 * kids.css — "cartoon world" design system shared by every page
 *   sky + hills + rainbow scene, गजू the elephant mascot,
 *   candy 3D buttons, speech bubbles, bottom tab bar on phones,
 *   stars counter, scroll-reveal motion.
 * Motion only runs when kids.js adds `html.motion` (skipped for
 * prefers-reduced-motion), so nothing is ever hidden without JS.
 * ============================================================ */

/* Self-hosted (SIL OFL) — Google-hosted copies were sometimes not ready
 * when Chrome printed, so the printed book fell back to Windows fonts. */
@font-face {
  font-family: 'Baloo 2';
  src: url('fonts/web/baloo2-deva.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('fonts/web/baloo2-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Serif Devanagari';
  src: url('fonts/web/notoserifdeva-deva.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: 'Noto Serif Devanagari';
  src: url('fonts/web/notoserifdeva-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Kids Brahmi';
  src: url('fonts/NotoSansBrahmi-Regular.ttf') format('truetype');
  font-display: swap;
  unicode-range: U+11000-1107F;
}
@font-face {
  font-family: 'JinShashan Brahmi';
  src: url('fonts/JinShashanBrahmi-Regular.ttf') format('truetype');
  font-display: swap;
  unicode-range: U+11000-1107F;
}

:root {
  --sun: #FFC93C;    --sun-d: #E0A100;
  --orange: #FF8A3D; --orange-d: #D9631A;
  --pink: #FF5C8A;   --pink-d: #D63A68;
  --sky: #3EC1F3;    --sky-d: #1C93C4;
  --leaf: #3DC46F;   --leaf-d: #239A50;
  --grape: #8B5CF6;  --grape-d: #6A3BD6;
  --red: #F25555;    --red-d: #C93636;
  --ink: #2B2140;    --ink-soft: #5B4E73;
  --cream: #FFF8E7;  --paper: #FFFFFF;
  --line: #F2E3C2;
  --font-fun: 'Baloo 2', 'Kids Brahmi', 'Noto Sans Devanagari', system-ui, sans-serif;
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --nav-h: 64px;
  --tabbar-h: 0px;
}

.hidden { display: none !important; }
html.motion { scroll-behavior: smooth; }

body.kids {
  margin: 0;
  min-height: 100vh;
  background: #CFEFFF;
  color: var(--ink);
  font-family: var(--font-fun);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: var(--tabbar-h);
}
/* the sky — fixed so it stays put while pages scroll over it */
body.kids::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 500px at 50% 115%, #F1FFE8 0%, transparent 60%),
    linear-gradient(180deg, #7FD3FF 0%, #B5E6FF 40%, #E3F6FF 78%, #F4FBFF 100%);
}
body.kids header,
body.kids main,
body.kids footer { position: relative; z-index: 2; }

/* ---------- Scene (built by kids.js) ---------- */
.kid-sky {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.kid-sky .rainbow {
  position: absolute;
  left: -90px;
  top: 70px;
  width: 380px;
  height: 190px;
  border-radius: 380px 380px 0 0;
  background: radial-gradient(circle at 50% 100%,
    transparent 50%, #FF5C8A 50% 56%, #FF8A3D 56% 62%, #FFC93C 62% 68%,
    #3DC46F 68% 74%, #3EC1F3 74% 80%, #8B5CF6 80% 86%, transparent 86%);
  opacity: .4;
}
.kid-sky .scene-sun {
  position: absolute;
  right: 4vw;
  top: calc(var(--nav-h) + 18px);
  width: 120px;
  height: 120px;
  opacity: .95;
}
.kid-sky .cloud {
  position: absolute;
  top: var(--y);
  left: -260px;
  width: var(--w);
  height: calc(var(--w) * .36);
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 10px 0 rgba(43, 33, 64, .05);
  animation: kidCloud var(--d) linear var(--delay) infinite;
}
.kid-sky .cloud::before,
.kid-sky .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.kid-sky .cloud::before { width: 48%; height: 125%; left: 16%; top: -58%; }
.kid-sky .cloud::after  { width: 36%; height: 100%; right: 16%; top: -42%; }
@keyframes kidCloud { to { transform: translateX(calc(100vw + 520px)); } }

/* Balloons with Brahmi letters — tap to pop */
.balloon {
  position: absolute;
  bottom: -140px;
  left: var(--x);
  width: 58px;
  height: 70px;
  pointer-events: auto;
  cursor: pointer;
  border: 0;
  padding: 0;
  border-radius: 50% 50% 47% 47% / 56% 56% 44% 44%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .75) 0 9%, transparent 10%),
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .35), transparent 55%),
    var(--c);
  color: #fff;
  font: 400 1.6rem/70px 'Kids Brahmi', serif;
  text-align: center;
  box-shadow: inset -6px -8px 0 rgba(0, 0, 0, .12);
  animation: kidBalloon var(--d) linear var(--delay) infinite;
}
.balloon::before {               /* knot */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 9px;
  transform: translateX(-50%);
  background: var(--c);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.balloon::after {                /* string */
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 56px;
  margin-top: 6px;
  background: rgba(43, 33, 64, .35);
  border-radius: 2px;
}
@keyframes kidBalloon {
  0%   { transform: translate3d(0, 0, 0) rotate(-4deg); }
  25%  { transform: translate3d(var(--sway), -32vh, 0) rotate(4deg); }
  50%  { transform: translate3d(0, -64vh, 0) rotate(-4deg); }
  75%  { transform: translate3d(calc(var(--sway) * -1), -96vh, 0) rotate(4deg); }
  100% { transform: translate3d(0, -130vh, 0) rotate(-4deg); }
}
.balloon.popped { animation: none; pointer-events: none; }

.kid-sky .hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 130px;
}

/* ---------- Top nav ---------- */
.kid-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--nav-h);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #fff;
  box-shadow: 0 4px 0 rgba(43, 33, 64, .06);
}
.kid-nav::after {                /* rainbow ribbon under the bar */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 5px;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--sun), var(--leaf), var(--sky), var(--grape));
}
.kid-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.3rem;
  white-space: nowrap;
  margin-right: auto;
}
.kid-logo .gaju-mini { width: 48px; height: 46px; display: inline-block; }
.kid-logo-img { width: 48px; height: 48px; object-fit: contain; flex: 0 0 auto; }
.kid-links { display: flex; align-items: center; gap: 8px; }
.kid-tools { display: flex; align-items: center; gap: 8px; }
.kid-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #FFF4C7;
  box-shadow: inset 0 0 0 2.5px var(--sun), 0 3px 0 var(--sun-d);
  font-weight: 800;
  font-size: 1.05rem;
  color: #8A5A00;
}
.kid-stars .ico { display: inline-block; }
.kid-mute {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  background: #EDE9FE;
  box-shadow: inset 0 0 0 2.5px var(--grape), 0 3px 0 var(--grape-d);
  transition: transform .18s var(--ease-bounce);
}
.kid-mute:active { transform: translateY(3px); }

/* ---------- Candy 3D buttons & pills ---------- */
.btn3d,
.kid-link {
  --c: var(--orange);
  --cd: var(--orange-d);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  cursor: pointer;
  font: 800 1.05rem/1.2 var(--font-fun);
  color: #fff;
  background: var(--c);
  padding: 11px 20px;
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--cd), inset 0 -3px 0 rgba(0, 0, 0, .08), inset 0 3px 0 rgba(255, 255, 255, .25);
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s var(--ease-bounce), box-shadow .18s ease, filter .18s ease;
  user-select: none;
}
.btn3d:hover,
.kid-link:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 8px 0 var(--cd), inset 0 -3px 0 rgba(0, 0, 0, .08), inset 0 3px 0 rgba(255, 255, 255, .25); }
.btn3d:active,
.kid-link:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--cd); }
.btn3d:focus-visible,
.kid-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn-sm { padding: 7px 14px; font-size: .95rem; border-radius: 14px; box-shadow: 0 4px 0 var(--cd); }
.btn-sm:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cd); }
.kid-link { padding: 7px 15px; border-radius: 999px; box-shadow: 0 4px 0 var(--cd); font-size: 1rem; }
.kid-link .ico { font-size: 1.15rem; }
.kid-link:hover { transform: translateY(-2px) rotate(-2deg); }
.kid-link[aria-current="page"] {
  background: #fff;
  color: var(--cd);
  box-shadow: inset 0 0 0 3px var(--c), 0 4px 0 var(--cd);
}

/* Colour variants — must come after the button defaults above */
.is-sun    { --c: var(--sun);    --cd: var(--sun-d); }
.is-orange { --c: var(--orange); --cd: var(--orange-d); }
.is-pink   { --c: var(--pink);   --cd: var(--pink-d); }
.is-sky    { --c: var(--sky);    --cd: var(--sky-d); }
.is-leaf   { --c: var(--leaf);   --cd: var(--leaf-d); }
.is-grape  { --c: var(--grape);  --cd: var(--grape-d); }
.is-red    { --c: var(--red);    --cd: var(--red-d); }
.btn3d.is-sun, .kid-link.is-sun { color: var(--ink); }

/* ---------- Cards ---------- */
.kid-card {
  --card-c: #FFD27A;
  background: var(--paper);
  border: 4px solid var(--card-c);
  border-radius: 28px;
  box-shadow: 0 8px 0 rgba(43, 33, 64, .10);
}

/* ---------- गजू the elephant (SVG injected by kids.js into [data-gaju]) ---------- */
.gaju { width: 100%; height: 100%; display: block; overflow: visible; }
.gaju-ear-l { transform-origin: 62px 50px; }
.gaju-ear-r { transform-origin: 98px 50px; }
.gaju-trunk { transform-origin: 80px 74px; }
.gaju-eye   { transform-box: fill-box; transform-origin: center; }
/* Animate only while the mascot is on screen — kids.js toggles .awake.
 * (SVG part animations run on the main thread, so dozens of off-screen
 * elephants flapping their ears used to drag scrolling down to ~10 fps.) */
.awake > .gaju        { animation: kidBob 3.4s ease-in-out infinite; }
.awake .gaju-ear-l    { animation: earL 2.6s ease-in-out infinite; }
.awake .gaju-ear-r    { animation: earR 2.6s ease-in-out infinite; }
.awake .gaju-trunk    { animation: trunk 3s ease-in-out infinite; }
.awake .gaju-eye      { animation: kidBlink 4.8s infinite; }
@keyframes earL  { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-10deg); } }
@keyframes earR  { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(10deg); } }
@keyframes trunk { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(8deg); } }

/* Smiling sun in the sky: rays spin on their own HTML layer (GPU-composited) */
.buddy { width: 100%; height: 100%; overflow: visible; display: block; }
.sun-rays, .sun-face { position: absolute; inset: 0; }
.sun-rays { animation: kidSpin 24s linear infinite; }
@keyframes kidSpin  { to { transform: rotate(360deg); } }
@keyframes kidBlink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes kidBob   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Speech bubble: <div class="say"><div class="say-mascot" data-gaju></div><div class="say-bubble">…</div></div> ---------- */
.say {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.say-mascot { width: 92px; height: 86px; flex-shrink: 0; }
.say-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 26px;
  padding: 12px 18px;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 6px 0 rgba(43, 33, 64, .15);
  margin-bottom: 26px;
}
.say-bubble::before,
.say-bubble::after {             /* tail pointing at the mascot */
  content: "";
  position: absolute;
  left: -18px;
  bottom: 14px;
  border: 12px solid transparent;
  border-right: 18px solid var(--ink);
  border-left: 0;
}
.say-bubble::after { left: -11px; bottom: 17px; border-width: 9px; border-right: 13px solid #fff; border-left: 0; }
.say-bubble b, .say-bubble strong { color: var(--pink-d); }
html.motion .reveal.in .say-bubble,
html.motion .say.pop-now .say-bubble { animation: kidBubble .6s var(--ease-bounce) .15s both; }
@keyframes kidBubble {
  from { opacity: 0; transform: scale(.6) translateX(-20px); transform-origin: 0 100%; }
  to   { opacity: 1; transform: none; }
}

/* ---------- Generic motion helpers ---------- */
@keyframes kidPop {
  from { opacity: 0; transform: scale(.5) translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes kidDrop {
  0%   { opacity: 0; transform: translateY(-30px) scale(.9); }
  60%  { opacity: 1; transform: translateY(5px) scale(1.04); }
  100% { opacity: 1; transform: none; }
}
@keyframes kidWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-7deg); }
  75% { transform: rotate(7deg); }
}
@keyframes kidBoing {
  0% { transform: scale(1); }
  30% { transform: scale(1.22, .82); }
  50% { transform: scale(.9, 1.1); }
  70% { transform: scale(1.05, .96); }
  100% { transform: scale(1); }
}
@keyframes kidShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
@keyframes kidShine {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

/* Scroll reveal — hidden only when motion is on */
html.motion .reveal {
  opacity: 0;
  transform: translateY(40px) scale(.96);
  transition: opacity .6s ease, transform .8s var(--ease-bounce);
}
html.motion .reveal.in { opacity: 1; transform: none; }

/* Stagger: children pop in one after another once revealed.
 * `backwards` fill lets hover transforms work after the pop finishes. */
html.motion .reveal:not(.in) .stagger > *,
html.motion .stagger.reveal:not(.in) > * { opacity: 0; }
html.motion .reveal.in .stagger > *,
html.motion .stagger.reveal.in > * {
  animation: kidPop .55s var(--ease-bounce) backwards;
  animation-delay: calc(min(var(--i, 0), 24) * 45ms);
}

/* one-shot effects; !important so they also beat the stagger pop */
.boing { animation: kidBoing .55s ease !important; }
.shake { animation: kidShake .45s ease !important; }

/* ---------- Reading progress + back-to-top rocket ---------- */
.kid-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  z-index: 60;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--sun), var(--leaf), var(--sky), var(--grape));
  border-radius: 0 7px 7px 0;
  pointer-events: none;
}
.kid-top {
  position: fixed;
  right: 16px;
  bottom: calc(18px + var(--tabbar-h));
  z-index: 50;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.7rem;
  opacity: 0;
  transform: translateY(24px) scale(.6);
  pointer-events: none;
}
.kid-top.show { opacity: 1; transform: none; pointer-events: auto; }
.kid-top.launch { animation: kidLaunch .9s ease-in forwards; }
@keyframes kidLaunch {
  0%   { transform: none; }
  30%  { transform: translateY(6px) rotate(-8deg); }
  100% { transform: translateY(-110vh) rotate(0); opacity: 0; }
}

/* "+1 ⭐" toast and confetti */
.kid-confetti {
  position: fixed;
  width: 10px;
  height: 14px;
  z-index: 100;
  pointer-events: none;
  border-radius: 2px;
}
.kid-toast {
  position: fixed;
  left: 50%;
  top: calc(var(--nav-h) + 24px);
  z-index: 90;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 999px;
  background: #fff;
  border: 4px solid var(--sun);
  box-shadow: 0 6px 0 var(--sun-d);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
  pointer-events: none;
  animation: kidToast 1.8s var(--ease-bounce) forwards;
}
@keyframes kidToast {
  0%   { opacity: 0; transform: translate(-50%, -20px) scale(.6); }
  15%  { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  25%  { transform: translate(-50%, 0) scale(1); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -14px); }
}

/* Footer */
.kid-footer {
  text-align: center;
  padding: 26px 16px 150px;
  color: var(--ink-soft);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.7;
}
.kid-footer .site-name { color: var(--orange-d); font-weight: 800; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin-bottom: 10px; }
.foot-links a {
  padding: 2px 12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--line);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.foot-links a:hover { box-shadow: inset 0 0 0 2px var(--orange); color: var(--orange-d); }

/* ---------- Phones: app-style bottom tab bar ---------- */
@media screen and (max-width: 720px) {
  :root { --nav-h: 58px; --tabbar-h: 74px; }
  .kid-nav { padding: 6px 12px; }
  .kid-logo { font-size: 1.15rem; }
  .kid-logo .gaju-mini { width: 42px; height: 40px; }
  .kid-logo-img { width: 42px; height: 42px; }
  .kid-links {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 4px solid var(--sun);
    box-shadow: 0 -6px 0 rgba(43, 33, 64, .06);
  }
  .kid-link {
    flex-direction: column;
    gap: 0;
    padding: 4px 2px 3px;
    border-radius: 16px;
    font-size: .8rem;
  }
  .kid-link .ico { font-size: 1.55rem; line-height: 1.1; }
  .kid-link:hover { transform: none; }
  .kid-sky .rainbow { width: 240px; height: 120px; top: 60px; left: -80px; }
  .kid-sky .scene-sun { width: 84px; height: 84px; }
  .kid-sky .hills { height: 90px; bottom: var(--tabbar-h); }
  .balloon { width: 48px; height: 58px; line-height: 58px; font-size: 1.3rem; }
  .say-mascot { width: 76px; height: 72px; }
  .say-bubble { font-size: 1rem; padding: 10px 14px; border-radius: 22px; border-width: 3px; }
  .kid-footer { padding-bottom: 60px; }
}

/* ---------- Reduced motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  .balloon, .kid-sky .cloud { display: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
@media print {
  .kid-sky, .kid-progress, .kid-top, .kid-nav, .kid-links, .chapter-bar, .kid-confetti, .kid-toast,
  .jt-strip, .kid-spark { display: none !important; }
  body.kids { background: #fff; padding: 0; }
  body.kids::before { display: none; }
  html.motion .reveal,
  html.motion .stagger > * { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* ============================================================
 * Main-site strip, designer credit, and more motion (2026-11)
 * ============================================================ */

/* thin navy strip on top: back to jainismthinker.org */
.jt-strip {
  position: relative;
  z-index: 41;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  box-sizing: border-box;
  padding: 4px 16px;
  background: #1B2653;
  color: #E6EBFF;
  font-size: .85rem;
  font-weight: 600;
}
.jt-strip a { color: #fff; text-decoration: none; }
.jt-home { display: inline-flex; align-items: center; gap: 8px; }
.jt-home img { width: 22px; height: 22px; border-radius: 6px; background: #fff; transition: transform .5s var(--ease-bounce); }
.jt-home:hover img { transform: rotate(-12deg) scale(1.15); }
.jt-home b { color: #FFC93C; }
.jt-sub { opacity: .85; }
.jt-mantra { opacity: .8; }
.jt-back {
  padding: 1px 12px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
  background: linear-gradient(90deg, #F58220, #ffb347 40%, #F58220 60%, #F58220);
  background-size: 250% 100%;
}
html.motion .jt-back { animation: jtShine 3.5s linear infinite; }
@keyframes jtShine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@media screen and (max-width: 720px) {
  .jt-strip { padding: 4px 10px; font-size: .78rem; }
  .jt-mantra { display: none; }
}
@media screen and (max-width: 360px) { .jt-sub { display: none; } }

/* "Designed by E-Public Touch" */
.foot-credit { margin-top: 14px; }
.ept-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 100px;
  background: #fff;
  border: 1px solid #e3e7ec;
  box-shadow: 0 3px 0 rgba(43, 33, 64, .07);
  color: #0a4273;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  transition: transform .25s var(--ease-bounce), box-shadow .25s ease;
}
.ept-badge:hover { color: #0a4273; transform: translateY(-3px); box-shadow: 0 8px 18px rgba(10, 66, 115, .18); }
.ept-badge .ept-pre { color: #9aa1ad; font-weight: 500; font-size: 12px; }
.ept-badge strong { font-weight: 800; }
.ept-badge svg { display: block; flex-shrink: 0; }
html.motion .ept-badge:hover svg { animation: kidSpin 1.1s ease; }

/* page to page: the old page fades up and away, the new one rises in */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .25s ease both; }
::view-transition-new(root) { animation: vtIn .45s var(--ease-bounce) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(22px); } }

/* first paint: content rises in, the menu buttons pop one by one */
html.motion body.kids > main,
html.motion body.kids > header { animation: pageIn .7s var(--ease-bounce) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(18px); } }
html.motion .kid-links > .kid-link { animation: kidPop .5s var(--ease-bounce) backwards; }
html.motion .kid-links > .kid-link:nth-child(2) { animation-delay: .07s; }
html.motion .kid-links > .kid-link:nth-child(3) { animation-delay: .14s; }
html.motion .kid-links > .kid-link:nth-child(4) { animation-delay: .21s; }
.kid-link .ico { display: inline-block; }
html.motion .kid-link[aria-current="page"] .ico { animation: kidBob 2.4s ease-in-out infinite; }
.kid-logo-img { transition: transform .6s var(--ease-bounce); }
.kid-logo:hover .kid-logo-img { transform: rotate(-360deg) scale(1.08); }

/* footer links hop on hover */
.foot-links a { transition: transform .2s var(--ease-bounce), box-shadow .2s ease, color .2s ease; }
.foot-links a:hover { transform: translateY(-3px) rotate(-2deg); }

/* ✨ sparkles: a soft trail behind the mouse, a burst on every tap (kids.js) */
.kid-spark {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  font-size: 15px;
  line-height: 1;
  text-shadow: 0 0 6px rgba(255, 255, 255, .95);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ============================================================
 * Home button (main site) + Jain flag in the strip (2026-11-12)
 * ============================================================ */
html.motion .kid-links > .kid-link:nth-child(5) { animation-delay: .28s; }
.kid-link.kid-home { gap: 5px; }
@media screen and (min-width: 721px) {
  .jt-mantra { display: inline-flex; align-items: center; gap: 6px; }
}
@media screen and (min-width: 721px) and (max-width: 900px) {
  .kid-links { gap: 6px; }
  .kid-link { padding: 7px 11px; }
  .kid-link.kid-home .lbl { display: none; }   /* 🏠 alone, title says where it goes */
}
@media screen and (min-width: 721px) and (max-width: 820px) {
  .kid-link { padding: 7px 8px; font-size: .95rem; }
}

/* ============================================================
 * 3D everywhere, pass 2 (2026-11-12)
 * ============================================================ */
/* page to page: the old page turns away like a book page, the new one swings in */
::view-transition-old(root) { animation: vtTurnOut .42s cubic-bezier(.5, 0, .75, 0) both; transform-origin: 0 50%; }
::view-transition-new(root) { animation: vtTurnIn .62s cubic-bezier(.2, .8, .25, 1) both; transform-origin: 100% 50%; }
@keyframes vtTurnOut { to { opacity: 0; transform: perspective(1600px) rotateY(-55deg) translateZ(40px); } }
@keyframes vtTurnIn { from { opacity: 0; transform: perspective(1600px) rotateY(35deg) translateZ(-160px); } }

/* menu icons spin round in 3D on hover */
@media (hover: hover) and (pointer: fine) {
  html.motion .kid-link:hover .ico { animation: ico3d .8s var(--ease-bounce); }
}
@keyframes ico3d { from { transform: perspective(220px) rotateY(0deg); } to { transform: perspective(220px) rotateY(360deg); } }

/* section titles get a little depth */
.box-title, .bp-title, .faq-title { text-shadow: 0 2px 0 rgba(255, 255, 255, .6), 0 4px 10px rgba(43, 33, 64, .12); }
.j3-title { text-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 0 18px rgba(255, 200, 80, .35); }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
@media screen and (max-width: 720px) {
  .kid-links { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding-left: 6px; padding-right: 6px; }
  .kid-link { font-size: .76rem; }
}