:root {
  color-scheme: light;
  --ink: #111111;
  --canvas: #FAFAF7;
  --white: #FFFFFF;
  --chartreuse: #D7FF3F;
  --border: #B6B6B0;
  --muted: #444444;
  --soft-grey: #E8E8E4;
  --radius: 20px;
  font-family: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 1.0625rem; line-height: 1.62; }
a { color: var(--ink); text-underline-offset: .22em; text-decoration-thickness: .09em; }
a:hover { text-decoration-thickness: .14em; }
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0 0 .65em; }
h1, h2, h3 { line-height: 1.13; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.45rem, 6vw, 4rem); letter-spacing: -.055em; }
h2 { font-size: clamp(1.55rem, 3.5vw, 2.1rem); letter-spacing: -.035em; }
h3 { font-size: 1.2rem; letter-spacing: -.02em; }
p:last-child { margin-bottom: 0; }

.site-header { background: var(--white); border-bottom: 1px solid var(--border); }
.header-inner, main, .site-footer { width: min(100% - 48px, 1120px); margin-inline: auto; }
.header-inner, .site-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; }
.footer-links, .support-choices { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
.support-page { max-width: 780px; }
.support-choices > section { flex: 1 1 220px; min-width: 0; }
.support-page .choice { min-height: 46px; }
.header-inner { min-height: 74px; }
.brand { display: inline-flex; min-height: 44px; align-items: center; gap: 10px; color: var(--ink); font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.brand-spark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--chartreuse); }
.header-inner nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.header-inner nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 8px; font-size: .96rem; font-weight: 700; }
.header-inner nav a[aria-current] { background: var(--soft-grey); border-radius: 8px; }
main { min-height: 50vh; }
.site-footer { margin-top: 54px; padding-block: 24px; border-top: 1px solid var(--border); font-size: .95rem; }
.site-footer p { margin: 0; }

.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); align-items: center; gap: 24px; min-height: 340px; margin-top: 28px; padding: clamp(26px, 5vw, 60px); border: 1px solid #B6B6B0; border-radius: 30px; background: var(--soft-grey); }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5.1rem); margin-bottom: .28em; line-height: .99; }
.hero p:not(.label) { max-width: 42ch; color: var(--muted); }
.label { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--chartreuse); color: var(--ink); font-size: .82rem; font-weight: 800; letter-spacing: .035em; }
.hero-art { position: relative; display: grid; place-items: center; width: min(100%, 286px); aspect-ratio: 1.22; justify-self: center; isolation: isolate; }
.section { margin-top: 34px; }
#subjects { scroll-margin-top: 18px; }

.term-links { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.term-link { display: flex; align-items: center; min-height: 56px; padding: 10px 14px; background: var(--white); border: 1px solid var(--border); border-radius: 13px; font-weight: 700; }
.term-link:hover, .term-link[aria-current] { background: var(--soft-grey); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.card, .panel { min-width: 0; padding: clamp(17px, 3vw, 24px); background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); }
.card { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.card h3 { color: var(--ink); text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .19em; }
.card:hover { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.card p { font-size: .98rem; color: var(--muted); }
.lesson-card-completed { background: var(--soft-grey); background: color-mix(in srgb, var(--chartreuse) 26%, var(--white)); border-left: 4px solid var(--ink); }
.icon { display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: 12px; border-radius: 12px; background: var(--soft-grey); color: var(--ink); font-size: 1.35rem; font-weight: 800; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: auto; color: var(--muted); font-size: .9rem; }
.progress-label { padding: 2px 8px; border: 1px solid #B6B6B0; border-radius: 999px; background: linear-gradient(to right, var(--chartreuse) var(--completion), var(--soft-grey) var(--completion)); color: var(--ink); font-weight: 700; }
.card-arrow { margin-left: auto; color: var(--ink); font-weight: 800; }
.lesson-action { margin-top: auto; font-size: .94rem; font-weight: 700; color: var(--muted); }

.inner, .profile-layout { margin-top: 26px; }
.inner > p:not(.label) { max-width: 65ch; }
.crumb { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 10px; font-weight: 700; }
.crumb + .label { display: table; }
.term-group { margin-top: 30px; }
.term-group h2 { margin-bottom: 12px; }
.lesson { max-width: 760px; margin-inline: auto; }
.panel { margin-block: 14px; }
.panel h2 { font-size: 1.48rem; }
.worked { background: var(--soft-grey); border-left: 5px solid var(--chartreuse); }
.muted { color: var(--muted); }
.video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; margin-bottom: 10px; border-radius: 10px; }
[data-video] { margin-right: 10px; }
.transcript { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--border); }
.transcript summary { min-height: 44px; padding: 8px 0; cursor: pointer; color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 9px 16px; border: 2px solid var(--ink); border-radius: 10px; color: var(--white); background: var(--ink); font-weight: 750; text-decoration: none; }
.button:hover { text-decoration: underline; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0 0 14px; }
legend { padding: 0; margin-bottom: 10px; font-size: 1.12rem; font-weight: 750; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 13px; margin-bottom: 8px; border: 1px solid #73736F; border-radius: 9px; cursor: pointer; overflow-wrap: anywhere; }
.choice input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.choice:has(input:checked) { outline: 2px solid var(--ink); outline-offset: -2px; background: var(--soft-grey); font-weight: 750; }
.feedback { margin: 12px 0 0; font-weight: 650; }
.feedback:empty { margin: 0; }
progress { display: block; width: 100%; height: 18px; margin-top: 8px; accent-color: var(--ink); }
.progress-subject ul { padding-left: 22px; margin-bottom: 0; }
.progress-subject li { margin-block: 8px; }

.profile-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
.profile-intro { padding: clamp(24px, 5vw, 52px); border: 1px solid #B6B6B0; border-radius: var(--radius); background: var(--soft-grey); }
.profile-panel { margin: 0; }
.profile-panel label { display: block; font-weight: 750; }
.profile-panel input { display: block; width: 100%; min-height: 46px; margin: 5px 0 10px; padding: 7px 10px; border: 1px solid #73736F; border-radius: 8px; color: var(--ink); background: var(--white); }
.profile-panel form { margin: 14px 0; }
.profile-choice { display: block; width: 100%; min-height: 44px; margin-bottom: 8px; padding: 8px 12px; border: 1px solid #73736F; border-radius: 9px; background: var(--white); color: var(--ink); font-weight: 750; text-align: left; overflow-wrap: anywhere; }
.profile-choice:hover { background: var(--soft-grey); text-decoration: underline; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.skip { position: absolute; z-index: 2; top: 8px; left: 8px; padding: 8px 12px; background: var(--white); transform: translateY(-160%); }
.skip:focus { transform: none; }

@media (max-width: 850px) {
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .term-links { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .header-inner, main, .site-footer { width: calc(100% - 32px); }
  .header-inner, .site-footer { align-items: flex-start; flex-direction: column; padding-block: 11px; gap: 2px; }
  .header-inner nav { gap: 0 8px; }
  .header-inner nav a { padding-inline: 3px; }
  .hero { grid-template-columns: 1fr; min-height: auto; margin-top: 16px; border-radius: 22px; }
  .hero-art { display: none; }
  .grid, .term-links, .profile-layout { grid-template-columns: 1fr; }
  .site-footer { padding-block: 18px; gap: 8px; }
}
.video-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.video-controls > a { display: inline-flex; align-items: center; min-height: 44px; }
.header-inner nav a[aria-current] { text-decoration-thickness: .16em; }
.maths-diagram { margin: 16px 0 0; }
.maths-diagram figcaption { margin-top: 8px; color: var(--muted); font-size: .95rem; }
.fraction-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 8px; align-items: center; max-width: 25rem; margin-bottom: 6px; }
.fraction-bar { display: grid; grid-template-columns: repeat(var(--parts), minmax(0, 1fr)); border: 1px solid var(--ink); background: var(--white); }
.fraction-bar span { display: grid; min-height: 28px; place-items: center; font-weight: 750; }
.fraction-bar span:not(:last-child) { border-right: 1px solid var(--ink); }
.area-grid { display: grid; grid-template-columns: repeat(5, 28px); gap: 2px; }
.area-grid span { min-height: 28px; border: 1px solid var(--ink); background: var(--white); }
.area-grid .empty-square { visibility: hidden; }
h1, h2, h3, .brand { font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif; font-weight: 700; }
.site-header { background: var(--ink); color: var(--white); border-bottom-color: var(--ink); }
.brand-lockup { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 14px; }
.brand { color: var(--white); font-size: 1.3rem; }
.brand-spark { width: auto; height: auto; background: none; color: var(--chartreuse); font-size: 1.25rem; }
.endorsement { padding-left: 14px; border-left: 1px solid #B6B6B0; font-size: .86rem; }
.header-inner nav a { color: var(--white); }
.header-inner nav a[aria-current] { background: transparent; text-decoration-thickness: .16em; }
.header-inner nav [data-profile-link] { padding-inline: 12px; color: var(--ink); background: var(--white); border-radius: 8px; }
.header-inner nav [data-profile-link][aria-current] { color: var(--ink); background: var(--white); }
.site-header :focus-visible { outline-color: var(--white); }
.hero { background: var(--white); border-color: var(--ink); }
.hero .button { background: var(--chartreuse); color: var(--ink); }
.hero-art { grid-template-columns: 1fr 1fr; align-content: center; gap: 3px; padding: 12px; }
.hero-art > span { position: absolute; top: 4%; right: 3%; color: var(--ink); font-size: 1.85rem; line-height: 1; }
.book-page { display: grid; gap: 10px; align-content: center; width: 100%; height: clamp(75px, 11vw, 138px); padding: 14%; border: 3px solid var(--ink); background: var(--white); box-shadow: 0 6px 0 var(--ink); }
.book-page:first-child { border-radius: 22px 9px 5px 9px; transform: skewY(8deg); }
.book-page:nth-child(2) { border-radius: 9px 22px 9px 5px; transform: skewY(-8deg); }
.book-page i { display: block; width: 100%; height: 3px; border-radius: 5px; background: var(--ink); }
.book-page i:last-child { width: 66%; }
.resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-top: 18px; border-left: 5px solid var(--ink); }
.resume h2 { margin-bottom: 4px; }
.resume a { font-weight: 700; }
.card h3, .term-link { color: var(--ink); }
.worked { background: var(--white); border-left: 4px solid var(--ink); }
.choice:has(input:checked) { background: var(--soft-grey); }
progress { background: var(--soft-grey); border: 1px solid var(--ink); border-radius: 9px; overflow: hidden; accent-color: var(--chartreuse); }
progress::-webkit-progress-bar { background: var(--soft-grey); }
progress::-webkit-progress-value { background: var(--chartreuse); border-right: 1px solid var(--ink); }
progress::-moz-progress-bar { background: var(--chartreuse); border-right: 1px solid var(--ink); }
.subject-card { gap: 4px; padding: clamp(18px, 3vw, 26px); }
.subject-card .icon { width: 48px; height: 48px; margin-bottom: 8px; border: 1px solid var(--border); }
.subject-card .icon svg { display: block; width: 26px; height: 26px; }
.subject-card .card-meta { padding-top: 10px; }
.subject-card:hover h3, .subject-card:focus-visible h3 { text-decoration-thickness: .15em; }
.lesson-page { max-width: 780px; border: 0; background: transparent; }
.lesson-page .panel { margin-block: 16px; border-radius: 16px; }
.lesson-page .panel p { max-width: 68ch; }
.lesson-page .worked { border-left: 1px solid var(--border); }
.lesson-progress { display: grid; grid-template-columns: minmax(0, auto) minmax(100px, 1fr) auto; align-items: center; gap: 8px 14px; padding: 8px 14px; margin: 0 0 20px; background: var(--soft-grey); border-radius: 10px; font-size: .95rem; }
.lesson-progress label { font-weight: 700; }
.lesson-progress progress { height: 12px; margin: 0; }
.lesson-progress a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; }
.lesson-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-block: 16px; }
.lesson-navigation a { min-height: 44px; padding: 9px 13px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; overflow-wrap: anywhere; }
.lesson-navigation a:hover { border-color: var(--ink); }
.lesson-navigation a span { display: block; font-size: .9rem; }
.lesson-navigation a span span { display: inline; }
.lesson-navigation .lesson-next { grid-column: 2; text-align: right; }
.practice-panel .choice { min-height: 50px; }
.practice-panel .choice:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.choice-marker { visibility: hidden; margin-inline-start: auto; font-weight: 700; }
.choice:has(input:checked) .choice-marker { visibility: visible; }
.place-value-example { max-width: 36rem; margin-inline: auto; }
.example-number { font-family: "Space Grotesk", system-ui, sans-serif; font-size: clamp(2.2rem, 6vw, 3.3rem); font-weight: 700; line-height: 1; text-align: center; }
.place-value-example table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: center; }
.place-value-example th, .place-value-example td { border: 1px solid var(--ink); padding: 4px 1px; overflow-wrap: anywhere; }
.place-value-example th { background: var(--soft-grey); font-size: clamp(.68rem, 2.4vw, .98rem); }
.place-value-example td { font-size: 1.3rem; }
.place-value-example strong { display: inline-block; min-width: 1.6em; border: 2px solid var(--ink); border-radius: 5px; }
.profile-intro { background: var(--ink); color: var(--white); }
@media (max-width: 600px) {
  .lesson-navigation { grid-template-columns: minmax(0, 1fr); }
  .lesson-navigation .lesson-next { grid-column: 1; text-align: left; }
  .lesson-progress { grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 10px 12px 4px; }
  .header-inner nav [data-profile-link] { padding-inline: 9px; }
  .endorsement { padding-left: 8px; }
}
