/* Home page, Sprout layout (templates/tutorials/home.html).
   Ideas: Duolingo's hero (picture + two stacked buttons) and alternating feature rows,
   a subject row like its language bar, Starfall's big framed tiles and ribbon,
   round tiles with pill labels, and a Khan-style "Get started" band.
   Everything uses the site tokens (rgb(var(--c-…))) so palettes and dark mode follow.
   Layouts: phone (one column), tablet (two columns where it fits), computer (wide).
   Hover effects only on devices that can hover; every tap target is at least 44px. */

.sp-home { --sp-max: 1100px; --sp-green: rgb(var(--c-accent-1)); --sp-lip: color-mix(in srgb, rgb(var(--c-accent-1)) 70%, #000); }
.sp-home > * { max-width: var(--sp-max); margin-left: auto; margin-right: auto; }
.sp-center { text-align: center; }
.sp-center-block { display: flex; justify-content: center; }
.sp-section { margin-top: 5.5rem; }
.sp-h2 { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.1; letter-spacing: -.02em; color: rgb(var(--c-ink)); }
.sp-lead { margin: .8rem auto 0; max-width: 40rem; font-size: 1.1rem; color: rgb(var(--c-slate-500)); }
.sp-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; color: rgb(var(--c-accent-2)); }
.sp-link:hover { text-decoration: underline; }
.sp-btn-xl { width: 100%; min-height: 52px; padding: .9rem 1.5rem; font-size: 1rem; }
.sp-btn-lg { min-height: 48px; padding: .75rem 1.4rem; }
.sp-center-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; margin-top: 2.2rem; }

/* ---------- 1. hero ---------- */
.sp-hero { display: grid; gap: 2rem; align-items: center; min-height: min(78vh, 680px); padding: 1rem 0 2rem; }
@media (min-width: 900px) { .sp-hero { grid-template-columns: 1.05fr 1fr; gap: 3.5rem; } }
.sp-hero-copy { text-align: center; max-width: 30rem; margin: 0 auto; }
.sp-kicker { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .9rem; border-radius: 12px; border: 2px solid rgb(var(--c-line));
  font-weight: 800; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: rgb(var(--c-accent-1-dark)); }
.sp-hero-title { margin-top: 1.1rem; font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: clamp(2rem, 4.4vw, 2.9rem); line-height: 1.15;
  letter-spacing: -.015em; color: rgb(var(--c-slate-700)); }
.sp-hero-lead { margin-top: 1rem; font-size: 1.15rem; line-height: 1.55; color: rgb(var(--c-slate-500)); }
.sp-hero-actions { display: grid; gap: .9rem; margin: 1.8rem auto 0; max-width: 22rem; }
.sp-hero-chat { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; margin-top: .9rem; font-weight: 700; color: rgb(var(--c-slate-500)); }
.sp-hero-chat:hover { color: rgb(var(--c-accent-1-dark)); text-decoration: underline; }

/* the picture: Pip with flying cards, stars and coins (pure CSS/SVG, no images to download) */
.sp-hero-art { display: flex; justify-content: center; }
.sp-scene { position: relative; width: min(100%, 460px); aspect-ratio: 1 / .9; }
.sp-blob { position: absolute; inset: 8% 6% 4% 8%; border-radius: 46% 54% 48% 52% / 54% 44% 56% 46%;
  background: radial-gradient(circle at 30% 30%, rgb(var(--c-accent-1-tint)), rgb(var(--c-accent-2-tint)) 70%); }
.sp-card { position: absolute; border-radius: 16px; background: rgb(var(--c-card)); border: 3px solid rgb(var(--c-line)); border-bottom-width: 6px; }
.sp-card-code { left: 2%; top: 10%; width: 52%; padding: .7rem .85rem .9rem; background: #2b211c; border-color: #1a1310; transform: rotate(-7deg);
  display: flex; flex-direction: column; gap: .15rem; font-family: "JetBrains Mono", monospace; font-size: clamp(.62rem, 1.55vw, .82rem); color: #e8f1f5; }
.sp-card-code code { white-space: nowrap; }
.sp-dots { display: flex; gap: 5px; margin-bottom: .35rem; }
.sp-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ff6b6b; }
.sp-dots i:nth-child(2) { background: #ffc94a; } .sp-dots i:nth-child(3) { background: #58d26b; }
.sp-k { color: #f0b87a; font-weight: 600; } .sp-s { color: #c5dc9a; font-weight: 600; }
.sp-card-quiz { right: 3%; top: 4%; width: 36%; padding: .7rem; border-color: rgb(var(--c-sun)); transform: rotate(6deg); }
.sp-quiz-bar { display: block; height: 10px; border-radius: 99px; background: rgb(var(--c-line)); overflow: hidden; }
.sp-quiz-bar span { display: block; width: 45%; height: 100%; border-radius: 99px; background: var(--sp-green); }
.sp-quiz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .6rem; }
.sp-quiz-grid span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: rgb(var(--c-line) / .5); font-size: clamp(1rem, 2.6vw, 1.5rem); }
.sp-quiz-badge { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); padding: .1rem .7rem; border-radius: 8px; background: rgb(var(--c-sun));
  color: #3c2a00; font-weight: 800; font-size: .8rem; box-shadow: 0 3px 0 color-mix(in srgb, rgb(var(--c-sun)) 70%, #000); }
.sp-pip { position: absolute; left: 22%; bottom: 2%; width: 62%; animation: sp-bob 4.5s ease-in-out infinite; }
.sp-pip .pip-svg { width: 100%; height: auto; display: block; }
.sp-float { position: absolute; font-size: clamp(1.3rem, 3vw, 2rem); animation: sp-bob 5s ease-in-out infinite; }
.sp-f1 { left: 0; bottom: 30%; animation-delay: .4s; } .sp-f2 { right: 2%; bottom: 36%; animation-delay: 1.2s; }
.sp-f3 { left: 48%; top: 0; animation-delay: .8s; } .sp-f4 { right: 12%; bottom: 4%; animation-delay: 1.8s; }
.sp-coin { position: absolute; width: 7%; aspect-ratio: 1; border-radius: 50%; background: rgb(var(--c-sun)); box-shadow: inset -3px -3px 0 color-mix(in srgb, rgb(var(--c-sun)) 70%, #000); }
.sp-c1 { left: 12%; bottom: 10%; } .sp-c2 { left: 6%; bottom: 20%; width: 5%; } .sp-c3 { right: 26%; top: 44%; width: 4.5%; }
@keyframes sp-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.no-motion .sp-pip, .no-motion .sp-float { animation: none; }
@media (prefers-reduced-motion: reduce) { .sp-pip, .sp-float { animation: none; } }
@media (max-width: 899px) {
  .sp-hero { min-height: 0; padding-top: 0; gap: 1.2rem; }
  .sp-scene { width: min(86%, 380px); }
}

/* ---------- 2. subject row ---------- */
.sp-strip { position: relative; display: flex; align-items: center; gap: .4rem; max-width: none !important; margin-top: 1rem;
  margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; padding: .6rem max(1rem, calc(50vw - 560px));
  border-top: 2px solid rgb(var(--c-line)); border-bottom: 2px solid rgb(var(--c-line)); background: rgb(var(--c-paper)); }
.sp-strip-track { display: flex; gap: .4rem; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; flex: 1; min-width: 0; }
.sp-strip-track::-webkit-scrollbar { display: none; }
.sp-strip-item { flex: none; display: inline-flex; align-items: center; gap: .6rem; min-height: 48px; padding: .3rem .8rem .3rem .35rem; border-radius: 12px;
  scroll-snap-align: start; font-weight: 800; font-size: .85rem; letter-spacing: .05em; text-transform: uppercase; color: rgb(var(--c-slate-500)); white-space: nowrap; }
.sp-strip-ico { display: grid; place-items: center; width: 40px; height: 32px; border-radius: 8px; font-size: 1.2rem; background: rgb(var(--c-accent-1-tint)); }
.sp-strip-item:nth-child(5n+2) .sp-strip-ico { background: rgb(var(--c-accent-2-tint)); }
.sp-strip-item:nth-child(5n+3) .sp-strip-ico { background: color-mix(in srgb, rgb(var(--c-sun)) 30%, rgb(var(--c-card))); }
.sp-strip-item:nth-child(5n+4) .sp-strip-ico { background: color-mix(in srgb, rgb(var(--c-grape)) 25%, rgb(var(--c-card))); }
.sp-strip-item:nth-child(5n+5) .sp-strip-ico { background: color-mix(in srgb, rgb(var(--c-leaf)) 25%, rgb(var(--c-card))); }
.sp-strip-arrow { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: 1.8rem; line-height: 1; color: rgb(var(--c-slate-400)); }
@media (hover: hover) {
  .sp-strip-item:hover { background: rgb(var(--c-line) / .45); color: rgb(var(--c-ink)); }
  .sp-strip-arrow:hover { background: rgb(var(--c-line) / .45); color: rgb(var(--c-ink)); }
}
@media (hover: none), (max-width: 639px) { .sp-strip-arrow { display: none; } }

/* ---------- 3. age tiles (big framed pictures with the title on top) ---------- */
.sp-ages { display: grid; gap: 1.4rem; margin-top: 2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sp-age { display: flex; flex-direction: column; align-items: center; gap: .7rem; text-align: center; }
.sp-age-title { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: 2rem; line-height: 1; color: var(--age); }
.sp-age-art { display: grid; grid-template-columns: 1fr 1fr; place-items: center; width: 100%; aspect-ratio: 1.15; padding: 1.2rem; border-radius: 32px;
  border: 6px solid #fff; background: radial-gradient(circle at 30% 25%, rgb(255 255 255 / .45), transparent 45%), var(--age-bg);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--age) 55%, #000), 0 0 0 2px rgb(var(--c-line)); font-size: clamp(2.4rem, 6vw, 3.4rem);
  transition: transform .15s ease, box-shadow .15s ease; }
.sp-age-art span { filter: drop-shadow(0 4px 0 rgb(0 0 0 / .12)); }
.sp-age-sub { font-weight: 800; color: rgb(var(--c-slate-500)); }
.sp-age-kids { --age: #a05214; --age-bg: linear-gradient(160deg, #f2c27b, #d0843c); }
.sp-age-teens { --age: #8b5e3c; --age-bg: linear-gradient(160deg, #d9b08c, #8b5e3c); }
.sp-age-adults { --age: #4f7d32; --age-bg: linear-gradient(160deg, #c5d8a4, #6f8f4a); }
:root[data-theme="dark"] .sp-age-art { border-color: rgb(var(--c-card)); }
:root[data-theme="dark"] .sp-age { --age: rgb(var(--c-accent-2)); }
@media (hover: hover) { .sp-age:hover .sp-age-art { transform: translateY(-4px) rotate(-1deg); } }
.sp-age:active .sp-age-art { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--age) 55%, #000), 0 0 0 2px rgb(var(--c-line)); }
@media (max-width: 639px) {
  .sp-ages { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .6rem; scrollbar-width: none; }
  .sp-age { scroll-snap-align: center; }
}

/* ---------- 4. ribbon of numbers ---------- */
.sp-ribbon { position: relative; margin-top: 4.5rem; padding: 0 1.4rem; }
.sp-ribbon::before, .sp-ribbon::after { content: ""; position: absolute; top: 18px; bottom: -14px; width: 60px; background: color-mix(in srgb, rgb(var(--c-sun)) 80%, #000);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 35% 50%); z-index: -1; }
.sp-ribbon::before { left: -6px; } .sp-ribbon::after { right: -6px; transform: scaleX(-1); }
.sp-ribbon-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 18px; overflow: hidden; border: 4px solid rgb(var(--c-sun));
  background: rgb(var(--c-card)); box-shadow: 0 6px 0 color-mix(in srgb, rgb(var(--c-sun)) 70%, #000); }
@media (min-width: 768px) { .sp-ribbon-in { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sp-ribbon-item { display: flex; align-items: center; justify-content: center; gap: .7rem; padding: 1.1rem .8rem; }
.sp-ribbon-item:nth-child(even) { background: color-mix(in srgb, rgb(var(--c-sun)) 14%, rgb(var(--c-card))); }
.sp-ribbon-ico { font-size: 2rem; }
.sp-ribbon-item p { margin: 0; display: flex; flex-direction: column; line-height: 1.1; }
.sp-ribbon-item b { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.9rem); color: rgb(var(--c-ink)); }
.sp-ribbon-item small { font-weight: 800; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: rgb(var(--c-slate-500)); }
@media (max-width: 639px) { .sp-ribbon::before, .sp-ribbon::after { display: none; } .sp-ribbon { padding: 0; } .sp-ribbon-item { justify-content: flex-start; } }

/* ---------- 5. feature rows ---------- */
.sp-features { margin-top: 6rem; }
.sp-features .sp-h2 { color: rgb(var(--c-accent-1-dark)); }
.sp-feature { display: grid; gap: 1.6rem; align-items: center; margin-top: 3.5rem; }
@media (min-width: 900px) {
  .sp-feature { grid-template-columns: 1fr 1fr; gap: 4rem; margin-top: 5rem; }
  .sp-feature-flip .sp-feature-copy { order: 2; }
}
.sp-feature-title { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.05; letter-spacing: -.02em; color: rgb(var(--c-accent-1-dark)); }
.sp-feature-copy p { margin-top: .9rem; font-size: 1.1rem; line-height: 1.6; color: rgb(var(--c-slate-500)); }
.sp-feature-copy .demo-code { margin-top: 1rem; }
.sp-feature-copy .demo-btn { min-height: 44px; }
.sp-feature-art { margin: 0; padding: 10px; border-radius: 24px; background: rgb(var(--c-card)); border: 3px solid rgb(var(--c-line)); border-bottom-width: 7px; transform: rotate(-1.5deg); }
.sp-feature-flip .sp-feature-art { transform: rotate(1.5deg); }
.sp-feature-art canvas { display: block; width: 100%; height: auto; border-radius: 16px; cursor: pointer; touch-action: manipulation; }
@media (max-width: 899px) { .sp-feature-copy { text-align: center; } .sp-feature-copy .demo-code { text-align: left; } .sp-feature-art { transform: none !important; } }

/* ---------- 6. round tiles with a pill label ---------- */
.sp-circles { display: grid; gap: 2rem 1.2rem; margin-top: 2.2rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.sp-circle { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sp-circle-art { display: grid; place-items: center; width: min(100%, 180px); aspect-ratio: 1; border-radius: 50%; font-size: clamp(3rem, 8vw, 4.4rem);
  border: 6px solid rgb(var(--c-card)); box-shadow: 0 0 0 2px rgb(var(--c-line)), 0 10px 24px -14px rgb(0 0 0 / .35); background: var(--circ, #22b8cf); transition: transform .15s ease; }
.sp-circle:nth-child(5n+1) { --circ: #d9a066; } .sp-circle:nth-child(5n+2) { --circ: #a9744a; } .sp-circle:nth-child(5n+3) { --circ: #7f9a5c; }
.sp-circle:nth-child(5n+4) { --circ: #c98a50; } .sp-circle:nth-child(5n+5) { --circ: #6f8f94; }
.sp-circle-pill { display: flex; flex-direction: column; margin-top: -1.6rem; padding: .55rem 1.1rem; min-width: 75%; border-radius: 999px; background: #8b5e3c; color: #fff;
  box-shadow: 0 4px 0 #5e3d24; line-height: 1.2; position: relative; }
.sp-circle-pill b { font-weight: 800; font-size: .95rem; }
.sp-circle-pill small { font-size: .78rem; opacity: .9; }
@media (hover: hover) { .sp-circle:hover .sp-circle-art { transform: scale(1.04) rotate(-3deg); } }
.sp-circle:active .sp-circle-pill { transform: translateY(3px); box-shadow: 0 1px 0 #5e3d24; }
@media (max-width: 639px) {
  .sp-circles { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .8rem; scrollbar-width: none; }
  .sp-circle { scroll-snap-align: start; }
}

/* ---------- 7. course tiles ---------- */
.sp-courses { display: grid; gap: 1rem; margin-top: 2rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.sp-course { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.2rem 1rem 1.4rem; text-align: center; border-radius: 16px;
  background: rgb(var(--c-card)); border: 2px solid rgb(var(--c-line)); border-bottom-width: 4px; transition: background .15s ease, transform .1s ease; }
.sp-course-mark { display: grid; place-items: center; width: 72px; height: 56px; margin-bottom: .5rem; border-radius: 14px; border: 4px solid rgb(var(--c-card));
  box-shadow: 0 0 0 2px rgb(var(--c-line)); background: var(--sp-green); color: #fff; font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: 1.6rem; }
.sp-course:nth-child(4n+2) .sp-course-mark { background: rgb(var(--c-accent-2-light)); }
.sp-course:nth-child(4n+3) .sp-course-mark { background: rgb(var(--c-sun)); color: #3c2a00; }
.sp-course:nth-child(4n+4) .sp-course-mark { background: rgb(var(--c-grape)); }
.sp-course b { font-weight: 800; color: rgb(var(--c-slate-700)); }
.sp-course small { color: rgb(var(--c-slate-500)); font-weight: 600; }
.sp-course-blurb { margin-top: .3rem; font-size: .85rem; color: rgb(var(--c-slate-500)); }
@media (hover: hover) { .sp-course:hover { background: rgb(var(--c-accent-2-tint) / .5); border-color: rgb(var(--c-accent-2-light) / .6); } }
.sp-course:active { transform: translateY(2px); border-bottom-width: 2px; }
:root[data-theme="dark"] .sp-course-mark { color: #10202a; }

/* ---------- lab categories as framed picture tiles ---------- */
.sp-cats { display: grid; gap: 1.6rem 1.2rem; margin-top: 2.2rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.sp-cat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .55rem; }
.sp-cat-title { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: 1.45rem; line-height: 1.1; color: var(--cat); }
.sp-cat-art { display: grid; place-items: center; width: 100%; aspect-ratio: 1.6; border-radius: 26px; border: 5px solid rgb(var(--c-card)); font-size: 3.6rem;
  background: radial-gradient(circle at 28% 25%, rgb(255 255 255 / .45), transparent 45%), var(--cat-bg);
  box-shadow: 0 0 0 2px rgb(var(--c-line)), 0 5px 0 2px color-mix(in srgb, var(--cat) 45%, #000); transition: transform .15s ease; }
.sp-cat-blurb { font-size: .92rem; color: rgb(var(--c-slate-500)); }
.sp-cat-count { font-weight: 800; color: rgb(var(--c-accent-2)); min-height: 28px; }
.sp-cat:nth-child(6n+1) { --cat: #8b5e3c; --cat-bg: linear-gradient(160deg, #ecd3b4, #b98458); }
.sp-cat:nth-child(6n+2) { --cat: #a05214; --cat-bg: linear-gradient(160deg, #f6d29f, #d78b3e); }
.sp-cat:nth-child(6n+3) { --cat: #4f7d32; --cat-bg: linear-gradient(160deg, #d6e3bd, #7f9a5c); }
.sp-cat:nth-child(6n+4) { --cat: #2f6f73; --cat-bg: linear-gradient(160deg, #c6dfdf, #5f9599); }
.sp-cat:nth-child(6n+5) { --cat: #8a6a12; --cat-bg: linear-gradient(160deg, #f1e0a8, #c9a23c); }
.sp-cat:nth-child(6n+6) { --cat: #a14a4a; --cat-bg: linear-gradient(160deg, #f0cbc3, #c97a6f); }
:root[data-theme="dark"] .sp-cat { --cat: rgb(var(--c-ink)); }
@media (hover: hover) { .sp-cat:hover .sp-cat-art { transform: translateY(-4px) rotate(-1deg); } }

/* ---------- Khan-style band: steps on the left, "Get started" choices on the right ---------- */
.sp-band { max-width: none !important; margin-top: 6rem; margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important;
  padding: 4.5rem 1rem; background: #3b2f2a; color: #fff; }
.sp-band-in { max-width: 1100px; margin: 0 auto; display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .sp-band-in { grid-template-columns: 1.1fr 1fr; gap: 4rem; align-items: start; } }
.sp-band-title { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.015em; }
.sp-steps { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.3rem; }
.sp-steps li { display: flex; gap: 1rem; }
.sp-steps b { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #deaa64; color: #3b2a12;
  font-family: Fredoka, Nunito, sans-serif; font-size: 1.35rem; box-shadow: 0 4px 0 #a87a3a; }
.sp-steps h3 { margin: 0; font-weight: 800; font-size: 1.15rem; }
.sp-steps p { margin: .2rem 0 0; color: #e8dccd; }
.sp-band-pick { display: grid; gap: .7rem; }
.sp-band-pick-title { margin: 0 0 .3rem; font-weight: 800; font-size: 1.15rem; }
.sp-pick { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; padding: .9rem 1.2rem; border-radius: 14px;
  background: #fffbf4; color: #3b2f2a; border: 2px solid #fffbf4; border-bottom: 5px solid #d8c3a8; transition: transform .1s ease, background .15s ease; }
.sp-pick b { display: block; font-weight: 800; font-size: 1.05rem; }
.sp-pick small { display: block; color: #735c4c; }
.sp-pick i { font-style: normal; font-size: 1.8rem; line-height: 1; color: #a05214; }
@media (hover: hover) { .sp-pick:hover { background: #f5ead9; } }
.sp-pick:active { transform: translateY(3px); border-bottom-width: 2px; }
:root[data-theme="dark"] .sp-band { background: #2a201b; }

/* the older sections that stay (paths, plans, tutor, reviews, FAQ, contact) sit on the same rhythm */
.sp-home > section.mt-16 { margin-top: 5.5rem; }
.sp-home .plan-tab { min-height: 44px; border-radius: 12px; font-weight: 800; }
.sp-home details > summary { min-height: 44px; }

/* ---------- hero slider: the intro video, then highlights; a new slide every 3 seconds ---------- */
.sp-slider { position: relative; width: min(100%, 500px); }
.sp-slides { position: relative; aspect-ratio: 1 / .92; border-radius: 28px; overflow: hidden; background: rgb(var(--c-card));
  border: 3px solid rgb(var(--c-line)); border-bottom-width: 8px; }
.sp-slide { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem 1rem 4.6rem;
  opacity: 0; visibility: hidden; transform: translateX(6%); transition: opacity .5s ease, transform .5s ease, visibility 0s linear .5s; }
.sp-slide { background: rgb(var(--c-card)); }
.sp-slide.is-active { z-index: 1; opacity: 1; visibility: visible; transform: none; transition: opacity .5s ease, transform .5s ease, visibility 0s; }
.sp-slide-video { padding: 0; background: #2b211c; }
.sp-slide-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-slide-cap { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; padding: .55rem .9rem; border-radius: 14px;
  background: rgb(var(--c-card) / .94); border: 2px solid rgb(var(--c-line)); line-height: 1.25; text-align: left; }
.sp-slide-cap b { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: 1.1rem; color: rgb(var(--c-ink)); }
.sp-slide-cap span { font-size: .88rem; font-weight: 600; color: rgb(var(--c-slate-500)); }
.sp-slide .sp-scene { width: 88%; }
.sp-term { width: 88%; padding: 1rem 1.1rem 1.2rem; border-radius: 18px; background: #2b211c; border: 3px solid #1a1310; border-bottom-width: 7px; transform: rotate(-2deg);
  display: flex; flex-direction: column; gap: .2rem; font-family: "JetBrains Mono", monospace; font-size: clamp(.72rem, 1.9vw, .98rem); color: #f3eae0; }
.sp-term code { white-space: nowrap; }
.sp-term-out { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed rgb(255 255 255 / .25); color: #c5dc9a; }
.sp-labgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; width: 88%; }
.sp-labgrid span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 20px; font-size: clamp(2rem, 6vw, 3rem); border: 3px solid rgb(var(--c-card));
  box-shadow: 0 0 0 2px rgb(var(--c-line)), 0 5px 0 2px rgb(0 0 0 / .12); background: #ecd3b4; }
.sp-labgrid span:nth-child(2) { background: #c6dfdf; } .sp-labgrid span:nth-child(3) { background: #d6e3bd; }
.sp-labgrid span:nth-child(4) { background: #f1e0a8; } .sp-labgrid span:nth-child(5) { background: #f6d29f; } .sp-labgrid span:nth-child(6) { background: #f0cbc3; }
.sp-quote { margin: 0; width: 88%; padding: 1.3rem 1.3rem 1.2rem; border-radius: 20px; background: rgb(var(--c-accent-2-tint)); border: 2px solid rgb(var(--c-line)); border-bottom-width: 5px; text-align: left; }
.sp-quote-stars { color: rgb(var(--c-accent-2)); font-size: 1.3rem; letter-spacing: .1em; }
.sp-quote p { margin: .5rem 0 0; font-family: Fredoka, Nunito, sans-serif; font-weight: 600; font-size: clamp(1.05rem, 2.6vw, 1.35rem); line-height: 1.35; color: rgb(var(--c-ink)); }
.sp-quote footer { margin-top: .7rem; font-weight: 800; font-size: .85rem; color: rgb(var(--c-slate-500)); }
.sp-slider-dots { display: flex; justify-content: center; gap: .15rem; margin-top: .5rem; }
.sp-slider-dots button { position: relative; width: 34px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; }
.sp-slider-dots button::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 99px; transform: translate(-50%, -50%);
  background: rgb(var(--c-line)); transition: width .25s ease, background .25s ease; }
.sp-slider-dots button.is-active::after { width: 26px; background: rgb(var(--c-accent-1)); }
.no-motion .sp-slide { transition: none; transform: none; }
@media (prefers-reduced-motion: reduce) { .sp-slide { transition: none; transform: none; } }
@media (max-width: 899px) { .sp-slider { width: min(100%, 420px); } .sp-slide .sp-scene { width: 80%; } }

/* =====================================================================
   Motion: calm, but with presence. Only transform and opacity are animated
   (cheap for the browser), everything runs once, and nothing is hidden unless
   <html> has .sp-anim – the page sets that only when animations are allowed
   (not with "Turn animations off" or the device's reduce-motion setting).
   - On load: the hero text rises in line by line, the slider settles into place,
     and a soft glow drifts slowly behind them.
   - On scroll: each section arrives its own way – headings rise and draw an
     underline, feature rows slide in from opposite sides, tiles pop in one after
     another, the ribbon unrolls, the steps and choices step in.
   - Where the browser supports scroll-driven animation: a reading-progress line
     under the header and feature pictures that straighten as they scroll in.
   ===================================================================== */
.sp-home { --ease: cubic-bezier(.2, .7, .2, 1); }

/* ---- on load ---- */
.sp-hero { position: relative; isolation: isolate; }
.sp-hero::before { content: ""; position: absolute; z-index: -1; inset: -3rem calc(50% - 50vw) -1rem; pointer-events: none;
  background: radial-gradient(38rem 24rem at 14% 22%, rgb(var(--c-accent-2-tint)), transparent 62%),
              radial-gradient(34rem 22rem at 88% 72%, rgb(var(--c-peach) / .75), transparent 62%),
              radial-gradient(26rem 18rem at 60% 8%, rgb(var(--c-accent-1-tint) / .8), transparent 60%); }
.sp-anim .sp-hero::before { animation: sp-aurora 22s ease-in-out infinite alternate; }
@keyframes sp-aurora { from { transform: translate3d(0, 0, 0) scale(.94); opacity: .75; } to { transform: translate3d(0, -2%, 0) scale(1); opacity: 1; } }
.sp-anim .sp-hero-copy > * { animation: sp-rise .8s var(--ease) both; }
.sp-anim .sp-hero-copy > :nth-child(1) { animation-delay: .1s; }
.sp-anim .sp-hero-copy > :nth-child(2) { animation-delay: .22s; }
.sp-anim .sp-hero-copy > :nth-child(3) { animation-delay: .36s; }
.sp-anim .sp-hero-copy > :nth-child(4) { animation-delay: .5s; }
.sp-anim .sp-hero-copy > :nth-child(5) { animation-delay: .64s; }
.sp-anim .sp-slider { animation: sp-settle 1s var(--ease) .15s both; }
.sp-anim .sp-strip { animation: sp-rise .8s var(--ease) .8s both; }
@keyframes sp-rise { from { opacity: 0; transform: translate3d(0, 26px, 0); } to { opacity: 1; transform: none; } }
@keyframes sp-settle { from { opacity: 0; transform: translate3d(0, 30px, 0) scale(.94) rotate(-2deg); } to { opacity: 1; transform: none; } }

/* headings retain a quiet accent without waiting for a scroll reveal */
.sp-h2.sp-center::after { content: ""; display: block; width: 72px; height: 6px; margin: .7rem auto 0; border-radius: 99px; background: rgb(var(--c-sun)); }

/* =====================================================================
   One layout per screen. Six tiers, each tuned on its own:
     phone          up to 639px     one column, swipe rows, full-width buttons
     tablet         640 – 1023px    two columns from 768px, larger tiles
     small laptop   1024 – 1279px   compact hero, tighter gaps
     laptop         1280 – 1535px   the base design
     monitor        1536 – 1919px   wider container, more columns
     TV / 4K        1920px and up   bigger type (set site-wide in app.css) and a wide stage
   ===================================================================== */
/* phone */
@media (max-width: 639px) {
  .sp-section { margin-top: 3.6rem; }
  .sp-features { margin-top: 4rem; }
  .sp-hero-title { font-size: clamp(1.75rem, 7.6vw, 2.2rem); }
  .sp-hero-lead { font-size: 1.05rem; }
  .sp-hero-actions { max-width: none; }
  .sp-center-row > * { flex: 1 1 100%; }
  .sp-courses { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .sp-course-blurb { display: none; }
  .sp-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem .8rem; }
  .sp-cat-title { font-size: 1.1rem; } .sp-cat-art { font-size: 2.6rem; border-radius: 20px; } .sp-cat-blurb { display: none; }
  .sp-band { padding: 3rem 1rem; margin-top: 4rem; }
}
/* tablet */
@media (min-width: 640px) and (max-width: 1023px) {
  .sp-ages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .sp-age-title { font-size: 1.6rem; }
  .sp-circles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-courses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-width: 899px) {
  .sp-hero { grid-template-columns: 1fr 1fr; gap: 1.8rem; }
  .sp-feature { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .sp-feature-flip .sp-feature-copy { order: 2; }
  .sp-feature-copy { text-align: left; }
  .sp-band-in { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
/* small laptop */
@media (min-width: 1024px) and (max-width: 1279px) {
  .sp-home { --sp-max: 980px; }
  .sp-hero { gap: 2.5rem; min-height: min(74vh, 600px); }
  .sp-slider { width: min(100%, 440px); }
  .sp-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-circles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* laptop */
@media (min-width: 1280px) { .sp-home { --sp-max: 1160px; } }
/* monitor */
@media (min-width: 1536px) {
  .sp-home { --sp-max: 1320px; }
  .sp-hero { gap: 5rem; min-height: min(76vh, 760px); }
  .sp-slider { width: min(100%, 580px); }
  .sp-hero-copy { max-width: 34rem; }
  .sp-hero-title { font-size: 3.2rem; }
  .sp-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sp-courses { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sp-band-in { max-width: 1320px; }
  .sp-strip { padding-left: max(1rem, calc(50vw - 660px)); padding-right: max(1rem, calc(50vw - 660px)); }
}
/* TV / 4K: the type itself grows site-wide (see app.css), so here only the stage widens */
@media (min-width: 1920px) {
  .sp-home { --sp-max: 1560px; }
  .sp-hero { min-height: min(72vh, 900px); }
  .sp-slider { width: min(100%, 680px); }
  .sp-hero-copy { max-width: 38rem; }
  .sp-section { margin-top: 7rem; }
  .sp-band-in { max-width: 1560px; }
  .sp-strip { padding-left: max(1rem, calc(50vw - 780px)); padding-right: max(1rem, calc(50vw - 780px)); }
  .sp-circles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 2560px) {
  .sp-home { --sp-max: 2000px; }
  .sp-band-in { max-width: 2000px; }
  .sp-strip { padding-left: max(1rem, calc(50vw - 1000px)); padding-right: max(1rem, calc(50vw - 1000px)); }
}
/* short, wide screens (small laptops, landscape tablets): keep the hero inside the first screen */
@media (min-width: 900px) and (max-height: 720px) { .sp-hero { min-height: 0; padding-bottom: 1rem; } .sp-slider { width: min(100%, 400px); } .sp-hero-title { font-size: 2.2rem; } }

/* Keep the feature art inside the viewport. */
.sp-features, .sp-band { overflow-x: clip; }

/* ---------- slide 2: a student coding to build a robot (templates/_student_coder.html) ---------- */
.sp-student { position: relative; width: 92%; }
.sc-svg { display: block; width: 100%; height: auto; }
.sp-student .sp-card-code { left: -2%; top: -4%; width: 46%; transform: rotate(-6deg); font-size: clamp(.55rem, 1.35vw, .74rem); padding: .55rem .7rem .7rem; }
.sc-svg * { transform-box: fill-box; transform-origin: center; }
.sc-arm-l { animation: sc-type .5s ease-in-out infinite alternate; }
.sc-arm-r { animation: sc-type .5s ease-in-out .25s infinite alternate; }
.sc-taps { animation: sc-blink 1s steps(2, jump-none) infinite; }
.sc-eyes { animation: sc-eyes 4.2s ease-in-out infinite; }
.sc-code { opacity: 0; animation: sc-float 3.6s ease-out infinite; }
.sc-code-2 { animation-delay: 1.2s; } .sc-code-3 { animation-delay: 2.4s; }
.sc-drop { animation: sc-drop 3.2s cubic-bezier(.3, 1.4, .5, 1) infinite; }
.sc-light { animation: sc-blink 1.2s steps(2, jump-none) infinite; }
.sc-wave { transform-origin: 0% 100%; animation: sc-wave 1.6s ease-in-out infinite alternate; }
.sc-robot { animation: sc-hop 3.2s ease-in-out infinite; }
@keyframes sc-type { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes sc-blink { from { opacity: 1; } to { opacity: .25; } }
@keyframes sc-eyes { 0%, 44%, 50%, 100% { transform: scaleY(1); } 47% { transform: scaleY(.1); } }
@keyframes sc-float { 0% { opacity: 0; transform: translateY(26px) scale(.7); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-34px) scale(1.1); } }
@keyframes sc-drop { 0%, 12% { opacity: 0; transform: translateY(-46px); } 30%, 88% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(0); } }
@keyframes sc-wave { from { transform: rotate(0); } to { transform: rotate(-22deg); } }
@keyframes sc-hop { 0%, 30%, 46%, 100% { transform: translateY(0); } 38% { transform: translateY(-7px); } }
.no-motion .sc-svg * { animation: none !important; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sc-svg * { animation: none !important; opacity: 1; } }

/* long code lines scroll inside their box; they never widen a feature row */
.sp-feature { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .sp-feature { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sp-feature > * { min-width: 0; }

/* ---------- every slide is clickable: the caption is a link that covers the slide; lab chips sit above it ---------- */
.sp-slide-cap { padding: 0; }
.sp-slide-link { display: flex; flex-direction: column; padding: .55rem .9rem; border-radius: 12px; color: inherit; text-decoration: none; }
.sp-slide-link::after { content: ""; position: absolute; inset: -100vh -12px -12px; }
.sp-slide { cursor: pointer; }
.sp-slide-link b i { font-style: normal; display: inline-block; transition: transform .2s ease; color: rgb(var(--c-accent-2)); }
@media (hover: hover) { .sp-slide:hover .sp-slide-link b i { transform: translateX(5px); } .sp-slide:hover .sp-slide-cap { border-color: rgb(var(--c-accent-2-light)); } }
.sp-slide-link:focus-visible { outline: 3px solid rgb(var(--c-accent-2)); outline-offset: 2px; }
.sp-slide-cap { overflow: visible; }
.sp-slide-cap span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* a slide per lab category: its name, then its labs as buttons */
.sp-slide-cat { justify-content: flex-start; padding-top: 1.2rem; }
.sp-cat-slide { width: 100%; display: flex; flex-direction: column; gap: .8rem; min-height: 0; }
.sp-cat-slide-head { margin: 0; display: flex; align-items: center; gap: .7rem; }
.sp-cat-slide-head span { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 16px; font-size: 1.9rem; background: rgb(var(--c-accent-2-tint)); box-shadow: 0 4px 0 rgb(var(--c-line)); }
.sp-cat-slide-head b { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: clamp(1.15rem, 2.4vw, 1.6rem); line-height: 1.15; color: rgb(var(--c-ink)); text-align: left; }
.sp-cat-slide-labs { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.sp-cat-slide-labs a { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .3rem .7rem; border-radius: 12px; background: rgb(var(--c-card)); border: 2px solid rgb(var(--c-line)); border-bottom-width: 4px;
  font-weight: 800; font-size: .86rem; line-height: 1.15; color: rgb(var(--c-slate-700)); text-align: left; overflow: hidden; }
.sp-cat-slide-labs a span { flex: none; font-size: 1.25rem; }
.sp-cat-slide-labs a:nth-child(n+9) { display: none; }
@media (hover: hover) { .sp-cat-slide-labs a:hover { background: rgb(var(--c-accent-2-tint)); border-color: rgb(var(--c-accent-2-light)); color: rgb(var(--c-accent-2)); } }
.sp-cat-slide-labs a:active { transform: translateY(2px); border-bottom-width: 2px; }
@media (max-width: 899px) { .sp-cat-slide-labs a:nth-child(n+7) { display: none; } .sp-cat-slide-labs a { font-size: .78rem; min-height: 42px; padding: .25rem .5rem; } .sp-cat-slide-head span { width: 44px; height: 44px; font-size: 1.5rem; } }
@media (min-width: 1536px) { .sp-cat-slide-labs a:nth-child(n+9) { display: flex; } .sp-cat-slide-labs a:nth-child(n+11) { display: none; } }
.sp-slider-dots { flex-wrap: wrap; }
.sp-slider-dots button { width: 26px; }
.sp-slider-dots button.is-active::after { width: 20px; }

/* the student picture: leave room above the head for the code card */
.sp-student { padding-top: 9%; width: 86%; }
.sp-student .sp-card-code { top: -1%; left: -5%; }

/* Meet your tutor: the portrait is shown whole (head to folded arms), never cropped at the face */
.tutor-photo.is-portrait img { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 0; }
@media (max-width: 899px) { .tutor-photo.is-portrait { max-width: 340px; margin-left: auto; margin-right: auto; } .tutor-photo.is-portrait img { aspect-ratio: 3 / 4; } }
/* the slider's slides sit inside its frame on every screen */
.sp-slides { contain: paint; }
.sp-slide-video video { object-position: 50% 12%; }

/* the tutor's photo: a clear layer sits over it, so "save image" and dragging get the layer, not the photo */
.tutor-photo img, .sp-slide-video video { pointer-events: none; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tutor-photo .photo-guard { position: absolute; inset: 0; z-index: 1; border-radius: inherit; -webkit-touch-callout: none; }
.tutor-photo figcaption { z-index: 2; }
