/* LearnSmart Kids — marketing site. Palette mirrors the mobile app's "Modern Sky" auth theme
   (apps/mobile/src/theme/colors.ts) and the logo's egg + sunshine colours. */
:root {
  --bg: #F4F8FC;
  --paper: #FFFFFF;
  --ink: #0F2A44;
  --ink-2: #4F6C84;
  --ink-3: #5F7286;
  --sky: #1F5DB0;
  --sky-deep: #17488A;
  --sky-soft: #CFE0F2;
  --coral: #FF8A5C;
  --coral-ink: #B8452A;
  --sun: #FFC93C;
  --sun-soft: #FFF1C7;
  --rule: #B9D2EE;
  --margin-red: #E8837A;
  --line: rgba(15, 42, 68, 0.12);
  --leaf: #2E9E5B;
  --lilac: #A18EE8;
  --teal: #00B7B3;

  --f-display: "Nunito", system-ui, sans-serif;
  --f-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --f-child: "Andika", "Comic Sans MS", system-ui, sans-serif;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--sky); text-underline-offset: 3px; }
a:hover { color: var(--sky-deep); }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 10; }

/* ---------- Header ---------- */
.site-header { padding: 20px 0; }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand img { width: 30px; height: auto; }
.wordmark {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  color: var(--sky);
  line-height: 1;
}
.wordmark .kids { color: var(--sun); position: relative; text-shadow: 0 1px 0 #C98A12, 0 0 1px #C98A12; }
.wordmark .kids::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: 0.15em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
}

.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}
.nav a:hover { color: var(--ink); }
.nav .btn,
.nav .btn:hover { color: #fff; }

.btn {
  display: inline-block;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--sky);
  color: #fff;
  box-shadow: 0 3px 0 var(--sky-deep);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { color: #fff; background: var(--sky-deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--sky-deep); }
.btn-small { padding: 10px 18px; font-size: 0.9375rem; }
.btn { white-space: nowrap; }

@media (max-width: 760px) {
  .nav a:not(.btn) { display: none; }
}
@media (max-width: 420px) {
  .wordmark { font-size: 1.2rem; }
  .brand img { width: 26px; }
  .btn-small { padding: 8px 14px; font-size: 0.875rem; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(32px, 6vw, 80px) 0 clamp(56px, 8vw, 112px); }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  margin: 0 0 24px;
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 3px var(--sun-soft);
}

.hero h1 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 5.6vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  max-width: 13ch;
}

.lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--ink-2);
  max-width: 34em;
  margin: 0 0 32px;
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.hero-actions .quiet { font-weight: 600; text-decoration: none; }
.hero-email { margin: 20px 0 0; font-size: 0.9375rem; color: var(--ink-2); }

/* The exercise-book page: the one memorable thing on this site. */
.page {
  position: relative;
  background:
    linear-gradient(90deg, transparent 54px, var(--margin-red) 54px, var(--margin-red) 56px, transparent 56px),
    repeating-linear-gradient(180deg, transparent 0, transparent 47px, var(--rule) 47px, var(--rule) 48px),
    var(--paper);
  background-position: 0 0, 0 23px, 0 0;
  border-radius: 6px 18px 18px 6px;
  padding: 23px 28px 40px 76px;
  box-shadow:
    0 1px 0 var(--line),
    0 24px 48px -24px rgba(15, 42, 68, 0.28);
  transform: rotate(-1.2deg);
  margin: 0;
}
.page-head {
  font-family: var(--f-child);
  font-size: 0.9375rem;
  color: var(--ink-3);
  line-height: 48px;
  margin: 0;
  display: flex;
  justify-content: space-between;
}
.page-text {
  font-family: var(--f-child);
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  line-height: 48px;
  margin: 0;
  color: #213A8F;
}

/* Both spellings share one grid cell, so the slot is always as wide as the longer word. */
.slip { position: relative; display: inline-grid; white-space: nowrap; }
.slip .wrong,
.slip .right { grid-area: 1 / 1; }
.slip .right { opacity: 0; }
.slip::after {
  /* the "finding" mark: a wavy underline the child is asked to look at */
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 6px;
  height: 6px;
  background: radial-gradient(circle at 3px -1px, transparent 3px, var(--coral) 3px, var(--coral) 4.5px, transparent 4.5px) 0 0 / 8px 6px repeat-x;
  opacity: 0;
}
.tick {
  position: absolute;
  top: -4px;
  right: -14px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--leaf);
  color: #fff;
  font: 700 0.75rem/20px var(--f-body);
  text-align: center;
  opacity: 0;
  transform: scale(0.4);
}

/* The buddy sits on the empty lines under the sentence. */
.buddy-note {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 10px;
  margin: 12px -12px 0 0;
  opacity: 0;
}
.buddy-note img { width: 40px; flex: none; }
.bubble {
  display: grid;
  max-width: 260px;
  background: var(--sun-soft);
  border: 2px solid var(--sun);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 14px;
  font-size: 0.9375rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--ink);
}
.bubble .then,
.bubble .done { grid-area: 1 / 1; }
.bubble .done { opacity: 0; }

/* One orchestrated sequence: mark the word -> buddy asks -> child fixes it. */
@media (prefers-reduced-motion: no-preference) {
  .slip::after { animation: show 0.4s ease 1.2s forwards, hide 0.3s ease 4.6s forwards; }
  .buddy-note { animation: rise 0.5s cubic-bezier(.2,.9,.3,1.2) 1.9s forwards; }
  .slip .wrong { animation: hide 0.3s ease 4.6s forwards; }
  .slip .right { animation: show 0.3s ease 4.8s forwards; }
  .tick { animation: pop 0.4s cubic-bezier(.2,.9,.3,1.4) 5.1s forwards; }
  .bubble .then { animation: hide 0.2s linear 5.1s forwards; }
  .bubble .done { animation: show 0.3s linear 5.2s forwards; }
}
/* With JS, hold the sequence until the card scrolls into view (script in index.html). */
.js .page:not(.play) *,
.js .page:not(.play) *::after { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .slip .wrong, .bubble .then { opacity: 0; }
  .slip .right, .tick, .buddy-note, .bubble .done { opacity: 1; transform: none; }
}

@keyframes show { to { opacity: 1; } }
@keyframes hide { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { to { opacity: 1; transform: scale(1); } }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .page { padding-left: 64px; padding-right: 18px; background-position: -10px 0, 0 23px, 0 0; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-alt { background: var(--paper); border-block: 1px solid var(--line); }

.section h2 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.875rem, 3.6vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  max-width: 22ch;
}
.section-intro { color: var(--ink-2); max-width: 38em; margin: 0 0 48px; }

/* Steps: a real sequence, so they are numbered. */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 48px);
  counter-reset: step;
}
.steps li { counter-increment: step; position: relative; padding-top: 64px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sky);
  color: #fff;
  font: 900 1.375rem/44px var(--f-display);
  text-align: center;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 21px;
  left: 56px;
  right: -12px;
  border-top: 2px dashed var(--sky-soft);
}
.steps h3,
.split h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.3125rem;
  line-height: 1.25;
  margin: 0 0 8px;
}
.steps p { margin: 0; color: var(--ink-2); }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps li { padding: 0 0 0 64px; min-height: 44px; }
  .steps li:not(:last-child)::after { display: none; }
}

/* Feature list: two-column definition list, not a card grid. */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 clamp(32px, 6vw, 80px);
  margin: 0;
}
.features div { padding: 24px 0; border-top: 1px solid var(--line); }
.features dt {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.features dt::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--c, var(--sky));
  flex: none;
}
.features dd { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

/* Schools / parents split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
}
.audience {
  border-radius: 24px;
  padding: clamp(28px, 4vw, 44px);
}
.audience.schools { background: var(--sky); color: #fff; }
.audience.schools p, .audience.schools li { color: #E3EEFA; }
.audience.parents { background: var(--sun-soft); }
.audience.parents p, .audience.parents li { color: #5A4A1C; }
.audience h3 { font-size: 1.625rem; margin-bottom: 12px; }
.audience ul { margin: 16px 0 0; padding-left: 1.2em; }
.audience li { margin: 6px 0; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* Safety + Claude */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.checks { list-style: none; margin: 0; padding: 0; }
.checks li {
  position: relative;
  padding: 0 0 18px 36px;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sky-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%231F5DB0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.checks strong { display: block; }
.checks span { color: var(--ink-2); }

.claude-note { color: var(--ink-2); max-width: 34em; margin: -24px 0 0; font-size: 0.9375rem; }
.checks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(32px, 6vw, 80px); }
@media (max-width: 760px) { .checks-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

/* Contact */
.contact { text-align: left; }
.contact .wrap > div { margin-bottom: 28px; }
.contact p { color: var(--ink-2); margin: 0; max-width: 34em; }
.contact .contact-email { margin-top: 16px; font-size: 0.9375rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 0.875rem;
  color: var(--ink-3);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--ink-2); }

/* Privacy page */
.prose { max-width: 42em; padding-block: clamp(32px, 6vw, 72px) clamp(56px, 8vw, 104px); }
.prose h1 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2rem, 4.4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 8px;
}
.prose h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.375rem;
  margin: 40px 0 8px;
}
.prose .updated { color: var(--ink-3); margin: 0 0 32px; }
.prose p, .prose li { color: var(--ink-2); }
