@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Caveat:wght@700&display=swap');
/* =====================================================================
   EZ Tutor GCSE — styles, matched to the main eztutor.co.uk brand
   (cream · Playfair Display + DM Sans · pill buttons · teal/amber).
   Class contracts used by gcse-engine.js / gcse-ui.js are preserved.
   ===================================================================== */

:root {
  --cream: #FAF7F2; --warm-white: #FFFDF9;
  --amber: #E8A842; --amber-dark: #C48A28; --amber-light: #FDF0D5;
  --teal: #2D6A6A; --teal-dark: #1E4D4D; --teal-light: #E8F4F4;
  --charcoal: #2C2C2C; --mid-gray: #6B6B6B; --line: #e5e0d9; --line-2: #d8d2c8;
  --ok: #2d8c5a; --ok-bg: #eaf7f0; --ok-ink: #1a5c38;
  --no: #c0392b; --no-bg: #fdf0ee; --no-ink: #8b1a12;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 24px; --pill: 50px;
  --sh-sm: 0 4px 24px rgba(0,0,0,.06); --sh: 0 12px 40px rgba(0,0,0,.1); --sh-lg: 0 20px 60px rgba(0,0,0,.12);
  --maxw: 1180px;
  /* design-language v2 (output/ui-redesign-spec.md) */
  --ink: #13403f; --teal-bright: #3BA6A0; --surface: #FFFDF8;
  --line-soft: rgba(19,64,63,.08);
  --sh-lift: 0 16px 40px -18px rgba(19,64,63,.35);
  --ease-out: cubic-bezier(.22,1,.36,1);
}

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); background: var(--cream); color: var(--charcoal); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: none; color: var(--teal-dark); }
img, svg { max-width: 100%; }
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 700; line-height: 1.18; color: var(--charcoal); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 14px 0 10px; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 30px 0 14px; }
h3 { font-size: 1.15rem; margin: 0 0 4px; font-weight: 700; }
h1 em, h2 em { color: var(--teal); font-style: normal; }
.sub { color: var(--mid-gray); margin: 0 0 26px; font-size: clamp(1rem, 2vw, 1.12rem); line-height: 1.7; max-width: 62ch; }
.note { font-size: .86rem; color: var(--mid-gray); line-height: 1.6; }
.err { color: var(--no); font-size: .9rem; }
.muted { color: var(--mid-gray); }
.eyebrow { display: inline-block; color: var(--amber-dark); font-size: .79rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: .6rem; }
.center { text-align: center; } .mt0 { margin-top: 0; } .mt2 { margin-top: 22px; } .hidden { display: none !important; }
:focus-visible { outline: 3px solid rgba(45,106,106,.4); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------- layout ----- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 30px 5vw 80px; }
.wrap.narrow { max-width: 760px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.section { padding: 0 0 8px; }

/* ----------------------------------------------- header (glass, v2) ---- */
.site-header { position: sticky; top: 0; z-index: 200; background: rgba(250,247,242,.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft); transition: box-shadow .3s; }
.site-header.scrolled { box-shadow: 0 10px 30px -18px rgba(19,64,63,.35); }
/* overflow:visible guards against the generic .bar (progress bar) class, which
   sets overflow:hidden and would clip the product-switcher dropdown */
.site-header .bar { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: nowrap; align-items: center; gap: 18px; padding: .4rem 5vw; min-height: 70px; overflow: visible; height: auto; background: none; border-radius: 0; }

/* ── product switcher (v2 — replaces loose cross-app links) ────────────── */
.switch-wrap { position: relative; }
.switch-pill { display: inline-flex; align-items: center; gap: .45rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); padding: .42rem .95rem; font: 600 .82rem var(--font-body); color: var(--charcoal); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.switch-pill:hover { border-color: var(--teal); box-shadow: var(--sh-sm); }
.switch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.switch-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-lg); padding: .55rem; z-index: 300; animation: switch-in .22s var(--ease-out); }
@keyframes switch-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.switch-label { margin: .2rem .6rem .35rem; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--mid-gray); }
.switch-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 .5rem; padding: .55rem .65rem; border-radius: 12px; transition: background .15s; }
.switch-item b { font-size: .9rem; color: var(--charcoal); }
.switch-item span { grid-column: 1; font-size: .76rem; color: var(--mid-gray); }
.switch-item i { grid-row: 1 / span 2; grid-column: 2; font-style: normal; color: var(--teal); font-weight: 700; }
.switch-item:hover { background: var(--teal-light); }
.switch-item.cur b { color: var(--teal); }
/* guard: the generic progress-bar rule (.bar i) must not restyle the ✓ tick —
   the header menu lives inside .site-header .bar */
.switch-wrap .switch-item i, .nav-overlay .switch-item i { display: inline; height: auto; min-width: 0; background: none; border-radius: 0; }

/* ── mobile full-screen menu (v2) ──────────────────────────────────────── */
.nav-overlay { position: fixed; inset: 0; z-index: 400; background: linear-gradient(160deg, var(--ink), var(--teal-dark)); color: #fff; display: flex; flex-direction: column; padding: 5rem 7vw 2.5rem; overflow-y: auto; }
.nav-overlay[hidden] { display: none; }
.overlay-close { position: absolute; top: 1.1rem; right: 5vw; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: 1.1rem; cursor: pointer; }
.overlay-nav { display: flex; flex-direction: column; gap: .35rem; }
.overlay-nav a { font-family: var(--font-display); font-size: clamp(1.9rem, 7vw, 2.6rem); font-weight: 700; color: #fff; padding: .35rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.overlay-nav a.on { color: var(--amber); }
.overlay-auth { display: flex; gap: 1.2rem; align-items: center; margin-top: 1.6rem; }
.overlay-auth a { color: rgba(255,255,255,.85); font-weight: 600; }
.overlay-auth .nav-cta { background: var(--amber); color: var(--ink); }
.overlay-products { margin-top: auto; padding-top: 2rem; }
.overlay-products .switch-label { color: rgba(255,255,255,.55); }
.overlay-products .switch-item { padding: .5rem .2rem; }
.overlay-products .switch-item b { color: rgba(255,255,255,.9); font-size: 1rem; }
.overlay-products .switch-item.cur b { color: var(--amber); }
.overlay-products .switch-item:hover { background: rgba(255,255,255,.06); }
body.menu-open { overflow: hidden; }
.brand { display: inline-flex; align-items: flex-start; flex-wrap: nowrap; gap: 9px; text-decoration: none; line-height: 1; }
.brand svg { display: block; height: 46px; width: auto; flex-shrink: 0; }
.brand .gcse-badge { font-family: var(--font-display); font-weight: 700; font-size: .72rem; color: #fff; background: var(--teal); padding: .1rem .5rem; border-radius: var(--pill); letter-spacing: .5px; align-self: flex-start; margin-top: 3px; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 1.15rem; margin-left: auto; white-space: nowrap; }
.site-nav a { font-size: .88rem; font-weight: 500; color: var(--charcoal); position: relative; transition: color .2s; }
.site-nav a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--amber); transition: width .25s; }
.site-nav a:hover { color: var(--teal); } .site-nav a:hover::after, .site-nav a.on::after { width: 100%; }
.site-nav a.on { color: var(--teal); }
/* teacher accounts get a chip-styled nav item */
.site-nav a[data-chip="teacher"] { background: var(--amber-light); color: var(--amber-dark); font-weight: 700; font-size: .78rem; padding: .28rem .85rem; border-radius: var(--pill); }
.site-nav a[data-chip="teacher"]::after { display: none; }
.site-nav a[data-chip="teacher"]:hover, .site-nav a[data-chip="teacher"].on { background: var(--amber); color: #fff; }
.header-right { display: flex; align-items: center; gap: 1rem; margin-left: 1.25rem; flex-shrink: 0; }
.header-right .signlink { font-size: .85rem; font-weight: 500; color: var(--mid-gray); }
.header-right .signlink:hover { color: var(--teal); }
.nav-cta { background: var(--teal); color: #fff; padding: .5rem 1.3rem; border-radius: var(--pill); font-size: .85rem; font-weight: 600; transition: background .2s, transform .15s; }
.nav-cta:hover { background: var(--teal-dark); color: #fff; transform: translateY(-1px); }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--mid-gray); }
.who .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; font-family: var(--font-display); }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 38px; height: 38px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 22px; height: 2px; background: var(--charcoal); border-radius: 2px; }
.nav-toggle span { position: relative; } .nav-toggle span::before { content: ''; position: absolute; top: -7px; } .nav-toggle span::after { content: ''; position: absolute; top: 7px; }

/* ---------------------------------------------------------- footer ----- */
.site-footer { background: var(--charcoal); color: rgba(255,255,255,.75); padding: 3.5rem 5vw 2rem; margin-top: 60px; }
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; }
.site-footer .brand svg { height: 46px; }
.site-footer .brand svg text[fill="#1A3045"] { fill: #fff; }  /* "Tutor" → white on charcoal */
/* Drop the GCSE pill from the FOOTER logo — it collided with the cursive "Easy",
   and the footer already says "GCSE Maths" in the tagline + the © line. The
   header keeps the pill. */
.site-footer .brand .gcse-badge { display: none; }
.site-footer .tagline { font-size: .85rem; line-height: 1.7; max-width: 240px; margin: 1rem 0 0; }
.site-footer h4 { color: #fff; font-size: .88rem; margin: 0 0 1rem; font-family: var(--font-body); font-weight: 600; }
.site-footer a { display: block; color: rgba(255,255,255,.6); font-size: .84rem; padding: .35rem 0; }
.site-footer a:hover { color: var(--amber); }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.08); margin-top: 1rem; padding-top: 1.4rem; font-size: .8rem; color: rgba(255,255,255,.55); }

/* ------------------------------------------------------- hero / mktg --- */
.hero { background: var(--teal-dark); color: #fff; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -50%; right: -10%; width: 60%; height: 180%; background: radial-gradient(ellipse at 60% 40%, rgba(232,168,66,.16) 0%, transparent 65%); pointer-events: none; }
/* v2 hero: deeper ink gradient + ambient canvas layer + stat counters */
.hero-v2 { background: linear-gradient(168deg, var(--ink) 0%, var(--teal-dark) 62%, #1B4444 100%); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; opacity: .85; }
.hero-stats { display: flex; gap: clamp(1.2rem, 4vw, 3rem); flex-wrap: wrap; margin-top: 2.2rem; }
.hero-stats > div { display: flex; flex-direction: column; }
.hero-stats b { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--amber); line-height: 1.1; }
.hero-stats span { font-size: .8rem; color: rgba(255,255,255,.65); letter-spacing: .02em; }
.hero .inner { max-width: var(--maxw); margin: 0 auto; padding: 5rem 5vw 5.5rem; position: relative; z-index: 1; }
.hero .eyebrow { color: var(--amber); }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5vw, 3.8rem); margin: 0 0 1.1rem; max-width: 16ch; }
.hero h1 em { color: var(--amber); }
.hero p.lede { color: rgba(255,255,255,.82); font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 52ch; margin: 0 0 1.8rem; line-height: 1.7; }
.hero .cta-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero .pills { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 2.2rem; }
.hero .pill-tag { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.85); padding: .45rem 1.1rem; border-radius: var(--pill); font-size: .82rem; font-weight: 500; }

.features { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 1rem 0; }
.feature { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 1.8rem 1.5rem; box-shadow: var(--sh-sm); transition: transform .25s var(--ease-out), border-color .25s, box-shadow .25s var(--ease-out); }
.feature:hover { transform: translateY(-5px); border-color: rgba(59,166,160,.45); box-shadow: var(--sh-lift); }
.feature .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--teal-light); display: grid; place-items: center; font-size: 24px; margin-bottom: 1.1rem; }
.feature h3 { font-size: 1.15rem; } .feature p { margin: .4rem 0 0; color: var(--mid-gray); font-size: .9rem; line-height: 1.65; }

.band { background: var(--warm-white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band .inner { max-width: var(--maxw); margin: 0 auto; padding: 4.5rem 5vw; }
.cta-band { background: var(--teal-dark); color: #fff; border-radius: var(--r-xl); padding: 3.2rem; text-align: center; box-shadow: var(--sh-lg); position: relative; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; top: -50%; left: -10%; width: 50%; height: 180%; background: radial-gradient(ellipse, rgba(255,255,255,.05) 0%, transparent 70%); }
.cta-band h2 { color: #fff; margin: 0 0 .6rem; position: relative; } .cta-band p { color: rgba(255,255,255,.7); margin: 0 0 1.6rem; position: relative; }

/* ---------------------------------------------------------- cards ------ */
.grid { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { display: block; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 1.5rem; color: inherit; box-shadow: var(--sh-sm); transition: transform .25s var(--ease-out), border-color .25s, box-shadow .25s var(--ease-out); }
a.card:hover { transform: translateY(-5px); border-color: rgba(59,166,160,.45); box-shadow: var(--sh-lift); }
.card h3 { font-size: 1.1rem; } .card .meta { color: var(--mid-gray); font-size: .85rem; line-height: 1.55; }
.card .pill { display: inline-block; margin-top: .9rem; font-size: .74rem; font-weight: 700; color: var(--teal-dark); background: var(--teal-light); padding: .25rem .8rem; border-radius: var(--pill); }
.card .ico { font-size: 24px; display: block; margin-bottom: .5rem; }
.mode-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.mode-grid .card { position: relative; overflow: hidden; padding-left: 1.6rem; }
.mode-grid .card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--teal); }
.mode-grid .card.amber::before { background: var(--amber); } .mode-grid .card.violet::before { background: #7c5cff; }
.card.locked { position: relative; opacity: .72; background: #f3efe8; border-style: dashed; border-color: var(--line-2); cursor: not-allowed; }
.card.locked h3 { color: var(--mid-gray); }
.card.locked .lock { position: absolute; top: 14px; right: 14px; font-size: 16px; opacity: .8; }
.pill.mastered { background: var(--ok-bg); color: var(--ok-ink); }
.mode-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.mode-chip { padding: .45rem 1.1rem; font-size: .85rem; }
.mode-hint { margin-left: .3rem; }
@media (max-width: 560px) { .mode-hint { width: 100%; margin-left: 0; } }

.stat { display: inline-flex; flex-direction: column; background: var(--warm-white); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.6rem; margin: 0 12px 12px 0; box-shadow: var(--sh-sm); }
.stat b { font-size: 2rem; color: var(--teal); font-family: var(--font-display); line-height: 1; } .stat span { font-size: .78rem; color: var(--mid-gray); margin-top: .25rem; }
.bar { height: 8px; background: rgba(19,64,63,.08); border-radius: var(--r-pill, 999px); overflow: hidden; min-width: 90px; } .bar i { display: block; height: 100%; background: var(--teal); border-radius: inherit; transition: width .5s var(--ease-out); }

/* gamification */
.xp-total { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; color: var(--teal-d, var(--teal)); line-height: 1; }
.xp-total span { font-size: 1.2rem; color: var(--amber-dark); }
.xp-goals { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.2rem; }
@media (max-width: 560px) { .xp-goals { grid-template-columns: 1fr; } }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .7rem; }
.badge { text-align: center; padding: .9rem .5rem; border: 1px solid var(--line); border-radius: var(--r); background: #f3efe8; opacity: .55; filter: grayscale(.6); }
.badge.on { opacity: 1; filter: none; background: var(--warm-white); border-color: var(--amber); box-shadow: var(--sh-sm); }
.badge .b-ico { font-size: 26px; display: block; }
.badge .b-name { font-size: .76rem; font-weight: 700; color: var(--charcoal); display: block; margin-top: .3rem; }

/* ----------------------------------------------------- chips/forms/btn - */
.chooser { display: flex; flex-wrap: wrap; gap: .7rem; margin: .7rem 0; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--pill); padding: .55rem 1.3rem; font-weight: 600; cursor: pointer; color: var(--charcoal); font-size: .88rem; font-family: var(--font-body); transition: border-color .2s, color .2s, background .2s, box-shadow .2s, transform .15s var(--ease-out); }
.chip:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-1px); }
.chip.on { background: var(--teal); color: #fff; border-color: var(--teal); box-shadow: 0 4px 16px rgba(45,106,106,.25); }
.field { display: block; margin: 1rem 0; }
.field > span, .field label { display: block; font-size: .81rem; font-weight: 600; color: var(--charcoal); margin-bottom: .45rem; letter-spacing: .3px; }
.field input, .field select, .input, select.input { width: 100%; padding: .75rem 1rem; border: 1px solid var(--line-2); border-radius: 12px; font-size: 1rem; background: var(--surface); color: var(--charcoal); font-family: var(--font-body); transition: border-color .2s, box-shadow .2s, background .2s; }
.field input:focus, .field select:focus, .input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(59,166,160,.14); background: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: var(--warm-white); color: var(--charcoal); border: 1.5px solid var(--line-2); border-radius: var(--pill); padding: .75rem 1.7rem; font-weight: 600; font-size: .92rem; font-family: var(--font-body); cursor: pointer; text-decoration: none; transition: background .2s, transform .15s, box-shadow .2s, border-color .2s; }
.btn:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); text-decoration: none; }
.btn.primary { background: var(--teal); color: #fff; border-color: var(--teal); box-shadow: 0 4px 20px rgba(45,106,106,.28); }
.btn.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; box-shadow: 0 8px 28px rgba(45,106,106,.38); }
.btn.amber { background: var(--amber); color: #fff; border-color: var(--amber); box-shadow: 0 4px 20px rgba(232,168,66,.32); }
.btn.amber:hover { background: var(--amber-dark); border-color: var(--amber-dark); color: #fff; }
.btn.white { background: #fff; color: var(--teal-dark); border-color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.btn.white:hover { background: var(--cream); color: var(--teal-dark); }
.btn.ghost { background: transparent; }
.btn.lg { padding: .95rem 2rem; font-size: 1rem; } .btn.block { width: 100%; } .btn:disabled { opacity: .5; cursor: default; transform: none; }
.role-grid { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; margin: .5rem 0; }
.role-card { text-align: left; border: 1px solid var(--line-2); border-radius: var(--r); padding: 1.1rem; background: var(--surface); cursor: pointer; transition: .15s; font-family: var(--font-body); }
.role-card:hover { border-color: var(--teal); }
.role-card.on { border-color: var(--teal); background: var(--teal-light); }
.role-card .ico { font-size: 26px; } .role-card h3 { margin: .4rem 0 .15rem; font-size: 1.05rem; } .role-card p { margin: 0; font-size: .8rem; color: var(--mid-gray); }

.panel { max-width: 460px; margin: 3rem auto; background: #fff; border-radius: var(--r-xl); padding: 2.6rem 2.3rem; box-shadow: var(--sh); }
.panel h1 { margin-top: 0; font-size: 1.9rem; } .panel .alt { text-align: center; margin-top: 1.3rem; font-size: .88rem; color: var(--mid-gray); }

.upsell { text-align: center; max-width: 580px; margin: 1.5rem auto; padding: 2.6rem 2.2rem; }
.upsell .ico { font-size: 42px; display: block; margin-bottom: .5rem; }
.upsell h2 { margin: 0; }
.upsell-list { list-style: none; padding: 0; margin: 0 auto; max-width: 380px; text-align: left; }
.upsell-list li { padding: .35rem 0; color: var(--mid-gray); font-size: .92rem; border-bottom: 1px solid var(--line); }
.banner { background: var(--amber-light); border: 1px solid var(--amber); border-radius: var(--r); padding: .8rem 1.1rem; font-size: .9rem; margin: 1rem 0; }
.banner.info { background: var(--teal-light); border-color: var(--teal); }
.empty { color: var(--mid-gray); padding: 2.4rem 1.5rem; text-align: center; background: var(--warm-white); border: 1.5px dashed var(--line-2); border-radius: var(--r); }
.empty .ico { font-size: 30px; display: block; margin-bottom: .5rem; opacity: .7; }
.skeleton { background: linear-gradient(100deg, #efe9e1 30%, #f7f2ec 50%, #efe9e1 70%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r); height: 90px; }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border: 3px solid var(--teal-light); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: -4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------- question runner (v2.1) ----
   "Exam hall calm" backdrop + "beautiful exam paper" cards.
   Class contracts (q-card / q-progress / q-form / q-input / q-feedback /
   selfmark / part-results …) are read by gcse-engine.js — restyle only. */

/* the desk: faint dot grid + soft vignette on question pages */
body.page-exam {
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -6%, rgba(232,168,66,.10), transparent 65%),
    radial-gradient(rgba(19,64,63,.06) 1px, transparent 1.2px);
  background-size: 100% 100%, 22px 22px;
  background-attachment: fixed;
}
body.page-exam::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 130% 95% at 50% 28%, transparent 58%, rgba(19,64,63,.06) 100%); }
body.page-exam main { position: relative; z-index: 1; }
/* chrome quietens while a question is on the desk */
body.page-exam:has(.q-stem) h1 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin: 8px 0 4px; }
body.page-exam:has(.q-stem) .sub { font-size: .92rem; margin-bottom: 14px; opacity: .8; }

/* slim sticky progress rail at the very top of the viewport (amber fill) */
.q-card .q-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; margin: 0;
  background: rgba(19,64,63,.10); border-radius: 0; overflow: hidden; z-index: 500; pointer-events: none; }
.q-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-dark)); transition: width .45s var(--ease-out); }

/* the paper */
.q-card { position: relative; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: clamp(1.4rem, 3.4vw, 2.2rem); max-width: 760px;
  box-shadow: var(--sh-sm), 0 1px 0 rgba(19,64,63,.04); overflow: hidden;
  animation: q-rise .24s var(--ease-out) both; transition: box-shadow .25s var(--ease-out); }
.q-card:focus-within { box-shadow: var(--sh-lift); }
.q-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-bright) 55%, var(--amber) 100%); }
@keyframes q-rise { from { opacity: 0; transform: translateY(12px); } }

.q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--mid-gray); margin-bottom: 1.1rem; flex-wrap: wrap; }
.q-pos { display: inline-flex; align-items: baseline; gap: .5rem; }
.q-no { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1; letter-spacing: -.01em; }
.q-of { font-size: .72rem; font-weight: 700; color: var(--mid-gray); text-transform: uppercase; letter-spacing: .09em; }
/* legacy single-span fallback (anything still rendering "Question 1 of 12") */
.q-pos:not(:has(.q-no)) { font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 1.2px; font-size: .73rem; }
.q-meta { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: .8rem; }
.q-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; padding: .24rem .72rem; border-radius: var(--pill);
  background: #fff; border: 1px solid var(--line-soft); color: var(--ink); }
.q-chip.marks { background: var(--amber-light); border-color: rgba(196,138,40,.25); color: var(--amber-dark); }

.q-stem { font-size: 1.12rem; font-weight: 500; line-height: 1.7; color: var(--charcoal); margin-bottom: .8rem; max-width: 68ch; }
.q-dia { margin: 1.1rem 0; padding: .9rem; max-width: 480px; background: #fff; border: 1px solid var(--line-soft); border-radius: 14px; }
.q-dia svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.q-form { display: flex; gap: .7rem; margin-top: .9rem; flex-wrap: wrap; }
.q-input { flex: 1; min-width: 180px; padding: .8rem 1.1rem; border: 1px solid var(--line-2); border-radius: 14px;
  font-size: 1.15rem; background: #fff; font-family: var(--font-body); color: var(--charcoal);
  transition: border-color .2s, box-shadow .2s, background .2s; }
.q-input::placeholder { color: #b4ada1; font-size: .95rem; }
.q-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(59,166,160,.15); }
.q-input:disabled { background: var(--cream); color: var(--mid-gray); }
.q-form.multi { flex-direction: column; align-items: stretch; }
.q-parts { display: flex; flex-direction: column; gap: .7rem; margin-bottom: .9rem; }
.q-part { display: flex; align-items: center; gap: .8rem; margin: 0; }
.q-part-lbl { font-family: var(--font-display); font-weight: 700; color: var(--teal); min-width: 2.2rem; font-size: 1.05rem; }
.q-form.multi .q-input { flex: 1; min-width: 0; }
.q-form.multi .btn { align-self: flex-start; }
.part-results { margin-top: .5rem; display: flex; flex-direction: column; gap: .3rem; }
.part-result { font-size: .92rem; font-weight: 600; }
.part-result.ok { color: var(--ok-ink); } .part-result.no { color: var(--no-ink); }
.q-nav { display: flex; gap: .7rem; margin-top: 1.4rem; flex-wrap: wrap; }
.q-nav [data-act="next"] { margin-left: auto; }
.q-nav .btn.ghost { border-color: transparent; color: var(--mid-gray); }
.q-nav .btn.ghost:hover { color: var(--teal); border-color: var(--line-soft); }
/* unified feedback panel: tinted, 4px left accent (same language as .worked /
   .selfmark / the Learn panels) */
.q-feedback { margin-top: 1.2rem; padding: 1rem 1.2rem; border-radius: 0 14px 14px 0; border-left: 4px solid var(--line-2); background: var(--cream); animation: pop .2s var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.q-feedback.ok { background: var(--ok-bg); border-left-color: var(--ok); } .q-feedback.no { background: var(--no-bg); border-left-color: var(--no); }
.q-feedback .verdict { font-weight: 700; font-size: 1rem; } .ok .verdict { color: var(--ok-ink); } .no .verdict { color: var(--no-ink); }
.q-feedback .model { margin-top: .4rem; }
details > summary { cursor: pointer; }
.assign-card > summary { font-weight: 500; padding: .2rem 0; list-style: none; }
.assign-card[open] > summary { margin-bottom: .4rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.student { border-left: 3px solid var(--line-2); padding-left: .8rem; }
.student > summary { font-weight: 500; color: var(--charcoal); }
.student.nosub { border-left-color: var(--no); background: var(--no-bg); border-radius: 0 8px 8px 0; }
.sort-btn.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.worked { margin-top: .9rem; padding: .75rem 1rem; background: rgba(45,106,106,.06); border-left: 4px solid var(--teal); border-radius: 0 14px 14px 0; }
.worked summary { cursor: pointer; font-weight: 700; color: var(--teal); }
.worked > div { margin-top: .6rem; font-size: .95rem; line-height: 1.75; }
.calc { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: .2rem .72rem; border-radius: var(--pill); border: 1px solid transparent; }
.calc.on { background: var(--ok-bg); color: var(--ok-ink); border-color: rgba(45,140,90,.22); } .calc.off { background: var(--no-bg); color: var(--no-ink); border-color: rgba(192,57,43,.18); }
.summary { text-align: center; } .summary h2 { margin-top: 0; }
.summary .score { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 800; font-family: var(--font-display); color: var(--ink); display: block; margin: .4rem 0 .2rem; }
.summary .pct { color: var(--mid-gray); font-weight: 500; font-size: 1.05rem; font-family: var(--font-body); }
.dots { display: flex; flex-wrap: wrap; gap: 5px; margin: 1rem 0 1.4rem; justify-content: center; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #ddd; } .dot.ok { background: var(--ok); } .dot.no { background: var(--no); }
.timer { font-family: monospace; font-weight: 700; font-size: 1.05rem; letter-spacing: 2px; color: var(--teal); background: var(--teal-light); padding: .35rem 1rem; border-radius: var(--pill); } .timer.low { color: #fff; background: var(--no); }
.timer:empty { display: none; }   /* no empty pill before the paper starts */

/* ----------------------------------------------------------- tables ---- */
.mdt { border-collapse: collapse; margin: 12px 0; font-size: .9rem; }
.mdt th, .mdt td { border: 1px solid var(--line-2); padding: 6px 13px; text-align: center; min-width: 34px; } .mdt th { background: var(--teal-light); }
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-sm); }
table.data th, table.data td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .88rem; }
table.data th { background: var(--cream); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mid-gray); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .15rem .7rem; border-radius: var(--pill); background: var(--teal-light); color: var(--teal-dark); }
.tag.amber { background: var(--amber-light); color: var(--amber-dark); } .tag.grey { background: #ece7df; color: var(--mid-gray); }
.code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: 2px; background: var(--teal-light); color: var(--teal-dark); padding: .15rem .6rem; border-radius: 6px; }

/* ------------------------------------------------------- responsive ---- */
/* Collapse the horizontal nav to the hamburger before it gets crammed. With
 * Dashboard/Teacher/Admin + the notification bell + subject switcher there are
 * too many items to fit on mid-size screens, so switch over at 1024px. */
@media (max-width: 1024px) {
  /* v2: desktop nav/switcher/CTAs hide — the hamburger opens the full-screen overlay */
  .site-nav, .header-right .who-text, .header-right .signlink, .header-right .nav-cta, .switch-wrap { display: none; }
  .header-right { margin-left: auto; }
  .nav-toggle { display: flex; }
}
@media (max-width: 820px) {
  .site-footer .inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .role-grid { grid-template-columns: 1fr; }
  .q-form { flex-direction: column; } .q-form .btn { width: 100%; }
  .stat { display: flex; flex-direction: row; align-items: baseline; gap: 10px; width: 100%; }
}
@media (max-width: 520px) {
  .wrap { padding: 22px 1.2rem 64px; } .q-card { padding: 1.4rem; } .site-footer .inner { grid-template-columns: 1fr; }
  .hero .inner { padding: 3.5rem 1.4rem 4rem; } .cta-band { padding: 2.2rem 1.4rem; }
}

/* ---- celebrations: perfect session + mastery toast --------------------- */
.q-card.summary.perfect { border-color: var(--teal, #2D6A6A); box-shadow: 0 0 0 3px rgba(45,106,106,.12), 0 18px 40px rgba(45,106,106,.18); }
.q-card.summary.perfect h2 { color: var(--teal, #2D6A6A); }
.mastery-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px);
  display: flex; align-items: center; gap: .7rem; z-index: 2147483601;
  background: #1A3045; color: #fff; padding: .8rem 1.1rem; border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0,0,0,.28); opacity: 0; pointer-events: none;
  transition: opacity .35s ease, transform .35s ease; max-width: 92vw;
}
.mastery-toast.show { opacity: 1; transform: translate(-50%, 0); }
.mastery-toast .mt-ico { font-size: 1.6rem; line-height: 1; }
.mastery-toast .mt-txt { display: flex; flex-direction: column; line-height: 1.25; }
.mastery-toast .mt-txt strong { font-weight: 700; }
.mastery-toast .mt-txt span { font-size: .85rem; opacity: .85; }
@media (prefers-reduced-motion: reduce) { .mastery-toast { transition: opacity .2s; } }

/* ---- Learn tab: concept guides --------------------------------------- */
.strand-h { margin: 2rem 0 .8rem; font-size: 1.15rem; }
/* tier tabs are anchors styled as chips */
.chooser a.chip { text-decoration: none; display: inline-block; }
/* card grids on the Learn page get a little more breathing room */
.learn-grid { margin-top: 1.4rem; gap: 1.5rem; }
.learn-grid .card { display: flex; flex-direction: column; }
/* level-1 strand cards: centred, big icon */
.card.learn-strand { align-items: center; text-align: center; gap: .2rem; padding: 1.8rem 1.4rem; }
.card.learn-strand .ico { font-size: 40px; margin-bottom: .2rem; }
.card.learn-strand h3 { margin: .1rem 0 .5rem; }
.strand-ico { font-size: 1.4rem; margin-right: .3rem; }
.backlink { display: inline-block; margin-bottom: .6rem; font-size: .9rem; text-decoration: none; opacity: .8; }
/* breadcrumb trail (Learn › Algebra › Sequences) */
.crumbs { font-size: .85rem; margin: .2rem 0 .9rem; color: var(--mid-gray); }
.crumbs a { text-decoration: none; color: var(--teal-dark); }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { margin: 0 .2rem; opacity: .55; }
.crumbs .cur { color: var(--charcoal); font-weight: 600; }
.backlink:hover { opacity: 1; }
.learn-before { background: #f3efe6; border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0 1.4rem; font-size: .95rem; }
.learn-fig { margin: 1.3rem 0; padding: 1rem; background: #fff; border: 1px solid rgba(26,48,69,.12); border-radius: 14px; text-align: center; }
.learn-fig svg { max-width: 100%; height: auto; max-height: 340px; }
.learn-fig figcaption { margin-top: .55rem; font-size: .85rem; color: var(--mid-gray); }
.learn-figeg { margin: -.4rem 0 1.3rem; padding: .9rem 1.1rem; background: #eef6f5; border-left: 3px solid var(--teal, #2D6A6A); border-radius: 0 10px 10px 0; }
.learn-figeg .figeg-tag { font-weight: 700; color: var(--teal, #2D6A6A); text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; }
.learn-figeg p { margin: .35rem 0 0; line-height: 1.5; }
.learn-figeg .figeg-q { font-weight: 600; }
.learn-figeg .figeg-a { margin-top: .4rem; }
.learn-steps { display: flex; flex-direction: column; gap: 1rem; }
.learn-step { background: #fff; border: 1px solid rgba(26,48,69,.12); border-radius: 14px; padding: 1.1rem 1.2rem; }
.learn-step h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.learn-step p { margin: 0; line-height: 1.55; }
.learn-step .eg { margin-top: .7rem; padding: .6rem .8rem; background: #eef6f5; border-left: 3px solid var(--teal, #2D6A6A); border-radius: 8px; font-size: .95rem; }
.learn-step .eg-tag { font-weight: 700; color: var(--teal, #2D6A6A); margin-right: .35rem; text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; }
.learn-watch { margin: 1.6rem 0; background: #fff7ec; border: 1px solid #f0d8a8; border-radius: 14px; padding: 1rem 1.2rem; }
.learn-watch h3 { margin: 0 0 .5rem; font-size: 1rem; }
.learn-watch ul { margin: 0; padding-left: 1.2rem; line-height: 1.6; }
.learn-check { margin: 1.6rem 0; background: #eef6f5; border-radius: 14px; padding: 1rem 1.2rem; }
.learn-check h3 { margin: 0 0 .5rem; font-size: 1rem; }
.learn-check .answer { margin-top: .7rem; font-weight: 600; }
.learn-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.8rem 0 1rem; }

/* ---- self-mark (open written-explanation parts) -----------------------
   same tinted left-accent panel language as .q-feedback / .worked */
.selfmark { border: 1px solid var(--line-soft); border-left: 4px solid var(--line-2); border-radius: 0 14px 14px 0; padding: .8rem 1rem; margin: .6rem 0; background: #fff; transition: border-color .2s, background .25s; }
.selfmark.ok { border-left-color: #33a06f; border-color: rgba(51,160,111,.25); background: #eef8f1; }
.selfmark.no { border-left-color: #d98a3a; border-color: rgba(217,138,58,.3); background: #fff7ec; }
.selfmark .sm-head { font-weight: 700; margin-bottom: .5rem; }
.selfmark .sm-row { display: flex; gap: .6rem; margin: .25rem 0; line-height: 1.5; }
.selfmark .sm-tag { flex: 0 0 6.5rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #6a7783; padding-top: .1rem; }
.selfmark .sm-btns { display: flex; gap: .6rem; margin-top: .6rem; }
.selfmark .sm-btns .btn { padding: .35rem .9rem; }
.selfmark .sm-got.chosen { background: #2e8b5a; color: #fff; }
.selfmark .sm-rev.chosen { background: #d98a3a; color: #fff; border-color: #d98a3a; }
@media (max-width: 520px) { .selfmark .sm-row { flex-direction: column; gap: .1rem; } .selfmark .sm-tag { flex: none; } }

/* =====================================================================
   v2.1 SURFACES — dashboard "your progress, beautifully told" + Learn
   reading view + consistency sweep (output/ui-redesign-spec.md §v2.1)
   ===================================================================== */

/* shared entrance for injected dashboard/summary content (pure CSS so it
   works even though these render after initMotion ran) */
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }

/* ---- dashboard greeting + insight ---- */
.dash-greet h1 { margin: 6px 0 6px; }
.dash-greet h1 em { color: var(--teal); font-style: italic; font-weight: 700; }
.dash-insight { color: var(--mid-gray); font-size: clamp(1rem, 2vw, 1.1rem); line-height: 1.7; margin: 0 0 26px; max-width: 62ch; }
.dash-insight strong { color: var(--ink); }

/* ---- 4 stat tiles: icon, big Playfair number, label ---- */
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: .4rem 0 1.4rem; }
.stat-tile { position: relative; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 1.15rem 1.3rem 1.05rem; box-shadow: var(--sh-sm); overflow: hidden; animation: rise-in .55s var(--ease-out) backwards; }
.stat-tile:nth-child(2) { animation-delay: .07s; } .stat-tile:nth-child(3) { animation-delay: .14s; } .stat-tile:nth-child(4) { animation-delay: .21s; }
.stat-tile::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--teal), var(--teal-bright)); opacity: .85; }
.stat-tile .t-ico { font-size: 1.15rem; display: block; margin-bottom: .35rem; }
.stat-tile b { display: block; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 3vw, 2.4rem); color: var(--ink); line-height: 1.05; letter-spacing: -.01em; }
.stat-tile > span:last-child { font-size: .76rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--mid-gray); margin-top: .3rem; display: block; }
@media (max-width: 860px) { .stat-tiles { grid-template-columns: 1fr 1fr; } }

/* ---- chart cards (donut · focus topics · 7-day) ---- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 14px 0 4px; }
.chart-grid .card { animation: rise-in .55s var(--ease-out) backwards; }
.chart-grid .card:nth-child(2) { animation-delay: .08s; } .chart-grid .card:nth-child(3) { animation-delay: .16s; }
.chart-grid h3 { margin: .2rem 0 .7rem; font-size: .78rem; font-family: var(--font-body); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mid-gray); }
.act-bar { border-radius: 99px 99px 0 0; background: linear-gradient(180deg, var(--teal-bright), var(--teal)); }

/* ---- section kickers (small-caps amber) + Playfair titles ---- */
.sect-head { margin: 2.4rem 0 1rem; }
.sect-head .eyebrow { margin-bottom: .25rem; }
.sect-head h2 { margin: 0; }

/* ---- friendly empty state: emoji + one sentence + ONE primary CTA ---- */
.empty { color: var(--mid-gray); padding: 2.6rem 1.5rem; text-align: center; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty .btn { margin-top: 1rem; }
.empty p { margin: .2rem 0 0; }

/* ---- baseline strip on the dashboard ---- */
.baseline-card { border-left: 4px solid var(--teal); border-radius: 0 var(--r-lg) var(--r-lg) 0; padding-left: 18px; margin: 0 0 1.2rem; }

/* ---- Learn: reading view gets a comfortable measure (~68ch) ---- */
.learn-read { max-width: 70ch; }
.learn-read .sub { max-width: 68ch; }
.learn-kicker { margin-bottom: .2rem; }
.learn-before { background: var(--surface); border: 1px solid var(--line-soft); border-left: 4px solid var(--amber); border-radius: 0 14px 14px 0; }
.learn-step { background: var(--surface); border: 1px solid var(--line-soft); box-shadow: var(--sh-sm); }
.learn-fig { background: var(--surface); border: 1px solid var(--line-soft); }
.learn-watch { background: #fff7ec; border: 1px solid rgba(217,138,58,.25); border-left: 4px solid var(--amber); border-radius: 0 14px 14px 0; }
.learn-check { background: #eef6f5; border: 1px solid rgba(45,106,106,.14); border-left: 4px solid var(--teal); border-radius: 0 14px 14px 0; }
.learn-grid .card .meta { margin-top: .35rem; }
.learn-grid .card .pill { margin-top: .6rem; }

/* ------------------------------------------------------------------------
   grade-trajectory thread (ez-thread.js) — strand cards on a winding route;
   the thread + comet are injected by JS, so without JS this is a plain grid */
.jt-stage { position: relative; max-width: 980px; margin: 2.4rem auto 0; padding: 10px 0 6px; }
.jt-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.jt-track { stroke: rgba(19,64,63,.13); stroke-width: 2.5; stroke-dasharray: 1 9; stroke-linecap: round; }
.jt-lit { stroke-width: 3.5; stroke-linecap: round; }
.jt-trail { stroke: #E8A842; stroke-width: 5; stroke-linecap: round; opacity: .5; }
.jt-head { fill: #E8A842; filter: drop-shadow(0 0 7px rgba(232,168,66,.9)); opacity: 0; }
.jt-halo { fill: #E8A842; opacity: 0; }
.jt-grid { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2.4rem; }
.jt-card { position: relative; width: min(46%, 360px); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 1.5rem 1.4rem 1.3rem; box-shadow: var(--sh-sm); transition: border-color .45s, box-shadow .45s var(--ease-out); }
.jt-card:nth-child(even) { align-self: flex-end; }
.jt-card .ico { width: 48px; height: 48px; border-radius: 13px; background: var(--teal-light); display: grid; place-items: center; font-size: 22px; margin-bottom: .9rem; transition: background .45s; }
.jt-card h3 { font-size: 1.1rem; margin: 0 0 .2rem; }
.jt-card p { margin: .25rem 0 .7rem; color: var(--mid-gray); font-size: .86rem; line-height: 1.6; }
.jt-band { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .6px; color: var(--teal); background: var(--teal-light); border-radius: 99px; padding: .18rem .7rem; }
.jt-tick { position: absolute; top: 1.1rem; right: 1.1rem; width: 26px; height: 26px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-ink); font-size: .8rem; font-weight: 700; display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: opacity .35s, transform .45s var(--ease-out); }
.jt-card.jt-on { border-color: rgba(59,166,160,.55); box-shadow: var(--sh-lift); }
.jt-card.jt-on .ico { background: var(--amber-light); }
.jt-card.jt-on .jt-tick { opacity: 1; transform: scale(1); }
/* the surge — current passing through as the comet arrives */
.jt-card.jt-live { animation: jt-zap .95s var(--ease-out); }
.jt-card.jt-live .ico { animation: jt-flicker .95s steps(2, jump-none); }
@keyframes jt-zap {
  0%   { box-shadow: 0 0 0 0 rgba(59,166,160,.55), 0 0 0 rgba(232,168,66,0); }
  40%  { box-shadow: 0 0 0 7px rgba(59,166,160,0), 0 0 30px rgba(232,168,66,.6); }
  100% { box-shadow: 0 0 0 0 rgba(59,166,160,0), 0 0 0 rgba(232,168,66,0); }
}
@keyframes jt-flicker { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.5) saturate(1.4); } }
/* terminal node — the grade-9 rosette the thread arrives at */
.jt-end { position: relative; align-self: center; width: 132px; text-align: center; }
.jt-end .jt-medal { width: 92px; height: 92px; margin: 0 auto; border-radius: 50%; background: var(--amber); border: 3px solid var(--amber-dark); display: grid; place-items: center; font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: #fff; box-shadow: var(--sh-sm); transition: transform .5s var(--ease-out), box-shadow .5s; transform: scale(.92); }
.jt-end .jt-medal::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; border: 2.5px dashed rgba(255,255,255,.75); }
.jt-end b { display: block; margin-top: .6rem; font-family: var(--font-display); font-size: .95rem; color: var(--ink); }
.jt-end span { font-size: .76rem; color: var(--mid-gray); }
.jt-end.jt-on .jt-medal { transform: scale(1); box-shadow: 0 0 0 9px rgba(232,168,66,.16), var(--sh-lift); }
.jt-end.jt-live .jt-medal { animation: jt-pop .8s var(--ease-out); }
@keyframes jt-pop { 0% { transform: scale(.92); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (max-width: 700px) {
  .jt-card, .jt-card:nth-child(even) { width: 100%; align-self: stretch; }
  .jt-grid { gap: 1.6rem; }
}

/* =====================================================================
   v2.2 SIGNATURE SCENES — per-page hero scenes (mock exam desk, baseline
   compass, learn open book) + chip pops + hand-drawn accents.
   Scenes ship in their FINISHED state in the markup; js/ez-scenes.js hides
   the pieces and replays the moment (reduced-motion / CDN failure ⇒ the
   finished still stands alone). All delayed CSS entrances live inside
   no-preference blocks so reduced-motion users get the final state at once.
   ===================================================================== */

/* page hero: copy on the left, a tilted scene card on the right */
.page-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: clamp(1.2rem, 4vw, 3rem); }
.page-hero .hero-copy { flex: 1 1 auto; min-width: 0; }
.hero-scene { flex: 0 0 clamp(230px, 27vw, 320px); margin-top: .2rem; }
.hero-scene .scene-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-xl); box-shadow: var(--sh); padding: 10px 10px 4px; transform: rotate(.9deg); }
.hero-scene svg { width: 100%; height: auto; display: block; }
@media (max-width: 860px) { .hero-scene { display: none; } }

/* chips pop in as they paint — pure CSS so re-painted rows (grade pickers,
   strand filters) pop again without any JS */
@media (prefers-reduced-motion: no-preference) {
  .chooser .chip { animation: chip-in .4s var(--ease-out) backwards; }
  .chooser .chip:nth-child(2) { animation-delay: .05s; }
  .chooser .chip:nth-child(3) { animation-delay: .1s; }
  .chooser .chip:nth-child(4) { animation-delay: .15s; }
  .chooser .chip:nth-child(5) { animation-delay: .2s; }
  .chooser .chip:nth-child(6) { animation-delay: .25s; }
  .chooser .chip:nth-child(7) { animation-delay: .3s; }
  .chooser .chip:nth-child(n+8) { animation-delay: .35s; }
}
@keyframes chip-in { from { opacity: 0; transform: translateY(7px) scale(.94); } }

/* hand-drawn underline accent (pricing h1) — draws itself in, CSS-only */
.hand-underline { display: block; width: min(230px, 60%); margin: 2px auto 0; overflow: visible; }
.hand-underline path { stroke: var(--amber); stroke-width: 3; fill: none; stroke-linecap: round; opacity: .9; }
@media (prefers-reduced-motion: no-preference) {
  .hand-underline path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: hand-draw .85s var(--ease-out) .55s forwards; }
}
@keyframes hand-draw { to { stroke-dashoffset: 0; } }

/* learn (strands view): copy + the open book aside */
.learn-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.learn-hero .hero-copy { min-width: 0; }
.learn-hero .learn-book { flex: 0 0 200px; margin-bottom: .4rem; }
.learn-hero .learn-book svg { width: 100%; height: auto; display: block; }
@media (max-width: 700px) { .learn-hero .learn-book { display: none; } }

/* ---- Learn|Practice chooser (subject + per-strand) ---- */
.chooser-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; max-width: 760px; margin: 1.4rem 0; }
.chooser-card { text-align: center; padding: 2.2rem 1.8rem; }
.chooser-card .ico { font-size: 38px; }
.chooser-card h3 { font-size: 1.35rem; margin: .2rem 0 .5rem; }
.chooser-card .meta { min-height: 3.2em; }
.chooser-card .btn { margin-top: 1.1rem; }

/* ---- Maths Lab cross-link card on the Learn overview ---- */
.lab-card { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; margin-top: 1.4rem;
  background: linear-gradient(120deg, var(--teal-light), var(--amber-light)); border-color: rgba(196,138,40,.35); }
.lab-card .ico { font-size: 34px; margin: 0; flex-shrink: 0; }
.lab-card .lab-card-body { flex: 1; min-width: 220px; }
.lab-card .lab-card-body h3 { margin: 0 0 .25rem; }
.lab-card .pill { margin: 0; background: var(--amber); color: #fff; }

/* ---- "Go deeper" row (games + Maths Lab links) on a strand's Learn page ---- */
.explore { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px dashed var(--line-2, #e4ddd0); }
.explore-h { font-size: 1.15rem; margin: 0 0 .2rem; }
.explore-sub { color: var(--mid-gray); font-size: .9rem; margin: .9rem 0 .5rem; }
.explore-sub a { color: var(--teal); font-weight: 700; }
.explore-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.explore-chip { display: inline-flex; align-items: center; gap: .45rem; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--pill); padding: .5rem .95rem; font-size: .9rem; font-weight: 600; color: var(--charcoal);
  box-shadow: var(--sh-sm); transition: transform .18s var(--ease-out), border-color .18s, box-shadow .18s; }
.explore-chip:hover { transform: translateY(-2px); border-color: rgba(59,166,160,.5); color: var(--teal-dark); }
.explore-chip.lab { background: var(--teal-light); border-color: rgba(45,106,106,.25); }
.explore-ico { font-size: 18px; }
.explore-new { font-size: .8rem; color: var(--amber-dark); }

/* ---- landing journey cards are now links into each strand ---- */
a.jt-card { color: inherit; text-decoration: none; cursor: pointer; }
a.jt-card:hover { transform: translateY(-4px); border-color: rgba(59,166,160,.5); box-shadow: var(--sh-lift); }

/* ---- Maths Lab as the PRIMARY learning on a strand page ---- */
.lab-primary { margin: 1.2rem 0 1.6rem; padding: 1.5rem 1.6rem 1.7rem; border-radius: var(--r-lg);
  background: linear-gradient(125deg, var(--teal-light), var(--amber-light)); border: 1px solid rgba(196,138,40,.28); }
.lab-primary-head h2 { margin: 0 0 .2rem; font-size: 1.5rem; }
.lab-primary-head .sub { margin: 0 0 1rem; max-width: 60ch; }
.lab-primary-head .sub a { color: var(--teal-dark); font-weight: 700; }
.lab-lesson-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.lab-lesson { text-align: center; padding: 1.3rem 1rem; background: var(--warm-white); border-color: rgba(45,106,106,.18); }
.lab-lesson .ico { font-size: 30px; }
.lab-lesson h3 { font-size: 1rem; margin: .2rem 0 .3rem; }
.lab-lesson .pill { margin-top: .3rem; background: var(--teal); color: #fff; }

/* ---- concept guides demoted to "extra" below the Lab ---- */
.learn-extra { margin-top: 2rem; }
.extra-head { font-size: 1.25rem; margin: 0 0 .1rem; }

/* ---- merged strand journey on /maths/ (threaded zigzag: pick a strand, learn or practise) ---- */
.jt-card.strand-journey { display: flex; flex-direction: column; }
.strand-pick-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.strand-pick-actions .btn { flex: 1; text-align: center; padding: .55rem .4rem; }
/* the comet-lit tick sits top-right; keep the action buttons clear of it */
.jt-card.strand-journey .jt-band { align-self: flex-start; }

/* ---- Maths Lab hero on /maths/ (the free, primary way to learn) ---- */
.lab-hero { text-decoration: none; color: inherit; }
.lab-hero:hover { transform: translateY(-3px); box-shadow: var(--sh-lift); }
.free-tag { display: inline-block; vertical-align: middle; font-size: .6rem; font-weight: 800; letter-spacing: .6px;
  background: var(--teal); color: #fff; padding: .14rem .5rem; border-radius: var(--pill); margin-left: .35rem; }

/* ---- locked concept-guides teaser (free users: Lab is free, guides are paid) ---- */
.guides-locked { text-align: center; padding: 1.8rem 1.4rem; border: 1px dashed var(--line-2, #e4ddd0);
  border-radius: var(--r-lg); background: var(--surface); }
.guides-locked .ico { font-size: 30px; }
.guides-locked h3 { margin: .3rem 0 .3rem; }
.guides-locked .sub { max-width: 56ch; margin: 0 auto 1rem; }

/* ---- reduced motion: everything lands in its final state ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
