@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito:wght@400;600;700;800&display=swap");

:root {
  --page: #ffffff;
  --surface: #f6f5ff;
  --ink: #1e1b4b;
  --text: #475569;
  --muted: #6b7280;
  --line: #e4e1fb;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-tint: #eef2ff;
  --violet: #7c3aed;
  --sun: #67e8f9;
  --good: #16a34a;
  --bad: #e11d48;
  --shadow: 0 2px 4px rgba(30, 27, 75, .05), 0 14px 34px rgba(30, 27, 75, .10);
  --radius: 24px;
  --font-head: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --grad: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #7c3aed 100%);
  /* subject colours */
  --c-english: #3b82f6; --c-math: #16a34a; --c-science: #8b5cf6;
  --c-geo: #0d9488; --c-history: #e11d48; --c-tech: #ec4899;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-body); font-size: 17px; line-height: 1.6;
  color: var(--text); background: var(--page); -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); letter-spacing: -.01em; margin: 0 0 .5em; line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); line-height: 1.05; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.ic { width: 1.4em; height: 1.4em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* form fields */
input, select, textarea {
  font: inherit; color: var(--ink); width: 100%; padding: 14px 16px; border-radius: 16px;
  border: 2.5px solid var(--line); background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79, 70, 229, .15); }
label { font-weight: 700; color: var(--ink); font-size: .95rem; display: block; margin-bottom: 6px; }

/* buttons: chunky, press down */
.btn {
  --b: var(--accent); --bd: #3730a3;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; border-radius: 18px; border: 0; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; text-decoration: none;
  color: #fff; background: var(--b); box-shadow: 0 5px 0 var(--bd); transition: transform .12s, box-shadow .12s, filter .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--bd); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { --b: var(--accent); --bd: #3730a3; }
.btn-fun { --b: #ec4899; --bd: #be185d; }
.btn-go { --b: var(--good); --bd: #15803d; }
.btn-sun { --b: #0e7490; --bd: #164e63; }
.btn-ghost { background: #fff; color: var(--accent); box-shadow: 0 4px 0 var(--line); border: 2.5px solid var(--line); --bd: var(--line); }
.btn-sm { min-height: 42px; padding: 0 20px; font-size: 1rem; border-radius: 14px; box-shadow: 0 4px 0 var(--bd); }
.btn-block { width: 100%; }

/* header */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 10px; flex-wrap: wrap; }
.brand img { height: 46px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 700; }
.site-nav a:not(.btn):hover, .site-nav a.active { color: var(--accent); }
.nav-toggle { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 46px; height: 46px; border-radius: 14px; border: 2.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; flex: 0 0 100%; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 0 14px; }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 10px 4px; }
  .site-nav .btn { width: 100%; }
}

/* landing hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(120deg, #e0e7ff, #cffafe, #fce7f3, #ede9fe, #dbeafe, #e0e7ff); background-size: 300% 300%; animation: gradShift 16s ease-in-out infinite; padding: 64px 0 88px; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; pointer-events: none; }
.hero::before { width: 360px; height: 360px; left: -80px; top: -60px; background: radial-gradient(circle, #f9a8d4, transparent 70%); animation: drift1 11s ease-in-out infinite alternate; }
.hero::after { width: 420px; height: 420px; right: -100px; bottom: -120px; background: radial-gradient(circle, #67e8f9, transparent 70%); animation: drift2 13s ease-in-out infinite alternate; }
.hero-grid { position: relative; z-index: 1; }
@keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes drift1 { to { transform: translate(160px, 90px) scale(1.2); } }
@keyframes drift2 { to { transform: translate(-180px, -70px) scale(1.15); } }
.auth-body, .cta-band, .stage-card { background-size: 220% 220%; animation-name: gradShift; animation-duration: 12s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); font-weight: 800; font-size: .9rem; margin-bottom: 18px; }
.hero h1 .hl { color: var(--accent); position: relative; white-space: nowrap; }
.hero p.lead { font-size: 1.2rem; max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 700; color: var(--ink); font-size: .92rem; }
.chip .ic { color: var(--accent); }

.stage { position: relative; aspect-ratio: 1 / 1; max-width: 520px; margin-inline: auto; width: 100%; }
.stage-card { position: absolute; inset: 6%; border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; background: var(--grad); box-shadow: var(--shadow); animation: blob 14s ease-in-out infinite alternate; }
@keyframes blob { 50% { border-radius: 58% 42% 45% 55% / 55% 55% 45% 45%; } 100% { border-radius: 45% 55% 58% 42% / 42% 50% 50% 58%; } }
.sparky-btn { position: absolute; left: 50%; top: 50%; width: 52%; transform: translate(-50%, -50%); background: none; border: 0; cursor: pointer; padding: 0; }
.sparky-btn svg { width: 100%; height: auto; filter: drop-shadow(0 14px 18px rgba(30, 27, 75, .35)); animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-12px); } }
.speech { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); width: max-content; max-width: 78%; background: #fff; color: var(--ink); font-weight: 800; padding: 12px 18px; border-radius: 20px; box-shadow: var(--shadow); text-align: center; font-size: .98rem; line-height: 1.35; }
.speech::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 20px; height: 20px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 4px; }
.float-badge { position: absolute; width: 74px; height: 74px; border-radius: 24px; display: grid; place-items: center; color: #fff; box-shadow: var(--shadow); animation: floaty 5s ease-in-out infinite; }
.float-badge .ic { width: 38px; height: 38px; }
.float-badge:nth-of-type(2n) { animation-duration: 6.2s; animation-delay: -1.5s; }
.float-badge:nth-of-type(3n) { animation-duration: 4.4s; animation-delay: -2.5s; }
@keyframes floaty { 50% { transform: translateY(-16px) rotate(-5deg); } }
.fb1 { left: 0; top: 24%; background: var(--c-english); }
.fb2 { right: 0; top: 18%; background: var(--c-math); }
.fb3 { left: 6%; bottom: 8%; background: var(--c-science); }
.fb4 { right: 4%; bottom: 14%; background: var(--c-tech); }
.fb5 { left: 42%; bottom: -2%; background: var(--c-geo); width: 62px; height: 62px; }
.confetti-bit { position: fixed; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; z-index: 90; }

@media (max-width: 900px) {
  .hero { padding: 36px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .float-badge { width: 58px; height: 58px; border-radius: 18px; }
  .float-badge .ic { width: 30px; height: 30px; }
}

/* sections */
.section { padding: 96px 0; }
@media (max-width: 720px) { .section { padding: 56px 0; } }
.section.tint { background: var(--surface); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.center { margin-inline: auto; text-align: center; }

.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.subject-tile { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: var(--radius); background: #fff; border: 2.5px solid var(--line); box-shadow: 0 5px 0 var(--line); transition: transform .2s, box-shadow .2s; }
.subject-tile:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 10px 0 var(--line); }
.subject-tile h3 { margin: 0; font-size: 1.2rem; }
.subject-tile p { margin: 2px 0 0; font-size: .95rem; line-height: 1.35; }
.s-ico { width: 62px; height: 62px; border-radius: 20px; display: grid; place-items: center; color: #fff; flex: none; }
.s-ico .ic { width: 32px; height: 32px; }
.bg-english { background: var(--c-english); } .bg-math { background: var(--c-math); } .bg-science { background: var(--c-science); }
.bg-geography { background: var(--c-geo); } .bg-history { background: var(--c-history); } .bg-tech { background: var(--c-tech); }
@media (max-width: 900px) { .subject-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .subject-grid { grid-template-columns: 1fr; } }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: s; }
.step { position: relative; padding: 32px 26px 26px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.step::before { counter-increment: s; content: counter(s); position: absolute; top: -22px; left: 24px; width: 48px; height: 48px; border-radius: 16px; background: var(--accent); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; display: grid; place-items: center; transform: rotate(-6deg); box-shadow: 0 4px 0 #3730a3; }
.step:nth-child(2)::before { background: #ec4899; box-shadow: 0 4px 0 #be185d; }
.step:nth-child(3)::before { background: var(--good); box-shadow: 0 4px 0 #15803d; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; gap: 40px; } }

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.feature.flip .feature-copy { order: 2; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; gap: 28px; } .feature.flip .feature-copy { order: 0; } }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; color: var(--ink); }
.ticks .ic { color: #fff; background: var(--good); border-radius: 50%; padding: 4px; width: 26px; height: 26px; margin-top: 1px; }

.mock { background: var(--grad); border-radius: 32px; padding: 28px; box-shadow: var(--shadow); transform: rotate(1.5deg); }
.mock .bubble { background: rgba(255, 255, 255, .96); color: var(--ink); border-radius: 20px 20px 20px 6px; padding: 14px 18px; font-weight: 700; margin-bottom: 14px; max-width: 88%; }
.mock .bubble.me { margin-left: auto; background: #eef2ff; border-radius: 20px 20px 6px 20px; }
.mock .bar { height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .3); overflow: hidden; margin-top: 6px; }
.mock .bar i { display: block; height: 100%; width: 62%; background: var(--sun); border-radius: 99px; }
.mock .mock-top { display: flex; align-items: center; gap: 12px; color: #fff; font-family: var(--font-head); font-weight: 600; margin-bottom: 18px; }
.mock .mock-top svg { width: 46px; height: 46px; }
.badges-mock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.badges-mock span { aspect-ratio: 1; border-radius: 22px; background: #fff; display: grid; place-items: center; color: var(--accent); box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.badges-mock span:nth-child(3n) { color: var(--c-math); } .badges-mock span:nth-child(3n+1) { color: #ec4899; }
.badges-mock span.off { opacity: .35; }
.badges-mock .ic { width: 42%; height: 42%; }

.photo-frame { border-radius: 32px; overflow: hidden; box-shadow: var(--shadow); transform: rotate(-1.5deg); }
.photo-frame img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.faq { max-width: 760px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { background: #fff; border: 2.5px solid var(--line); border-radius: 18px; padding: 4px 22px; }
.faq summary { cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; color: var(--ink); padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.6rem; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "-"; }

.cta-band { background: var(--grad); color: #fff; border-radius: 40px; padding: 64px 32px; text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #e0e7ff; max-width: 46ch; margin-inline: auto; }
.cta-band .sp { width: 110px; margin: 0 auto 12px; }

.site-footer { padding: 40px 0; border-top: 2px solid var(--line); background: #fff; }
.footer-row { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; }
.footer-row p { margin: 0; font-size: .95rem; }
.footer-row nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-row nav a { font-weight: 700; text-decoration: none; }
@media (max-width: 800px) { .footer-row { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: no-preference) {
  html.js-motion [data-animate="hero"],
  html.js-motion [data-animate="split"],
  html.js-motion [data-animate="reveal"],
  html.js-motion [data-animate="count"],
  html.js-motion [data-animate="stagger"] > * { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== auth pages ===== */
.auth-body { min-height: 100vh; background: var(--grad); }
.auth-main { display: grid; place-items: center; padding: 40px 16px 64px; }
.auth-card { width: min(440px, 100%); background: #fff; border-radius: 32px; padding: 34px 30px; box-shadow: 0 30px 60px rgba(30, 27, 75, .35); position: relative; }
.auth-card .sp { width: 84px; margin: -64px auto 10px; display: block; filter: drop-shadow(0 8px 10px rgba(30, 27, 75, .25)); }
.auth-card h1 { font-size: 2rem; text-align: center; }
.auth-card .sub { text-align: center; margin-bottom: 22px; }
.field { margin-bottom: 16px; }
.auth-alt { text-align: center; margin: 18px 0 0; font-size: .98rem; }
.auth-alt a { font-weight: 800; }
.form-msg { min-height: 1.4em; margin: 0 0 12px; font-weight: 700; font-size: .96rem; }
.form-msg.err { color: var(--bad); } .form-msg.ok { color: var(--good); }
altcha-widget { display: block; margin: 0 0 16px; color-scheme: light; --altcha-color-base: #ffffff; --altcha-color-base-content: #1e1b4b; --altcha-border-color: #e4e1fb; --altcha-border-radius: 16px; --altcha-max-width: 100%; }

/* ===== modal ===== */
dialog { margin: auto; border: 0; padding: 0; border-radius: 32px; max-width: min(440px, calc(100% - 32px)); width: 100%; box-shadow: 0 30px 70px rgba(30, 27, 75, .45); color: var(--text); }
dialog::backdrop { background: rgba(30, 27, 75, .55); backdrop-filter: blur(3px); }
.dlg { padding: 34px 28px 28px; text-align: center; }
.dlg .sp { width: 96px; margin: 0 auto 8px; }
.dlg h2 { font-size: 1.8rem; }
.dlg-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
