/*
 * testogram.com — the shared design system (BITE W3, "Option C — serious
 * analytics, warm rewards"). Every generated page links this file and
 * /assets/js/site.js; no page carries its own style block.
 *
 * SCOPE. Tokens and the fonts are global. Components are prefixed `s-` (and a
 * few short names under `.s-site`), and base element styles apply only inside
 * `body.s-site`, so an older hand-written page can link this file for the new
 * header, footer and logo without its own inline styles being overridden.
 *
 * TOKENS
 *   colour   sapphire #0F52BA primary · #124799 hero and dark sections ·
 *            KP gold #F59E0B and streak orange #F97316 as ACCENTS only
 *            (never white text on orange; gold text on dark only at large sizes)
 *   type     golden ratio from 18 px: 12 / 18 / 29 / 47 / 76; phone drops a step
 *   space    Fibonacci: 8 / 13 / 21 / 34 / 55 / 89
 *   radius   16 and 21 (cards); pills for buttons
 *   motion   reveal on scroll, count-up, mascot float, card lift — all off under
 *            prefers-reduced-motion
 */

/* ── Fonts: self-hosted, swap ───────────────────────────────────────────── */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans Devanagari";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/noto-sans-devanagari-devanagari-400-normal.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: "Noto Sans Devanagari";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/noto-sans-devanagari-devanagari-600-normal.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}

/* Metric-matched fallbacks: while a web font loads, the system font takes the
   same room, so the swap moves nothing (no layout shift). Measured from the
   font files' glyph widths against Arial (BITE W3). */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.48%;
  ascent-override: 90.14%;
  descent-override: 22.44%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Plus Jakarta Sans Fallback";
  src: local("Arial Bold"), local("Arial");
  size-adjust: 101.82%;
  ascent-override: 101.95%;
  descent-override: 21.8%;
  line-gap-override: 0%;
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --sapphire: #0f52ba;
  --sapphire-deep: #124799;
  --sapphire-ink: #0b2f6b;
  --sapphire-tint: #eef3fb;
  --sapphire-line: #c9d7ef;
  --gold: #f59e0b;
  --gold-soft: #fef3c7;
  --orange: #f97316;
  --orange-soft: #ffedd5;
  --ink: #111827;
  --muted: #4b5563;
  --on-dark: #ffffff;
  --on-dark-muted: #dbe5f6;
  --line: #dde3ee;
  --paper: #ffffff;
  --free: #065f46;
  --free-soft: #d1fae5;

  --t-1: 12px;
  --t-2: 18px;
  --t-3: 29px;
  --t-4: 47px;
  --t-5: 76px;
  --lh-body: 1.618;
  --lh-head: 1.15;

  --s-1: 8px;
  --s-2: 13px;
  --s-3: 21px;
  --s-4: 34px;
  --s-5: 55px;
  --s-6: 89px;

  --r-1: 16px;
  --r-2: 21px;

  --font-head: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", "Inter Fallback", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;

  --shadow-1: 0 1px 2px rgba(17, 24, 39, 0.06), 0 8px 21px rgba(15, 82, 186, 0.08);
  --shadow-2: 0 2px 4px rgba(17, 24, 39, 0.06), 0 21px 34px rgba(15, 82, 186, 0.14);
  --wrap: 1180px;
  --measure: 68ch;
}
@media (max-width: 720px) {
  /* Phone: every heading drops one step; the body stays at the base. */
  :root {
    --t-5: 47px;
    --t-4: 29px;
    --t-3: 18px;
    --s-6: 55px;
    --s-5: 34px;
  }
}

/* ── Base (new pages only) ──────────────────────────────────────────────── */
.s-site,
.s-site *,
.s-site *::before,
.s-site *::after {
  box-sizing: border-box;
}
body.s-site {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-2);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.s-site :lang(hi) {
  font-family: "Noto Sans Devanagari", var(--font-body);
}
.s-site h1,
.s-site h2,
.s-site h3 {
  font-family: var(--font-head);
  line-height: var(--lh-head);
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-3);
  font-weight: 800;
}
.s-site h1 { font-size: var(--t-5); letter-spacing: -0.02em; }
/* Plus Jakarta Sans draws ".", "!" (0.13 em) and "," (0.11 em) with a wide
   left margin and kerns them only after V, y, 7, 9: at headline size that
   reads as a space ("stand ."). The export wraps a heading's word-ending
   marks; this pulls each back to its word. Static: nothing animates. */
.s-site .s-punct { margin-left: -0.1em; }
.s-site .s-punct--comma { margin-left: -0.08em; }
.s-site h2 { font-size: var(--t-4); }
.s-site h3 { font-size: var(--t-3); font-weight: 700; }
.s-site p { margin: 0 0 var(--s-3); }
.s-site img { max-width: 100%; height: auto; }
.s-site a { color: var(--sapphire); text-underline-offset: 3px; }
.s-site a:hover { color: var(--sapphire-ink); }
.s-site :focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.s-site ul, .s-site ol { margin: 0 0 var(--s-3); padding-left: var(--s-3); }
.s-skip {
  position: absolute;
  left: -9999px;
  top: var(--s-1);
  background: var(--paper);
  color: var(--sapphire);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-1);
  z-index: 10;
}
.s-skip:focus { left: var(--s-2); }

.s-wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--s-3);
}
@media (max-width: 720px) {
  .s-wrap { padding: 0 16px; }
}
.s-section { padding: var(--s-6) 0; }
.s-section--tint { background: var(--sapphire-tint); }
.s-section--dark { background: var(--sapphire-deep); color: var(--on-dark); }
.s-section--dark a { color: var(--on-dark); }
.s-eyebrow {
  font-family: var(--font-head);
  font-size: var(--t-1);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sapphire);
  margin: 0 0 var(--s-2);
}
.s-section--dark .s-eyebrow,
.s-hero .s-eyebrow { color: var(--on-dark-muted); }
.s-lead { font-size: var(--t-2); color: var(--muted); max-width: var(--measure); }
.s-section--dark .s-lead { color: var(--on-dark-muted); }
.s-prose { max-width: var(--measure); }
.s-prose p:last-child { margin-bottom: 0; }
.s-small { font-size: var(--t-1); color: var(--muted); }
.s-section--dark .s-small, .s-hero .s-small { color: var(--on-dark-muted); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.s-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 48px;
  padding: var(--s-2) var(--s-4);
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--t-2);
  line-height: 1.2;
  text-decoration: none;
  background: var(--sapphire);
  color: #ffffff;
  border: 2px solid var(--sapphire);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.s-site a.s-btn { color: #ffffff; }
.s-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.s-site a.s-btn:hover { color: #ffffff; background: var(--sapphire-ink); }
/* On a sapphire section the button is white with sapphire text. */
.s-btn--light,
.s-site a.s-btn--light { background: #ffffff; color: var(--sapphire); border-color: #ffffff; }
.s-site a.s-btn--light:hover { background: var(--sapphire-tint); color: var(--sapphire-ink); }
.s-btn--line,
.s-site a.s-btn--line { background: transparent; color: var(--sapphire); border-color: var(--sapphire); }
.s-site a.s-btn--line:hover { background: var(--sapphire-tint); color: var(--sapphire-ink); }
.s-btn--line-light,
.s-site a.s-btn--line-light { background: transparent; color: #ffffff; border-color: #ffffff; }
.s-site a.s-btn--line-light:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.s-when { list-style: none; padding: 0; }
.s-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-top: var(--s-4); }

/* ── Header (the wordmark's 26/21 px are the logo lockup, not text sizes) ─────────────────────────────────────────────────────────────── */
.s-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(8px);
}
.s-header__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--s-2) var(--s-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
@media (max-width: 720px) {
  .s-header__inner { padding: var(--s-1) 16px; }
  .s-header .s-btn { padding: var(--s-1) var(--s-3); min-height: 44px; }
}
.s-brand,
.tg-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.s-brand img,
.tg-brand img { display: block; width: 40px; height: 40px; }
.s-brand span,
.tg-word {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--sapphire);
}
/* W4b: the logo is 40 px on every screen size, header and footer; on a
   phone only the wordmark beside it steps down. */
@media (max-width: 560px) {
  .s-brand span, .tg-word { font-size: 21px; }
}

/* ── The header nav (W4b): Exams · Blog · Downloads · Avi & Mira ─────────── */
.s-nav { display: flex; align-items: center; margin-left: auto; }
.s-site .s-nav__list,
.s-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px var(--s-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.s-nav__list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-2);
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
}
.s-nav__list a:hover { background: var(--sapphire-tint); color: var(--sapphire-ink); }
.s-nav__list a[aria-current="page"] { color: var(--sapphire); background: var(--sapphire-tint); }
/* The hand-written card pages (/download/, /app, 404 …): the nav as a top bar. */
.s-topnav { display: flex; justify-content: center; padding: var(--s-1) 16px; background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--line); }
/* Before the export fills it, the bar holds only its markers: hide it. */
.s-topnav:not(:has(a)) { display: none; }
.s-topnav .s-nav { margin: 0; }
/* The older pages' own headers: the nav sits between the logo and the button. */
.nav-inner .s-nav { flex: 1; justify-content: flex-end; margin-right: var(--s-2); }
.s-pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); margin: 0 0 var(--s-3); }
.s-pagehead .s-nav { margin-left: 0; }
@media (max-width: 860px) {
  /* Phone and tablet: the nav takes its own row under the logo and button. */
  .s-header__inner, .nav-inner { flex-wrap: wrap; row-gap: 0; }
  .s-header .s-nav, .nav-inner .s-nav { order: 3; width: 100%; margin: 0; justify-content: flex-start; }
  .s-nav__list { gap: 0 4px; }
  .s-nav__list a { padding: 0 10px; font-size: 15px; }
  .s-header .s-nav__list { margin-left: -10px; }
}

/* The Testogram UTS heading (the crown and its name as text) and the
   catalogue's plain series list, as the older pages draw them. */
.tg-uts { display: flex; align-items: center; gap: 10px; }
.tg-uts img { display: block; height: 40px; width: auto; }
.tg-uts span { font-family: var(--font-head); font-weight: 800; color: #8a6d0b; }
.s-section--dark .tg-uts span, .s-hero .tg-uts span { color: var(--gold); }
.uts-list { list-style: none; padding-left: 0; margin: 0; }
.uts-series { padding: var(--s-1) 0; border-bottom: 1px solid var(--line); }
.uts-series a { font-weight: 600; }
.uts-meta { color: var(--muted); }

/* The brand line in every footer (W3 part 2), and two screens side by side. */
.s-brandline { margin: var(--s-1) 0 0; font-size: var(--t-1); letter-spacing: 0.06em; }
.s-brandline strong { font-family: var(--font-head); font-weight: 800; }
.s-pair { display: flex; gap: var(--s-2); align-items: flex-start; }
.s-pair .s-phone { max-width: 200px; }

/* ── Breadcrumbs ────────────────────────────────────────────────────────── */
.s-crumbs { font-size: var(--t-1); margin: 0 0 var(--s-3); }
.s-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-1); margin: 0; padding: 0; }
.s-crumbs li + li::before { content: "›"; margin-right: var(--s-1); opacity: 0.7; }
.s-crumbs a { color: inherit; }
.s-hero .s-crumbs { color: var(--on-dark-muted); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.s-hero {
  background: var(--sapphire-deep);
  color: var(--on-dark);
  position: relative;
  overflow: hidden;
  padding: var(--s-5) 0 0;
}
.s-hero::before {
  content: "";
  position: absolute;
  right: -21%;
  top: -34%;
  width: 55vw;
  height: 55vw;
  max-width: 760px;
  max-height: 760px;
  border-radius: 50%;
  background: var(--sapphire);
  opacity: 0.85;
}
.s-hero a { color: var(--on-dark); }
.s-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--s-4);
  align-items: end;
}
.s-hero__copy { padding-bottom: var(--s-6); }
.s-hero h1 { color: var(--on-dark); }
.s-hero h1 .s-accent { color: var(--gold); }
.s-hero .s-lead { color: var(--on-dark-muted); font-size: var(--t-2); }
.s-hero__art { align-self: end; }
.s-hero__art img { display: block; width: 100%; height: auto; }
@media (max-width: 860px) {
  .s-hero__grid { grid-template-columns: 1fr; }
  .s-hero__copy { padding-bottom: 0; }
  .s-hero__art { max-width: 233px; margin: 0 auto; }
}
.s-avail { margin-top: var(--s-3); font-size: var(--t-1); color: var(--on-dark-muted); }

/* ── Chips and tags ─────────────────────────────────────────────────────── */
.s-tag {
  display: inline-block;
  font-family: var(--font-head);
  font-size: var(--t-1);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  vertical-align: middle;
  line-height: 1.6;
}
.s-tag--free { background: var(--free-soft); color: var(--free); }
/* Orange is never under white text: the Postponed tag is dark on soft orange. */
.s-tag--postponed { background: var(--orange-soft); color: #7c2d12; }
.s-tag--gold { background: var(--gold-soft); color: #78350f; }
.s-tag--soon { background: var(--gold-soft); color: #78350f; }

/* ── Cards and the bento grid ───────────────────────────────────────────── */
.s-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--s-4);
  box-shadow: var(--shadow-1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.s-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.s-card h3 { font-size: var(--t-3); }
.s-bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.s-tile {
  grid-column: span 2;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--s-4);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.s-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.s-tile h3 { font-size: var(--t-3); margin: 0; }
.s-tile p { margin: 0; color: var(--muted); }
/* Long copy in a tile keeps its paragraphs apart (W4b: the home story). */
.s-tile .s-prose p + p { margin-top: var(--s-2); }
.s-tile--wide { grid-column: span 4; }
.s-tile--half { grid-column: span 3; }
.s-tile--full { grid-column: 1 / -1; }
.s-tile--warm { background: linear-gradient(160deg, #fffbeb 0%, #ffffff 60%); border-color: #f6dfa8; }
.s-tile--deep { background: var(--sapphire-deep); color: var(--on-dark); border-color: var(--sapphire-deep); }
.s-tile--deep p { color: var(--on-dark-muted); }
/* A number tile beside a phone: its figure centred, not stranded at the top. */
.s-tile--deep { justify-content: center; }
.s-tile__media { margin-top: auto; display: flex; justify-content: center; }
.s-tile__row { display: flex; gap: var(--s-3); align-items: center; }
.s-tile__icon { width: 55px; height: 55px; flex: none; }
.s-figure {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--t-4);
  line-height: 1;
  color: var(--sapphire);
}
.s-tile--deep .s-figure { color: #ffffff; }
@media (max-width: 960px) {
  .s-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-tile, .s-tile--half { grid-column: span 1; }
  .s-tile--wide, .s-tile--full { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .s-bento { grid-template-columns: 1fr; }
  .s-tile, .s-tile--half, .s-tile--wide { grid-column: 1 / -1; }
}

/* ── Phone frame and the sample label ───────────────────────────────────── */
.s-phone {
  position: relative;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  padding: 8px;
  border-radius: 34px;
  background: #0b1220;
  box-shadow: 0 21px 34px rgba(11, 18, 32, 0.25);
}
.s-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
  background: #f4f5fa;
}
.s-phone__label {
  position: absolute;
  top: 21px;
  left: -8px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--t-1);
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: var(--shadow-1);
}
/* A tall phone screen in a tile shows its top part. */
.s-phone--crop { max-height: 420px; overflow: hidden; }
.s-phone--crop img { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* ── The video card (click to load; W3 add-on) ─────────────────────────── */
.s-section--tight { padding: var(--s-4) 0 0; }
.s-section--tight .s-bento { margin-top: 0; }
.s-video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-1);
  overflow: hidden;
  background: var(--sapphire-deep);
}
.s-video__frame img,
.s-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
.s-video__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: var(--sapphire);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 21px rgba(11, 18, 32, 0.35);
}
.s-video__play:hover { background: var(--sapphire-ink); }
.s-video__play:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; }

/* ── Programmes (exam hub) ──────────────────────────────────────────────── */
.s-programmes { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: var(--s-4); }
.s-programme { border-top: 8px solid var(--accent, var(--sapphire)); }
.s-programme h3 { margin-bottom: var(--s-1); }
.s-site .s-editions { list-style: none; padding: 0; margin: var(--s-3) 0 0; }
.s-editions li { padding: var(--s-2) 0; border-top: 1px solid var(--line); }
.s-editions a { font-weight: 600; }

/* ── Timetable ──────────────────────────────────────────────────────────── */
.s-site .s-timetable { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.s-paper {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: var(--s-3);
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.s-paper:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.s-paper__when { font-family: var(--font-head); font-weight: 800; color: var(--sapphire); line-height: 1.3; }
.s-paper__when small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: var(--t-1); }
.s-paper__name { font-weight: 600; }
.s-paper__name a { color: var(--ink); text-decoration: none; }
.s-paper__name a:hover { color: var(--sapphire); text-decoration: underline; }
.s-paper__topics { display: block; font-size: var(--t-1); color: var(--muted); font-weight: 400; margin-top: 4px; }
.s-paper__tags { display: flex; gap: var(--s-1); flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) {
  .s-paper { grid-template-columns: 1fr; gap: var(--s-1); }
  .s-paper__tags { justify-content: flex-start; }
}

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.s-faq { max-width: 860px; margin-top: var(--s-4); }
.s-faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--paper);
  margin-bottom: var(--s-2);
  padding: 0 var(--s-3);
}
.s-faq summary {
  cursor: pointer;
  list-style: none;
  padding: var(--s-3) 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--t-2);
  display: flex;
  justify-content: space-between;
  gap: var(--s-2);
}
.s-faq summary::-webkit-details-marker { display: none; }
.s-faq summary::after { content: "+"; color: var(--sapphire); font-weight: 800; }
.s-faq details[open] summary::after { content: "–"; }
.s-faq .s-answer { padding-bottom: var(--s-3); color: var(--muted); }
.s-faq .s-answer p:last-child { margin-bottom: 0; }

/* ── Downloads ──────────────────────────────────────────────────────────── */
.s-search { display: flex; flex-direction: column; gap: var(--s-1); max-width: 560px; margin: var(--s-4) 0 var(--s-3); }
.s-search label { font-weight: 600; }
.s-search input {
  font: inherit;
  padding: var(--s-2) var(--s-3);
  border: 2px solid var(--sapphire-line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}
.s-search input:focus { border-color: var(--sapphire); outline: none; box-shadow: 0 0 0 4px rgba(15, 82, 186, 0.18); }
.s-site .s-downloads { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.s-download {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-3);
}
.s-download__name { font-weight: 600; }
.s-download__meta { display: block; font-size: var(--t-1); color: var(--muted); font-weight: 400; }
.s-download .s-btn { padding: var(--s-1) var(--s-3); min-height: 44px; white-space: nowrap; }
@media (max-width: 600px) {
  .s-download { flex-direction: column; align-items: flex-start; }
}
.s-edition-title { margin-top: var(--s-5); }
[hidden] { display: none !important; }

/* ── Mascot and CTA band ────────────────────────────────────────────────── */
.s-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-4);
  align-items: center;
  background: var(--sapphire-deep);
  color: var(--on-dark);
  border-radius: var(--r-2);
  padding: var(--s-5);
  overflow: hidden;
}
.s-cta h2 { color: var(--on-dark); font-size: var(--t-4); }
.s-cta p { color: var(--on-dark-muted); max-width: 56ch; }
.s-cta__art { width: 233px; }
.s-cta__badge { width: 144px; height: auto; display: block; margin-top: var(--s-3); }
@media (max-width: 720px) {
  .s-cta { grid-template-columns: 1fr; padding: var(--s-4) var(--s-3); }
  .s-cta__art { width: 160px; margin: 0 auto; }
}

/* ── W4b: home, blog and Avi & Mira ─────────────────────────────────────── */
.s-promise { font-family: var(--font-head); font-weight: 700; color: var(--on-dark); margin-bottom: var(--s-2); }
.s-tag--exam { background: var(--sapphire-tint); color: var(--sapphire-ink); }
.s-tag--topic { background: var(--gold-soft); color: #78350f; }
.s-tag--video { background: var(--ink); color: #ffffff; }
/* Avi's orange is an accent: dark text on soft orange, never white on orange. */
.s-tag--avi { background: var(--orange-soft); color: #7c2d12; }
.s-tag--mira { background: var(--sapphire); color: #ffffff; }

/* A two-column band: copy beside a character. */
.s-band { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: var(--s-5); align-items: center; }
.s-band__art { max-width: 233px; justify-self: center; }
.s-band__next { font-weight: 600; margin-top: var(--s-3); }
/* The programme's name in gold, as on its series page (gold text on a light
   ground is the deep gold, the app's rule). */
.s-band h2 .s-accent { color: #8a6d0b; }
#avi-and-mira .s-band { grid-template-columns: 0.6fr 1.4fr; }
@media (max-width: 860px) {
  .s-band, #avi-and-mira .s-band { grid-template-columns: 1fr; gap: var(--s-4); }
  .s-band__art { max-width: 160px; order: -1; }
}

/* Cards side by side (home: Downloads, and the blog once it has a post). */
.s-cards { display: grid; gap: var(--s-3); }
.s-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .s-cards--2 { grid-template-columns: 1fr; } }
.s-cards .s-card p { color: var(--muted); }

/* The founder. */
.s-founder { display: grid; grid-template-columns: 160px 1fr; gap: var(--s-5); align-items: start; }
.s-founder__img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-1); }
.s-site .s-founder blockquote { margin: 0; padding: 0 0 0 var(--s-3); border-left: 4px solid var(--gold); }
.s-founder__sign { font-family: var(--font-head); font-weight: 800; color: var(--sapphire-ink); margin-top: var(--s-3); }
@media (max-width: 720px) {
  .s-founder { grid-template-columns: 1fr; gap: var(--s-3); }
  .s-founder__img { width: 120px; height: 120px; }
}

/* The blog: filters, the featured post and the grid. */
.s-filters { display: grid; gap: var(--s-3); margin-bottom: var(--s-4); }
.s-filters .s-search { margin: 0; }
.s-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); }
.s-chips__label { font-weight: 600; min-width: 4.5em; }
.s-chips__row { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.s-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-3);
  border-radius: 999px;
  border: 2px solid var(--sapphire-line);
  background: var(--paper);
  color: var(--ink);
  font: 600 16px/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
}
.s-site a.s-chip { color: var(--ink); }
.s-chip:hover { border-color: var(--sapphire); }
.s-site a.s-chip[aria-current="page"],
.s-chip[aria-current="page"],
.s-chip[aria-pressed="true"] { background: var(--sapphire); border-color: var(--sapphire); color: #ffffff; }
.s-featured { margin-bottom: var(--s-4); }
.s-posts { display: grid; gap: var(--s-3); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .s-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .s-posts { grid-template-columns: 1fr; } }
.s-post {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.s-post:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.s-site .s-post__link { display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none; }
.s-post__cover img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.s-post__body { padding: var(--s-3) var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-1); }
.s-post__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.s-site .s-post__title { font-size: var(--t-3); margin: var(--s-1) 0 0; }
.s-site .s-post--featured .s-post__title { font-size: var(--t-4); }
.s-post__answer { color: var(--muted); margin: 0; }
.s-post__meta { font-size: var(--t-1); color: var(--muted); margin: auto 0 0; padding-top: var(--s-1); }
@media (min-width: 861px) {
  .s-post--featured .s-post__link { display: grid; grid-template-columns: 1.1fr 0.9fr; }
  .s-post--featured .s-post__body { padding: var(--s-5) var(--s-4); justify-content: center; }
}
.s-site .s-analysis { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: grid; gap: var(--s-2); }
.s-analysis__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-3);
}
.s-analysis__row a { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

@media (min-width: 861px) {
  .s-post--featured .s-post__cover,
  .s-post--featured .s-post__cover picture { display: block; height: 100%; }
  .s-post--featured .s-post__cover img { height: 100%; aspect-ratio: auto; min-height: 320px; }
}
/* A standing character beside a hero's copy stays hero-sized. */
.s-hero__char { max-width: 233px; margin: 0 auto; }
@media (max-width: 860px) { .s-hero__char { max-width: 144px; } }
/* The home story's Mira: a phone shows her smaller. */
@media (max-width: 600px) { #why .s-tile__media { max-width: 200px; margin: 0 auto; } }

/* A post. */
.s-hero--post { padding: var(--s-5) 0 var(--s-5); }
.s-hero--post .s-wrap { position: relative; }
.s-hero--post h1 { max-width: 22ch; margin-top: var(--s-2); }
.s-hero--post .s-post__tags .s-tag--video { background: #ffffff; color: var(--ink); }
.s-post__dates { color: var(--on-dark-muted); font-size: var(--t-1); margin: 0; }
.s-section--article { padding-top: var(--s-5); }
.s-article { max-width: calc(var(--measure) + 2 * var(--s-3)); }
.s-cover { margin: 0 0 var(--s-4); }
.s-cover img { display: block; width: 100%; height: auto; border-radius: var(--r-2); }
.s-shortanswer {
  background: var(--sapphire-tint);
  border-left: 6px solid var(--sapphire);
  border-radius: var(--r-1);
  padding: var(--s-3) var(--s-4);
  margin: 0 0 var(--s-4);
}
.s-site .s-shortanswer__title { font-size: var(--t-2); margin: 0 0 var(--s-1); color: var(--sapphire-ink); }
.s-shortanswer p { margin: 0; font-size: var(--t-2); }
.s-bento--single { grid-template-columns: 1fr; margin: 0 0 var(--s-4); }
.s-toc { border: 1px solid var(--line); border-radius: var(--r-1); padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-4); }
.s-site .s-toc__title { font-size: var(--t-2); margin: 0 0 var(--s-1); }
.s-site .s-toc ol { margin: 0; }
.s-toc a { display: inline-block; padding: 6px 0; }
.s-postbody h2 { font-size: var(--t-3); margin-top: var(--s-5); scroll-margin-top: 120px; }
.s-postbody img { border-radius: var(--r-1); }
.s-relatedtest { margin-top: var(--s-5); }
.s-relatedtest h2 { font-size: var(--t-3); }

/* Avi & Mira. */
.s-character { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: var(--s-5); align-items: center; }
.s-character__line { font-family: var(--font-head); font-weight: 800; font-size: var(--t-3); color: var(--sapphire-ink); }
.s-character__art { max-width: 233px; justify-self: center; }
#mira .s-character { grid-template-columns: 0.7fr 1.3fr; }
#mira .s-character__art { order: -1; }
@media (max-width: 860px) {
  .s-character, #mira .s-character { grid-template-columns: 1fr; gap: var(--s-4); }
  .s-character__art, #mira .s-character__art { max-width: 160px; order: -1; }
}
.s-bento--three .s-tile { grid-column: span 2; }
@media (max-width: 960px) { .s-bento--three .s-tile { grid-column: 1 / -1; } }
/* The "Together" tiles: each pose in the same 160 px band, never squeezed. */
.s-tile__media--top { margin: 0 auto var(--s-2); height: 160px; }
.s-tile__media--top picture { display: contents; }
.s-site .s-tile__media--top img { height: 160px; width: auto; max-width: 100%; object-fit: contain; }

/* /exams/ (W4b fix A): every exam, grouped by category. */
.s-tag--live { background: var(--free-soft); color: var(--free); }
.s-examcards { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: var(--s-3); }
/* Category (h2) > board (h3) > exam card (h4). */
.s-board { margin-top: var(--s-4); }
.s-site .s-board__title { font-size: var(--t-2); font-weight: 800; color: var(--sapphire-ink); letter-spacing: 0.01em; margin: 0; }
.s-site .s-examcard h4, .s-site .s-dlcard h4 { font-family: var(--font-head); font-size: var(--t-3); font-weight: 700; line-height: var(--lh-head); margin: var(--s-1) 0; }
.s-examcard h4 a, .s-dlcard h4 a { color: var(--ink); text-decoration: none; }
.s-examcard h4 a:hover, .s-dlcard h4 a:hover { color: var(--sapphire); text-decoration: underline; }
.s-examcard p { margin: 0 0 var(--s-1); }
.s-examcard__line { color: var(--muted); }
.s-examcard__label { font-weight: 600; margin-top: var(--s-2); }
.s-site .s-examcard__series { list-style: none; padding: 0; margin: 0 0 var(--s-2); }
.s-examcard__series a, .s-examcard__more a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.s-examcard--soon { background: #fbfcfe; }

/* /downloads/ (W4b fix D): exam -> series cards. */
.s-dlgroup { margin-top: var(--s-5); }
.s-dlcards { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.s-site .s-dlcard__links, .s-site .s-dlcard__past { list-style: none; padding: 0; margin: 0 0 var(--s-2); }
.s-dlcard__links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.s-dlcard__label { font-weight: 600; margin: var(--s-3) 0 var(--s-1); }
.s-dlcard__past-name { margin: 0; color: var(--muted); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.s-footer {
  background: #0b2f6b;
  color: var(--on-dark-muted);
  padding: var(--s-5) 0 var(--s-4);
  font-size: var(--t-2);
}
.s-footer a { color: #ffffff; }
.s-footer .s-brand span { color: #ffffff; }
.s-footer__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4); align-items: flex-start; }
.s-footer nav a { margin-right: var(--s-2); display: inline-block; padding: 4px 0; }
.s-footer p { margin: var(--s-1) 0 0; }
.s-updated { font-size: var(--t-1); color: var(--muted); margin-top: var(--s-4); }

/* ── Motion ─────────────────────────────────────────────────────────────── */
/* Reveal waits for site.js to mark the page (`html.s-js`); without script,
   everything is simply there. */
.s-js .s-reveal { opacity: 0; transform: translateY(21px); transition: opacity 0.6s ease, transform 0.6s ease; }
.s-js .s-reveal.is-in { opacity: 1; transform: none; }
.s-js .s-reveal.d1 { transition-delay: 0.08s; }
.s-js .s-reveal.d2 { transition-delay: 0.16s; }
.s-js .s-reveal.d3 { transition-delay: 0.24s; }
@keyframes s-float {
  from { transform: translateY(0); }
  to { transform: translateY(-13px); }
}
.s-float { animation: s-float 3.4s ease-in-out infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .s-js .s-reveal { opacity: 1; transform: none; }
  .s-card:hover, .s-tile:hover, .s-paper:hover, .s-btn:hover, .s-post:hover { transform: none; }
}
