/* Masterclass engine - site stylesheet (the engine defaults; a site overrides the tokens in assets/theme/tokens.css and styles in assets/theme/site.css).
   Black ground, warm white "paper" sections, colour photographs, one warm accent colour.
   Type: Cormorant Garamond (display), Inter (text), JetBrains Mono (labels). */

@font-face { font-family: "Cormorant"; font-weight: 400; font-display: swap; src: url("../fonts/cormorant-400.woff2") format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 500; font-display: swap; src: url("../fonts/cormorant-500.woff2") format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 600; font-display: swap; src: url("../fonts/cormorant-600.woff2") format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 500; font-style: italic; font-display: swap; src: url("../fonts/cormorant-500i.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "JBMono"; font-weight: 400; font-display: swap; src: url("../fonts/jbmono-400.woff2") format("woff2"); }
@font-face { font-family: "JBMono"; font-weight: 500; font-display: swap; src: url("../fonts/jbmono-500.woff2") format("woff2"); }

:root {
  --bg: #040405;
  --panel: #0d0d0f;
  --panel-2: #141416;
  --ink: #f4f3ee;
  --muted: #a3a29b;
  --dim: #6f6e68;
  --line: rgba(255, 255, 255, .13);
  --line-strong: rgba(255, 255, 255, .28);
  --paper: #f4f3ee;
  --paper-2: #eae8e1;
  --paper-ink: #0b0b0c;
  --paper-muted: #5c5b55;
  --paper-line: #d6d4cb;
  --accent: #e9b872;
  --accent-ink: #9a5b12;
  --ok: #2f8a55;
  --bad: #b3392f;
  --serif: "Cormorant", "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JBMono", "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1180px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16.500px/1.650 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.080; margin: 0; letter-spacing: -.005em; }
h1 { font-size: clamp(2.600rem, 6.200vw, 5.300rem); }
h2 { font-size: clamp(2.100rem, 4.200vw, 3.500rem); }
h3 { font-size: 1.650rem; line-height: 1.150; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: #fff; color: #000; }
.light ::selection, .paper ::selection { background: #000; color: #fff; }
/* Form fields and light cards are white or paper-coloured even inside dark sections: a white highlight would be invisible there. */
.auth-card ::selection, .paper-card ::selection, input::selection, textarea::selection { background: var(--accent); color: #000; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 820px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; }
.skip { position: absolute; left: -9999px; top: 0; background: #fff; color: #000; padding: 10px 16px; z-index: 200; }
.skip:focus { left: 12px; top: 12px; }
.icon { width: 1.500em; height: 1.500em; flex: none; }

.eyebrow { font: 500 .700rem/1.300 var(--mono); letter-spacing: .220em; text-transform: uppercase; color: var(--accent); }
.light .eyebrow, .paper .eyebrow, .paper-card .eyebrow, .auth-card .eyebrow, .reader .eyebrow { color: var(--accent-ink); }
.site-footer .eyebrow, .mm-group .eyebrow { color: var(--muted); }
.lead { font-size: 1.150rem; line-height: 1.600; color: var(--muted); max-width: 46em; }
.light .lead { color: var(--paper-muted); }
.credit { font: 400 .620rem/1.300 var(--mono); letter-spacing: .080em; color: rgba(255, 255, 255, .5); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .600em; padding: .900em 1.650em; border: 1px solid var(--ink); font: 500 .900rem/1.200 var(--sans); letter-spacing: .020em; text-decoration: none; background: transparent; color: var(--ink); transition: background .180s, color .180s, border-color .180s; border-radius: 0; cursor: pointer; }
.btn-light { background: var(--ink); color: #000; }
.btn-light:hover { background: transparent; color: var(--ink); }
.btn-ghost { border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); background: var(--ink); color: #000; }
.btn-dark { background: var(--paper-ink); color: var(--paper); border-color: var(--paper-ink); }
.btn-dark:hover { background: transparent; color: var(--paper-ink); }
.btn-outline { border-color: var(--paper-ink); color: var(--paper-ink); }
.btn-outline:hover { background: var(--paper-ink); color: var(--paper); }
.btn-sm { padding: .620em 1.150em; font-size: .820rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .400; pointer-events: none; }
.link-arrow { display: inline-flex; align-items: center; gap: .500em; font: 500 .780rem/1 var(--mono); letter-spacing: .160em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: .400em; }
.link-arrow:hover { opacity: .700; }

/* ----------------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 100; height: var(--header-h); background: rgba(4, 4, 5, .860); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); transition: background .250s, border-color .250s; }
.has-overlay-header .site-header { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.has-overlay-header .site-header.is-scrolled { background: rgba(4, 4, 5, .880); border-color: var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.header-inner { display: flex; align-items: center; height: 100%; gap: 34px; }
.brand { display: flex; align-items: center; }
.logo { height: 46px; width: auto; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav-group { position: relative; }
.nav-top { background: none; border: 0; padding: 10px 14px; font: 500 .860rem/1 var(--sans); color: var(--ink); letter-spacing: .010em; }
.nav-top::after { content: ""; display: inline-block; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-3px); margin-left: 8px; opacity: .600; }
.nav-menu { position: absolute; top: 100%; left: 0; min-width: 250px; background: #0a0a0b; border: 1px solid var(--line); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .160s, transform .160s, visibility .160s; }
.nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu, .nav-group.is-open .nav-menu { opacity: 1; visibility: visible; transform: none; }
.nav-menu a { display: block; padding: 10px 12px; font-size: .880rem; text-decoration: none; color: var(--muted); }
.nav-menu a:hover { color: var(--ink); background: var(--panel-2); }
.header-cta { display: flex; align-items: center; gap: 18px; }
.nav-login { font-size: .860rem; font-weight: 500; text-decoration: none; }
.nav-login:hover { text-decoration: underline; }
.burger { display: none; width: 42px; height: 42px; background: none; border: 1px solid var(--line-strong); position: relative; }
.burger span { position: absolute; left: 11px; right: 11px; height: 1px; background: var(--ink); transition: transform .200s, top .200s; }
.burger span:first-child { top: 16px; }
.burger span:last-child { top: 24px; }
.burger[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }
.mobile-menu { position: fixed; inset: var(--header-h) 0 0 0; z-index: 99; background: #040405; overflow-y: auto; padding: 28px 0 60px; }
.mm-group { padding: 18px 0; border-bottom: 1px solid var(--line); }
.mm-group a { display: block; font: 500 1.650rem/1.200 var(--serif); text-decoration: none; padding: 7px 0; }
.mm-group .eyebrow { margin-bottom: 8px; }
.mm-cta { display: grid; gap: 12px; margin-top: 28px; }

/* --------------------------------------------------------------- sections */
.section { padding: clamp(72px, 9vw, 132px) 0; position: relative; }
.section.light { background: var(--paper); color: var(--paper-ink); }
.section.tight { padding: clamp(48px, 6vw, 84px) 0; }
.section-head { display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 860px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; justify-items: center; }
.section-head p { font-size: 1.120rem; color: var(--muted); margin: 0; max-width: 44em; }
.light .section-head p { color: var(--paper-muted); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.light .rule { border-color: var(--paper-line); }
.flash { padding: 14px 0; font-size: .920rem; background: #17301f; border-bottom: 1px solid #25553a; }
.flash-error { background: #3a1512; border-color: #6b241e; }
.has-overlay-header .flash { padding-top: calc(var(--header-h) + 14px); }

/* ------------------------------------------------------------------- hero */
.hero { position: relative; min-height: min(100svh, 980px); display: flex; align-items: flex-end; overflow: hidden; background: #000; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; filter: contrast(1.050) brightness(.900) saturate(1.100); animation: heroDrift 40s ease-in-out infinite alternate; }
@keyframes heroDrift { from { transform: scale(1.020); } to { transform: scale(1.120) translate(-1.500%, -1%); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.900) 0%, rgba(0,0,0,.550) 42%, rgba(0,0,0,.080) 78%), linear-gradient(0deg, rgba(4,4,5,1) 0%, rgba(4,4,5,0) 30%), linear-gradient(180deg, rgba(0,0,0,.550) 0%, rgba(0,0,0,0) 22%); }
.hero-inner { position: relative; z-index: 2; padding-top: calc(var(--header-h) + 70px); padding-bottom: clamp(48px, 7vw, 96px); width: 100%; }
.hero h1 { max-width: none; margin: 0 0 26px; font-weight: 500; font-size: inherit; }
.hero-headline { max-width: 13.500em; }
.br-lg { display: none; }
@media (min-width: 861px) { .br-lg { display: inline; } }
.hero h1 em { font-style: italic; font-weight: 500; }
.hero-name { display: block; font: 500 clamp(1.120rem, 2.100vw, 1.900rem)/1.200 var(--serif); letter-spacing: .010em; color: var(--accent); margin-bottom: 18px; }
.hero-headline { display: block; font-size: clamp(2.500rem, 5.600vw, 4.800rem); line-height: 1.040; }
.hero-sub { font-size: clamp(1.050rem, 1.500vw, 1.300rem); line-height: 1.550; color: #d9d8d1; max-width: 34em; margin-bottom: 34px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { font: 500 .680rem/1 var(--mono); letter-spacing: .180em; text-transform: uppercase; padding: 8px 12px; border: 1px solid var(--line-strong); color: #e6e5df; background: rgba(0, 0, 0, .350); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: clamp(40px, 6vw, 76px); }
.hero-checks { list-style: none; margin: 0; padding: 24px 0 0; border-top: 1px solid var(--line-strong); display: flex; flex-wrap: wrap; gap: 14px 46px; font: 500 1.120rem/1.200 var(--sans); }
.hero-checks li { display: flex; align-items: center; gap: 10px; }
.hero-checks .icon { color: var(--accent); width: 1.350em; height: 1.350em; stroke-width: 2; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.hero-stats div { padding: 20px 20px 0 0; }
.hero-stats b { display: block; font: 500 clamp(1.700rem, 2.800vw, 2.500rem)/1 var(--serif); margin-bottom: 8px; }
.hero-stats span { font: 400 .680rem/1.400 var(--mono); letter-spacing: .140em; text-transform: uppercase; color: var(--muted); }
.hero .credit { position: absolute; right: 18px; bottom: 12px; z-index: 2; }

/* ---------------------------------------------------------------- marquee */
.alumni { padding: 44px 0 50px; border-bottom: 1px solid var(--line); overflow: hidden; }
.alumni .eyebrow { text-align: center; margin-bottom: 30px; color: var(--muted); }
.marquee { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee-set { display: flex; align-items: center; gap: 76px; padding-right: 76px; }
.marquee img { height: 36px; width: auto; max-width: 210px; object-fit: contain; filter: brightness(0) invert(1); opacity: .620; }
.marquee .wordmark { font: 500 1.450rem/1 var(--serif); white-space: nowrap; opacity: .620; letter-spacing: .010em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ------------------------------------------------------------------ intro */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.split.flip > :first-child { order: 2; }
.split-media { position: relative; }
.split-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.split-media .credit { position: absolute; left: 12px; bottom: 10px; }
.split-body h2 { margin: 0 0 22px; }
.split-body .eyebrow + h2 { margin-top: 16px; }
.split-body p { color: var(--muted); font-size: 1.060rem; }
.light .split-body p { color: var(--paper-muted); }
.checks { list-style: none; padding: 0; margin: 26px 0 32px; display: grid; gap: 14px; }
.checks li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; }
.checks .icon { margin-top: 2px; color: var(--accent); }
.light .checks .icon { color: var(--accent-ink); }
.checks b { font-weight: 600; }

/* --------------------------------------------------------------- audience */
.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--paper-line); }
.aud { padding: 40px 34px 38px; border-right: 1px solid var(--paper-line); background: var(--paper); transition: background .250s, color .250s; display: flex; flex-direction: column; }
.aud:last-child { border-right: 0; }
.aud:hover { background: var(--paper-ink); color: var(--paper); }
.aud:hover p, .aud:hover .eyebrow, .aud:hover li { color: #c9c8c1; }
.aud .icon { width: 44px; height: 44px; margin-bottom: 30px; color: var(--accent-ink); }
.aud:hover .icon, .aud:hover .eyebrow { color: var(--accent); }
.aud h3 { font-size: 1.900rem; margin-bottom: 14px; }
.aud p { color: var(--paper-muted); font-size: .980rem; flex: 1; margin: 0; }
.aud ul { margin: 22px 0 0; padding: 20px 0 0; list-style: none; border-top: 1px solid currentColor; font-size: .900rem; display: grid; gap: 10px; color: var(--paper-muted); }
.aud li { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.aud li .icon { width: 17px; height: 17px; margin: 0; stroke-width: 2; }

/* ------------------------------------------------------------------ steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.step { background: var(--bg); padding: 34px 30px 36px; position: relative; }
.step-no { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.step-num { display: flex; align-items: center; }
.step-num b { width: 66px; height: 66px; border-radius: 50%; background: var(--accent); color: #000; display: flex; align-items: center; justify-content: center; font: 600 1.950rem/1 var(--sans); }
.step .icon { width: 32px; height: 32px; color: var(--accent); margin-top: 17px; }
.step h3 { font-size: 1.550rem; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: .950rem; margin: 0; }

.week { margin-top: 56px; border: 1px solid var(--line); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week > div { padding: 18px 16px 20px; border-right: 1px solid var(--line); min-height: 132px; }
.week > div:last-child { border-right: 0; }
.week .d { font: 500 .660rem/1 var(--mono); letter-spacing: .200em; color: var(--dim); margin-bottom: 14px; text-transform: uppercase; }
.week b { display: block; font: 500 1.150rem/1.200 var(--serif); margin-bottom: 4px; }
.week span { font-size: .800rem; color: var(--muted); line-height: 1.400; display: block; }
.week .on { background: var(--panel-2); }

/* ------------------------------------------------------------- curriculum */
.unit-group { margin-bottom: 54px; }
.unit-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--paper-ink); margin-bottom: 0; }
.unit-group-head h3 { font-size: 1.900rem; }
.unit-rows { list-style: none; margin: 0; padding: 0; }
.unit-row { display: grid; grid-template-columns: 64px minmax(0, 1.100fr) minmax(0, 1.600fr) auto; gap: 24px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--paper-line); text-decoration: none; transition: background .200s, box-shadow .200s; }
/* The highlight is widened with shadows in the same colour, so the text does not move. */
a.unit-row:hover { background: var(--paper-2); box-shadow: -14px 0 0 var(--paper-2), 14px 0 0 var(--paper-2); }
.unit-row:target { background: var(--paper-2); box-shadow: -14px 0 0 var(--paper-2), 14px 0 0 var(--paper-2), -17px 0 0 var(--accent-ink); }
.unit-row .no { font: 500 .720rem/1 var(--mono); letter-spacing: .180em; color: var(--paper-muted); }
/* The unit number sits in a line box as tall as the first line of the title next to it, so both share a centre line. */
.unit-row[style*="align-items:start"] .no { display: flex; align-items: center; height: 1.610rem; padding-top: .120rem; }
.unit-row h4, .unit-row h3 { font-size: 1.400rem; line-height: 1.150; }
.unit-row p { margin: 0; font-size: .920rem; color: var(--paper-muted); }
.topic-badges { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.topic-badges li { font-size: .780rem; line-height: 1.300; color: #6f6d66; border: 1px solid #d3d0c6; background: #faf9f5; padding: 4px 10px; border-radius: 999px; }
.spot-box { margin-top: 14px; padding: 12px 14px; background: #fbfaf6; border: 1px solid var(--paper-line); border-left: 2px solid var(--accent-ink); display: grid; gap: 10px; }
.spot-label { font: 500 .620rem/1 var(--mono); letter-spacing: .180em; text-transform: uppercase; color: var(--accent-ink); }
.spot { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; text-decoration: none; color: var(--paper-ink); }
.spot .avatar { width: 40px; height: 40px; border-radius: 50%; aspect-ratio: auto; }
.spot .avatar-mono { font-size: .900rem; letter-spacing: .020em; background: var(--paper-2); }
.spot span { font-size: .840rem; line-height: 1.400; color: var(--paper-muted); }
.spot b { display: block; font: 600 .920rem/1.300 var(--sans); color: var(--paper-ink); }
.spot em { display: block; font-style: normal; font-size: .800rem; }
.spot:hover b { text-decoration: underline; text-underline-offset: 3px; }
.sample-cta { display: inline-flex; align-items: center; gap: 12px; margin-top: 16px; padding: 11px 16px 11px 13px; background: var(--paper-ink); color: var(--paper); text-decoration: none; transition: background .200s; }
.sample-cta:hover { background: #2a2a28; }
.sample-cta .icon { width: 22px; height: 22px; color: var(--accent); }
.sample-cta span { font-size: .800rem; line-height: 1.350; color: #c9c8c1; }
.sample-cta b { display: block; font-size: .900rem; color: #fff; font-weight: 600; }
.unit-row .pk { font: 500 .620rem/1 var(--mono); letter-spacing: .140em; text-transform: uppercase; color: var(--paper-muted); white-space: nowrap; }
.dark .unit-row, .section:not(.light) .unit-row { border-color: var(--line); }

.learn { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.learn-card { display: flex; flex-direction: column; text-decoration: none; background: #fbfaf6; border: 1px solid var(--paper-line); transition: border-color .200s, transform .250s; }
.learn-card:hover { border-color: var(--paper-ink); transform: translateY(-4px); }
.learn-img { aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.learn-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .600s; }
.learn-card:hover .learn-img img { transform: scale(1.050); }
.learn-body { padding: 24px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.learn-body h3 { font-size: 1.850rem; margin: 12px 0 12px; min-height: 2.300em; }
.learn-body p { color: var(--paper-ink); font-size: .980rem; min-height: 8.250em; margin: 0 0 18px; }
.learn-units { font-size: .800rem; line-height: 1.550; color: var(--paper-muted); border-top: 1px solid var(--paper-line); padding-top: 14px; }
.sample-feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.sample-pages { position: relative; display: block; aspect-ratio: 1 / 1.020; }
.sample-pages .pg { position: absolute; width: 62%; height: auto; box-shadow: 0 24px 60px rgba(0, 0, 0, .650); border: 1px solid var(--line); transition: transform .350s; background: #fff; }
.sample-pages .pg-1 { left: 0; top: 4%; z-index: 3; }
.sample-pages .pg-2 { left: 19%; top: 8%; z-index: 2; transform: rotate(3deg); }
.sample-pages .pg-3 { left: 38%; top: 12%; z-index: 1; transform: rotate(6deg); }
.sample-pages:hover .pg-1 { transform: translateY(-6px); }
.sample-pages:hover .pg-2 { transform: rotate(5deg) translateX(10px); }
.sample-pages:hover .pg-3 { transform: rotate(9deg) translateX(20px); }
.sample-card { border-left: 2px solid var(--accent); padding: 4px 0 4px 22px; margin: 26px 0 30px; }
.sample-card h3 { font-size: 1.900rem; margin: 10px 0 10px; }
.sample-card p { font-size: .960rem; margin: 0; }
.samples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.sample { display: flex; flex-direction: column; text-decoration: none; border: 1px solid var(--line); background: var(--panel); transition: border-color .200s, transform .250s; }
.sample:hover { border-color: var(--ink); transform: translateY(-4px); }
.sample-img { aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.sample-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .600s; }
.sample:hover .sample-img img { transform: scale(1.050); }
.sample-body { padding: 24px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.sample h3 { margin: 12px 0 10px; }
.sample p { color: var(--muted); font-size: .930rem; flex: 1; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.sample .link-arrow { align-self: flex-start; margin-top: 10px; }

/* ------------------------------------------------------------ researchers */
.researchers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px 22px; }
.researcher { text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.avatar { width: 100%; aspect-ratio: 1; object-fit: cover; filter: grayscale(1) contrast(1.050); background: var(--paper-2); transition: filter .300s; }
.avatar-mono { display: flex; align-items: center; justify-content: center; font: 500 3.200rem/1 var(--serif); color: var(--paper-muted); border: 1px solid var(--paper-line); letter-spacing: .040em; }
.researcher-body { padding: 16px 0 0; border-top: 1px solid var(--paper-ink); margin-top: 14px; flex: 1; display: flex; flex-direction: column; }
.researcher-body .eyebrow { margin-top: auto; padding-top: 4px; }
.researcher h3 { font-size: 1.350rem; margin-bottom: 4px; }
.researcher-inst { font-size: .840rem; color: var(--paper-muted); margin-bottom: 8px; }
.researcher p { font-size: .880rem; margin: 0 0 12px; color: var(--paper-ink); }
.researcher:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.disclaimer { margin-top: 44px; padding: 18px 22px; border: 1px solid var(--paper-line); font-size: .860rem; color: var(--paper-muted); max-width: 860px; }
.section:not(.light) .disclaimer { border-color: var(--line); color: var(--muted); }

/* ------------------------------------------------------------ certificate */
.cert-shot { position: relative; }
.cert-shot img { width: 100%; box-shadow: 0 30px 80px rgba(0, 0, 0, .600); border: 1px solid var(--line); }
.light .cert-shot img { box-shadow: 0 30px 70px rgba(0, 0, 0, .220); border-color: var(--paper-line); }
.cert-shot .tr { position: absolute; width: 34%; right: -4%; bottom: -9%; }

/* --------------------------------------------------------------- packages */
.packages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.package { border: 1px solid var(--line); background: var(--panel); padding: 34px 30px 30px; position: relative; }
.package.is-featured { border-color: var(--accent); background: #111113; }
.package-flag { position: absolute; top: -1px; right: -1px; background: var(--accent); color: #000; font: 500 .620rem/1 var(--mono); letter-spacing: .180em; text-transform: uppercase; padding: 8px 12px; }
.package h2, .package h3 { font-size: 2.150rem; margin: 14px 0 10px; min-height: 2.320em; display: flex; align-items: flex-end; }
.package-note { color: var(--muted); font-size: .920rem; min-height: 3.200em; }
.fee { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin: 22px 0 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.fee-label { flex-basis: 100%; font: 500 .660rem/1 var(--mono); letter-spacing: .200em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.fee-now { font: 500 3.700rem/1 var(--serif); color: var(--accent); }
.fee-cents { font-size: .550em; vertical-align: .600em; margin-left: 1px; }
.fee-was { font: 400 1.350rem/1 var(--serif); color: var(--dim); text-decoration: line-through; text-decoration-thickness: 1px; }
.package-incl { list-style: none; margin: 22px 0 0; padding: 0; font-size: .880rem; color: var(--muted); display: grid; gap: 7px; }
.package-incl li::before { content: "+ "; font-family: var(--mono); color: var(--accent); }
.package-units-label { margin: 26px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.package-units { list-style: none; margin: 0; padding: 0; font-size: .880rem; display: grid; gap: 7px; }
.package-units li a { display: grid; grid-template-columns: 26px 1fr 14px; gap: 8px; align-items: start; padding: 12px 11px 12px 13px; border: 1px solid var(--line); border-left: 2px solid var(--accent); background: rgba(255, 255, 255, .045); line-height: 1.350; font-weight: 500; text-decoration: none; transition: background .220s ease, border-color .220s ease; }
.package-units li a::after { content: "\2192"; font: 400 .900rem/1.450 var(--sans); color: var(--accent); opacity: 0; transform: translateX(-6px); transition: opacity .220s ease, transform .220s ease; }
.package-units li a:hover, .package-units li a:focus-visible { background: rgba(233, 184, 114, .130); border-color: var(--accent); outline: none; }
.package-units li a:hover::after, .package-units li a:focus-visible::after { opacity: 1; transform: none; }
.package-units li.gap { margin-top: 18px; }
.topic-badge { float: right; margin: 0 0 0 10px; font: 500 .560rem/1 var(--mono); font-style: normal; letter-spacing: .160em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); padding: 2px 6px; white-space: nowrap; }
.package-units li a > span { font: 500 .700rem/1.700 var(--mono); color: var(--accent); }
/* Topics a masterclass does not include are not shown; side by side the rows keep their place so the cards line up. */
.package-units li.out { visibility: hidden; }
.fee-footnote { margin-top: 26px; font-size: .840rem; color: var(--dim); text-align: center; }

/* ----------------------------------------------------------- testimonials */
.testimonials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.testimonial { margin: 0; padding: 32px 30px 28px; border: 1px solid var(--paper-line); background: #fbfaf6; display: flex; flex-direction: column; }
.testimonial blockquote { margin: 0 0 26px; font: 500 1.320rem/1.380 var(--serif); flex: 1; }
.testimonial blockquote::before { content: "\201C"; display: block; font-size: 3.400rem; line-height: .700; margin-bottom: 10px; color: var(--paper-muted); }
.testimonial figcaption { border-top: 1px solid var(--paper-line); padding-top: 16px; font-size: .860rem; display: flex; align-items: center; gap: 14px; }
.t-avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; }
.testimonial figcaption .t-avatar-mono { display: flex; align-items: center; justify-content: center; background: var(--paper-ink); color: var(--accent); font: 600 1.050rem/1 var(--sans); letter-spacing: .040em; }
.section:not(.light) .testimonial figcaption .t-avatar-mono { background: var(--accent); color: #000; }
.testimonial figcaption strong { display: block; font-weight: 600; }
.testimonial figcaption span { color: var(--paper-muted); }
.testimonial .t-date { display: block; margin-top: 2px; font-size: .780rem; color: var(--paper-muted); }
.section:not(.light) .testimonial { background: var(--panel); border-color: var(--line); }
.section:not(.light) .testimonial figcaption { border-color: var(--line); }
.section:not(.light) .testimonial figcaption span, .section:not(.light) .testimonial .t-date { color: var(--muted); }

/* -------------------------------------------------------------- community */
.community { position: relative; overflow: hidden; }
.community-bg { position: absolute; inset: 0; }
.community-bg img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.550); }
.community-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 0%, rgba(4,4,5,.350) 30%, rgba(4,4,5,.550) 70%, var(--bg) 100%); }
.community .wrap { position: relative; z-index: 2; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); margin: 48px 0; }
.stats div { padding: 30px 24px 30px 0; }
.stats b { display: block; font: 500 clamp(2.600rem, 5vw, 4.200rem)/1 var(--serif); margin-bottom: 10px; color: var(--accent); }
.stats span { font: 400 .700rem/1.400 var(--mono); letter-spacing: .160em; text-transform: uppercase; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px; }
.feature .icon { width: 30px; height: 30px; margin-bottom: 18px; color: var(--accent); }
.light .feature .icon { color: var(--accent-ink); }
.feature h3 { font-size: 1.500rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: .950rem; margin: 0; }
.light .feature p { color: var(--paper-muted); }

/* ------------------------------------------------------------------- blog */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 26px; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 56px; font-size: .900rem; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 14px; border: 1px solid var(--paper-line); color: var(--paper-ink); text-decoration: none; }
.pager a:hover { border-color: var(--paper-ink); }
.pager-step { padding: 0; }
.pager-step .icon { width: 18px; height: 18px; stroke-width: 1.600; }
.pager-prev .icon { transform: scaleX(-1); }
.pager .is-current { background: var(--paper-ink); border-color: var(--paper-ink); color: #fff; }
.post-card { text-decoration: none; display: block; }
.post-card-img { aspect-ratio: 16 / 10; overflow: hidden; background: #000; margin-bottom: 18px; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .600s; }
.post-card:hover .post-card-img img { transform: scale(1.050); }
.post-card h3 { margin: 10px 0 8px; font-size: 1.550rem; }
.post-card p { font-size: .920rem; color: var(--paper-muted); margin: 0; }
.section:not(.light) .post-card p { color: var(--muted); }
.post-card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* -------------------------------------------------------------------- faq */
.faq { border-top: 1px solid var(--line-strong); }
.light .faq { border-color: var(--paper-ink); }
.faq details { border-bottom: 1px solid var(--line); }
.light .faq details { border-color: var(--paper-line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 44px 22px 0; font: 500 1.400rem/1.250 var(--serif); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 400 1.500rem/1 var(--mono); transition: transform .200s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-a { padding: 0 44px 24px 0; color: var(--muted); max-width: 52em; }
.light .faq-a { color: var(--paper-muted); }

/* ------------------------------------------------------------- newsletter */
.newsletter { border: 1px solid var(--line); padding: clamp(32px, 5vw, 60px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; background: var(--panel); }
.newsletter h2 { font-size: clamp(1.800rem, 3vw, 2.600rem); margin-bottom: 10px; }
.newsletter p { color: var(--muted); margin: 0; }
.newsletter-form { display: flex; gap: 0; }
.newsletter-form input[type=email] { flex: 1; min-width: 0; background: transparent; border: 1px solid var(--line-strong); border-right: 0; color: var(--ink); padding: 0 18px; font: inherit; font-size: .950rem; height: 52px; border-radius: 0; }
.newsletter-form input[type=email]:focus { outline: none; border-color: var(--ink); }
.newsletter-form .btn { height: 52px; }
.cta-final { text-align: center; position: relative; overflow: hidden; }
.cta-final h2 { max-width: 15em; margin: 0 auto 26px; }
.cta-final .hero-actions { justify-content: center; margin-bottom: 0; }

/* ----------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); padding: 72px 0 0; background: #000; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: 40px; }
.logo-footer { height: 62px; margin-bottom: 22px; }
.footer-brand p { color: var(--muted); font-size: .880rem; max-width: 26em; }
.footer-contact { display: grid; grid-template-columns: 74px 1fr; gap: 8px 12px; margin: 22px 0 0; font-size: .880rem; color: var(--muted); max-width: 26em; }
.footer-contact dt { font: 500 .660rem/2.100 var(--mono); letter-spacing: .180em; text-transform: uppercase; color: var(--dim); }
.footer-contact dd { margin: 0; line-height: 1.550; color: var(--muted); }
.footer-contact a { color: var(--muted); text-decoration: none; }
.footer-contact a:hover { color: var(--ink); }
.footer-contact a:hover { text-decoration: underline; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col .eyebrow { margin-bottom: 8px; }
.footer-col a { font-size: .820rem; color: var(--muted); text-decoration: none; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { margin-top: 60px; padding-top: 22px; padding-bottom: 26px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: space-between; font-size: .780rem; color: var(--dim); }
.footer-bottom a { color: var(--muted); text-decoration: none; margin-left: 18px; }
.footer-social a { display: inline-flex; align-items: center; gap: 7px; margin-left: 22px; }
.footer-social a:first-child { margin-left: 0; }
.social-icon { width: 17px; height: 17px; flex: none; }
.footer-bottom span:first-child a, .footer-bottom span:last-child a { margin-left: 0; }
.footer-bottom a:hover { color: var(--ink); }

/* -------------------------------------------------------------- page hero */
.page-hero { padding: clamp(64px, 9vw, 120px) 0 clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
/* The band's photograph: one of the three steps mc_page_hero() sets, by viewport, so a phone downloads the 800 px file only. */
.page-hero.has-img { --hero-img: var(--hero-img-sm); }
@media (min-width: 700px) { .page-hero.has-img { --hero-img: var(--hero-img-md); } }
@media (min-width: 1201px) { .page-hero.has-img { --hero-img: var(--hero-img-lg); } }
.page-hero.has-img::before { content: ""; position: absolute; inset: 0; background: var(--hero-img) center/cover; filter: brightness(.550); }
.page-hero.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,4,5,.920) 0%, rgba(4,4,5,.400) 100%); }
.page-hero .wrap { position: relative; z-index: 2; }
.page-hero h1 { font-size: clamp(2.500rem, 5.400vw, 4.400rem); margin: 18px 0 20px; max-width: 14em; }
.page-hero .lead { margin: 0; }

/* ------------------------------------------------------------------ prose */
.prose { font-size: 1.060rem; line-height: 1.720; }
.prose h2 { font-size: 2.100rem; margin: 2em 0 .600em; }
.prose h3 { font-size: 1.500rem; margin: 1.700em 0 .500em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.150em; }
.prose ul, .prose ol { padding-left: 1.300em; }
.prose li { margin-bottom: .400em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose .citation { padding-left: 1.600em; text-indent: -1.600em; font-size: 1rem; line-height: 1.650; }
.prose .citation a { text-decoration: none; color: inherit; }
.prose .citation a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose .citation .cite-doi { color: var(--accent-ink); word-break: break-all; }
.prose .citation .cite-note { display: block; text-indent: 0; margin-top: 6px; font-size: .900rem; color: var(--paper-muted); }
.prose blockquote { margin: 1.500em 0; padding: .200em 0 .200em 1.300em; border-left: 2px solid currentColor; font: 500 1.350rem/1.450 var(--serif); }
.legal-updated { font: 500 .720rem/1.400 var(--mono); letter-spacing: .140em; text-transform: uppercase; color: var(--paper-muted); margin-top: 0; }
.legal-box { border: 1px solid var(--paper-line); background: #fbfaf6; padding: 6px 28px 10px; margin: 1.600em 0; }
.legal-box h3 { margin-top: 1.200em; }
@media (max-width: 600px) {
  .legal-box { padding: 4px 18px 8px; }
  .stack-table thead { display: none; }
  .stack-table tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--paper-line); }
  .prose .stack-table td { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 3px 0; border: 0; }
  .stack-table td::before { content: attr(data-label); font: 500 .640rem/1.900 var(--mono); letter-spacing: .120em; text-transform: uppercase; color: var(--paper-muted); }
}
.prose table { width: 100%; border-collapse: collapse; margin: 1.500em 0; font-size: .940rem; }
.prose th { text-align: left; font: 500 .680rem/1.300 var(--mono); letter-spacing: .140em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding: 8px 12px 8px 0; }
.prose td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
.prose mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.post-cover { aspect-ratio: 21 / 9; overflow: hidden; margin-bottom: 0; background: #000; position: relative; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover .credit { position: absolute; right: 14px; bottom: 10px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 34px; padding-bottom: 20px; border-bottom: 1px solid var(--paper-line); }

.resource-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 44px; }
.resource { display: block; padding: 20px 14px; margin: 0 -14px; border-bottom: 1px solid var(--paper-line); color: inherit; text-decoration: none; transition: background .15s; }
.resource:hover { background: rgba(0, 0, 0, .035); }
.resource-name { display: block; font: 500 1.350rem/1.200 var(--serif); color: var(--paper-ink); }
.resource:hover .resource-name { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.resource p { margin: 6px 0 10px; font-size: .920rem; color: var(--paper-muted); }
.resource-host { display: inline-flex; align-items: center; gap: 6px; font: 500 .800rem/1 var(--sans); letter-spacing: .020em; color: var(--accent-ink); }
.resource-host .icon { width: 14px; height: 14px; stroke-width: 1.800; }
.resource-note { display: flex; align-items: center; gap: 8px; margin: 0 0 34px; font-size: .920rem; color: var(--paper-muted); }
.resource-note .icon { width: 16px; height: 16px; color: var(--accent-ink); }
.eq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.eq-card { border: 1px solid var(--paper-line); background: #fbfaf6; padding: 22px 24px 12px; overflow: hidden; }
.eq-card h4, .eq-card h3 { font: 600 .950rem/1.300 var(--sans); margin-bottom: 4px; letter-spacing: 0; }
.eq-card p { font-size: .900rem; color: var(--paper-muted); }
.eq-card mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; margin: .600em 0 !important; }

/* ------------------------------------------------------------------ forms */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font: 500 .680rem/1 var(--mono); letter-spacing: .180em; text-transform: uppercase; margin-bottom: 9px; color: var(--paper-muted); }
.field input, .field select, .field textarea { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--paper-line); background: #fff; color: var(--paper-ink); font: inherit; font-size: .980rem; border-radius: 0; }
.field textarea { height: auto; min-height: 150px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--paper-ink); }
.field input[disabled] { background: var(--paper-2); color: var(--paper-muted); }
.field .hint { font-size: .800rem; color: var(--paper-muted); margin-top: 7px; }
.checkline { display: grid; grid-template-columns: 22px 1fr; gap: 12px; font-size: .900rem; line-height: 1.500; align-items: start; }
.checkline input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #000; }
.notice { border-left: 3px solid var(--paper-ink); background: var(--paper-2); padding: 16px 20px; font-size: .940rem; }
.notice.warn { border-color: var(--bad); }
/* Something to pay attention to (not an error): orange, as the important box in the emails. */
.notice.important { background: #fdf0e6; border: 1px solid #f0b48f; border-left: 4px solid #d9541e; color: #5a2410; }
.notice.important strong { color: #8a3311; }
.notice strong { font-weight: 600; }
.auth-card { max-width: 480px; margin: 0 auto; background: var(--paper); color: var(--paper-ink); padding: clamp(28px, 5vw, 48px); }
.auth-card h1 { font-size: 2.500rem; margin: 12px 0 14px; }
.auth-card p { color: var(--paper-muted); font-size: .960rem; }
.country-picker { position: relative; }
.country-picker .cp-flag { position: absolute; left: 14px; top: 50%; width: 22px; height: 16.5px; transform: translateY(-50%); display: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); pointer-events: none; }
.country-picker.has-flag .cp-flag { display: block; }
.country-picker.has-flag input { padding-left: 48px; }
.cp-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; margin: 0; padding: 6px 0; list-style: none; background: #fff; color: var(--paper-ink); border: 1px solid var(--paper-line); box-shadow: 0 14px 34px rgba(0, 0, 0, .16); }
.cp-list li { display: flex; align-items: center; gap: 12px; padding: 8px 14px; font-size: .940rem; cursor: pointer; }
.cp-list li img { width: 22px; height: 16.5px; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.cp-list li.is-active, .cp-list li[role=option]:hover { background: var(--paper-2); }
.cp-list .cp-none { color: var(--paper-muted); cursor: default; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px 8px; font: 500 .780rem/1 var(--sans); color: var(--accent-ink); cursor: pointer; }
.auth-switch { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--paper-line); font-size: .920rem; }
.auth-card .field .hint a { color: var(--accent-ink); }

/* ---------------------------------------------------------------- account */
.account-head { padding: 54px 0 0; }
.account-head h1 { font-size: clamp(2.200rem, 4.400vw, 3.400rem); margin: 12px 0 6px; }
.account-head p { color: var(--muted); margin: 0; }
/* The base line is an inset shadow, so the active tab's border can sit on it without overflowing (no stray scrollbar); the tabs still scroll sideways on phones. */
.tabs { display: flex; gap: 30px; margin-top: 34px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 0 0 14px; font: 500 .740rem/1 var(--mono); letter-spacing: .180em; text-transform: uppercase; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.is-active, .tabs a:hover { color: var(--ink); border-color: var(--accent); }
.account-body { padding: 44px 0 110px; }
.account-body .wrap > .notice { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.account-body .wrap > .notice a { color: var(--accent); }
.account-body .wrap > .notice-bad { border-left-color: #d9534f; }
.icon-link { display: inline-flex; align-items: center; gap: 7px; }
.icon-link .icon { width: 16px; height: 16px; flex: none; }
.save-ok { color: #3fae6a; }
.save-bad { color: #e0605a; }
.dialog-back { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .66); }
.dialog { width: 100%; max-width: 460px; background: var(--paper); color: var(--paper-ink); padding: 34px 34px 30px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); border-top: 3px solid var(--accent); }
.dialog h2 { margin: 0 0 12px; font: 500 1.700rem/1.200 var(--serif); }
.dialog p { margin: 0 0 26px; color: var(--paper-muted); font-size: .960rem; line-height: 1.600; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.account-body .wrap > .notice .link-button { color: var(--accent); }
.progress-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); margin-bottom: 34px; }
.progress-strip div { padding: 20px 22px; border-right: 1px solid var(--line); }
.progress-strip div:last-child { border-right: 0; }
.progress-strip b { display: block; font: 500 1.900rem/1.100 var(--serif); margin-bottom: 6px; }
.progress-strip span { font: 400 .660rem/1.300 var(--mono); letter-spacing: .150em; text-transform: uppercase; color: var(--muted); }
.bar { height: 3px; background: var(--line); margin: 0 0 40px; }
.bar i { display: block; height: 100%; background: var(--accent); }

.ucards { display: grid; gap: 14px; }
.ucard { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 26px; align-items: center; border: 1px solid var(--line); background: var(--panel); padding: 22px 26px; }
.ucard.is-open { border-color: var(--accent); background: #121214; }
.ucard.is-locked { background: transparent; }
.ucard.is-locked h3, .ucard.is-locked .ucard-no { color: var(--dim); }
.ucard-no { font: 500 2.300rem/1 var(--serif); color: var(--ink); }
.ucard-no small { display: block; font: 500 .600rem/1 var(--mono); letter-spacing: .200em; color: var(--dim); margin-bottom: 8px; }
/* The label starts at the same left edge as UNIT on the other cards and the icon sits centred under it;
   the icon's negative side margins keep it from widening the group. The negative margin offsets the letter-spacing after the last letter. */
.ucard-no-icon { display: inline-flex; flex-direction: column; align-items: center; justify-self: start; width: max-content; }
.ucard-no-icon small { margin-right: -.200em; }
.ucard-no-icon .icon { width: 3.450rem; height: 3.450rem; margin: 0 -.500rem; }   /* full size; its empty margin may reach past the label on both sides */
.ucard h3 { font-size: 1.500rem; margin-bottom: 6px; }
.ucard-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .840rem; color: var(--muted); align-items: center; }
.ucard-meta .icon { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; display: inline-block; }
.ucard-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 430px; }
.ucard-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ucard-actions:has(.ucard-score) { flex-direction: column; align-items: flex-end; gap: 10px; }
/* The quiz points share the top line with the title; buttons and further reading follow below. */
.ucard:has(.ucard-score) { align-items: start; }
.ucard-score { min-height: 1.900rem; display: flex; align-items: baseline; gap: 4px; font-family: var(--sans); white-space: nowrap; }
.ucard-score b { font-weight: 600; font-size: 1.450rem; line-height: 1; color: var(--ink); }
.ucard-score span { font-size: .950rem; color: var(--muted); }
.ucard-score:not(.is-done) b { color: var(--dim); }
.ucard-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: .840rem; color: var(--muted); text-decoration: none; }
.ucard-more:hover { color: var(--accent); }
.ucard-more .icon { width: 14px; height: 14px; }
.pill { display: inline-block; font: 500 .620rem/1 var(--mono); letter-spacing: .160em; text-transform: uppercase; padding: 6px 9px; border: 1px solid var(--line-strong); color: var(--ink); }
.pill.ok { border-color: var(--ok); color: #7fd3a1; }
.pill.wait { color: var(--muted); }
.pill.bad { border-color: #c0392b; color: #ff8a80; }
.exam-result.is-failed { border-color: #c0392b; }
.exam-result.is-passed { border-color: var(--ok); }
.exam-score { font: 600 3.600rem/1 var(--sans); color: var(--ink); letter-spacing: -.020em; }
.exam-score small { font-size: 1.500rem; font-weight: 500; color: var(--muted); }
.exam-score span { margin-left: 16px; font: 500 1.200rem/1 var(--sans); color: var(--muted); }
.verdict { display: inline-block; font: 600 .900rem/1 var(--mono); letter-spacing: .160em; text-transform: uppercase; padding: 12px 18px; }
.verdict.bad { background: #c0392b; color: #fff; }
.verdict.ok { background: #2e8a50; color: #fff; }
.score { font: 500 1.250rem/1 var(--serif); color: var(--ink); }
.panel { border: 1px solid var(--line); background: var(--panel); padding: 28px 30px; margin-bottom: 22px; }
.panel h2 { font-size: 1.900rem; margin-bottom: 10px; }
.panel h3 { margin-bottom: 8px; }
.panel p { color: var(--muted); }
.panel.is-key { border-color: var(--ink); }
.panel-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.paper-card { background: var(--paper); color: var(--paper-ink); padding: clamp(26px, 4vw, 44px); }
.paper-card h2 { font-size: 2.100rem; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 20px; font-size: .940rem; margin: 0; }
.kv dt { font: 500 .680rem/1.900 var(--mono); letter-spacing: .160em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; }
.rating-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rating-opt { position: relative; margin: 0 !important; cursor: pointer; }
.rating-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-opt span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 4px 11px; border: 1px solid var(--paper-line); background: #fff; color: var(--paper-ink); text-transform: none; letter-spacing: 0; }
.rating-opt b { font: 600 1.600rem/1 var(--serif); font-variant-numeric: lining-nums; }
.rating-opt small { font: 400 .740rem/1.2 var(--sans, inherit); color: var(--paper-muted); text-align: center; }
.rating-opt:hover span { border-color: var(--paper-ink); }
.rating-opt input:checked + span { background: var(--paper-ink); border-color: var(--paper-ink); color: var(--paper); }
.rating-opt input:checked + span small { color: #cfcec7; }
.rating-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.upgrade-offer { display: grid; gap: 10px; margin-top: 18px; }
.upgrade-opt { display: grid; grid-template-columns: 26px 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--paper-line); background: #fff; cursor: pointer; }
.upgrade-opt input { width: 18px; height: 18px; accent-color: #000; margin: 0; }
.upgrade-opt:has(input:checked) { border-color: var(--paper-ink); box-shadow: inset 0 0 0 1px var(--paper-ink); }
.upgrade-opt b { display: block; font: 600 1.300rem/1.2 var(--serif); }
.upgrade-opt small { color: var(--paper-muted); font-size: .860rem; }
.upgrade-price { text-align: right; white-space: nowrap; }
.upgrade-badge { display: inline-block; margin-left: 6px; padding: 3px 7px; background: #d9541e; color: #fff; font: 600 .680rem/1 var(--mono); letter-spacing: .080em; text-transform: uppercase; vertical-align: 4px; }
.upgrade-price strong { display: block; font: 600 1.500rem/1 var(--serif); }
.upgrade-price s { color: var(--paper-muted); font-size: .840rem; }
.suggest-picker .sg-own { font-style: italic; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tags:empty { display: none; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 11px; background: var(--paper-ink); color: var(--paper); font-size: .860rem; }
.tag-chip button { border: 0; background: none; color: inherit; font-size: 1.050rem; line-height: 1; cursor: pointer; padding: 0 3px; opacity: .75; }
.tag-chip button:hover { opacity: 1; }
.coupon-box { margin: -6px 0 24px; font-size: .900rem; }
.coupon-box summary { cursor: pointer; color: var(--paper-muted); text-decoration: underline; text-underline-offset: 3px; width: max-content; list-style: none; }
.coupon-box summary::-webkit-details-marker { display: none; }
.coupon-box[open] summary { margin-bottom: 12px; }
.coupon-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.coupon-form input { width: 240px; max-width: 100%; padding: .600em .800em; border: 1px solid #b9b8b1; background: #fff; color: var(--paper-ink); font: 500 .900rem/1.2 var(--mono); letter-spacing: .060em; text-transform: uppercase; }
.coupon-form input::placeholder { text-transform: none; letter-spacing: .040em; color: #a3a29b; }
.coupon-error { margin-top: 10px; color: #a1281c; font-size: .860rem; }
.coupon-applied { color: #1d6b3a; }
.coupon-code { font: 500 .800rem/1 var(--mono); letter-spacing: .080em; color: var(--paper-muted); margin-right: 8px; }
.kv .flag { display: inline-block; vertical-align: -1px; margin-left: 6px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.contact-faq { border: 1px solid var(--paper-line); background: #fbfaf6; padding: 34px 34px 36px; }
.contact-faq h3 { margin: 14px 0 12px; font: 500 1.700rem/1.200 var(--serif); }
.contact-faq p { margin: 0 0 24px; color: var(--paper-muted); }
.doc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.doc-card { border: 1px solid var(--line); background: var(--panel); padding: 26px; }
.doc-card img { border: 1px solid var(--line); margin-bottom: 20px; width: 100%; }
.doc-card h3 { margin-bottom: 6px; }
.doc-card p { color: var(--muted); font-size: .920rem; }
.copyline { display: flex; gap: 0; margin-top: 12px; }
.copyline input { flex: 1; min-width: 0; background: #000; border: 1px solid var(--line-strong); border-right: 0; color: var(--ink); font: 400 .820rem/1 var(--mono); padding: 0 14px; height: 44px; }

/* ------------------------------------------------------------------- quiz */
.quiz-wrap { max-width: 820px; margin: 0 auto; padding: 50px 28px 120px; }
.quiz-head { margin-bottom: 36px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.quiz-head h1 { font-size: clamp(2.100rem, 4vw, 3rem); margin: 12px 0 12px; }
.quiz-head p { color: var(--muted); margin: 0; }
.q { border: 1px solid var(--line); background: var(--panel); padding: 26px 28px 24px; margin-bottom: 16px; }
.q-no { font: 500 .660rem/1 var(--mono); letter-spacing: .200em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; display: flex; justify-content: space-between; gap: 12px; }
.q-text { font: 500 1.350rem/1.350 var(--serif); margin-bottom: 18px; }
.opts { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); cursor: pointer; transition: border-color .150s, background .150s; font-size: .980rem; }
.opt:hover { border-color: var(--line-strong); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .k { width: 30px; height: 30px; border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font: 500 .720rem/1 var(--mono); }
.opt:has(input:checked) { border-color: var(--ink); background: #18181b; }
.opt:has(input:checked) .k { background: var(--ink); color: #000; border-color: var(--ink); }
.opt:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt.is-right { border-color: var(--ok); background: rgba(47, 138, 85, .130); }
.opt.is-right .k { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.is-wrong { border-color: var(--bad); background: rgba(179, 57, 47, .130); }
.opt.is-wrong .k { background: var(--bad); border-color: var(--bad); color: #fff; }
.result .opt { cursor: default; }
.q.is-correct { border-left: 3px solid var(--ok); }
.q.is-incorrect { border-left: 3px solid var(--bad); }
.explain { margin-top: 16px; padding: 14px 16px; background: #000; border-left: 2px solid var(--ink); font-size: .920rem; color: #d5d4cd; }
.explain b { font: 500 .640rem/1 var(--mono); letter-spacing: .180em; text-transform: uppercase; display: block; margin-bottom: 7px; color: var(--muted); }
.quiz-foot { position: sticky; bottom: 0; background: rgba(4, 4, 5, .940); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 16px 0; margin-top: 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quiz-foot .state { font: 400 .720rem/1.400 var(--mono); letter-spacing: .100em; color: var(--muted); text-transform: uppercase; }
.scorebox { border: 1px solid var(--ink); padding: 30px; margin-bottom: 30px; display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
.scorebox .big { font: 500 4.200rem/1 var(--serif); }
.scorebox .big small { font-size: 1.700rem; color: var(--muted); }
.timer { position: sticky; top: var(--header-h); z-index: 50; background: #000; border: 1px solid var(--ink); padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; font: 500 .720rem/1 var(--mono); letter-spacing: .160em; text-transform: uppercase; }
.timer b { font: 500 1.650rem/1 var(--mono); letter-spacing: .040em; }
.timer.is-low { border-color: var(--bad); color: #ff9c92; }
.breakdown { width: 100%; border-collapse: collapse; font-size: .920rem; }
.breakdown td, .breakdown th { padding: 9px 0; border-bottom: 1px solid var(--line); text-align: left; }
.breakdown th { font: 500 .660rem/1 var(--mono); letter-spacing: .160em; text-transform: uppercase; color: var(--muted); }
.breakdown td:last-child, .breakdown th:last-child { text-align: right; }

/* ------------------------------------------------------------ unit reader */
.reader-hero { position: relative; background: #000; overflow: hidden; }
.reader-hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.580); }
.reader-hero .wrap { position: relative; z-index: 2; padding-top: 70px; padding-bottom: 56px; max-width: 980px; }
.reader-hero h1 { font-size: clamp(2.300rem, 5vw, 4rem); margin: 16px 0 14px; }
.reader-hero .sub { font: 500 italic 1.400rem/1.350 var(--serif); color: #dddcd5; margin-bottom: 26px; }
.reader-hero .credit { position: absolute; right: 14px; bottom: 8px; z-index: 2; }
.reader-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.reader { background: var(--paper); color: var(--paper-ink); }
.reader-grid { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: 60px; max-width: 1140px; margin: 0 auto; padding: 56px 28px 100px; }
.toc { position: sticky; top: calc(var(--header-h) + 26px); align-self: start; font-size: .860rem; max-height: calc(100vh - var(--header-h) - 60px); overflow-y: auto; }
.toc .eyebrow { margin-bottom: 14px; }
.toc a { display: block; padding: 6px 0 6px 14px; border-left: 1px solid var(--paper-line); color: var(--paper-muted); text-decoration: none; line-height: 1.350; }
.toc a.l2 { padding-left: 28px; font-size: .800rem; }
.toc a:hover, .toc a.is-active { color: var(--paper-ink); border-color: var(--paper-ink); }
.unit-text { font-size: 1.080rem; line-height: 1.740; min-width: 0; }
.unit-text h2 { font-size: 2.200rem; margin: 2.200em 0 .700em; padding-bottom: .350em; border-bottom: 1px solid var(--paper-ink); }
.unit-text h2:first-child { margin-top: 0; }
.unit-text h3 { font-size: 1.550rem; margin: 1.800em 0 .500em; }
.unit-text h4 { font: 600 1.050rem/1.300 var(--sans); font-style: italic; margin: 1.500em 0 .300em; letter-spacing: 0; }
.unit-text .secno { font: 500 .600em/1 var(--mono); color: var(--paper-muted); margin-right: .700em; vertical-align: .200em; letter-spacing: .050em; }
.unit-text p { margin: 0 0 1.050em; }
.unit-text ul, .unit-text ol { padding-left: 1.400em; margin: 0 0 1.100em; }
.unit-text li { margin-bottom: .350em; }
.unit-text li > p { margin-bottom: .400em; }
.unit-text a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.unit-text code { font: 400 .880em var(--mono); background: var(--paper-2); padding: .100em .350em; }
.unit-text .math-display { display: block; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.unit-text .fn { color: var(--paper-muted); font-size: .920em; }
.unit-text .sc { font-variant: small-caps; }
.unit-text .center { text-align: center; }
.unit-text figure { margin: 2em 0; text-align: center; }
.unit-text figure picture { display: contents; }   /* a photograph with its WebP source: the <img> inside keeps the layout */
.unit-text figure img { margin: 0 auto; max-width: 100%; height: auto; }
.unit-text figcaption { font-size: .860rem; line-height: 1.500; color: var(--paper-muted); margin-top: 12px; text-align: left; max-width: 620px; margin-left: auto; margin-right: auto; }
.unit-text figcaption b { color: var(--paper-ink); font-weight: 600; }
.unit-text .table-wrap { overflow-x: auto; }
.unit-text .table-wrap figcaption { margin-top: 10px; margin-bottom: 0; text-align: center; }
.unit-text table { border-collapse: collapse; margin: 0 auto; font-size: .920rem; border: 1px solid var(--paper-ink); }
.unit-text th { border-bottom: 1px solid var(--paper-ink); font-weight: 600; }
.unit-text th, .unit-text td { padding: 7px 14px; }
.box { margin: 1.900em 0; border: 1px solid var(--paper-ink); background: #fbfaf6; }
.box-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 11px 20px; }
.box-kind { font: 500 .640rem/1.200 var(--mono); letter-spacing: .220em; text-transform: uppercase; }
.box-title { font: 600 .980rem/1.300 var(--sans); }
.box-body { padding: 4px 20px 6px; }
.box-body > :last-child { margin-bottom: .900em; }
.box { --bx: var(--paper-ink); --bx-l: #fbfaf6; }
/* Box colours, the same as in the unit PDFs (content/tex/aamunit.cls): a strong tone for bars and rules, a light tint as ground. */
.box-keyequation { --bx: #d9731a; --bx-l: #fdf0e2; border-color: var(--bx); background: var(--bx-l); }
.box-keyequation .box-head { background: var(--bx); color: #fff; }
.box-keyequation .box-body { padding-top: 12px; }
.box-law, .box-laws { --bx: #2e6496; --bx-l: #eaf1f8; border-color: var(--bx); background: var(--bx-l); }
.box-law .box-head, .box-laws .box-head { background: var(--bx); color: #fff; }
.box-law .box-body, .box-laws .box-body { padding-top: 12px; }
.box-derivation { --bx: #2e6496; --bx-l: #eaf1f8; border-color: var(--bx); background: #fff; }
.box-derivation .box-head { background: var(--bx-l); color: var(--bx); border-bottom: 1px solid var(--bx); }
.box-derivation .box-body { font-size: .960em; padding-top: 14px; }
.box-example { --bx: #2e7d4f; --bx-l: #eaf5ee; border: 0; border-top: 3px solid var(--bx); background: var(--bx-l); }
.box-example .box-head { padding-bottom: 2px; color: var(--bx); }
.box-excursion { --bx: #6b4c9a; --bx-l: #f3eef9; border: 0; border-left: 4px solid var(--bx); background: var(--bx-l); }
.box-excursion .box-head { padding-bottom: 2px; color: var(--bx); }
.box-excursion .box-title { font-style: italic; }
.box-research { --bx: #146c6a; --bx-l: #e7f3f2; border: 1.500px solid var(--bx); background: var(--bx-l); }
.box-research .box-head { background: var(--bx); color: #fff; display: grid; gap: 5px; padding: 16px 20px; }
.box-research .box-kind { letter-spacing: .260em; color: #cfe6e4; }
.box-research .box-name { font: 600 1.450rem/1.150 var(--serif); }
.box-research .box-inst { font: 500 italic 1.050rem/1.200 var(--serif); color: #cfe6e4; }
.box-research .box-body { padding-top: 16px; }
.box-lead { font-weight: 600; }
.paperlink { font-size: .900rem; padding-top: .800em; border-top: 1px solid var(--paper-line); }
.paperlink span { font: 500 .640rem/1 var(--mono); letter-spacing: .180em; text-transform: uppercase; display: block; margin-bottom: 5px; color: var(--paper-muted); }
.box-keypoints { --bx: #b8862e; --bx-l: #faf3e4; border: 0; border-top: 3px solid var(--bx); border-bottom: 1px solid var(--bx); background: var(--bx-l); }
.box-keypoints .box-kind { color: #9a6d1f; font-weight: 600; }
.box-keypoints .box-head { padding-bottom: 0; padding-top: 16px; }
.reader-end { margin-top: 3em; padding: 30px; background: var(--paper-ink); color: var(--paper); display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.reader-end h3, .reader-end h2 { font-size: 1.700rem; }
.preview-fade { position: relative; max-height: 760px; overflow: hidden; }
.preview-fade::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 260px; background: linear-gradient(180deg, rgba(244,243,238,0) 0%, var(--paper) 88%); }
.lit-list { list-style: none; padding: 0; margin: 0; }
.unit-text .lit-list { padding-left: 0; margin-left: 0; }
.reader-single { padding: 56px 0 90px; }
.lit-list li { padding: 20px 0; border-bottom: 1px solid var(--paper-line); }
.lit-list a.t { font: 500 1.400rem/1.200 var(--serif); text-decoration: none; }
.lit-list a.t:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.lit-list .m { font-size: .840rem; color: var(--paper-muted); margin: 4px 0 8px; }
.lit-list p { margin: 0; font-size: .960rem; }

/* ----------------------------------------------------------------- verify */
.verify-form { display: flex; max-width: 560px; }
.verify-form input { flex: 1; min-width: 0; height: 58px; background: #000; border: 1px solid var(--line-strong); border-right: 0; color: var(--ink); padding: 0 18px; font: 500 1.050rem/1 var(--mono); letter-spacing: .120em; text-transform: uppercase; border-radius: 0; }
.verify-form input:focus { outline: none; border-color: var(--ink); }
.verify-form .btn { height: 58px; }
.credential { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: clamp(28px, 5vw, 56px); }
.credential .eyebrow { color: var(--accent); }
.credential h1 { font-size: clamp(2.300rem, 5vw, 3.800rem); margin: 10px 0 8px; }
.credential .valid { display: inline-flex; align-items: center; gap: 8px; font: 500 .700rem/1 var(--mono); letter-spacing: .180em; text-transform: uppercase; color: #7fd3a1; border: 1px solid var(--ok); padding: 8px 12px; margin-bottom: 22px; }
.credential .valid .icon { width: 16px; height: 16px; }
.credential .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 30px 0; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.credential .facts b { display: block; font: 600 1.350rem/1.200 var(--sans); margin-top: 8px; color: var(--ink); }
.credential table { width: 100%; border-collapse: collapse; font-size: .940rem; }
.credential th { text-align: left; font: 500 .660rem/1 var(--mono); letter-spacing: .180em; text-transform: uppercase; color: var(--muted); padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.credential td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.credential td:first-child { font: 400 .780rem/1 var(--mono); color: var(--muted); width: 54px; }
.credential td:last-child, .credential th:last-child { text-align: right; }

/* ----------------------------------------------------------------- cookie */
.cookie { position: fixed; left: 20px; bottom: 20px; z-index: 150; max-width: 430px; background: #0a0a0b; border: 1px solid var(--line-strong); padding: 20px 22px; font-size: .860rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .600); }
.cookie p { color: var(--muted); margin: 0 0 14px; }
.cookie-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ----------------------------------------------------------------- reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .700s ease, transform .700s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-media img, .marquee { animation: none; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .nav, .nav-login { display: none; }
  .burger { display: block; }
  .header-cta { margin-left: auto; }
  .researchers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .reader-grid { grid-template-columns: minmax(0, 760px); justify-content: center; }
  .toc { display: none; }
  .packages { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .learn-body p, .learn-body h3 { min-height: 0; }
  .package-note, .package h3 { min-height: 0; }
  .package-units li.out { display: none; }
}
@media (max-width: 860px) {
  :root { --header-h: 66px; }
  .logo { height: 40px; }
  .split, .newsletter, .sample-feature { grid-template-columns: 1fr; }
  .sample-pages { max-width: 440px; }
  .split.flip > :first-child { order: 0; }
  .split-media img { aspect-ratio: 4 / 3; }
  .cards-3, .steps, .samples, .learn, .testimonials, .features, .posts, .stats, .doc-cards, .eq-grid, .resource-list { grid-template-columns: 1fr; }
  .aud { border-right: 0; border-bottom: 1px solid var(--paper-line); }
  .aud:last-child { border-bottom: 0; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats div { padding-bottom: 14px; }
  .week { grid-template-columns: 1fr; }
  .week > div { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 54px 1fr; gap: 0 12px; }
  .week > div .d { grid-row: span 2; margin: 4px 0 0; }
  .week > div:last-child { border-bottom: 0; }
  .unit-row { grid-template-columns: 62px minmax(0, 1fr); gap: 6px 12px; }
  .unit-row .no { white-space: nowrap; }
  .hero .credit { display: none; }
  .unit-row > p, .unit-row > div, .unit-row > .pk { grid-column: 2; }
  .researchers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div { border-bottom: 1px solid var(--line); padding: 22px 0; }
  .stats div:last-child { border-bottom: 0; }
  .ucard { grid-template-columns: 54px minmax(0, 1fr); gap: 14px 18px; padding: 20px; }
  .ucard-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .ucard-buttons { justify-content: flex-start; }
  .ucard-actions:has(.ucard-score) { align-items: flex-start; }
  .progress-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-strip div:nth-child(2) { border-right: 0; }
  .progress-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .form-row { grid-template-columns: 1fr; }
  .credential .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 12px; }
  .cert-shot .tr { display: none; }
  .scorebox .big { font-size: 3.200rem; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  body { font-size: 16px; }
  .newsletter-form { flex-direction: column; gap: 10px; }
  .newsletter-form input[type=email] { border-right: 1px solid var(--line-strong); height: 52px; flex: none; }
  .hero-actions .btn { flex: 1 1 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px 20px; }
  .q { padding: 20px 18px; }
  .quiz-wrap { padding: 34px 18px 100px; }
  .reader-grid { padding: 36px 20px 70px; }
  .unit-text { font-size: 1.020rem; }
  .box-head, .box-body { padding-left: 15px; padding-right: 15px; }
  .cookie { left: 12px; right: 12px; bottom: 12px; }
  .verify-form { flex-direction: column; gap: 10px; }
  .verify-form input { border-right: 1px solid var(--line-strong); flex: none; height: 54px; }
  .researchers { gap: 44px 16px; }
}
@media print {
  .site-header, .site-footer, .toc, .reader-end, .cookie, .mobile-menu { display: none !important; }
}

/* Formulas wider than the screen scroll inside their own box instead of widening the page. */
mjx-container[display="true"] { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
/* Inline formulas stay inline (an own scroll box would lift them off the line); the paragraphs and
   quiz text boxes that hold them scroll sideways instead when a formula is wider than the screen. */
.q .q-text, .q .opt > span:last-child, .q .explain,
.unit-text p, .unit-text td, .prose p { overflow-x: auto; overflow-y: hidden; min-width: 0; }
/* List items keep their markers, which an overflow rule would clip: wide maths scrolls on its own. */
.unit-text li mjx-container, .prose li mjx-container { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; }

/* The copyright line keeps its distance from the rule above it, also where .wrap sets its own padding. */
.wrap.footer-bottom { padding-top: 22px; padding-bottom: 26px; }

/* Unit pages and the curriculum overview: links to the unit pages, related articles, previous and next unit. */
.unit-row h4 .unit-link, .unit-row h3 .unit-link { color: inherit; text-decoration: none; }
.unit-row h4 .unit-link:hover, .unit-row h3 .unit-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.unit-more, .sample-pdf { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: .860rem; color: var(--paper-muted); text-decoration: none; }
.sample-pdf { margin-left: 4px; }
.unit-more:hover, .sample-pdf:hover { color: var(--paper-ink); text-decoration: underline; }
.unit-more svg, .sample-pdf svg { width: 14px; height: 14px; }
.unit-related ul { margin: 0; padding-left: 20px; line-height: 1.8; }
.unit-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 3em 0 0; padding-top: 1.500em; border-top: 1px solid var(--paper-line); }
.unit-pager a { text-decoration: none; color: inherit; font-family: var(--serif); font-size: 1.150rem; line-height: 1.3; }
.unit-pager a span { display: block; font: 500 .680rem/1.8 var(--mono); letter-spacing: .160em; text-transform: uppercase; color: var(--paper-muted); }
.unit-pager a.next { text-align: right; }
.unit-pager a:hover { text-decoration: underline; }

/* Blog topics: links to the topic hubs on the index, the hubs and every article. */
.topic-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 1.800em; }
.topic-links .eyebrow { margin-right: 6px; }
.topic-links a { display: inline-block; padding: 6px 12px; border: 1px solid var(--paper-line); border-radius: 999px; font-size: .840rem; color: inherit; text-decoration: none; }
.topic-links a:hover { border-color: currentColor; }
.section:not(.light) .topic-links a { border-color: var(--line); }
.post-meta a { color: inherit; }
h2.h3-look { font-size: 1.900rem; }

/* Text pages (the pathway page, schools): lists and the syllabus table. */
.prose-page ul { padding-left: 20px; line-height: 1.700; }
.prose-page li { margin-bottom: 8px; }
.table-scroll { overflow-x: auto; margin: 0 0 1.500em; }
.pathway-map td, .pathway-map th { padding: 10px 12px 10px 0; vertical-align: top; text-align: left; border-bottom: 1px solid var(--paper-line); font-size: .920rem; }
.pathway-map td a { white-space: nowrap; }

/* Key sheet: jump links to the units. */
.eq-toc { margin: 0 0 40px; padding: 22px 24px; border: 1px solid var(--paper-line); }
.eq-toc ol { list-style: none; margin: 12px 0 0; padding: 0; columns: 2; column-gap: 32px; }
.eq-toc li { break-inside: avoid; margin: 0 0 6px; }
.eq-toc a { color: inherit; text-decoration: none; font-size: .940rem; }
.eq-toc a:hover { text-decoration: underline; }
.eq-toc a span { display: inline-block; width: 2.200em; font: 500 .760rem/1 var(--mono); color: var(--paper-muted); }
.unit-group[id^="eq-unit-"] { scroll-margin-top: 90px; }
@media (max-width: 640px) { .eq-toc ol { columns: 1; } }

/* ---- Financial aid request form (pages/aid.php) ---- */
.aid-h1 { font-size: clamp(2.200rem, 4.600vw, 3.400rem); margin: 16px 0 0; }

.aid-apply { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 9fr); gap: clamp(30px, 5vw, 70px); align-items: start; }
.aid-apply-aside { position: sticky; top: calc(var(--header-h) + 24px); border-top: 2px solid var(--paper-ink); padding-top: 22px; font-size: .920rem; color: var(--paper-muted); }
.aid-apply-aside h3 { color: var(--paper-ink); margin: 12px 0 14px; }
.aid-apply-aside ul { padding-left: 1.100em; margin: 0 0 18px; display: grid; gap: 6px; color: var(--paper-ink); }
.aid-apply-aside a { color: var(--paper-ink); text-decoration: underline; text-underline-offset: 3px; }
.aid-form { gap: 26px; }
.aid-form fieldset { border: 1px solid var(--paper-line); background: #fbfaf6; padding: 26px clamp(18px, 3vw, 32px) 30px; margin: 0; display: grid; gap: 18px; min-width: 0; }
.aid-form fieldset[hidden] { display: none; }
.aid-form legend { font: 500 1.650rem/1.200 var(--serif); padding: 0 10px; margin-left: -10px; display: flex; align-items: center; gap: 12px; }
.aid-form legend span { width: 34px; height: 34px; border-radius: 50%; background: var(--paper-ink); color: var(--paper); font: 600 .950rem/34px var(--sans); text-align: center; }
.aid-form [hidden] { display: none !important; }
.aid-form .field input[type=file] { height: auto; padding: 12px 14px; background: #fff; }
.aid-form .field textarea { min-height: 170px; }
.aid-form [aria-invalid=true] { border-color: var(--bad); }
.aid-err { color: var(--bad); font-size: .840rem; margin-top: 7px; }
.aid-consents { display: grid; gap: 12px; }
.aid-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.aid-submit span { font-size: .880rem; color: var(--paper-muted); }
.aid-submit button[disabled] { opacity: .6; cursor: wait; }
@media (max-width: 860px) {
  .aid-apply { grid-template-columns: 1fr; }
  .aid-apply-aside { position: static; }
}
.aid-form .aid-radios .checkline { display: grid; grid-template-columns: 18px 1fr; gap: 12px; align-items: center; font: 400 .920rem/1.500 var(--sans); letter-spacing: 0; text-transform: none; color: var(--paper-ink); margin: 0; cursor: pointer; }
.aid-form .aid-radios input { width: 18px; height: 18px; margin: 0; padding: 0; border: 0; accent-color: #000; cursor: pointer; }

/* Unit text: a term where it is defined is bold and underlined; a worked example's result is double underlined. */
.unit-text strong.term { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.unit-text .result { border-bottom: 3px double currentColor; padding-bottom: 1px; }

/* ---- Financial aid (pages/aid.php, the package cards, the account) ---- */
.fee-aid { display: inline-block; margin: -8px 0 18px; font-size: .800rem; color: var(--muted); text-decoration: none; letter-spacing: .010em; }
.fee-aid span { color: var(--accent); margin-right: 3px; }
.fee-aid:hover, .fee-aid:focus-visible { color: var(--ink); }
.aid-note { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; margin: 0 0 30px; padding: 24px 28px; border: 1px solid var(--accent); background: rgba(233, 184, 114, .070); }
.aid-note:not(:has(.aid-note-flag)) { grid-template-columns: minmax(0, 1fr) auto; }
.aid-note .flag { display: block; width: 48px; height: 36px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.aid-note h3 { margin: 0 0 6px; font-size: 1.300rem; }
.aid-note p { margin: 0; color: var(--muted); font-size: .930rem; max-width: 46em; }
.aid-note.is-granted { border-color: var(--ok); background: rgba(47, 138, 85, .100); }
.account-body .aid-note { margin: 0 0 26px; }
.aid-flag-inline { width: 22px; height: 16.5px; vertical-align: -2px; margin-right: 8px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.aid-location { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--paper-line); background: #f1efe8; font-weight: 500; }
.aid-location .flag { width: 30px; height: 22.5px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.aid-location em { font-style: normal; font-weight: 400; color: var(--paper-muted); font-size: .860rem; margin-left: auto; }
.aid-wrong { font-size: .840rem; }
.aid-wrong summary { font-size: .740rem; cursor: pointer; color: var(--paper-muted); text-decoration: underline; text-underline-offset: 2px; list-style: none; display: inline; }
.aid-wrong summary::-webkit-details-marker { display: none; }
.aid-wrong[open] summary { margin-bottom: 10px; display: inline-block; }
.aid-wrong textarea { min-height: 90px !important; }
.aid-status { margin-bottom: 26px; }
@media (max-width: 760px) {
  .aid-note, .aid-note:not(:has(.aid-note-flag)) { grid-template-columns: 1fr; gap: 14px; padding: 22px; }

}
.aid-body > p, .aid-body > .aid-note { max-width: 860px; }
.aid-body > .aid-note { margin: 30px 0 0; }
.aid-body h2 { margin: 0 0 22px; }
.aid-body > p { color: var(--muted); font-size: 1.060rem; }
.aid-contact { margin: 26px 0 0; font-size: .880rem; color: var(--dim) !important; }
.aid-contact a { color: inherit; }
.aid-apply-aside .eyebrow + p { margin-top: 14px; }
/* Shown only while a signed ?geo_test= link simulates another country (inc/aid.php). */
.geo-test-badge { position: fixed; right: 14px; bottom: 14px; z-index: 900; display: flex; align-items: center; gap: 6px; padding: 9px 14px; background: #fff3d6; color: #4a3300; border: 1px solid #e3c873; font-size: .800rem; box-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.geo-test-badge .flag { width: 20px; height: 15px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.geo-test-badge a { color: inherit; text-decoration: underline; margin-left: 6px; }
.aid-note.is-plain { grid-template-columns: auto minmax(0, 1fr); }
/* The drawing of a quiz or exam question (a black and grey PNG on a transparent background from
   questions/<name>.tex), inverted to white lines on the dark quiz pages. */
.q-figure { margin: 2px 0 18px; }
.q-figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; filter: invert(1); mix-blend-mode: screen; }


/* Questions in the unit text (checkpoint) */
.box-check { --bx: #8e3b66; --bx-l: #f8eef3; border: 1px solid var(--bx); background: var(--bx-l); }
.box-check .box-head { background: var(--bx); color: #fff; }
.box-check .box-body { padding-top: 14px; }
.box-check .check-q { font-weight: 500; }
.box-check .opt { border-color: rgba(11, 11, 12, .180); background: #fff; color: var(--paper-ink); }
.box-check .opt:hover { border-color: var(--bx); }
.box-check .opt .k { border-color: rgba(11, 11, 12, .280); }
.box-check .opt:has(input:checked) { border-color: var(--bx); background: #fff; }
.box-check .opt:has(input:checked) .k { background: var(--bx); color: #fff; border-color: var(--bx); }
.box-check .opt:has(input:disabled) { cursor: default; }
.box-check.is-done .opt.is-right { border-color: var(--ok); background: #eaf5ee; }
.box-check.is-done .opt.is-right .k { background: var(--ok); border-color: var(--ok); color: #fff; }
.box-check.is-done .opt.is-wrong { border-color: var(--bad); background: #fbecea; }
.box-check.is-done .opt.is-wrong .k { background: var(--bad); border-color: var(--bad); color: #fff; }
.box-check .check-actions { margin: 14px 0 4px; }
.box-check .check-result { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(142, 59, 102, .250); }
.box-check .check-verdict { font-weight: 600; margin-bottom: .400em; }
.box-check.is-ok .check-verdict { color: var(--ok); }
.box-check.is-no .check-verdict { color: var(--bad); }

/* Interactive elements (assets/ia, placed with \interactive{id}) */
.box-interactive { --bx: #1f2a44; --bx-l: #f3f5f9; border: 1px solid var(--bx); background: var(--bx-l); }
.box-interactive .box-head { background: var(--bx); color: #fff; }
.box-interactive .box-body { padding-top: 14px; }
.box-interactive .ia-caption { font-size: .900rem; color: #4a4a46; margin-top: 10px; }
.box-check .btn:disabled { opacity: .450; cursor: default; }
.box-questions .box-kind { text-transform: none; letter-spacing: 0; font: 600 1.000rem/1.400 var(--sans); color: #8a5f12; }
.ia-mount { color: var(--paper-ink); }
.ia-stage { background: #fff; border: 1px solid rgba(11, 11, 12, .120); }
.ia-canvas { display: block; width: 100%; }
.ia-ctrls { display: grid; gap: 10px; margin: 14px 0 6px; }
.ia-slider { display: grid; grid-template-columns: minmax(110px, 190px) 1fr minmax(84px, auto); gap: 12px; align-items: center; font-size: .920rem; }
.ia-slider input[type=range] { width: 100%; accent-color: #1f2a44; }
.ia-val { font: 500 .860rem/1.300 var(--mono); text-align: right; white-space: nowrap; }
.ia-choice { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .920rem; }
.ia-choice .ia-name { margin-right: 6px; }
.ia-btn { font: 500 .820rem/1 var(--sans); padding: 7px 11px; border: 1px solid rgba(11, 11, 12, .250); background: #fff; color: var(--paper-ink); cursor: pointer; }
.ia-btn.on { background: #1f2a44; border-color: #1f2a44; color: #fff; }
.ia-readouts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; font-size: .900rem; }
.ia-readout span { color: #6b6b64; margin-right: 6px; }
.ia-readout b { font: 600 .920rem/1.300 var(--mono); }
.ia-note { font-size: .900rem; margin: 8px 0 0; color: #33332f; }
@media (max-width: 640px) { .ia-slider { grid-template-columns: 1fr auto; } .ia-slider input[type=range] { grid-column: 1 / -1; grid-row: 2; } }
