/* =========================================================
   Prodigy Brains — global styles
   Source of truth: DESIGN.md (tokens below must match it)
   ========================================================= */

/* ---------- Tokens: light (default) ---------- */
:root {
  --color-primary: #FFC933;
  --color-primary-deep: #F0A020;
  --color-bg: #FFFFFF;
  --color-surface: #FFF7E0;
  --color-ink: #1B1A2E;
  --color-ink-soft: #5B5870;
  --color-border: #EDE6D3;
  --color-link: #9A6700;
  --color-error: #D93A2B;
  --color-success: #1F9D6B;

  --font-display: "Poppins", system-ui, sans-serif;
  --font-body: "Poppins", system-ui, sans-serif;

  --space-1: 4px;  --space-2: 8px;  --space-3: 16px; --space-4: 24px;
  --space-5: 32px; --space-6: 48px; --space-7: 64px; --space-8: 96px; --space-9: 128px;

  --radius-sm: 10px; --radius-md: 18px; --radius-lg: 28px; --radius-xl: 40px; --radius-pill: 999px;

  --shadow-soft: 0 8px 24px rgba(27, 26, 46, 0.08);
  --shadow-lift: 0 14px 32px rgba(27, 26, 46, 0.12);
  --edge: 0 5px 0 var(--color-primary-deep);
  --edge-ink: 0 5px 0 var(--color-ink);

  --section-y: 64px;           /* one vertical rhythm for every section */
  --header-h: 72px;
  --content-max: 1200px;
  --gutter: 16px;

  color-scheme: light;
}

@media (min-width: 900px) {
  :root { --gutter: 32px; --section-y: 96px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
@media (min-width: 900px) { body { font-size: 18px; } }

img, canvas { display: block; max-width: 100%; }

a { color: var(--color-link); }

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

.container {
  width: 100%;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute; left: var(--space-3); top: -60px; z-index: 200;
  background: var(--color-primary); color: #1B1A2E;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }

:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 14px 28px;
  border: 0; border-radius: var(--radius-md);
  font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(5px); box-shadow: none; }

.btn--primary { background: var(--color-primary); color: #1B1A2E; box-shadow: var(--edge); }
.btn--primary:hover { box-shadow: 0 7px 0 var(--color-primary-deep); }

.btn--secondary {
  background: var(--color-bg); color: var(--color-ink);
  border: 2px solid var(--color-ink); box-shadow: var(--edge-ink);
}
.btn--secondary:hover { box-shadow: 0 7px 0 var(--color-ink); }

.btn--pill { border-radius: var(--radius-pill); }

/* =========================================================
   HEADER / NAVBAR
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--color-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--color-border); }

.site-header__inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
}

.brand { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--color-ink); flex-shrink: 0; }
.brand img { width: 44px; height: 44px; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: 0.02em; line-height: 1; }

.nav { display: none; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-1); }
.nav__link {
  position: relative; display: block;
  padding: var(--space-2) 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--color-ink); text-decoration: none; border-radius: var(--radius-sm);
}
.nav__link::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 4px;
  border-radius: var(--radius-pill); background: var(--color-primary);
  transform: scaleX(0); transform-origin: left; transition: transform 0.2s ease;
}
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: var(--space-2); }
.header-actions .btn { min-height: 44px; padding: 12px 22px; }

/* Theme toggle */
.icon-btn {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 2px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-bg); color: var(--color-ink); cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease;
}
.icon-btn:hover { border-color: var(--color-primary-deep); }
.icon-btn svg { width: 22px; height: 22px; }


/* Hamburger */
.menu-toggle .bar { display: block; width: 20px; height: 2.5px; border-radius: 2px; background: currentColor; }
.menu-toggle span.bars { display: grid; gap: 4px; }

/* Header Register button: hidden on the smallest screens to avoid crowding */
.header-register { display: none; }
@media (min-width: 600px) { .header-register { display: inline-flex; } }

@media (min-width: 900px) {
  .nav { display: block; }
  .menu-toggle { display: none; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .nav__link { padding-inline: 8px; font-size: 14px; }
  .nav__link::after { left: 8px; right: 8px; }
  .brand__name { display: none; }
}

/* Mobile overlay menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 150;
  background: var(--color-bg);
  display: flex; flex-direction: column;
  padding: var(--space-3) var(--gutter) var(--space-6);
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.mobile-menu__top { display: flex; align-items: center; justify-content: space-between; height: calc(var(--header-h) - var(--space-3)); }
.mobile-menu__list { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; gap: var(--space-1); }
.mobile-menu__link {
  display: block; padding: 12px 0;
  font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1.1;
  color: var(--color-ink); text-decoration: none;
}
.mobile-menu__link[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--color-primary); text-decoration-thickness: 6px; text-underline-offset: 6px; }
.mobile-menu__cta { margin-top: auto; }
.mobile-menu__cta .btn { width: 100%; }
body.menu-open { overflow: hidden; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  padding-block: var(--space-7) var(--space-8);
  overflow: hidden;
}
@media (min-width: 900px) { .hero { padding-block: var(--space-8) var(--space-9); } }

.hero__grid { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.1fr 0.9fr; gap: var(--space-5); } }

.hero__title {
  font-weight: 800;
  font-size: clamp(40px, 7.2vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero__lead {
  margin: var(--space-4) 0 0;
  max-width: 34ch;
  font-size: clamp(18px, 2vw, 22px); font-weight: 500; line-height: 1.5;
  color: var(--color-ink-soft);
}

.hero__actions { margin-top: var(--space-5); display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* 3D stage */
.hero__stage {
  position: relative;
  width: 100%; max-width: 520px; margin-inline: auto;
  aspect-ratio: 1 / 1;
}
.hero__sun {
  position: absolute; inset: 6%;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: inset 0 -14px 0 var(--color-primary-deep);
}
.hero__canvas, .hero__fallback {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero__fallback {
  object-fit: contain; padding: 22%;
  filter: drop-shadow(0 10px 0 rgba(27, 26, 46, 0.12));
}
.hero__stage.is-3d .hero__fallback { display: none; }
.hero__canvas { cursor: grab; touch-action: pan-y; }
.hero__canvas:active { cursor: grabbing; }

/* =========================================================
   STATS
   ========================================================= */
.stats {
  background: var(--color-surface);
  padding-block: var(--section-y);
 
}

.stats__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .stats__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .stats__grid { gap: var(--space-5); } }

.stat-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.stat-card__number {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(40px, 5.6vw, 64px); line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}
.stat-card__label {
  font-family: var(--font-body); font-weight: 700;
  font-size: 18px; color: var(--color-ink-soft);
}
@media (min-width: 600px) and (max-width: 899px) {
  .stat-card { padding: var(--space-4) var(--space-3); }
  .stat-card__label { font-size: 16px; }
}

/* =========================================================
   SECTION TITLE (shared)
   ========================================================= */
.section-title {
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--color-ink);
}

/* =========================================================
   HOW IT WORKS — train
   ========================================================= */
.how {
  padding-block: var(--section-y);
  overflow: hidden;
}
.how .section-title { margin-bottom: var(--space-6); }
.how.is-pinned {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
}

/* Default (no JS / reduced motion): the train can be swiped inside its own box */
.how__viewport {
  position: relative;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-bottom: var(--space-2);
}
.how__viewport::-webkit-scrollbar { display: none; }
.how__viewport.is-animated { overflow: hidden; }

.train {
  --engine-w: 200px;
  --car-w: 190px;
  --coupler: 20px;
  --wheel: 36px;
  position: relative; z-index: 1;
  display: flex; align-items: flex-end;
  width: max-content;
  padding-inline: var(--gutter);
  padding-top: 72px; /* room for steam */
  will-change: transform;
}
@media (min-width: 900px) {
  .train {
    --engine-w: clamp(180px, 18vw, 240px);
    --car-w: auto;
    width: 100%;
    max-width: calc(var(--content-max) + var(--gutter) * 2);
    margin-inline: auto;
  }
}

/* Engine */
.train__engine {
  position: relative; flex: 0 0 var(--engine-w);
  aspect-ratio: 240 / 170;
}
.train__engine-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.train__engine-svg .t-body { fill: var(--color-primary); stroke: var(--color-ink); stroke-width: 4; stroke-linejoin: round; }
.train__engine-svg .t-ink-fill { fill: var(--color-ink); }
.train__engine-svg .t-cream { fill: var(--color-surface); stroke: var(--color-ink); stroke-width: 4; }
.train__logo {
  position: absolute; left: 77.5%; top: 35.3%; width: 15%; height: auto;
  transform: translate(-50%, -50%);
}
.train__engine .train__wheel { width: 19%; top: 73%; }

/* Steam puffs (only move while the train moves) */
.train__puff {
  position: absolute; left: 31%; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-surface); border: 3px solid var(--color-ink);
  opacity: 0;
}

/* Wheels: a spoke line makes rotation visible */
.train__wheel {
  position: absolute; bottom: calc(var(--wheel) / -2);
  width: var(--wheel); aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--color-primary) 0 20%, transparent 21%),
    linear-gradient(90deg, transparent 44%, var(--color-primary-deep) 44% 56%, transparent 56%),
    var(--color-ink);
  border: 3px solid var(--color-ink);
}
.train__engine .train__wheel { bottom: auto; }

/* Cars */
.train__cars {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex: 1 1 auto; align-items: flex-end;
}
.car {
  position: relative;
  flex: 0 0 var(--car-w);
  margin-left: var(--coupler);
  margin-bottom: calc(var(--wheel) / 2);
}
@media (min-width: 900px) { .car { flex: 1 1 0; min-width: 0; } }

.car__coupler {
  position: absolute; left: calc(var(--coupler) * -1 - 2px); bottom: 18px;
  width: calc(var(--coupler) + 4px); height: 8px;
  background: var(--color-ink); border-radius: var(--radius-pill);
}
.car__box {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  gap: var(--space-2);
  min-height: 150px;
  padding: var(--space-4) var(--space-3) var(--space-3);
  background: var(--color-bg);
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.car__box::before { /* roof */
  content: ""; position: absolute; left: -8px; right: -8px; top: -14px; height: 14px;
  background: var(--color-ink); border-radius: var(--radius-pill);
}
.car__num {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-primary); color: #1B1A2E;
  border: 3px solid var(--color-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1;
}
.car__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 20px; line-height: 1.15; color: var(--color-ink);
}
@media (min-width: 1200px) { .car__name { font-size: 22px; } }
.car__name small {
  display: block; margin-top: 4px;
  font-family: var(--font-body); font-weight: 700; font-size: 14px;
  color: var(--color-ink-soft);
}

/* Track */
.track {
  position: relative; z-index: 0;
  height: 18px; margin-top: calc(var(--space-1) * -1);
  background:
    linear-gradient(var(--color-ink), var(--color-ink)) top / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, var(--color-border) 0 14px, transparent 14px 40px) 0 6px / 100% 12px no-repeat;
}
.how__viewport:not(.is-animated) .track { width: max(100%, 1100px); }

/* =========================================================
   PLACEHOLDER (empty state, DESIGN.md)
   ========================================================= */
.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2); text-align: center;
  padding: var(--space-3);
  background: var(--color-surface);
  border: 2px dashed var(--color-ink-soft);
  border-radius: var(--radius-sm);
  color: var(--color-ink-soft);
}
.placeholder__tag {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--color-bg); border: 2px solid var(--color-ink-soft);
}
.placeholder__note { font-weight: 700; font-size: 14px; line-height: 1.3; }

/* =========================================================
   CHIPS
   ========================================================= */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--color-surface); border: 2px solid var(--color-border);
  font-family: var(--font-body); font-weight: 700; font-size: 14px; line-height: 1.2;
  white-space: nowrap;
  color: var(--color-ink);
}

/* =========================================================
   EXAMS — homepage card grid + Exams-page slider (slider from Sachin's reference)
   Dark stage: big exam title left, card deck right (all cards inside),
   arrows + progress line + big number underneath.
   ========================================================= */
.exams {
  background: var(--color-surface);
  padding-block: var(--section-y);
 
}
.exams .section-title { margin-bottom: var(--space-6); }

.exams__grid {
  --cols: 1;
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--space-4);
}
@media (min-width: 600px)  { .exams__grid { --cols: 2; } }
@media (min-width: 900px)  { .exams__grid { --cols: 3; gap: var(--space-5); } }
@media (min-width: 1200px) { .exams__grid { --cols: 4; } }

.exam-card {
  position: relative;
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--space-4)) / var(--cols));
  display: flex; flex-direction: column;
  background: var(--color-bg);
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--edge);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
}
@media (min-width: 900px) {
  .exam-card { flex-basis: calc((100% - (var(--cols) - 1) * var(--space-5)) / var(--cols)); }
}
.exam-card:hover { box-shadow: 0 9px 0 var(--color-primary-deep), var(--shadow-lift); }
.exam-card__cover { aspect-ratio: 4 / 3; margin: var(--space-3) var(--space-3) 0; }
.exam-card__body {
  flex: 1; display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4) var(--space-3) var(--space-4);
}
.exam-card__title { font-weight: 700; font-size: 22px; line-height: 1.15; }
@media (max-width: 599px) { .exam-card__title { font-size: 20px; } }
.exam-card__link { color: var(--color-ink); text-decoration: none; }
.exam-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.exam-card__link:focus-visible { outline: none; }
.exam-card:has(.exam-card__link:focus-visible) { outline: 3px solid var(--color-ink); outline-offset: 4px; }
.exam-card__desc { margin: 0; font-size: 16px; line-height: 1.5; color: var(--color-ink-soft); }
.exam-card .chips { margin-top: auto; }
.exam-card__cta { position: relative; z-index: 2; align-self: flex-start; }
@media (max-width: 599px) {
  .exam-card { display: grid; grid-template-columns: 108px 1fr; }
  .exam-card__cover { aspect-ratio: 3 / 4; margin: var(--space-3) 0 var(--space-3) var(--space-3); align-self: start; padding: var(--space-2); }
  .exam-card__cover .placeholder__note { font-size: 12px; }
  .exam-card__cover .placeholder__tag { font-size: 9px; padding: 2px 5px; letter-spacing: 0; border-width: 1.5px; }
  .exam-card__body { padding: var(--space-3); gap: var(--space-2); }
}

/* =========================================================
   EXAMS PAGE — pinned full-screen showcase
   Scroll moves through the exams; the stage stays still (pinned).
   Desktop: text | framed main book | "Up next" list, controls along the bottom.
   ========================================================= */
.exam-slider { padding: 0; }
.xs {
  --xs-bg: #1B1A2E;
  --xs-text: #FFF7E0;
  --xs-soft: rgba(255, 247, 224, 0.72);
  --xs-line: rgba(255, 247, 224, 0.22);
  --xs-pad: max(var(--gutter), calc((100vw - var(--content-max)) / 2));
  position: relative;
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "pills    pills"
    "head     book"
    "desc     desc"
    "facts    facts"
    "actions  actions"
    "controls controls";
  grid-template-rows: auto auto auto auto auto 1fr;
  column-gap: var(--space-3); row-gap: var(--space-3);
  align-content: start;
  padding: var(--space-5) var(--xs-pad) var(--space-4);
  background: var(--xs-bg); color: var(--xs-text);
  overflow: hidden; overflow: clip;
}
@media (min-width: 900px) {
  .xs {
    grid-template-columns: minmax(0, 1.05fr) auto minmax(0, 0.55fr);
    grid-template-areas:
      "pills    pills    pills"
      "head     book     next"
      "desc     book     next"
      "facts    book     next"
      "actions  book     next"
      "controls controls controls";
    grid-template-rows: auto 1fr auto auto 1fr auto;
    column-gap: var(--space-6); row-gap: var(--space-4);
    align-content: stretch;
    padding: var(--space-6) var(--xs-pad) var(--space-5);
  }
}

.xs__head { grid-area: head; align-self: end; }
.xs__pills { grid-area: pills; }
.xs__desc { grid-area: desc; }
.xs__facts { grid-area: facts; }
.xs__actions { grid-area: actions; align-self: start; }
.xs__book { grid-area: book; }
.xs__next { grid-area: next; }
.xs__controls { grid-area: controls; align-self: end; }

.xs__eyebrow { display: flex; align-items: center; gap: 12px; margin: 0; font-weight: 700; font-size: 15px; color: var(--xs-soft); }
.xs__dash { width: 32px; height: 3px; border-radius: 2px; background: var(--color-primary); flex: 0 0 auto; }
.xs__title {
  margin-top: var(--space-2);
  font-weight: 800; text-transform: uppercase;
  font-size: clamp(38px, 5.4vw, 88px); line-height: 0.92; letter-spacing: -0.01em;
  color: var(--xs-text);
}
.xs__title > span { display: block; }
.xs__title-top { color: var(--color-primary); }
.xs__title:focus { outline: none; }
.xs__desc { margin: 0; max-width: 42ch; font-size: 16px; font-weight: 500; color: var(--xs-soft); }
@media (min-width: 900px) { .xs__desc { font-size: 18px; min-height: 3.2em; } }

.xs__facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.xs__facts li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  border: 2px solid var(--xs-line);
  font-weight: 700; font-size: 14px; color: var(--xs-text);
}
.xs__facts span { color: var(--color-primary); font-family: var(--font-display); font-size: 12px; }
.xs__tba { font-style: italic; color: var(--xs-soft); }
@media (min-width: 900px) { .xs__facts li { font-size: 15px; padding: 6px 14px; } }
.xs__actions { display: flex; gap: var(--space-3); }

/* ---- Main book in a gold frame ---- */
.xs__book { display: grid; place-items: center; }
.book-frame {
  --frame-h: 150px;
  height: var(--frame-h); aspect-ratio: 3 / 4;
  padding: 8px;
  background: var(--color-primary);
  border-radius: 14px;
  box-shadow: 0 0 0 3px #FFF7E0, 0 18px 40px rgba(0, 0, 0, 0.45);
  will-change: opacity;
}
@media (min-width: 600px) { .book-frame { --frame-h: 190px; } }
@media (min-width: 900px) {
  .book-frame { --frame-h: min(calc(100svh - var(--header-h) - 250px), 560px); padding: 14px; border-radius: 20px; }
}
.book-frame__cover {
  position: relative; width: 100%; height: 100%;
  border-radius: 8px; overflow: hidden;
  background: #FFF7E0;
  box-shadow: inset 12px 0 0 rgba(27, 26, 46, 0.12); /* spine */
}
.book-frame__img { width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.book-frame__ph {
  position: absolute; inset: 8px 8px 8px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; color: #5B5870;
  border: 2px dashed #5B5870; border-radius: 6px;
}
.book-frame__ph .placeholder__tag { font-size: 10px; background: #FFFFFF; border-color: #5B5870; color: #5B5870; }
.book-frame__ph-name {
  max-width: 100%; padding-inline: 6px;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(13px, 2vw, 28px); line-height: 1; color: #1B1A2E;
  overflow-wrap: anywhere;
}
.book-frame__ph-name > span { display: block; }
@media (max-width: 899px) {
  .book-frame__ph { inset: 4px 4px 4px 10px; gap: 4px; }
  .book-frame__ph .placeholder__tag { font-size: 7px; padding: 2px 4px; letter-spacing: 0; border-width: 1.5px; }
  .book-frame__ph-note { display: none; }
  .xs__eyebrow { font-size: 13px; }
}
.book-frame__ph-note { font-size: 12px; font-weight: 700; }

/* ---- Up next (desktop only) ---- */
.xs__next { display: none; }
@media (min-width: 900px) {
  .xs__next { display: flex; flex-direction: column; justify-content: center; gap: var(--space-3); }
}
.xs__next-label { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--xs-soft); }
.xs__next-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.xs-next[hidden], .xs-next:nth-child(n+4) { display: none; }
.xs-next__link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px; border-radius: var(--radius-md);
  background: rgba(255, 247, 224, 0.06);
  border: 2px solid var(--xs-line);
  color: var(--xs-text); text-decoration: none;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.xs-next__link:hover { background: var(--color-primary); border-color: var(--color-primary); color: #1B1A2E; transform: translateX(-4px); }
.xs-next__link:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
.xs-next__thumb {
  flex: 0 0 48px; height: 64px; border-radius: 6px;
  background: #FFF7E0; border: 2px dashed #5B5870;
  box-shadow: inset 5px 0 0 rgba(27, 26, 46, 0.12);
}
.xs-next__thumb.has-img { border: 0; background-size: cover; background-position: center; }
.xs-next__meta { display: block; font-size: 12px; font-weight: 700; opacity: 0.8; }
.xs-next__name { display: block; font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 1.1; text-transform: uppercase; }

/* ---- Controls ---- */
.xs__controls { display: flex; align-items: center; gap: var(--space-3); padding-top: var(--space-2); }
.xs__arrow {
  flex: 0 0 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; color: var(--xs-text);
  border: 2px solid var(--xs-text); cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}
.xs__arrow:hover { background: var(--color-primary); border-color: var(--color-primary); color: #1B1A2E; }
.xs__arrow:active { transform: scale(0.94); }
.xs__arrow:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
.xs__arrow svg { width: 20px; height: 20px; }
.xs__track { position: relative; flex: 1; height: 3px; border-radius: 2px; background: var(--xs-line); margin-inline: var(--space-2); }
.xs__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--color-primary); }
.xs__hint { margin: 0; font-size: 13px; font-weight: 700; color: var(--xs-soft); white-space: nowrap; transition: opacity 0.4s ease; }
.xs__hint-arrow { display: inline-block; animation: hint 1.4s ease-in-out 3; }
@keyframes hint { 50% { transform: translateY(4px); } }
.xs__hint.is-gone { opacity: 0; }
.xs__num { margin: 0; font-family: var(--font-display); font-weight: 800; line-height: 1; color: var(--xs-text); font-variant-numeric: tabular-nums; }
.xs__num > span:first-child { font-size: clamp(34px, 4.4vw, 60px); }
.xs__num-total { font-size: 16px; color: var(--xs-soft); margin-left: 2px; }
@media (max-width: 599px) { .xs__hint { display: none; } }

/* =========================================================
   BOOKS PAGE — 3D library
   ========================================================= */
.library { padding: 0; }
.library__stage {
  position: relative;
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 520px;
  overflow: hidden;
  background: #2E5B5D;              /* library wall teal (matches the 3D wall) */
}
.library__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  transition: filter 0.5s ease, transform 0.5s ease;
}
.library__canvas--front { pointer-events: none; }
/* Book open: the library behind blurs and dims; the front layer (the open book) stays sharp */
.library__stage.is-open .library__canvas:not(.library__canvas--front) {
  filter: blur(8px) brightness(0.72);
  transform: scale(1.02);
}
.library__stage.is-open .library__canvas--front { pointer-events: auto; cursor: zoom-out; }

/* The 3D board shows the heading; the H1 stays for screen readers and appears if 3D can't start */
.library__intro {
  position: absolute; left: 50%; bottom: var(--space-4); transform: translateX(-50%);
  z-index: 2; pointer-events: none; text-align: center;
  transition: opacity 0.4s ease;
}
.library__title {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  font-weight: 800; font-size: clamp(28px, 4vw, 48px); line-height: 1; letter-spacing: -0.02em; color: #F4EEDF;
}
.library__stage.is-fallback .library__intro { top: var(--space-5); bottom: auto; }
.library__stage.is-fallback .library__title { position: static; width: auto; height: auto; clip: auto; }
/* Phones: show the heading as text at the top (the 3D board is hidden there); the hint stays at the bottom */
.library__stage.can-pan .library__intro {
  top: var(--space-4); bottom: var(--space-4); left: var(--gutter); right: var(--gutter); width: auto; transform: none;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
}
.library__stage.can-pan .library__title {
  position: static; width: auto; height: auto; clip: auto; overflow: visible;
  padding: 8px 18px; background: #F4EEDF; color: var(--color-ink); border: 4px solid #8C5227;
  font-size: 22px; text-transform: uppercase; letter-spacing: 0;
}
.library__lead {
  display: inline-block; margin: var(--space-2) 0 0; padding: 8px 18px; border-radius: var(--radius-pill);
  background: #F4EEDF; color: var(--color-ink); font-weight: 600; font-size: 15px;
}
@media (max-width: 599px) { .library__lead { font-size: 14px; } }
.library__swipe { display: none; }
.library__stage.can-pan .library__swipe { display: inline; }
.library__stage.can-pan .library__canvas { touch-action: pan-y; cursor: grab; }
.library__stage.is-open .library__intro { opacity: 0; }

.library__loading, .library__fallback {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; padding: var(--space-3) var(--space-4);
  background: var(--color-surface); border: 2px solid var(--color-border); border-radius: var(--radius-md);
  font-weight: 700; color: var(--color-ink-soft); text-align: center; max-width: 90%;
}
.library__fallback p { margin: 0; }

/* Keyboard / screen-reader list: hidden until something inside it gets focus */
.lib-access {
  position: absolute; left: var(--space-3); bottom: var(--space-3); z-index: 5;
  width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
.lib-access:focus-within, .library__stage.is-fallback .lib-access {
  width: auto; height: auto; max-height: 60%; overflow: auto; clip: auto;
  right: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg); border: 3px solid var(--color-ink); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
}
.library__stage.is-fallback .lib-access { top: 30%; }
.lib-access ul { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lib-access__btn {
  padding: 6px 12px; border-radius: var(--radius-pill);
  border: 2px solid var(--color-border); background: var(--color-surface); color: var(--color-ink);
  font: 700 14px/1.2 var(--font-body); cursor: pointer;
}
.lib-access__btn:hover, .lib-access__btn:focus-visible { border-color: var(--color-ink); }

/* Pop-up next to the open book */
.lib-panel {
  position: absolute; z-index: 6;
  right: var(--xs-pad, max(var(--gutter), calc((100vw - var(--content-max)) / 2)));
  top: 50%; transform: translate(0, -46%);
  width: min(340px, calc(100% - 2 * var(--gutter)));
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2);
  padding: var(--space-5) var(--space-4) var(--space-4);
  background: var(--color-bg); color: var(--color-ink);
  border: 3px solid var(--color-ink); border-radius: var(--radius-lg);
  box-shadow: var(--edge), var(--shadow-lift);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.lib-panel.is-visible { opacity: 1; transform: translate(0, -50%); }
.lib-panel__section { margin: var(--space-2) 0 0; font-weight: 500; font-size: 14px; color: var(--color-ink-soft); }
.lib-panel__title { font-weight: 800; font-size: 26px; line-height: 1.1; }
.lib-panel__meta { margin: 0; }
.lib-panel__desc { margin: 0; font-size: 16px; color: var(--color-ink-soft); font-style: italic; }
.lib-panel__back { margin-top: var(--space-3); width: 100%; }
.lib-panel__hint { margin: 0; align-self: center; font-size: 13px; color: var(--color-ink-soft); }
@media (max-width: 899px) {
  /* phones/tablets: the pop-up sits along the bottom, the book above it */
  .lib-panel {
    left: 50%; right: auto; top: auto; bottom: var(--space-3);
    transform: translate(-50%, 12px);
    padding: var(--space-3) var(--space-4);
  }
  .lib-panel.is-visible { transform: translate(-50%, 0); }
  .lib-panel__title { font-size: 20px; }
  .lib-panel__desc, .lib-panel__hint { display: none; }
  .lib-panel__back { margin-top: var(--space-2); }
}
@media (prefers-reduced-motion: reduce) {
  .library__canvas, .lib-panel { transition: none; }
}

/* =========================================================
   ACHIEVERS PAGE — dynamic (filters, podium, charts, schools, wall)
   Medal colours: gold = brand yellow, silver #D7D5E0, bronze #E3A56B (podium & rank badges only)
   ========================================================= */
.ach { --gold: #FFC933; --silver: #D7D5E0; --bronze: #E3A56B; }
.sample-banner {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  margin: 0 auto var(--space-5); padding: 10px 16px; max-width: max-content;
  border: 2px dashed var(--color-ink-soft); border-radius: var(--radius-md);
  font-size: 14px; font-weight: 700; color: var(--color-ink-soft); text-align: center; justify-content: center;
}
.ach-hero { padding-block: var(--space-6) var(--space-5); text-align: center; }
.ach-hero__title { font-weight: 800; font-size: clamp(40px, 7vw, 80px); line-height: 1; letter-spacing: -0.03em; }
.ach-hero__lead { margin: var(--space-3) auto 0; max-width: 44ch; font-size: clamp(17px, 2vw, 20px); font-weight: 500; color: var(--color-ink-soft); }

/* Filters (one row above everything they control) */
.ach-filters {
  margin: var(--space-5) auto 0; max-width: 820px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: var(--space-3);
}
.select { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 180px; }
.select__label { font-size: 13px; font-weight: 700; color: var(--color-ink-soft); }
.select select {
  width: 100%; min-height: 48px; padding: 10px 40px 10px 14px;
  appearance: none; -webkit-appearance: none;
  font: 700 16px/1.2 var(--font-body); color: var(--color-ink);
  background: var(--color-bg); border: 2px solid var(--color-ink); border-radius: var(--radius-md);
  box-shadow: 0 4px 0 var(--color-ink); cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.2s ease;
}
.select select:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--color-ink); }
.select select:focus-visible { outline: none; border-color: var(--color-primary-deep); box-shadow: 0 4px 0 var(--color-primary-deep), 0 0 0 4px rgba(255, 201, 51, 0.45); }
.select svg { position: absolute; right: 12px; bottom: 15px; width: 18px; height: 18px; pointer-events: none; color: var(--color-ink); }
.select--compact { min-width: 150px; }
.ach-filters__reset {
  min-height: 48px; padding: 0 var(--space-3);
  background: none; border: 0; cursor: pointer;
  font: 700 15px var(--font-display); color: var(--color-link); text-decoration: underline; text-underline-offset: 4px;
}
.ach-summary { margin: var(--space-4) 0 0; font-size: 15px; color: var(--color-ink-soft); }
.ach-summary strong { color: var(--color-ink); font-family: var(--font-display); }
.section-sub { margin: var(--space-2) auto var(--space-5); text-align: center; color: var(--color-ink-soft); font-weight: 500; max-width: 52ch; }

/* 3 big numbers */
.ach-kpis { padding-block: var(--space-4) var(--space-7); }
.kpi-row { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 600px) { .kpi-row { grid-template-columns: repeat(3, 1fr); } }
.kpi {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: var(--space-5) var(--space-4);
  background: var(--color-ink); color: #FFF7E0;
  border-radius: var(--radius-lg);
  transition: transform 0.25s ease;
}
.kpi:hover { transform: translateY(-4px); }
.kpi__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--color-primary); color: #1B1A2E; }
.kpi__icon svg { width: 24px; height: 24px; }
.kpi__value { margin-top: var(--space-2); font-family: var(--font-display); font-weight: 800; font-size: clamp(38px, 4.6vw, 60px); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi__label { font-weight: 700; font-size: 17px; color: rgba(255, 247, 224, 0.75); }

/* Podium */
.ach-podium-sec { padding-block: var(--section-y); background: var(--color-surface); }
.ach-podium-sec .section-title { margin-bottom: 0; }
.ach-podium-sec .section-sub { margin-bottom: var(--space-7); }
.podium {
  position: relative;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end;
  gap: var(--space-2); max-width: 900px; margin: 0 auto;
}
@media (min-width: 600px) { .podium { gap: var(--space-4); } }
.podium__confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.podium__col { display: flex; flex-direction: column; align-items: stretch; }
.podium__empty { grid-column: 1 / -1; text-align: center; color: var(--color-ink-soft); font-weight: 700; }
.podium__card {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  margin-bottom: -14px; padding: var(--space-4) var(--space-2) var(--space-5);
  background: var(--color-bg); color: var(--color-ink);
  border: 3px solid var(--color-ink); border-radius: var(--radius-lg);
  cursor: pointer; font: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.podium__card:hover, .podium__card:focus-visible { transform: translateY(-8px); box-shadow: 0 16px 30px rgba(27, 26, 46, 0.18); }
.podium__col--1 .podium__card { padding-top: var(--space-5); }
.podium__crown { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); width: 40px; height: 40px; }
.podium__crown svg { width: 100%; height: 100%; fill: var(--gold); stroke: #1B1A2E; stroke-width: 1.6; stroke-linejoin: round; }
.podium__avatar, .ach-card__avatar, .profile__avatar { border-radius: 50%; object-fit: cover; }
.avatar--initials {
  display: grid; place-items: center;
  background: var(--color-primary); color: #1B1A2E;
  font-family: var(--font-display); font-weight: 800;
  border: 3px solid var(--color-ink);
}
.podium__avatar { width: 64px; height: 64px; font-size: 22px; }
.podium__col--1 .podium__avatar { width: 84px; height: 84px; font-size: 28px; }
.podium__name { margin-top: 6px; font-family: var(--font-display); font-weight: 800; font-size: clamp(15px, 2vw, 20px); line-height: 1.1; }
.podium__meta { font-size: 13px; font-weight: 700; color: var(--color-ink-soft); }
.podium__school { font-size: 13px; font-weight: 700; color: var(--color-ink-soft); display: none; }
@media (min-width: 600px) { .podium__school { display: block; } }
.podium__score { margin-top: 4px; font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.podium__score small { font-size: 12px; color: var(--color-ink-soft); }
.podium__step {
  display: grid; place-items: start center; padding-top: var(--space-4);
  border: 3px solid var(--color-ink); border-radius: var(--radius-md) var(--radius-md) 6px 6px;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(34px, 5vw, 56px); color: #1B1A2E;
}
.podium__step--gold { height: 170px; background: var(--gold); }
.podium__step--silver { height: 120px; background: var(--silver); }
.podium__step--bronze { height: 90px; background: var(--bronze); }
@media (max-width: 599px) {
  .podium__step--gold { height: 110px; } .podium__step--silver { height: 80px; } .podium__step--bronze { height: 60px; }
  .podium__card { padding-inline: 6px; }
  .podium__score { font-size: 17px; }
}

/* Charts */
.ach-charts { padding-block: var(--section-y); }
.chart-grid { display: grid; gap: var(--space-4); }
@media (min-width: 900px) { .chart-grid { grid-template-columns: 1.4fr 1fr; gap: var(--space-5); } .chart-card--full { grid-column: 1 / -1; } }
.chart-card {
  margin: 0; display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg); border: 2px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.chart-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.chart-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.chart-card__title { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.chart-card__toggle {
  padding: 6px 14px; border-radius: var(--radius-pill);
  border: 2px solid var(--color-border); background: var(--color-surface); color: var(--color-ink);
  font: 700 13px var(--font-display); cursor: pointer;
}
.chart-card__toggle:hover { border-color: var(--color-ink); }
.chart-card__plot { position: relative; height: 280px; }
.chart-card--full .chart-card__plot { height: 240px; }
.chart-card__plot--donut { height: 240px; }
.chart-card__plot[hidden], .chart-legend[hidden] { display: none; }
.chart-missing { margin: 0; padding-top: 100px; text-align: center; color: var(--color-ink-soft); font-weight: 700; }
.donut-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; pointer-events: none;
}
.donut-center span { font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1; color: var(--color-ink); }
.donut-center small { font-weight: 700; font-size: 13px; color: var(--color-ink-soft); }
.chart-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.legend-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  border: 2px solid var(--color-border); background: var(--color-bg); color: var(--color-ink);
  font: 700 14px var(--font-body); cursor: pointer;
}
.legend-btn strong { font-family: var(--font-display); }
.legend-btn.is-on, .legend-btn:hover { border-color: var(--color-ink); }
.legend-swatch { width: 12px; height: 12px; border-radius: 4px; }
.facts-table { width: 100%; border-collapse: collapse; }
.facts-table th, .facts-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 15px; }
.facts-table thead th { background: var(--color-surface); font-family: var(--font-display); font-weight: 700; }
.facts-table td { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Top schools leaderboard */
.ach-schools { padding-block: var(--section-y); background: var(--color-surface); }
.leaderboard { list-style: none; margin: 0 auto; padding: 0; max-width: 900px; display: grid; gap: var(--space-2); }
.lb-btn {
  width: 100%; display: grid; align-items: center; gap: var(--space-3);
  grid-template-columns: 44px minmax(0, 1fr) auto;
  padding: 12px var(--space-3);
  background: var(--color-bg); color: var(--color-ink);
  border: 2px solid var(--color-border); border-radius: var(--radius-md);
  font: inherit; text-align: left; cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
@media (min-width: 700px) { .lb-btn { grid-template-columns: 44px minmax(0, 1.2fr) minmax(0, 1fr) 110px; } }
.lb-btn:hover, .lb-btn:focus-visible { transform: translateX(6px); border-color: var(--color-ink); box-shadow: var(--shadow-soft); }
.lb-row.is-on .lb-btn { border-color: var(--color-ink); box-shadow: 0 4px 0 var(--color-primary-deep); }
.lb-rank {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; color: #1B1A2E; border: 2px solid #1B1A2E;
}
.lb-rank--gold { background: var(--gold); } .lb-rank--silver { background: var(--silver); } .lb-rank--bronze { background: var(--bronze); }
.lb-rank--plain { background: var(--color-surface); color: var(--color-ink); border-color: var(--color-border); }
.lb-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.2; }
.lb-name small { display: block; font-family: var(--font-body); font-size: 13px; color: var(--color-ink-soft); }
.lb-bar { display: none; height: 12px; border-radius: 6px; background: var(--color-surface); overflow: hidden; }
@media (min-width: 700px) { .lb-bar { display: block; } }
.lb-fill { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--color-primary-deep); transition: width 0.9s cubic-bezier(.2,.8,.2,1); }
.leaderboard.is-filled .lb-fill { width: var(--w); }
.lb-count { font-family: var(--font-display); font-weight: 800; font-size: 20px; text-align: right; white-space: nowrap; }
.lb-count small { font-family: var(--font-body); font-size: 12px; color: var(--color-ink-soft); font-weight: 700; }
.lb-empty { text-align: center; color: var(--color-ink-soft); font-weight: 700; }

/* Achievers wall */
.ach-wall { padding-block: var(--section-y); }
.wall-tools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.search { position: relative; display: flex; align-items: center; flex: 1 1 260px; max-width: 420px; }
.search svg { position: absolute; left: 14px; width: 20px; height: 20px; color: var(--color-ink-soft); }
.search input {
  width: 100%; min-height: 48px; padding: 10px 14px 10px 44px;
  font: 700 16px var(--font-body); color: var(--color-ink); background: var(--color-bg);
  border: 2px solid var(--color-ink); border-radius: var(--radius-pill);
}
.search input:focus { outline: none; border-color: var(--color-primary-deep); box-shadow: 0 0 0 4px rgba(255, 201, 51, 0.45); }
.chip-filter {
  min-height: 48px; padding: 0 16px; border-radius: var(--radius-pill);
  background: var(--color-primary); color: #1B1A2E; border: 2px solid #1B1A2E;
  font: 700 15px var(--font-display); cursor: pointer;
}
.wall { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); } }
@media (min-width: 1100px) { .wall { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ach-card { perspective: 1000px; }
.ach-card__btn {
  position: relative; display: block; width: 100%; height: 230px;
  padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--color-ink);
  transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}
@media (hover: hover) { .ach-card__btn:hover, .ach-card__btn:focus-visible { transform: rotateY(180deg); } }
.ach-card__btn:focus-visible { outline: none; }
.ach-card__btn:focus-visible .ach-card__face { outline: 3px solid var(--color-ink); outline-offset: 3px; }
.ach-card__face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: var(--space-3); text-align: center;
  border: 3px solid var(--color-ink); border-radius: var(--radius-lg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.ach-card__front { background: var(--color-bg); box-shadow: 0 5px 0 var(--color-primary-deep); }
.ach-card__back { background: var(--color-ink); color: #FFF7E0; transform: rotateY(180deg); gap: 6px; }
.ach-card__avatar { width: 64px; height: 64px; font-size: 22px; }
.ach-card__name { margin-top: 6px; font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 1.1; }
.ach-card__meta { font-size: 13px; font-weight: 700; color: var(--color-ink-soft); }
.ach-card__school { font-size: 13px; font-weight: 700; color: var(--color-ink-soft); }
.ach-card__score { font-family: var(--font-display); font-weight: 800; font-size: 36px; line-height: 1; color: var(--color-primary); }
.ach-card__score small { font-size: 14px; opacity: 0.7; }
.ach-card__line { font-size: 13px; font-weight: 700; opacity: 0.85; }
.ach-card__cta { margin-top: 6px; font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.ach-rank {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--color-surface); color: var(--color-ink); border: 2px solid var(--color-border);
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
}
.ach-rank--gold { background: var(--gold); border-color: #1B1A2E; color: #1B1A2E; }
.ach-rank--silver { background: var(--silver); border-color: #1B1A2E; color: #1B1A2E; }
.ach-rank--bronze { background: var(--bronze); border-color: #1B1A2E; color: #1B1A2E; }
.wall-empty { text-align: center; font-weight: 700; color: var(--color-ink-soft); }
.wall-more { display: flex; justify-content: center; margin-top: var(--space-5); }
.wall-more[hidden] { display: none; }

/* CTA */
.ach-cta { padding-block: var(--section-y); }
.ach-cta__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-6) var(--space-5);
  background: var(--color-primary); border: 3px solid #1B1A2E; border-radius: var(--radius-xl);
  box-shadow: 0 8px 0 #1B1A2E;
}
.ach-cta__title { font-weight: 800; font-size: clamp(28px, 4vw, 48px); line-height: 1; color: #1B1A2E; }
.ach-cta .btn--primary { background: #1B1A2E; color: #FFF7E0; box-shadow: 0 5px 0 rgba(27, 26, 46, 0.4); }

/* Profile pop-up */
.profile { width: min(560px, calc(100% - 2 * var(--gutter))); }
.profile .modal__inner { padding: var(--space-5); opacity: 0; transform: translateY(16px) scale(0.97); transition: opacity 0.3s ease, transform 0.3s ease; }
.profile.is-in .modal__inner { opacity: 1; transform: none; }
.profile__top { display: flex; align-items: center; gap: var(--space-3); padding-right: var(--space-5); }
.profile__avatar { flex: 0 0 auto; width: 76px; height: 76px; font-size: 26px; }
.profile__name { margin-top: 6px; font-weight: 800; font-size: 26px; line-height: 1.1; }
.profile__sub { margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--color-ink-soft); }
.ach-rank--lg { position: static; margin-left: auto; font-size: 20px; padding: 6px 14px; }
.profile__stats { margin: var(--space-4) 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.profile__stats div { padding: 12px 14px; background: var(--color-surface); border-radius: var(--radius-sm); }
.profile__stats dt { font-size: 12px; font-weight: 700; color: var(--color-ink-soft); }
.profile__stats dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.profile__meter { margin-top: var(--space-4); }
.profile__meter-head { display: flex; justify-content: space-between; gap: var(--space-2); font-size: 14px; font-weight: 700; color: var(--color-ink-soft); margin-bottom: 8px; }
.profile__meter-head strong { color: var(--color-ink); }
.meter { height: 12px; border-radius: 6px; background: var(--color-surface); overflow: hidden; }
.meter__fill { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--color-primary-deep); transition: width 0.9s cubic-bezier(.2,.8,.2,1) 0.2s; }
.profile.is-in .meter__fill { width: var(--w); }
@media (max-width: 599px) {
  .profile__top { flex-wrap: wrap; }
  .ach-rank--lg { margin-left: 0; }
  .profile__stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ach-card__btn, .lb-fill, .meter__fill, .profile .modal__inner { transition: none; }
}

/* =========================================================
   TESTIMONIALS PAGE — the flight (plane, smoke, 3 lanes, cracking wall, waving parents)
   ========================================================= */
.t-intro { padding-block: var(--space-7) var(--space-5); text-align: center; }
.t-intro__title { font-weight: 800; font-size: clamp(40px, 7vw, 80px); line-height: 1; letter-spacing: -0.03em; }
.t-intro__lead { margin: var(--space-3) auto 0; font-size: clamp(17px, 2vw, 20px); font-weight: 500; color: var(--color-ink-soft); }
.t-intro__hint { margin: var(--space-4) 0 0; font-family: var(--font-display); font-weight: 700; color: var(--color-primary-deep); }

.flight { position: relative; overflow: hidden; overflow: clip; padding-bottom: var(--space-8); }
.flight__sky { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; overflow: visible; }
.smoke {
  fill: none; stroke: #FFC933; stroke-width: 8; stroke-linecap: round;
}
.plane { position: absolute; left: -55px; top: -35px; width: 110px; z-index: 4; pointer-events: none; opacity: 0; will-change: transform; }
.plane svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 10px rgba(27, 26, 46, 0.25)); }
@media (max-width: 699px) { .plane { width: 72px; left: -36px; top: -23px; } }

.lane { position: relative; z-index: 2; padding-block: var(--space-8) var(--space-6); }
.lane__head { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-5); }
.lane__head--right { justify-content: flex-end; }
.lane__num { font-family: var(--font-display); font-weight: 800; font-size: clamp(40px, 6vw, 72px); line-height: 1; color: var(--color-primary-deep); }
.lane__title { font-weight: 800; font-size: clamp(28px, 4vw, 48px); line-height: 1; letter-spacing: -0.02em; }

/* Lane 1 — videos in retro TV frames */
.tv-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5) var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 600px) { .tv-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .tv-grid { grid-template-columns: repeat(3, 1fr); } }
.tv { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.tv__set {
  position: relative; width: 100%;
  display: grid; grid-template-columns: 1fr 44px; gap: 12px;
  padding: 16px; margin-top: 26px;
  background: #1B1A2E; border: 3px solid #1B1A2E; border-radius: 22px;
  box-shadow: 0 8px 0 var(--color-primary-deep);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s ease;
}
.tv__set:hover, .tv__set:focus-visible { transform: translateY(-6px) rotate(-1.5deg); box-shadow: 0 14px 0 var(--color-primary-deep); }
.tv__antenna { position: absolute; left: 50%; top: -28px; width: 60px; height: 28px; transform: translateX(-50%); }
.tv__antenna::before, .tv__antenna::after {
  content: ""; position: absolute; bottom: 0; width: 4px; height: 34px; background: #1B1A2E; border-radius: 2px; transform-origin: bottom;
}
.tv__antenna::before { left: 18px; transform: rotate(-28deg); }
.tv__antenna::after { right: 18px; transform: rotate(28deg); }
.tv__screen {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: 18px / 26px; background: #3A3750;
  box-shadow: inset 0 0 0 4px #5B5870;
}
.tv__screen img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); }
.tv__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-primary); border: 3px solid #1B1A2E;
  transition: transform 0.2s ease;
}
.tv__set:hover .tv__play { transform: translate(-50%, -50%) scale(1.1); }
.tv__play svg { width: 26px; height: 26px; fill: #1B1A2E; margin-left: 4px; }
.tv__panel { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; }
.tv__panel span { width: 30px; height: 30px; border-radius: 50%; background: var(--color-primary-deep); border: 3px solid #5B5870; }
.tv__panel span + span { width: 22px; height: 22px; background: #5B5870; }
.tv__label { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--color-ink-soft); }

/* Lane 2 — articles as newspaper clippings */
.clip-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .clip-grid { grid-template-columns: repeat(3, 1fr); } }
.clip:nth-child(1) .clip__paper { transform: rotate(-2deg); }
.clip:nth-child(2) .clip__paper { transform: rotate(1.5deg); }
.clip:nth-child(3) .clip__paper { transform: rotate(-1deg); }
.clip__paper {
  position: relative; height: 100%;
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4) var(--space-4) var(--space-6);
  background: #FFF7E0; color: #1B1A2E;
  box-shadow: 0 12px 26px rgba(27, 26, 46, 0.18);
  clip-path: polygon(0 0, 100% 0, 100% 94%, 94% 100%, 88% 95%, 80% 100%, 72% 96%, 64% 100%, 56% 95%, 48% 100%, 40% 96%, 32% 100%, 24% 95%, 16% 100%, 8% 96%, 0 100%);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.clip__paper:hover { transform: rotate(0deg) translateY(-6px) scale(1.02); }
.clip__masthead {
  margin: 0; padding-bottom: 6px; border-bottom: 3px double #1B1A2E;
  font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: 0.04em; text-transform: uppercase; text-align: center;
}
.clip__date { margin: 0; font-size: 13px; font-weight: 700; color: #5B5870; }
.clip__title { font-weight: 800; font-size: 22px; line-height: 1.15; }
.clip__lines { display: block; height: 54px; background: none; border-top: 5px solid rgba(27,26,46,0.14); border-bottom: 5px solid rgba(27,26,46,0.14); }
.clip__link { margin-top: auto; font-family: var(--font-display); font-weight: 700; color: #9A6700; }

/* Lane 3 — photos as polaroids */
.polaroid-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5) var(--space-4); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .polaroid-grid { grid-template-columns: repeat(3, 1fr); } }
.polaroid {
  position: relative; padding: 12px 12px 0; background: #FFFFFF;
  box-shadow: 0 12px 24px rgba(27, 26, 46, 0.2);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.polaroid:nth-child(odd) { transform: rotate(-2.5deg); }
.polaroid:nth-child(even) { transform: rotate(2deg); }
.polaroid:hover { transform: rotate(0deg) scale(1.04); z-index: 2; }
.polaroid__tape { position: absolute; left: 50%; top: -12px; width: 80px; height: 24px; transform: translateX(-50%) rotate(-3deg); background: rgba(255, 201, 51, 0.75); }
.polaroid__photo { aspect-ratio: 1; border-radius: 2px; background: #FFF7E0; }
.polaroid__caption { margin: 0; padding: 12px 4px 16px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #1B1A2E; font-style: italic; }

/* Finale — the wall cracks open */
.finale { position: relative; z-index: 3; padding-top: var(--space-8); }
.finale__box {
  position: relative; overflow: hidden;
  height: min(70vh, 560px); min-height: 380px;
  border-radius: var(--radius-xl); border: 3px solid #1B1A2E;
  background: var(--color-primary);
}
.finale__inside {
  position: absolute; inset: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-4);
  padding: var(--space-5);
}
.finale__face { width: min(220px, 40vw); height: auto; }
.bubble {
  position: relative; max-width: 380px;
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: #FFFFFF; color: #1B1A2E;
  border: 3px solid #1B1A2E; border-radius: var(--radius-lg);
  box-shadow: 0 6px 0 #1B1A2E;
}
.bubble::before { /* tail pointing at the face */
  content: ""; position: absolute; left: -18px; top: 40%;
  border: 14px solid transparent; border-right-color: #1B1A2E; border-left: 0;
}
@media (max-width: 599px) {
  .bubble::before { left: 50%; top: -16px; transform: translateX(-50%); border: 14px solid transparent; border-bottom-color: #1B1A2E; border-top: 0; }
  .finale__inside { flex-direction: column; flex-wrap: nowrap; }
}
.bubble__text { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.2; }
.bubble__text strong { color: #9A6700; }
.finale__half {
  position: absolute; top: 0; bottom: 0; width: 100%;
  background: #1B1A2E;
}
/* the two halves share the crack's zigzag exactly, so they fit together with no gap */
.finale__half--l { left: 0; clip-path: polygon(0 0, 50% 0, 46% 12%, 55% 22%, 44% 34%, 56% 46%, 47% 58%, 57% 70%, 45% 82%, 53% 92%, 50% 100%, 0 100%); }
.finale__half--r { left: 0; clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%, 53% 92%, 45% 82%, 57% 70%, 47% 58%, 56% 46%, 44% 34%, 55% 22%, 46% 12%); }
.finale__crack { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.finale__crack path { fill: none; stroke: #FFC933; stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; opacity: 0; }
.finale__crack .crack-small { stroke-width: 3.5; }
.finale__label {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; margin: 0;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 3vw, 32px); color: #FFF7E0;
}
/* the face blinks, and "talks" once the wall is open */
.face__eyes { transform-box: fill-box; transform-origin: center; animation: blink 4s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
.face__mouth { transform-box: fill-box; transform-origin: center; }
.finale.is-talking .face__mouth { animation: talk 0.28s ease-in-out 8 alternate; }
@keyframes talk { from { transform: scaleY(0.4); } to { transform: scaleY(1.5); } }

/* Waving parents — fixed to the very edges of the screen */
.wavers { position: fixed; inset: auto 0 0 0; height: 0; z-index: 40; pointer-events: none; }
.waver { position: fixed; bottom: -6px; width: clamp(70px, 9vw, 130px); transition: transform 0.7s cubic-bezier(.2,.8,.2,1); }
.waver--left { left: 0; transform: translateX(-110%); }
.waver--right { right: 0; transform: translateX(110%); }
.wavers.is-on .waver { transform: translateX(0); }
.waver__svg { display: block; width: 100%; height: auto; }
.waver__arm { transform-box: view-box; }
.wavers.is-on .waver__arm { animation: wave 0.9s ease-in-out infinite alternate; }
.waver--right .waver__arm { animation-direction: alternate-reverse; }
@keyframes wave { from { transform: rotate(-18deg); } to { transform: rotate(22deg); } }
.wavers.is-cheering .waver { animation: hop 0.5s ease-in-out 6 alternate; }
.wavers.is-cheering .waver__arm { animation-duration: 0.35s; }
@keyframes hop { from { bottom: -6px; } to { bottom: 20px; } }
@media (max-width: 599px) { .waver { width: 58px; } }

/* No animation: show everything, wall already open */
.t-static .plane, .t-static .flight__sky, .t-static .finale__half, .t-static .finale__crack, .t-static .finale__label, .t-static .wavers { display: none; }
@media (prefers-reduced-motion: reduce) {
  .face__eyes, .finale.is-talking .face__mouth { animation: none; }
}

/* =========================================================
   LOGIN / SIGN UP — one card that flips
   ========================================================= */
.auth-page { background: var(--color-surface); }
.auth {
  min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-6) var(--gutter);
}
.auth__card { display: grid; width: min(440px, 100%); perspective: 1400px; }
.auth__face {
  grid-area: 1 / 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--space-6) var(--space-5) var(--space-5);
  background: var(--color-bg);
  border: 3px solid var(--color-ink); border-radius: var(--radius-xl);
  box-shadow: 0 8px 0 var(--color-ink);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform 0.8s cubic-bezier(.2,.8,.2,1);
}
@media (max-width: 479px) { .auth__face { padding: var(--space-5) var(--space-4) var(--space-4); } }
.auth__face--back { transform: rotateY(180deg); }
.auth__card.is-flipped .auth__face--front { transform: rotateY(-180deg); }
.auth__card.is-flipped .auth__face--back { transform: rotateY(0deg); }

.auth__title { font-weight: 800; font-size: clamp(34px, 6vw, 44px); line-height: 1; letter-spacing: -0.03em; }
.auth__sub { margin: var(--space-2) 0 0; font-weight: 500; font-size: 16px; color: var(--color-ink-soft); }
.auth__form { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.auth__form .field input { font-weight: 700; font-size: 17px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span {
  display: grid; place-items: center; padding: 0 12px;
  font-family: var(--font-display); font-weight: 700; color: var(--color-ink-soft);
  background: var(--color-surface); border: 2px solid var(--color-border); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-prefix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; letter-spacing: 0.06em; }
.input-pw { position: relative; }
.input-pw input { padding-right: 52px !important; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; color: var(--color-ink-soft); cursor: pointer;
}
.pw-toggle:hover { color: var(--color-ink); background: var(--color-surface); }
.pw-toggle svg { width: 22px; height: 22px; }
.pw-toggle .eye-shut { display: none; }
.pw-toggle[aria-pressed="true"] .eye-open { display: none; }
.pw-toggle[aria-pressed="true"] .eye-shut { display: block; }
.field__hint { margin: 0; font-size: 13px; font-weight: 700; color: var(--color-ink-soft); }
.auth__submit { width: 100%; min-height: 54px; margin-top: var(--space-2); font-size: 17px; }
.auth__submit.is-loading { pointer-events: none; opacity: 0.8; }
.auth__submit.is-loading::after {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid rgba(27, 26, 46, 0.25); border-top-color: #1B1A2E; animation: spin 0.7s linear infinite;
}
.auth__switch { margin: var(--space-4) 0 0; text-align: center; font-weight: 700; color: var(--color-ink-soft); }
.auth__link {
  padding: 0; background: none; border: 0; cursor: pointer;
  font: 800 16px var(--font-display); color: var(--color-ink);
  text-decoration: underline; text-decoration-color: var(--color-primary); text-decoration-thickness: 4px; text-underline-offset: 5px;
}
.auth__link:hover { text-decoration-color: var(--color-primary-deep); }

/* Success: big green tick */
.auth-done { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-5) 0 var(--space-3); }
.auth-done[hidden] { display: none; }
.tick { width: 120px; height: 120px; }
.tick__circle { fill: none; stroke: var(--color-success); stroke-width: 7; stroke-dasharray: 330; stroke-dashoffset: 330; animation: draw 0.6s ease-out forwards; transform-origin: center; }
.tick__mark { fill: none; stroke: var(--color-success); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw 0.4s 0.5s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.auth-done .tick { animation: pop 0.5s 0.85s ease-out both; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
.auth-done__title { margin-top: var(--space-4); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -0.03em; color: var(--color-ink); }
.auth-done__title:focus { outline: none; }
.auth-done__sub { margin: var(--space-2) 0 0; font-weight: 700; color: var(--color-ink-soft); }
.auth-done__home { margin-top: var(--space-4); font-family: var(--font-display); font-weight: 700; color: var(--color-link); }
@media (prefers-reduced-motion: reduce) {
  .auth__face { transition: none; }
  .tick__circle, .tick__mark { animation: none; stroke-dashoffset: 0; }
  .auth-done .tick { animation: none; }
}

/* =========================================================
   PRODUCTS teaser (Books, Games)
   ========================================================= */
.products { padding-block: var(--section-y); }
.products--bg { background: var(--color-bg); }
.products--surface { background: var(--color-surface); }
.products .section-title { margin-bottom: var(--space-6); }

.products__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .products__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .products__grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-5); } }
/* 2-column tablets: centre the third card */
@media (min-width: 600px) and (max-width: 899px) {
  .products__grid > :last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - var(--space-4) / 2); }
}

.product-card {
  display: flex; flex-direction: column;
  background: var(--color-bg);
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.products--bg .product-card { background: var(--color-surface); }
.products--bg .product-card .placeholder { background: var(--color-bg); }
.product-card__img { aspect-ratio: 4 / 3; margin: var(--space-3) var(--space-3) 0; }
.product-card__body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-4); }
.product-card__title { font-weight: 700; font-size: 22px; line-height: 1.15; color: var(--color-ink); }
.product-card__desc { margin: 0; font-size: 16px; color: var(--color-ink-soft); }
.is-placeholder { color: var(--color-ink-soft); font-style: italic; }
.chip--placeholder { border-style: dashed; border-color: var(--color-ink-soft); color: var(--color-ink-soft); background: transparent; }

.products__more { margin-top: var(--space-6); display: flex; justify-content: center; }

/* =========================================================
   ACHIEVERS teaser
   ========================================================= */
.achievers { background: var(--color-bg); padding-block: var(--section-y); }
.achievers .section-title { margin-bottom: var(--space-6); }
.achievers__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--space-4); grid-template-columns: 1fr;
}
@media (min-width: 600px) { .achievers__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .achievers__grid { gap: var(--space-5); } }

.achiever-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4) var(--space-4);
  background: var(--color-surface);
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.achiever-card__photo {
  width: 120px; height: 120px; border-radius: 50%; padding: 0;
  background: var(--color-bg);
}
.rank-badge {
  margin-top: -22px; position: relative;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--color-primary); color: #1B1A2E;
  border: 3px solid var(--color-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 14px; line-height: 1;
}
.is-placeholder-badge { background: var(--color-bg); color: var(--color-ink-soft); border-style: dashed; border-color: var(--color-ink-soft); }
.achiever-card__name { font-weight: 700; font-size: 20px; line-height: 1.2; margin-top: var(--space-2); }
.achiever-card__meta { margin: 0; font-size: 15px; }

/* =========================================================
   TESTIMONIALS teaser
   ========================================================= */
.testimonials { background: var(--color-surface); padding-block: var(--section-y); }
.testimonials .section-title { margin-bottom: var(--space-6); }
.testimonials__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--space-4); grid-template-columns: 1fr;
}
@media (min-width: 600px) { .testimonials__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .testimonials__grid { gap: var(--space-5); } }

.video-card { display: flex; flex-direction: column; gap: var(--space-2); }
.video-card__btn {
  position: relative; display: block; width: 100%; padding: 0;
  aspect-ratio: 16 / 10; overflow: hidden;
  border: 3px solid var(--color-ink); border-radius: var(--radius-lg);
  background: var(--color-bg); box-shadow: var(--edge);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.video-card__btn:hover { transform: translateY(-4px); box-shadow: 0 9px 0 var(--color-primary-deep), var(--shadow-lift); }
.video-card__btn:active { transform: translateY(3px); box-shadow: none; }
.video-card__thumb { width: 100%; height: 100%; object-fit: cover; }
.video-card__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-primary); border: 3px solid #1B1A2E;
  box-shadow: 0 4px 0 var(--color-primary-deep);
  transition: transform 0.2s ease;
}
.video-card__btn:hover .video-card__play { transform: translate(-50%, -50%) scale(1.08); }
.video-card__play svg { width: 30px; height: 30px; fill: #1B1A2E; margin-left: 4px; }
.video-card__who { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 16px; }

/* =========================================================
   MODAL (video)
   ========================================================= */
.modal {
  width: min(960px, calc(100% - 2 * var(--gutter)));
  max-width: none; padding: 0; border: 0;
  background: transparent; color: var(--color-ink);
  overflow: visible;
}
.modal::backdrop { background: rgba(27, 26, 46, 0.6); }
.modal__inner {
  position: relative;
  padding: var(--space-3);
  background: var(--color-bg);
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-xl);
}
.modal__close { position: absolute; top: -20px; right: -12px; z-index: 2; }
@media (max-width: 599px) { .modal__close { top: -56px; right: 0; } }
.modal__video {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius-xl) - var(--space-3)); overflow: hidden;
  background: #000;
}
.modal__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal__spinner {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border: 4px solid rgba(255, 201, 51, 0.3); border-top-color: var(--color-primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.modal__fallback { margin: var(--space-3) 0 0; text-align: center; }
body.modal-open { overflow: hidden; }

/* =========================================================
   FORMS
   ========================================================= */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-body); font-weight: 700; font-size: 14px; color: var(--color-ink); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px;
  padding: 12px 14px;
  font: 400 16px/1.5 var(--font-body);
  color: var(--color-ink); background: var(--color-bg);
  border: 2px solid var(--color-border); border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--color-primary-deep);
  box-shadow: 0 0 0 4px rgba(255, 201, 51, 0.45);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--color-error); }
.field__error {
  margin: 0; display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 14px; color: var(--color-error);
}
.field__error::before {
  content: "!"; flex: 0 0 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-error); color: var(--color-bg);
  font: 800 12px/1 var(--font-display);
}
.field__error[hidden] { display: none; }
.field-row { display: grid; gap: var(--space-3); }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }

.btn--whatsapp { background: #25D366; color: #1B1A2E; box-shadow: 0 5px 0 #179E4B; }
.btn--whatsapp:hover { box-shadow: 0 7px 0 #179E4B; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact { background: var(--color-bg); padding-block: var(--section-y); }
.contact__grid { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 900px) { .contact__grid { grid-template-columns: 0.8fr 1.2fr; gap: var(--space-7); } }
.contact__title {
  font-weight: 800; font-size: clamp(34px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.02em;
}
.contact__direct { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.contact-link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface); color: var(--color-ink); text-decoration: none;
  border: 3px solid var(--color-ink); border-radius: var(--radius-md);
  box-shadow: var(--edge);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.contact-link:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--color-primary-deep); }
.contact-link:active { transform: translateY(5px); box-shadow: none; }
.contact-link__icon {
  flex: 0 0 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-primary); color: #1B1A2E;
}
.contact-link__icon--wa { background: #25D366; }
.contact-link__icon svg { width: 24px; height: 24px; }
.contact-link__icon--wa svg { fill: #1B1A2E; }
.contact-link__label { display: block; font-weight: 700; font-size: 14px; color: var(--color-ink-soft); }
.contact-link__value { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; }

.contact-form {
  display: grid; gap: var(--space-3);
  max-width: 640px; width: 100%;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-lg);
}
@media (min-width: 600px) { .contact-form { padding: var(--space-5); } }
.contact-form__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
@media (max-width: 599px) { .contact-form__actions .btn { flex: 1 1 100%; } }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--color-surface);
  border-top: 3px solid var(--color-ink);
  padding-top: var(--space-7);
 
}
.site-footer__grid { display: grid; gap: var(--space-5); }
@media (min-width: 600px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .site-footer__grid { grid-template-columns: 1.2fr 1.2fr 1fr 1fr; } }
.site-footer__tagline { margin: var(--space-3) 0 0; font-weight: 700; color: var(--color-ink-soft); max-width: 26ch; }
.site-footer__heading { font-weight: 700; font-size: 16px; margin-bottom: var(--space-2); }
.site-footer__col address, .site-footer__col p { margin: 0 0 6px; font-style: normal; font-size: 15px; color: var(--color-ink-soft); line-height: 1.5; }
.site-footer__col a { color: var(--color-ink); font-weight: 700; text-decoration-color: var(--color-primary); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.social {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--color-ink);
  color: var(--color-ink) !important; background: var(--color-bg);
  transition: background-color 0.2s ease, transform 0.1s ease;
}
.social:hover { background: var(--color-primary); color: #1B1A2E !important; transform: translateY(-2px); }
.social svg { width: 22px; height: 22px; }
.site-footer__bottom {
  margin-top: var(--space-6); padding-block: var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: 14px; color: var(--color-ink-soft);
}
.site-footer__bottom p { margin: 0; }

/* =========================================================
   INNER PAGES — page hero (shared)
   ========================================================= */
.page-hero { padding-block: var(--space-7) var(--space-6); text-align: center; }
@media (min-width: 900px) { .page-hero { padding-block: var(--space-8) var(--space-7); } }
.page-hero__title {
  font-weight: 800; font-size: clamp(34px, 6vw, 56px); line-height: 1.05; letter-spacing: -0.02em;
}
.page-hero__lead {
  margin: var(--space-3) auto 0; max-width: 40ch;
  font-size: clamp(18px, 2vw, 22px); font-weight: 500; color: var(--color-ink-soft);
}

/* =========================================================
   NAV — Exams dropdown (desktop) and sub-list (mobile menu)
   ========================================================= */
.nav__item { position: relative; }
.nav__split { display: flex; align-items: center; }
.has-dropdown .nav__link { padding-right: 4px; }
.has-dropdown .nav__link::after { right: 4px; }
.nav__caret {
  width: 28px; height: 28px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--color-ink); cursor: pointer;
  transition: background-color 0.2s ease;
}
.nav__caret:hover { background: var(--color-surface); }
.nav__caret svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.has-dropdown.is-open .nav__caret svg { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% + 10px); left: 50%;
  width: 380px;
  padding: var(--space-3);
  background: var(--color-bg);
  border: 3px solid var(--color-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--edge), var(--shadow-lift);
  opacity: 0; visibility: hidden;
  transform: translate(-50%, -8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.dropdown::before { /* hover bridge so the menu doesn't close in the gap */
  content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px;
}
.has-dropdown.is-open .dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.dropdown__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.dropdown__link, .dropdown__all {
  display: block; padding: 10px 12px; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--color-ink); text-decoration: none; white-space: nowrap;
}
.dropdown__link:hover, .dropdown__link:focus-visible { background: var(--color-primary); color: #1B1A2E; }
.dropdown__all {
  margin-top: var(--space-2); padding-top: 12px;
  border-top: 1px solid var(--color-border); border-radius: 0;
  font-weight: 700; color: var(--color-link);
}
.dropdown__all:hover { text-decoration: underline; }

.mobile-menu { overflow-y: auto; }
.mobile-menu__split { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.mobile-menu__caret svg { transition: transform 0.2s ease; }
.mobile-menu__caret[aria-expanded="true"] svg { transform: rotate(180deg); }
.mobile-sub {
  list-style: none; margin: 0 0 var(--space-2); padding: 0 0 0 var(--space-3);
  border-left: 4px solid var(--color-primary);
  display: grid; gap: 2px;
}
.mobile-sub[hidden] { display: none; }
.mobile-sub__link {
  display: block; padding: 8px 0;
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  color: var(--color-ink); text-decoration: none;
}

/* Section-entry animation (hero, CSS) */
.reveal { opacity: 0; transform: translateY(24px); animation: reveal 0.6s ease-out forwards; }
.reveal[data-delay="1"] { animation-delay: 0.08s; }
.reveal[data-delay="2"] { animation-delay: 0.16s; }
.reveal[data-delay="3"] { animation-delay: 0.24s; }
.reveal[data-delay="4"] { animation-delay: 0.32s; }
@keyframes reveal { to { opacity: 1; transform: none; } }

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

/* =========================================================
   PROOF — real video + real numbers (homepage)
   ========================================================= */
.proof { background: var(--color-surface); padding-block: var(--section-y); }
.proof__grid { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 900px) { .proof__grid { grid-template-columns: 1.15fr 1fr; gap: var(--space-7); } }
.proof__title { text-align: left; margin-bottom: var(--space-3); }
.proof__lead { margin: 0 0 var(--space-4); color: var(--color-ink-soft); max-width: 46ch; }
.proof__facts { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: grid; gap: var(--space-3); }
.proof__facts li { display: flex; align-items: baseline; gap: var(--space-3); padding-bottom: var(--space-3); border-bottom: 2px solid var(--color-border); }
.proof__facts strong { min-width: 5.2em; font-size: clamp(24px, 3vw, 32px); font-weight: 800; line-height: 1; color: var(--color-ink); }

/* ---- Exam buttons (Exams page, top row) ---- */
.xs__pills {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  min-width: 0;
}
.xs-pill {
  flex: 0 0 auto;
  padding: 9px 18px; border-radius: var(--radius-pill);
  border: 2px solid var(--xs-line); color: var(--xs-text);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.xs-pill:hover { border-color: var(--color-primary); }
.xs-pill.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #1B1A2E; box-shadow: 0 4px 0 var(--color-primary-deep); }
.xs-pill:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
@media (max-width: 899px) {
  /* phones: one row that scrolls sideways */
  .xs__pills { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--xs-pad)); padding: 2px var(--xs-pad) 8px; }
  .xs__pills::-webkit-scrollbar { display: none; }
  .xs-pill { padding: 7px 14px; font-size: 13px; }
}

/* =========================================================
   REGISTER PAGE — Student / School registration / Book slot
   ========================================================= */
.reg-page { background: var(--color-surface); }
.reg { padding-block: var(--space-6) var(--section-y); }
.reg__inner { max-width: 720px; }
.reg__head { text-align: center; }
.reg__title { font-weight: 800; font-size: clamp(36px, 6vw, 56px); line-height: 1; letter-spacing: -0.03em; }
.reg__lead { margin: var(--space-3) auto 0; max-width: 46ch; color: var(--color-ink-soft); }

/* switch buttons (same pill style as the exam buttons) */
.reg-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: var(--space-5) 0 var(--space-4); }
.reg-tab {
  padding: 10px 20px; border-radius: var(--radius-pill);
  border: 2px solid var(--color-ink); background: var(--color-bg); color: var(--color-ink);
  font: 700 15px/1.2 var(--font-display); cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
.reg-tab:hover { background: var(--color-surface); }
.reg-tab.is-active { background: var(--color-primary); box-shadow: 0 4px 0 var(--color-ink); }
.reg-tab:focus-visible { outline: 3px solid var(--color-primary-deep); outline-offset: 3px; }
@media (max-width: 479px) { .reg-tab { padding: 8px 14px; font-size: 14px; } }

.reg-panel[hidden] { display: none; }
.reg-card, .reg-done {
  padding: var(--space-5);
  background: var(--color-bg);
  border: 3px solid var(--color-ink); border-radius: var(--radius-lg);
  box-shadow: 0 8px 0 var(--color-ink);
}
@media (max-width: 479px) { .reg-card, .reg-done { padding: var(--space-4); } }
.reg-card[hidden] { display: none; }
.reg-card__title { font-weight: 800; font-size: clamp(24px, 4vw, 32px); line-height: 1.1; }
.reg-card__sub { margin: var(--space-2) 0 0; color: var(--color-ink-soft); }
.reg-form { display: grid; gap: var(--space-4); margin-top: var(--space-5); }
.reg-form[hidden] { display: none; }
.reg-opt, .reg-req { font-weight: 500; color: var(--color-ink-soft); }
.field-row--3 { display: grid; gap: var(--space-3); }
@media (min-width: 600px) { .field-row--3 { grid-template-columns: 1fr 1.3fr 1.3fr; } }

/* exams: toggle buttons, pick one or more */
.reg-exams { margin: 0; padding: 0; border: 0; min-width: 0; }
.reg-exams legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 14px; color: var(--color-ink); }
.exam-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.exam-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-pill);
  border: 2px solid var(--color-border); background: var(--color-bg); color: var(--color-ink);
  font: 700 14px/1.2 var(--font-display); cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.exam-toggle:hover { border-color: var(--color-primary-deep); }
.exam-toggle[aria-pressed="true"] { background: var(--color-primary); border-color: var(--color-ink); }
.exam-toggle[aria-pressed="true"]::before { content: "✓"; }
.exam-toggle:focus-visible { outline: 3px solid var(--color-primary-deep); outline-offset: 2px; }
.reg-exams.has-error .exam-toggle { border-color: var(--color-error); }

/* coupon: input + Apply side by side */
.input-action { display: flex; gap: 8px; }
.input-action input { flex: 1; min-width: 0; }
.input-action .btn { flex: 0 0 auto; }

.reg-summary { display: grid; gap: 6px; padding: var(--space-3) var(--space-4); background: var(--color-surface); border: 2px solid var(--color-border); border-radius: var(--radius-md); }
.reg-summary p { margin: 0; display: flex; justify-content: space-between; gap: var(--space-3); }
.reg-summary span { color: var(--color-ink-soft); }
.reg-summary__total { padding-top: 6px; border-top: 2px solid var(--color-border); font-size: 20px; }
.reg-summary__total strong { font-weight: 800; }
.reg-summary__note { font-size: 14px; color: var(--color-ink-soft); }
.reg-submit { width: 100%; min-height: 54px; font-size: 17px; }
.reg-submit.is-loading { pointer-events: none; opacity: 0.8; }
.reg-step { margin: 0; font-weight: 700; color: var(--color-success); }

.reg-done { display: flex; flex-direction: column; align-items: center; text-align: center; }
.reg-done[hidden] { display: none; }
.reg-done .tick { animation: pop 0.5s 0.85s ease-out both; }
.reg-done .auth__link { margin-top: var(--space-4); }
@media (prefers-reduced-motion: reduce) { .reg-done .tick { animation: none; } }

/* Books page: class buttons (one class loads at a time) */
.lib-classes {
  display: inline-flex; gap: 6px; padding: 6px; border-radius: var(--radius-pill);
  background: rgba(15, 42, 44, 0.85); pointer-events: auto;
}
.lib-class {
  padding: 9px 20px; border-radius: var(--radius-pill); border: 0;
  background: transparent; color: #FFF7E0;
  font: 700 15px/1.2 var(--font-display); cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.lib-class:hover { background: rgba(255, 247, 224, 0.12); }
.lib-class[aria-pressed="true"] { background: var(--color-primary); color: #1B1A2E; }
.lib-class:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.library__intro .library__lead { display: block; width: max-content; margin: var(--space-2) auto 0; }
.library__stage.is-fallback .library__intro { position: relative; left: auto; transform: none; padding-top: var(--space-5); }
@media (max-width: 479px) { .lib-class { padding: 8px 16px; font-size: 14px; } .library__intro .library__lead { font-size: 13px; } }
.lib-panel[hidden] { display: none; }
@media (min-width: 900px) {
  /* desktop: class buttons stacked on the left, in the empty wall space */
  .library__intro { left: max(var(--gutter), calc((100vw - var(--content-max)) / 2)); top: 50%; bottom: auto; transform: translateY(-50%); text-align: left; }
  .lib-classes { flex-direction: column; border-radius: var(--radius-lg); padding: 10px; }
  .lib-class { padding: 14px 32px; font-size: 20px; text-align: left; }
  .library__intro .library__lead { margin: var(--space-3) 0 0; }
}

/* =========================================================
   NAVBAR (Nov 2026): no Register button in the bar; "Our Other Products" stays inactive
   until its address is set in js/site-config.js
   ========================================================= */
.nav__link--soon, .mobile-menu__link--soon { color: var(--color-ink-soft); cursor: default; }
.nav__link--soon::after { display: none; }
.soon-tag {
  display: inline-block; vertical-align: middle; margin-left: 4px; padding: 2px 8px;
  border: 1.5px dashed var(--color-ink-soft); border-radius: var(--radius-pill);
  font-family: var(--font-display); font-size: 11px; font-weight: 600; line-height: 1.4; letter-spacing: 0; white-space: nowrap;
}
.mobile-menu__link--soon .soon-tag { font-size: 14px; }

/* =========================================================
   REGISTER (Nov 2026): "Are you a student or a school?" choice cards, friendlier forms, congratulations pop-up
   ========================================================= */
.reg__inner { max-width: 760px; }
.reg__title { font-size: clamp(32px, 6vw, 52px); text-wrap: balance; }

/* two big choice cards */
.reg-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: var(--space-5) 0 var(--space-5); }
.reg-choice__card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--space-4) var(--space-3) var(--space-4); text-align: center;
  border: 3px solid var(--color-ink); border-radius: var(--radius-lg); background: var(--color-bg); color: var(--color-ink);
  font-family: var(--font-body); cursor: pointer;
  box-shadow: 0 6px 0 var(--color-ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.2s ease;
}
.reg-choice__card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--color-ink); }
.reg-choice__card:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--color-ink); }
.reg-choice__card:focus-visible { outline: 4px solid var(--color-primary-deep); outline-offset: 4px; }
.reg-choice__art { width: 88px; height: 88px; }
.reg-choice__name { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.1; }
.reg-choice__text { font-size: 15px; line-height: 1.45; color: var(--color-ink-soft); max-width: 26ch; }
.reg-choice__check {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--color-ink); color: var(--color-bg); font-weight: 800;
  opacity: 0; transform: scale(0.6); transition: opacity 0.15s ease, transform 0.15s ease;
}
.reg-choice__card.is-active .reg-choice__check { opacity: 1; transform: none; }
.reg-choice__card--student.is-active { background: #FFE89A; }
.reg-choice__card--school.is-active { background: #D6EEFB; }
.reg-choice__card.is-active .reg-choice__text { color: var(--color-ink); }
/* once a choice is made, the other card steps back but stays one tap away */
.reg.has-choice .reg-choice__card:not(.is-active) { box-shadow: 0 3px 0 var(--color-ink); background: var(--color-bg); }
@media (max-width: 479px) {
  .reg-choice { gap: 12px; }
  .reg-choice__card { padding: var(--space-3) 10px; border-radius: var(--radius-md); }
  .reg-choice__art { width: 64px; height: 64px; }
  .reg-choice__name { font-size: 22px; }
  .reg-choice__text { font-size: 14px; }
  .reg-choice__check { top: 8px; right: 8px; width: 26px; height: 26px; font-size: 14px; }
}

/* form cards: a coloured welcome band on top, roomy numbered groups, bigger labels */
.reg-card { padding: 0; overflow: hidden; scroll-margin-top: calc(var(--header-h) + 16px); }
.reg-panel { scroll-margin-top: calc(var(--header-h) + 16px); }
.reg-card__head { padding: var(--space-4) var(--space-5); border-bottom: 3px solid var(--color-ink); }
.reg-card--student .reg-card__head { background: #FFE89A; }
.reg-card--school .reg-card__head { background: #D6EEFB; }
.reg-card__title:focus { outline: none; }
.reg-card__sub { color: var(--color-ink); }
.reg-card .reg-form { margin-top: 0; padding: var(--space-5); gap: var(--space-5); }
.reg-group { display: grid; gap: var(--space-4); }
.reg-group + .reg-group { padding-top: var(--space-5); border-top: 2px dashed var(--color-border); }
.reg-group__title { margin: 0; display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.2; }
.reg-group__n { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--color-primary); border: 2px solid var(--color-ink); font-size: 16px; }
.reg-card--school .reg-group__n { background: #BFE3F7; }
.reg-card .field { gap: 8px; }
.reg-card .field label, .reg-card .reg-exams legend { font-size: 16px; line-height: 1.4; }
.reg-card .field input, .reg-card .field select, .reg-card .field textarea { min-height: 56px; border-color: #CFC8B4; }
.reg-card .field input:hover, .reg-card .field select:hover, .reg-card .field textarea:hover { border-color: var(--color-ink-soft); }
.reg-card .input-prefix span { border-color: #CFC8B4; }
.reg-card .field__hint { margin: 0; font-size: 14px; color: var(--color-ink-soft); }
.reg-card .exam-toggles { gap: 10px; }
.reg-card .exam-toggle { min-height: 48px; padding: 10px 18px; font-size: 15px; border-color: #CFC8B4; }
.reg-card .exam-toggle[aria-pressed="true"] { border-color: var(--color-ink); box-shadow: 0 3px 0 var(--color-ink); }
.reg-card--school .btn--primary { background: var(--color-primary); }
.reg-fail { margin: 0; padding: 14px 16px; border: 2px solid var(--color-error); border-radius: var(--radius-sm); background: #FDECEA; color: #8F1D12; font-weight: 700; }
.reg-fail[hidden] { display: none; }
@media (max-width: 479px) {
  .reg-card__head { padding: var(--space-3) var(--space-4); }
  .reg-card .reg-form { padding: var(--space-4); }
  .reg-group__title { font-size: 18px; }
}

/* congratulations pop-up */
.reg-pop { width: min(520px, calc(100% - 32px)); padding: 0; border: 3px solid var(--color-ink); border-radius: var(--radius-lg); background: var(--color-bg); color: var(--color-ink); box-shadow: 0 8px 0 var(--color-ink); }
.reg-pop::backdrop { background: rgba(27, 26, 46, 0.72); }
.reg-pop__inner { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); padding: var(--space-6) var(--space-5) var(--space-5); text-align: center; }
.reg-pop .tick { animation: pop 0.5s 0.85s ease-out both; }
.reg-pop__msg { margin: 0; font-size: 18px; line-height: 1.5; text-wrap: balance; }
.reg-pop__msg strong { display: block; margin-bottom: 8px; font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 7vw, 40px); line-height: 1.05; letter-spacing: -0.02em; }
.reg-pop__msg:focus { outline: none; }
.reg-pop__btn { min-width: 160px; }
body.modal-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .reg-choice__card, .reg-choice__check { transition: none; }
  .reg-choice__card:hover, .reg-choice__card:active { transform: none; }
}
.reg-summary p[hidden] { display: none; }

/* =========================================================
   BOOKS (Nov 2026): Class, then Exam, then Book, with Read book / View syllabus / View sample paper together
   ========================================================= */
.books-page { background: var(--color-surface); }
.books { padding-block: var(--space-6) var(--section-y); }
.books__inner { max-width: 1040px; }
.books__head { text-align: left; }
.books__title { font-weight: 800; font-size: clamp(40px, 7vw, 64px); line-height: 1; letter-spacing: -0.03em; }
.books__lead { margin: var(--space-3) 0 0; max-width: 54ch; color: var(--color-ink-soft); font-size: 18px; }
.pick { margin-top: var(--space-6); }
.pick__title { margin: 0; display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.2; }
.pick__n { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--color-primary); border: 2px solid var(--color-ink); font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.pick__hint { margin: 8px 0 0; color: var(--color-ink-soft); }
.pick__opts { margin-top: var(--space-3); display: flex; flex-wrap: wrap; gap: 10px; }
.pick-btn {
  min-height: 48px; padding: 10px 20px; border-radius: var(--radius-pill);
  border: 2px solid var(--color-ink); background: var(--color-bg); color: var(--color-ink);
  font: 700 16px/1.2 var(--font-display); cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.pick-btn:hover { background: #FFF0BF; }
.pick-btn[aria-pressed="true"] { background: var(--color-primary); box-shadow: 0 4px 0 var(--color-ink); }
.pick-btn:focus-visible, .exam-tile:focus-visible { outline: 3px solid var(--color-primary-deep); outline-offset: 3px; }
.pick__opts--tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 520px) { .pick__opts--tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .pick__opts--tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.exam-tile {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 8px 12px;
  border: 2px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg); color: var(--color-ink);
  font: 700 14px/1.2 var(--font-display); text-align: center; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.exam-tile__cover { display: block; aspect-ratio: 542 / 640; border-radius: var(--radius-sm); background: var(--color-surface); overflow: hidden; }
.exam-tile__cover img { width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.exam-tile__cover img[hidden] { display: none; }
.exam-tile:hover:not(:disabled) { border-color: var(--color-ink); transform: translateY(-3px); }
.exam-tile[aria-pressed="true"] { border-color: var(--color-ink); background: var(--color-primary); box-shadow: 0 4px 0 var(--color-ink); }
.exam-tile:disabled { cursor: not-allowed; color: var(--color-ink-soft); }
.exam-tile:disabled .exam-tile__cover { border: 2px dashed var(--color-border); }

.book-view {
  margin-top: var(--space-6); display: grid; gap: var(--space-4); padding: var(--space-4);
  background: var(--color-bg); border: 3px solid var(--color-ink); border-radius: var(--radius-lg); box-shadow: 0 8px 0 var(--color-ink);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.book-view[hidden] { display: none; }
@media (min-width: 760px) { .book-view { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: var(--space-6); padding: var(--space-5); align-items: center; } }
.book-view__cover { border-radius: var(--radius-md); overflow: hidden; background: #FFFFFF; max-width: 360px; margin-inline: auto; width: 100%; }
.book-view__cover img { display: block; width: 100%; height: auto; }
.book-view__step { margin: 0; display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--color-ink-soft); }
.book-view__title { margin: var(--space-3) 0 0; font-weight: 800; font-size: clamp(28px, 5vw, 44px); line-height: 1.05; letter-spacing: -0.02em; }
.book-view__title:focus { outline: none; }
.book-view__text { margin: var(--space-3) 0 0; color: var(--color-ink-soft); max-width: 48ch; }
.book-view__actions { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: 12px; }
.book-view__actions .btn { min-height: 52px; }
.book-view__actions .btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.book-view__note { margin: var(--space-3) 0 0; padding: 10px 14px; border: 2px dashed var(--color-ink-soft); border-radius: var(--radius-sm); font-weight: 600; color: var(--color-ink); }
.book-view__note[hidden] { display: none; }
@media (max-width: 479px) { .book-view__actions .btn { width: 100%; } .pick-btn { padding-inline: 16px; } }
@media (prefers-reduced-motion: reduce) { .pick-btn, .exam-tile { transition: none; } .exam-tile:hover:not(:disabled) { transform: none; } }

/* =========================================================
   ACHIEVERS (Nov 2026): trophy photos + achiever photo gallery ("Wall of Fame"), loaded a few at a time
   ========================================================= */
.ach-hero--dash { padding-top: var(--section-y); border-top: 2px solid var(--color-border); }
.ach-hero--dash .section-sub { margin-bottom: var(--space-4); }
.ach-photos { padding-block: var(--space-5) var(--section-y); }
.ach-photos--fame { background: var(--color-surface); padding-top: var(--section-y); }
.photo-wall { display: flex; flex-direction: column; align-items: center; }
.photo-grid { width: 100%; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); } }
@media (min-width: 1100px) { .photo-grid--awards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.photo {
  position: relative; display: block; width: 100%; padding: 0; aspect-ratio: 4 / 3; overflow: hidden;
  border: 3px solid var(--color-ink); border-radius: var(--radius-md); background: var(--color-border); cursor: zoom-in;
  transition: transform 0.15s ease;
}
/* award photos carry names and captions, so they are shown whole instead of cropped */
.photo-grid--awards .photo { background: #FFFFFF; }
.photo-grid--awards .photo img { object-fit: contain; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.photo:hover { transform: translateY(-4px); }
.photo:focus-visible { outline: 4px solid var(--color-primary-deep); outline-offset: 3px; }
.photo-wall__count { margin: var(--space-4) 0 0; font-weight: 600; color: var(--color-ink-soft); }
.photo-wall__more { margin-top: var(--space-3); }
.photo-wall__more[hidden] { display: none; }
.photo-wall__sentinel { width: 100%; height: 1px; }

.photo-box { width: min(1100px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 24px); padding: 0; border: 3px solid var(--color-ink); border-radius: var(--radius-md); background: var(--color-ink); color: var(--color-bg); overflow: hidden; }
.photo-box[open] { display: flex; flex-direction: column; }
.photo-box::backdrop { background: rgba(27, 26, 46, 0.86); }
.photo-box__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 8px 8px 8px 16px; background: var(--color-bg); color: var(--color-ink); border-bottom: 3px solid var(--color-ink); }
.photo-box__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.photo-box__title:focus { outline: none; }
.photo-box__stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.photo-box__img { display: block; max-width: 100%; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); width: auto; height: auto; object-fit: contain; }
.photo-box__nav { position: absolute; top: 50%; transform: translateY(-50%); background: var(--color-bg); border-color: var(--color-ink); }
.photo-box__nav--prev { left: 8px; }
.photo-box__nav--next { right: 8px; }
.photo-box__nav:disabled { opacity: 0.35; cursor: not-allowed; }
.photo-box .icon-btn:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .photo { transition: none; } .photo:hover { transform: none; } }

/* Exams page: once a real cover is set, the placeholder label must not sit on top of it */
.book-frame__ph[hidden], .book-frame__img[hidden] { display: none !important; }
.xs-next__thumb.has-img { background-color: #FFFFFF; background-size: contain; background-repeat: no-repeat; }

/* =========================================================
   EXAMS (Nov 2026): choose a class, then an exam, then the details. Dark stage, yellow accents.
   ========================================================= */
.xp { background: var(--color-ink); color: #FFFFFF; padding-block: var(--space-6) var(--section-y); min-height: calc(100vh - var(--header-h)); }
.xp__inner { max-width: 1200px; }
.xp__h1 { font-weight: 800; font-size: clamp(40px, 7vw, 64px); line-height: 1; letter-spacing: -0.03em; color: var(--color-primary); }
.xp__lead { margin: var(--space-3) 0 0; max-width: 52ch; font-size: 18px; color: #D9D7E6; }
.xp__picks { margin-top: var(--space-5); display: grid; gap: var(--space-4); }
.xp__step { margin: 0; display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: #FFFFFF; }
.xp__n { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--color-primary); color: var(--color-ink); font-weight: 800; font-size: 15px; }
.xp__opts { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.xp-btn {
  min-height: 46px; padding: 10px 18px; border-radius: var(--radius-pill);
  border: 2px solid rgba(255, 255, 255, 0.45); background: transparent; color: #FFFFFF;
  font: 700 15px/1.2 var(--font-display); cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.xp-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.xp-btn:active { transform: scale(0.97); }
.xp-btn[aria-pressed="true"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-ink); }
.xp-btn:focus-visible, .xp-res:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
.xp__stage { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 2px solid rgba(255, 255, 255, 0.16); }
.xp__prompt { margin: 0; padding: var(--space-6) var(--space-4); border: 2px dashed rgba(255, 255, 255, 0.35); border-radius: var(--radius-lg); text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 18px; color: #D9D7E6; }
.xp__prompt[hidden], .xp__detail[hidden] { display: none; }
.xp__detail { display: grid; gap: var(--space-5); align-items: center; }
@media (min-width: 860px) { .xp__detail { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: var(--space-7); } }
.xp__eyebrow { margin: 0; display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--color-primary); }
.xp__dash { width: 40px; height: 3px; border-radius: 2px; background: var(--color-primary); }
.xp__title { margin: var(--space-2) 0 0; font-weight: 800; font-size: clamp(48px, 9vw, 96px); line-height: 0.95; letter-spacing: -0.03em; text-transform: uppercase; color: #FFFFFF; }
.xp__title:focus { outline: none; }
.xp__title-top { display: block; color: var(--color-primary); }
.xp__desc { margin: var(--space-3) 0 0; max-width: 44ch; font-size: 18px; font-weight: 500; color: #E6E4F0; }
.xp__facts { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.xp__facts li { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border: 2px solid rgba(255, 255, 255, 0.3); border-radius: var(--radius-pill); font-weight: 700; font-size: 14px; }
.xp__facts span { color: var(--color-primary); font-family: var(--font-display); font-size: 12px; }
.xp__facts em { font-style: italic; font-weight: 600; }
.xp__actions { margin-top: var(--space-4); }
.xp__res { margin-top: var(--space-3); display: flex; flex-wrap: wrap; gap: 10px; }
.xp-res { min-height: 46px; padding: 10px 18px; border-radius: var(--radius-pill); border: 2px solid #FFFFFF; background: #FFFFFF; color: var(--color-ink); font: 700 15px/1.2 var(--font-display); cursor: pointer; transition: background-color 0.15s ease, transform 0.1s ease; }
.xp-res:hover:not(:disabled) { background: var(--color-primary); border-color: var(--color-primary); }
.xp-res:disabled { opacity: 0.4; cursor: not-allowed; }
.xp__note { margin: var(--space-3) 0 0; font-weight: 600; color: #D9D7E6; }
.xp__note[hidden] { display: none; }
.xp__cover { justify-self: center; width: 100%; max-width: 420px; padding: 12px; border-radius: var(--radius-lg); background: var(--color-primary); }
.xp__cover img { display: block; width: 100%; height: auto; border-radius: var(--radius-md); background: #FFFFFF; }
@media (max-width: 859px) { .xp__cover { order: -1; max-width: 300px; } }
@media (max-width: 479px) { .xp-btn { padding-inline: 14px; font-size: 14px; } .xp-res { flex: 1 1 100%; } .xp__actions .btn { width: 100%; } }
/* the details slide in each time the choice changes */
.xp__detail.is-in .xp__copy { animation: xp-copy 0.45s cubic-bezier(.2,.7,.2,1) both; }
.xp__detail.is-in .xp__cover { animation: xp-cover 0.55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes xp-copy { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes xp-cover { from { opacity: 0; transform: translateX(40px) rotate(4deg) scale(0.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .xp__detail.is-in .xp__copy, .xp__detail.is-in .xp__cover { animation: none; } .xp-btn, .xp-res { transition: none; } }

/* =========================================================
   ACHIEVERS REDESIGN (Nov 2026): tabs, fast photo reels, "see all" pop-up. Replaces the long stacked page.
   ========================================================= */
.ach-hero { padding-block: var(--space-5) var(--space-3); }
.ach-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-block: var(--space-3) var(--space-4); }
.ach-tab {
  min-height: 48px; padding: 10px 24px; border-radius: var(--radius-pill);
  border: 2px solid var(--color-ink); background: var(--color-bg); color: var(--color-ink);
  font: 700 16px/1.2 var(--font-display); cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.ach-tab:hover { background: #FFF0BF; }
.ach-tab[aria-selected="true"] { background: var(--color-primary); box-shadow: 0 4px 0 var(--color-ink); }
.ach-tab:focus-visible { outline: 3px solid var(--color-primary-deep); outline-offset: 3px; }
.ach-panel[hidden] { display: none; }
.ach-panel { padding-bottom: var(--space-6); }
.ach-panel.is-in { animation: ach-panel-in 0.35s ease-out both; }
@keyframes ach-panel-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ach-panel__head .section-sub { margin-bottom: var(--space-4); }
.ach-panel__foot { display: flex; justify-content: center; margin-top: var(--space-4); }
.ach-panel--results .ach-hero--dash { padding-top: 0; border-top: 0; }
.ach-more { display: flex; justify-content: center; padding-block: var(--space-4); }
[data-ach-more][hidden] { display: none; }

/* reels: rows of photos gliding sideways; drag them by hand */
.reel { display: grid; gap: 14px; overflow: hidden; padding-block: 6px; }
.reel__row { overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.reel__row.is-dragging { cursor: grabbing; }
.reel__row.is-dragging .photo { pointer-events: none; }
.reel__row.is-static { overflow-x: auto; cursor: auto; touch-action: auto; }
.reel__track { display: flex; gap: 14px; width: max-content; padding-inline: 7px; will-change: transform; }
.reel .photo { flex: none; width: auto; height: 220px; aspect-ratio: auto; border-radius: var(--radius-md); cursor: zoom-in; }
.reel .photo img { width: auto; height: 100%; max-width: none; object-fit: cover; -webkit-user-drag: none; }
.reel--whole .photo { height: 300px; background: #FFFFFF; }
@media (max-width: 699px) { .reel .photo { height: 150px; } .reel--whole .photo { height: 190px; } .reel, .reel__track { gap: 10px; } }

/* "see all" pop-up */
.photo-all { width: min(1200px, calc(100% - 24px)); height: min(900px, calc(100% - 24px)); max-width: none; max-height: none; padding: 0; border: 3px solid var(--color-ink); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-ink); overflow: hidden; }
.photo-all[open] { display: flex; flex-direction: column; animation: ach-panel-in 0.3s ease-out both; }
.photo-all::backdrop { background: rgba(27, 26, 46, 0.8); }
.photo-all__bar { display: flex; align-items: center; gap: var(--space-3); padding: 8px 8px 8px 16px; background: var(--color-bg); border-bottom: 3px solid var(--color-ink); }
.photo-all__title { margin: 0; flex: 1; font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.2; }
.photo-all__title:focus { outline: none; }
.photo-all__count { margin: 0; font-weight: 600; font-size: 14px; color: var(--color-ink-soft); white-space: nowrap; }
.photo-all__body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-3); display: flex; flex-direction: column; align-items: center; overscroll-behavior: contain; }
.photo-all .photo-grid--awards .photo { background: #FFFFFF; }
@media (max-width: 599px) { .photo-all { width: 100%; height: 100%; border: 0; border-radius: 0; } .ach-tab { padding-inline: 16px; font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .ach-panel.is-in, .photo-all[open] { animation: none; } .ach-tab { transition: none; } }
@media (max-width: 419px) { .ach-tabs { gap: 6px; } .ach-tab { padding-inline: 12px; font-size: 14px; } }
/* Achievers tabs take turns by themselves: a thin bar on the active tab shows the time left (js/achievers-gallery.js) */
.ach-tab { position: relative; overflow: hidden; }
.ach-tab::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--color-ink); transform-origin: left; transform: scaleX(var(--p, 0)); }
.ach-tab:not([aria-selected="true"])::after { display: none; }

/* =========================================================
   REGISTER: feel-good feedback (js/register.js "Feel-good feedback")
   ========================================================= */
.reg-card { overflow: clip; }   /* clip, not hidden, so the progress bar can stick while the form scrolls */
.reg-progress { position: sticky; top: var(--header-h); z-index: 5; margin: calc(var(--space-5) * -1) calc(var(--space-5) * -1) 0; padding: 12px var(--space-5); background: var(--color-bg); border-bottom: 2px solid var(--color-border); }
@media (max-width: 479px) { .reg-progress { margin: calc(var(--space-4) * -1) calc(var(--space-4) * -1) 0; padding-inline: var(--space-4); } }
.reg-progress__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.reg-progress__text { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 15px; transform-origin: left center; }
.reg-progress__num { margin: 0; font-weight: 600; font-size: 13px; color: var(--color-ink-soft); white-space: nowrap; }
.reg-progress__track { margin-top: 8px; height: 12px; border-radius: var(--radius-pill); background: var(--color-surface); border: 2px solid var(--color-ink); overflow: hidden; }
.reg-progress__fill { display: block; height: 100%; background: var(--color-primary); transform: scaleX(0); transform-origin: left; transition: transform 0.45s cubic-bezier(.3,1.4,.5,1), background-color 0.3s ease; }
.reg-progress.is-full .reg-progress__fill { background: var(--color-success); }
.reg-progress.is-full .reg-progress__text { color: #137A52; }
.reg-card--school .reg-progress__fill { background: #7CC4EA; }
.reg-card--school .reg-progress.is-full .reg-progress__fill { background: var(--color-success); }

/* a green tick pops in beside a field once it is right */
.reg-card .field > label, .reg-card .reg-exams > legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.reg-card .field.is-ok > label::after, .reg-card .field.is-ok > legend::after {
  content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--color-success); color: #FFFFFF; font: 800 13px/1 var(--font-display);
}
.reg-card .field.is-ok-pop > label::after, .reg-card .field.is-ok-pop > legend::after { animation: joy-pop 0.45s cubic-bezier(.3,1.6,.5,1) both; }
.reg-card .field.is-ok input, .reg-card .field.is-ok select, .reg-card .field.is-ok textarea { border-color: var(--color-success); }
.reg-card .field.is-ok .input-prefix span { border-color: var(--color-success); }

/* a finished step: its number becomes a tick */
.reg-group.is-done .reg-group__n { background: var(--color-success); color: #FFFFFF; }
.reg-group__n.is-pop, .exam-toggle.is-pop, .reg-progress__text.is-pop, .reg-summary__total strong.is-pop, .reg-choice__art.is-pop { animation: joy-pop 0.5s cubic-bezier(.3,1.6,.5,1) both; }
.reg-summary__total strong { display: inline-block; transform-origin: right center; }
@keyframes joy-pop { 0% { transform: scale(0.6); } 55% { transform: scale(1.25); } 100% { transform: scale(1); } }
.exam-toggle { transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease; }
.exam-toggle:active { transform: scale(0.94); }
.reg-card .field input, .reg-card .field select, .reg-card .field textarea { transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease; }
.reg-card .field input:focus, .reg-card .field select:focus, .reg-card .field textarea:focus { transform: translateY(-1px); }

/* everything is right: the Register button glows */
.reg-submit.is-ready { animation: joy-glow 1.6s ease-in-out infinite; }
@keyframes joy-glow { 0%, 100% { transform: translateY(0); box-shadow: 0 5px 0 var(--color-primary-deep), 0 0 0 0 rgba(255, 201, 51, 0.7); } 50% { transform: translateY(-2px); box-shadow: 0 7px 0 var(--color-primary-deep), 0 0 0 12px rgba(255, 201, 51, 0); } }
@media (prefers-reduced-motion: reduce) {
  .reg-progress__fill, .exam-toggle, .reg-card .field input, .reg-card .field select, .reg-card .field textarea { transition: none; }
  .reg-card .field input:focus, .reg-card .field select:focus, .reg-card .field textarea:focus, .exam-toggle:active { transform: none; }
  .reg-group__n.is-pop, .exam-toggle.is-pop, .reg-progress__text.is-pop, .reg-summary__total strong.is-pop, .reg-choice__art.is-pop, .reg-card .field.is-ok-pop > label::after, .reg-card .field.is-ok-pop > legend::after, .reg-submit.is-ready { animation: none; }
}
/* Achievers, 21 Nov 2026: the three parts are stacked one below the other (tabs and timer removed) */
.ach-panel { padding-bottom: var(--space-5); scroll-margin-top: calc(var(--header-h) + 8px); }
.ach-panel + .ach-panel { padding-top: var(--space-5); }
#trophies { background: var(--color-surface); }
.ach-panel--results { padding-top: var(--space-6); border-top: 2px solid var(--color-border); }

/* =========================================================
   REGISTER: doodles left and right of the form (js/register.js "Doodles beside the form")
   Only where there is room beside the 760px form. They colour in as the form fills up.
   ========================================================= */
.reg { position: relative; }
.reg-doodles { display: none; }
@media (min-width: 1180px) {
  .reg-doodles { display: block; position: absolute; top: 0; bottom: 0; width: calc((100% - 760px) / 2 - 32px); max-width: 300px; pointer-events: none; }
  .reg-doodles--left { right: calc(50% + 380px + 16px); }
  .reg-doodles--right { left: calc(50% + 380px + 16px); }
  .reg-doodles__inner { position: sticky; top: calc(var(--header-h) + 16px); height: calc(100vh - var(--header-h) - 32px); min-height: 520px; overflow: hidden; }
  .reg__inner { position: relative; z-index: 1; }
}
.doodle { position: absolute; display: block; filter: grayscale(1); opacity: 0.22; transition: filter 0.5s ease, opacity 0.5s ease; }
.doodle svg { display: block; width: 100%; height: 100%; overflow: visible; transform: rotate(var(--tilt, 0deg)); animation: doodle-float 5s ease-in-out var(--delay, 0s) infinite; }
.doodle.is-lit { filter: none; opacity: 1; }
.doodle.is-pop { animation: joy-pop 0.6s cubic-bezier(.3,1.6,.5,1) both; }
.doodle.is-cheer { animation: doodle-cheer 0.7s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes doodle-float { 0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); } 50% { transform: translateY(-10px) rotate(calc(var(--tilt, 0deg) + 5deg)); } }
@keyframes doodle-cheer { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-26px) scale(1.15) rotate(-8deg); } 70% { transform: translateY(4px) scale(0.96) rotate(5deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .doodle svg, .doodle.is-pop, .doodle.is-cheer { animation: none; } .doodle { transition: none; } }

/* =========================================================
   OUR OTHER PRODUCTS (20 Nov 2026): a page of its own. The kindergarten books rectangle, then the 3D library.
   ========================================================= */
.products { background: var(--color-surface); }
.prod-top { padding-block: var(--space-6) var(--space-6); }
.prod-top__inner { max-width: 1100px; }
.prod-head__title { font-weight: 800; font-size: clamp(36px, 6vw, 60px); line-height: 1; letter-spacing: -0.03em; }
.prod-head__lead { margin: var(--space-3) 0 0; max-width: 46ch; font-size: 18px; color: var(--color-ink-soft); }
.prod-card {
  margin-top: var(--space-5); display: grid; gap: var(--space-5); align-items: center; padding: var(--space-5);
  background: var(--color-bg); border: 3px solid var(--color-ink); border-radius: var(--radius-lg); box-shadow: 0 8px 0 var(--color-ink);
}
@media (min-width: 860px) { .prod-card { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-7); padding: var(--space-6); } }
.prod-card__title { margin: var(--space-3) 0 0; font-weight: 800; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.05; letter-spacing: -0.02em; }
.prod-card__text { margin: var(--space-3) 0 var(--space-4); max-width: 40ch; font-size: 17px; color: var(--color-ink-soft); }
.prod-card__note { margin: var(--space-3) 0 0; font-size: 14px; color: var(--color-ink-soft); font-style: italic; }
.prod-card__books { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.kgbook__btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 12px 8px 14px;
  border: 2px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-ink); cursor: pointer;
  font-family: var(--font-display); transition: transform 0.2s cubic-bezier(.3,1.6,.5,1), border-color 0.15s ease, background-color 0.15s ease;
}
.kgbook__btn:hover { transform: translateY(-8px) rotate(-1.5deg); border-color: var(--color-ink); background: #FFF0BF; }
.kgbook:nth-child(2) .kgbook__btn:hover { transform: translateY(-8px) rotate(1.5deg); }
.kgbook__btn:active { transform: translateY(-2px) scale(0.98); }
.kgbook__btn:focus-visible { outline: 3px solid var(--color-primary-deep); outline-offset: 3px; }
.kgbook__art { width: 100%; height: auto; max-width: 150px; }
.kgbook__name { font-family: var(--font-display); font-weight: 800; font-size: 14px; fill: #1B1A2E; }
.kgbook__label { font-weight: 700; font-size: 15px; }
@media (max-width: 479px) { .prod-card { padding: var(--space-4); } .prod-card__books { gap: 8px; } .kgbook__btn { padding-inline: 4px; } .kgbook__label { font-size: 13px; } }

/* the library below the rectangle: a normal block on the page, not the whole screen */
.products .library { background: #2E5B5D; }
.library__heading { margin: 0; padding: var(--space-4) var(--gutter) 0; text-align: center; font-weight: 800; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.1; color: #F4EEDF; scroll-margin-top: var(--header-h); }
.products .library__stage { height: clamp(560px, 86svh, 860px); }

/* the Nursery / LKG / UKG switch: a yellow highlight slides to the chosen class */
.lib-classes { position: relative; }
.lib-class { position: relative; z-index: 1; }
.lib-classes__thumb {
  position: absolute; left: 0; top: 0; z-index: 0; width: var(--w, 0); height: var(--h, 0); border-radius: var(--radius-pill);
  background: var(--color-primary); transform: translate(var(--x, 0), var(--y, 0));
  transition: transform 0.42s cubic-bezier(.3,1.4,.5,1), width 0.42s cubic-bezier(.3,1.4,.5,1), height 0.42s ease;
}
.lib-classes.has-thumb .lib-class[aria-pressed="true"] { background: transparent; }
.lib-class.is-pop { animation: joy-pop 0.5s cubic-bezier(.3,1.6,.5,1) both; }
@media (prefers-reduced-motion: reduce) { .lib-classes__thumb { transition: none; } .lib-class.is-pop, .kgbook__btn:hover { animation: none; transform: none; } .kgbook__btn { transition: none; } }

/* =========================================================
   LIBRARY, REDONE (20 Nov 2026): bright funky room, three almirahs that swap, doodles on the wall
   ========================================================= */
.products .library { background: #3D1D94; }
.library__stage { background-color: #3D1D94; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Ccircle cx='18' cy='18' r='5' fill='%23fff' fill-opacity='.14'/%3E%3Ccircle cx='54' cy='54' r='5' fill='%23fff' fill-opacity='.14'/%3E%3C/svg%3E"); }
.library__heading { color: #FFE04A; text-shadow: 0 3px 0 #1C0D42; }
.library__canvas { position: absolute; z-index: 1; }
.library__canvas--front { z-index: 2; }
.library__wall { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; transition: filter 0.5s ease; }
.library__stage.is-open .library__wall { filter: blur(8px) brightness(0.72); }
.wd { position: absolute; display: block; transform-origin: 50% 50%; animation: var(--wd-anim) var(--dur, 5s) ease-in-out var(--delay, 0s) infinite; }
.wd svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wd--float { --wd-anim: wd-float; }
.wd--wiggle { --wd-anim: wd-wiggle; }
.wd--pulse { --wd-anim: wd-pulse; }
.wd--spin { --wd-anim: wd-spin; animation-timing-function: linear; }
@keyframes wd-float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-16px) rotate(5deg); } }
@keyframes wd-wiggle { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg) scale(1.06); } }
@keyframes wd-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@keyframes wd-spin { to { transform: rotate(360deg); } }
@media (max-width: 699px) { .wd { transform: scale(0.7); } .library__wall .wd:nth-child(n+11) { display: none; } }
@media (prefers-reduced-motion: reduce) { .wd { animation: none; } }

.library__intro { z-index: 3; }
.library__lead { background: #FFE04A; color: #2A1458; border: 3px solid #2A1458; font-weight: 700; }
.lib-arrow {
  position: absolute; top: 50%; z-index: 4; width: 56px; height: 56px; margin-top: -28px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; border: 3px solid #2A1458; background: #FFE04A; color: #2A1458; cursor: pointer;
  box-shadow: 0 5px 0 #2A1458; transition: transform 0.15s cubic-bezier(.3,1.6,.5,1), opacity 0.2s ease;
}
.lib-arrow svg { width: 28px; height: 28px; }
.lib-arrow--prev { left: var(--space-3); }
.lib-arrow--next { right: var(--space-3); }
.lib-arrow:hover:not(:disabled) { transform: scale(1.12); }
.lib-arrow:active:not(:disabled) { transform: scale(0.94); box-shadow: 0 2px 0 #2A1458; }
.lib-arrow:disabled { opacity: 0.3; cursor: default; }
.lib-arrow:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 3px; }
.library__stage.is-open .lib-arrow { display: none; }
@media (max-width: 599px) { .lib-arrow { width: 48px; height: 48px; margin-top: -24px; } }
@media (prefers-reduced-motion: reduce) { .lib-arrow { transition: none; } }
/* the instruction pill sits along the bottom, centred (the old left-hand switch column is gone) */
.products .library__stage .library__intro { left: 0; right: 0; top: auto; bottom: var(--space-4); transform: none; display: flex; justify-content: center; text-align: center; padding-inline: var(--space-3); }
.products .library__stage .library__intro .library__lead { margin: 0; width: auto; max-width: 100%; font-size: 15px; padding: 8px 18px; }
@media (max-width: 599px) { .products .library__stage .library__intro .library__lead { font-size: 13px; padding: 6px 14px; } }
