/* Light / Dark design. Load after site.css. Pale teal with white cards in light mode;
   deep teal with brighter sea-glass accents in dark mode (Ben, 13 Oct 2026). */
:root {
  color-scheme: light;
  --paper: #e8f8f6;
  --surface: #ffffff;
  --surface-soft: #d6f2ee;
  --surface-hover: #bee9e3;
  --ink: #123f3b;
  --ink-soft: #386a65;
  --biro: #067067;
  --teal: #067067;
  --teal-pale: #d6f2ee;
  --grid: #b6dfd8;
  --border-hover: #65afa3;
  --highlighter: #bee9e3;
  --solid: #067067;
  --on-solid: #ffffff;
  --shadow: 0 5px 18px #123f3b08;
  --radius: 12px;
  --text-hero: clamp(1.875rem, 1.2rem + 2vw, 2.625rem);
  --text-2xl: clamp(1.875rem, 1.2rem + 2vw, 2.625rem);
  --focus: 3px solid var(--biro);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #082825;
  --surface: #103b37;
  --surface-soft: #174b45;
  --surface-hover: #205e57;
  --ink: #edf9f6;
  --ink-soft: #afd3cd;
  --biro: #78dfcd;
  --teal: #78dfcd;
  --teal-pale: #174b45;
  --grid: #2f5e56;
  --border-hover: #62aa9e;
  --highlighter: #205e57;
  --solid: #78dfcd;
  --on-solid: #082825;
  --shadow: 0 5px 18px #00000018;
}
body { min-height: 100svh; }
.wrap { width: min(1152px, calc(100% - 80px)); padding-inline: 0; }
h1, h2, h3, .site-header__name { color: var(--ink); letter-spacing: -.025em; }
h1 { text-wrap: balance; line-height: 1.15; }
a { text-decoration-thickness: 1px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: var(--focus); outline-offset: 4px; }
.site-header, .site-footer { background: var(--paper); border-color: var(--grid); }
.site-header__inner { min-height: 88px; padding-block: 16px; gap: 16px 24px; }
/* The name is as big as the home page's heading (Ben, 13 Oct 2026). */
.site-header__name { font-size: var(--text-hero); padding: 0; }
.static-field { background: radial-gradient(ellipse 640px 430px at 100% 0%, color-mix(in srgb, var(--surface-hover) 55%, transparent), transparent), var(--paper); }
.theme-switch { display: inline-flex; padding: 4px; gap: 2px; border: 1px solid var(--grid); border-radius: 100px; background: var(--surface-soft); }
.theme-switch button { color: var(--ink-soft); border: 0; background: transparent; border-radius: 100px; font-size: 13px; line-height: 1.2; padding: 6px 12px; min-height: 30px; }
.theme-switch button[aria-pressed="true"] { background: var(--solid); color: var(--on-solid); }
.theme-switch button:hover:not([aria-pressed="true"]) { background: var(--surface-hover); color: var(--ink); }
.site-nav { gap: 8px 26px; font-size: 15px; }
/* Separate the three subjects from the two qualifications; keep the rule with GCSE when wrapping. */
.site-nav li:nth-child(4) { display: flex; align-items: center; gap: 26px; }
.site-nav li:nth-child(4)::before { content: ""; height: 1em; border-left: 1px solid var(--border-hover); }
.site-nav a { display: inline-block; min-height: 44px; line-height: 44px; font-size: inherit; font-weight: 400; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.site-nav a[aria-current="page"] { font-weight: 700; }
.site-footer__inner { justify-content: space-between; align-items: center; padding-block: 24px; gap: 12px 24px; }
.site-footer__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.site-footer p, .site-footer__links { margin: 0; }
.site-footer a { color: var(--ink-soft); }
.page { padding-top: 30px; padding-bottom: 90px; }
.breadcrumbs { min-height: 34px; margin: 0 0 36px; font-size: 14px; line-height: 1.6; }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumbs > span[aria-hidden] { margin-inline: 7px; opacity: .6; }
/* Home: the heading, a line under it, then the groups of cards. */
.hero--home { padding: 56px 0 90px; }
.hero--home .hero__title { max-width: 960px; margin: 0 0 16px; }
/* The lead runs the full width of the cards below it, wrapping only when the screen is too narrow (Ben, 13 Oct 2026). */
.hero--home .hero__lead { margin: 0 0 8px; font-size: 19px; line-height: 1.6; color: var(--ink-soft); }
.hero--hub { padding-top: 30px; }
.hero--hub .breadcrumbs { margin-bottom: 28px; }
.level--untitled { margin-top: 36px; }
.level__title { font-size: 20px; margin: 44px 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--grid); }
.choose { grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); gap: 18px; }
.choose__card { border: 1px solid var(--grid); border-radius: 16px; padding: 24px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); min-width: 0; }
.choose__title { font-size: 23px; line-height: 1.2; margin: 0 0 24px; }
.choose__boards { display: grid; gap: 8px; }
.choose__boards a { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 17px; line-height: 1.25; font-weight: 400; min-height: 46px; padding: 12px 14px; background: var(--surface-soft); color: var(--ink); border: 1px solid transparent; border-radius: 9px; text-decoration: none; }
.choose__boards a::after { content: "↗"; font-size: 20px; font-weight: 400; flex: none; }
.choose__boards a:hover, .choose__boards a:focus-visible { background: var(--surface-hover); border-color: var(--border-hover); }
.choose__card--link { position: relative; display: flex; flex-direction: column; min-height: 204px; text-decoration: none; }
.choose__card--link::after { content: "↗"; display: grid; place-items: center; width: 38px; height: 38px; margin-top: auto; align-self: flex-end; border: 1px solid var(--grid); border-radius: 50%; font-size: 24px; line-height: 1; background: var(--surface-soft); color: var(--ink); }
.choose__card--link .choose__title { margin: 0 0 8px; }
/* The one exam board a single-link card leads to, named under the title. */
.choose__board { margin: 0 0 20px; font-size: 17px; color: var(--ink-soft); }
.choose__card--link:hover, .choose__card--link:focus-visible { background: var(--surface-hover); border-color: var(--border-hover); }
.choose__card--link:hover .choose__title { text-decoration: none; }
.choose__card--link:hover::after { color: var(--on-solid); background: var(--solid); border-color: var(--solid); }
.page > h1 { max-width: 980px; margin-bottom: 28px; }
.spec-code { white-space: nowrap; font-size: .7em; }
.board-bar { gap: 16px 22px; margin: 0 0 28px; }
.switch { padding: 4px; gap: 4px; border: 1px solid var(--grid); border-radius: 100px; background: var(--surface-soft); flex-wrap: wrap; }
.switch a { min-width: 0; padding: 8px 17px; border: 0; border-radius: 100px; font-size: 15px; }
.switch a + a { border: 0; }
.switch a[aria-current="page"] { background: var(--solid); color: var(--on-solid); }
.switch a:not([aria-current]):hover { background: var(--surface-hover); }
.switch a:focus-visible { outline: var(--focus); outline-offset: -2px; }
/* Keep keyboard focus visible even on a selected control, whose fill is the accent colour. */
.switch a[aria-current="page"]:focus-visible,
.theme-switch button[aria-pressed="true"]:focus-visible { outline: 2px solid var(--on-solid); outline-offset: -4px; }
.paper-grid-scroll { border: 1px solid var(--grid); border-radius: 16px; background: var(--surface); }
.paper-grid { border-collapse: separate; border-spacing: 0; }
.paper-grid th, .paper-grid td { padding: 22px 18px; border-color: var(--grid); }
.paper-grid thead th { padding-block: 16px; border-bottom: 1px solid var(--grid); color: var(--ink-soft); background: var(--surface-soft); font-size: 14px; font-weight: 400; }
.paper-grid tbody th { font-size: 18px; }
.paper-grid tbody th a { text-decoration: none; }
.paper-grid tbody th a:hover { text-decoration: underline; }
.paper-grid tbody tr:last-child > * { border-bottom: 0; }
.is-newest th a { background: none; margin: 0; padding: 0; }
.newest-tag { width: fit-content; margin-top: 9px; padding: 3px 9px; color: var(--biro); background: var(--surface-soft); border-radius: 30px; font-size: 12px; line-height: 1.4; }
.doc-links { gap: 7px; }
.doc-link { display: inline-flex; align-items: center; padding: 9px 12px; min-height: 42px; border: 1px solid var(--grid); border-radius: 9px; background: var(--surface-soft); color: var(--ink); font-size: 14px; line-height: 1.4; text-decoration: none; }
.doc-link:hover, .doc-link:focus-visible { border-color: var(--border-hover); background: var(--surface-hover); }
.series-paper { padding: 22px; border: 1px solid var(--grid); border-radius: 14px; background: var(--surface); margin-bottom: 12px; }
.page > .board-bar__formulae { margin-bottom: 24px; }
.series-nav a { padding: 10px 16px; border: 1px solid var(--grid); border-radius: 10px; background: var(--surface); text-decoration: none; }
.series-nav a:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.paper-grid--stacked { background: var(--paper); }
.paper-grid--stacked tbody { gap: 18px; }
.paper-grid--stacked tbody tr { background: var(--surface); border-radius: 14px; }
.paper-grid--stacked tbody th { border-bottom: 1px solid var(--grid); background: var(--surface-soft); }
.paper-grid--stacked .newest-tag { margin-top: 0; }
@media (prefers-reduced-motion: no-preference) {
  .choose__card, .choose__boards a, .doc-link, .theme-switch button { transition: background-color .16s ease, border-color .16s ease; }
}
@media (max-width: 1000px) {
  .wrap { width: calc(100% - 48px); }
  .choose { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 704px) {
  .paper-grid-scroll { border: 0; background: transparent; overflow: visible; }
  .paper-grid tbody tr { border-radius: 14px; background: var(--surface); }
  .paper-grid tbody th { background: var(--surface-soft); border-bottom: 1px solid var(--grid); }
  .paper-grid th, .paper-grid td { padding: 18px; }
  .paper-grid td { grid-template-columns: minmax(90px, 32%) 1fr; gap: 12px; }
  .paper-grid .newest-tag { margin-top: 0; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 36px); }
  /* On a phone the logo takes a line and the five hub links wrap under it. */
  .site-header__inner { min-height: 0; padding-block: 14px 6px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .site-header__name { font-size: 30px; } /* the home heading's size on a phone */
  .site-nav { gap: 0 12px; font-size: 14px; }
  .site-nav li:nth-child(4) { gap: 12px; }
  .site-nav a { min-height: 40px; line-height: 40px; }
  .page { padding-bottom: 56px; }
  .breadcrumbs { margin-bottom: 26px; font-size: 13px; }
  .hero--home { padding: 32px 0 56px; }
  .hero--home .hero__title { font-size: 30px; margin-bottom: 12px; }
  .hero--home .hero__lead { font-size: 16px; }
  .level__title { margin-top: 32px; }
  .choose { grid-template-columns: 1fr; gap: 12px; }
  .choose__card { padding: 18px 20px; }
  .choose__title { font-size: 20px; margin-bottom: 14px; }
  /* On a phone a single-link card is one row: title on the left, arrow on the right. */
  .choose__card--link { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 14px; }
  .choose__card--link .choose__title { margin: 0; }
  .choose__card--link .choose__board { order: 3; flex-basis: 100%; margin: 0; font-size: 15px; }
  .choose__card--link::after { margin-top: 0; flex-shrink: 0; width: 34px; height: 34px; font-size: 21px; }
  .site-footer__inner { font-size: 14px; }
  .series-paper { padding: 20px; }
}
@media (forced-colors: active) {
  .static-field { background: Canvas; }
  .theme-switch button[aria-pressed="true"] { outline: 2px solid ButtonText; }
}
