/* Layout: each lesson is a drawing sheet. A title block on top, the work as numbered operations (OP 10, 20, …)
   down one column, the answers inspected against a tolerance and stamped. Light = drawing paper, dark = ink. */
/* Open CAD Academy's colours: ink on drawing paper, with the checker's red as the one brand accent (the mark,
   kickers, OP numbers, focus rings). Drawing lines stay blue, as on a drawing; an error is orange, never red. */
:root {
  --paper: #f2f2ee;       /* drawing paper */
  --sheet: #fafaf7;       /* raised surfaces: title block, inputs */
  --ink: #111111;
  --ink-2: #55554e;       /* notes, labels */
  --rule: #d9d9d1;        /* hairlines */
  --line: #83837a;        /* control outlines; 3:1 on paper, sheet and wash (tick boxes, quiz keys) */
  --brand: #c8281e;       /* the checker's red: Open CAD Academy's accent */
  --brand-wash: #f9e8e4;
  --layout: #1f55c8;      /* layout-dye blue: bend lines and drawing notes */
  --layout-wash: #dfe6f4;
  --steel: #d9dcdc;       /* the blank */
  --ok: #18744a;
  --ok-wash: #dcefe4;
  --ng: #a14800;          /* out of tolerance: orange, so red always means the brand */
  --ng-wash: #f8e6d2;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141413; --sheet: #1d1d1b; --ink: #ecece6; --ink-2: #a8a89f; --rule: #33332f; --line: #7a7a72;
    --brand: #ff7466; --brand-wash: #3b1c19; --layout: #86b0ff; --layout-wash: #1d2a40; --steel: #2e2f2e;
    --ok: #63d49c; --ok-wash: #12332a; --ng: #ffa257; --ng-wash: #3a2914; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141413; --sheet: #1d1d1b; --ink: #ecece6; --ink-2: #a8a89f; --rule: #33332f; --line: #7a7a72;
  --brand: #ff7466; --brand-wash: #3b1c19; --layout: #86b0ff; --layout-wash: #1d2a40; --steel: #2e2f2e;
  --ok: #63d49c; --ok-wash: #12332a; --ng: #ffa257; --ng-wash: #3a2914; color-scheme: dark;
}

/* Fonts, served from this site (web/fonts, SIL Open Font License 1.1, see web/fonts/OFL-*.txt): no request to a
   third party. Latin subset. IBM Plex Sans is one variable file covering weights 400 to 600. */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/barlow-condensed-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/barlow-condensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/barlow-condensed-700.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-mono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-mono-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-stretch: 100%; font-display: swap;
  src: url(fonts/ibm-plex-sans-variable.woff2) format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  /* a faint 10 mm grid, like the film on a drawing board */
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 40px 40px; background-attachment: fixed;
  background-blend-mode: normal;
}
body::before { content: ""; position: fixed; inset: 0; background: var(--paper); opacity: 0.86; z-index: -1; }
a { color: var(--ink); text-decoration-color: var(--brand); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }
img { max-width: 100%; height: auto; display: block; }
code { font: 0.88em var(--mono); background: var(--rule); padding: 0.05em 0.35em; }
strong { font-weight: 600; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* over the light viewer and the placeholder the ring keeps the light-theme red in both themes */
.vbar :focus-visible { outline: 3px solid #c8281e; outline-offset: 2px; box-shadow: 0 0 0 5px #fafaf7; }
.steps > li:focus-visible { outline-offset: -2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.why:focus { outline: none; }
.why:focus-visible { outline: 2px solid var(--brand); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 20; padding: 10px 14px; background: var(--ink); color: var(--paper); font-weight: 600; }
.skip:focus { top: 8px; }

.wrap {
  max-width: 980px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* masthead */
.masthead { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--ink); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; flex-wrap: wrap; }
.mark { display: flex; align-items: center; min-height: 44px; gap: 10px; color: var(--ink); text-decoration: none;
  font: 700 1.3rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.05em; }
.mark img { width: 34px; height: 34px; }
.mark:hover { color: var(--ink); }
/* on a course's pages: the course's name after a rule */
.course-mark { display: flex; align-items: center; min-height: 44px; padding-left: 14px; border-left: 1.5px solid var(--ink);
  color: var(--ink); text-decoration: none; font: 600 1.1rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.course-mark em { font-style: normal; font-weight: 500; color: var(--ink-2); letter-spacing: 0.02em; text-transform: none; margin-left: 0.3em; }
.course-mark:hover { color: var(--brand); }
.masthead nav { display: flex; gap: 22px; }
.masthead nav a { display: inline-flex; align-items: center; min-height: 44px; font: 500 0.82rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); text-decoration: none; }
.masthead nav a:hover { color: var(--brand); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: 600 1rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em;
  min-height: 44px; padding: 11px 18px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer;
  border-radius: 2px; transition: background 0.15s, color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { color: var(--brand); border-color: var(--brand); background: transparent; }

.note { color: var(--ink-2); font-size: 0.95rem; margin: 0 0 12px; }

/* ---------- home ---------- */
.home { padding-block: 40px 24px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.kicker { font: 500 0.8rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand); margin: 0 0 14px; }
.hero h1 { font: 700 clamp(2.6rem, 6vw, 4.4rem)/0.95 var(--display); text-transform: uppercase; letter-spacing: 0.01em; margin: 0 0 18px; }
.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 36em; margin: 0 0 20px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.progress { font: 500 0.85rem var(--mono); color: var(--ink-2); margin: 0; }
.hero-art { margin: 0; border: 1px solid var(--ink); background: var(--sheet); padding: 12px 12px 0; position: relative; }
.hero-art::before, .hero-art::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--brand); border-style: solid; }
.hero-art::before { top: -6px; left: -6px; border-width: 2px 0 0 2px; }
.hero-art::after { bottom: -6px; right: -6px; border-width: 0 2px 2px 0; }
.hero-art figcaption { border-top: 1px solid var(--rule); margin: 8px -12px 0; padding: 8px 12px; font: 0.78rem var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }

.register-wrap { margin-top: 56px; }
.register-wrap h2, .prose h2 { font: 700 1.6rem/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 12px; }
.register { list-style: none; padding: 0; margin: 0; border-top: 1.5px solid var(--ink); }
.register li { border-bottom: 1px solid var(--rule); }
.register a { display: grid; grid-template-columns: 3.2rem 104px minmax(0, 1fr) 4.5rem 7.5rem; align-items: center; gap: 16px;
  padding: 10px 6px; color: var(--ink); text-decoration: none; transition: background 0.12s; }
.register a:hover { background: var(--sheet); }
.register .no { font: 700 1.7rem/1 var(--display); color: var(--ink-2); }
.register img { width: 104px; aspect-ratio: 3 / 2; object-fit: cover; background: #e6e7e4; border: 1px solid var(--rule); }
.register .what { min-width: 0; display: flex; flex-direction: column; }
.register strong { font: 600 1.25rem/1.15 var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.register small { color: var(--ink-2); font-size: 0.9rem; }
.register .min { font: 0.85rem var(--mono); color: var(--ink-2); }
.register .st { text-align: right; }
.st-done, .st-next { display: none; font: 600 0.82rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 8px; border: 1.5px solid; }
.is-done .st-done { display: inline-block; color: var(--ok); transform: rotate(-4deg); }
.is-done .no { color: var(--ok); }
.is-next .st-next { display: inline-block; color: var(--brand); }
.is-next a { background: var(--brand-wash); }

/* ---------- lesson: the title block ---------- */
.lesson { padding-block: 28px 16px; }
.titleblock { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); border: 1.5px solid var(--ink); background: var(--sheet); }
.tb-main { padding: 20px 22px; border-right: 1px solid var(--ink); min-width: 0; }
.tb-no { font: 500 0.8rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); margin: 0 0 6px; }
.tb-no b { color: var(--brand); font-weight: 500; }
.titleblock h1 { font: 700 clamp(1.9rem, 4vw, 2.7rem)/1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; margin: 0 0 12px; }
.titleblock .lead { font-size: 1rem; margin: 0; }
.tb-grid { margin: 0; display: grid; grid-template-columns: 1fr; }
.tb-grid div { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); border-bottom: 1px solid var(--rule); }
.tb-grid div:last-child { border-bottom: 0; }
.tb-grid dt { font: 500 0.7rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); padding: 9px 10px; border-right: 1px solid var(--rule); }
.tb-grid dd { margin: 0; padding: 8px 10px; font: 0.86rem var(--mono); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.tb-status dd { font: 700 1rem var(--display); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); }
.tb-status dd.is-inspected { color: var(--ok); }

.route { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--rule); border-bottom: 0; background: var(--sheet); }
.route li { flex: 1 1 auto; border-right: 1px solid var(--rule); }
.route li:last-child { border-right: 0; }
.route a { display: flex; flex-direction: column; padding: 7px 12px; text-decoration: none; color: var(--ink); font: 600 0.98rem/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.route a span { font: 500 0.68rem var(--mono); color: var(--ink-2); letter-spacing: 0.08em; }
.route a:hover { background: var(--brand-wash); }
.meter { height: 4px; background: var(--rule); }
.meter div { height: 100%; width: 0; background: var(--brand); transition: width 0.4s ease; }

/* operations */
.op { padding-block: 28px 8px; border-bottom: 1px solid var(--rule); }
.op h2 { display: flex; align-items: baseline; gap: 12px; font: 700 1.55rem/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; margin: 0 0 16px; }
.opno { font: 500 0.78rem var(--mono); letter-spacing: 0.08em; color: var(--brand); border: 1px solid var(--brand); padding: 3px 7px; flex: none; transform: translateY(-3px); }

.video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #000; border: 1px solid var(--ink); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* a published video: the part picture and a play button; YouTube loads only on the click */
.video.facade { background: #e9e9e4; display: grid; place-items: center; overflow: hidden; }
.video.facade img { position: absolute; inset: 6% 12%; width: 76%; height: 88%; object-fit: contain; }
.video .play { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; cursor: pointer;
  background: #111111; color: #fafaf7; border: 0; font: 700 1.1rem var(--display); text-transform: uppercase; letter-spacing: 0.08em; }
.video .play:hover { background: #c8281e; }
.video .play:focus-visible { outline: 3px solid #c8281e; outline-offset: 3px; }
.video .play-icon { width: 0; height: 0; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent currentColor; }
.video .yt-note { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 6px 10px; background: rgba(250, 250, 247, 0.94);
  color: #111111; font-size: 0.82rem; }
.video .yt-note a { color: #111111; text-decoration-color: #c8281e; }
.video.pending { background: #e9e9e4; display: grid; place-items: center; overflow: hidden;
  background-image: repeating-linear-gradient(135deg, transparent 0 10px, rgba(17, 17, 17, 0.05) 10px 11px); }
.video.pending img { position: absolute; inset: 6% 12%; width: 76%; height: 88%; object-fit: contain; opacity: 0.55; filter: grayscale(0.4); }
.video.pending p { position: relative; margin: 0; padding: 10px 14px; background: #fafaf7; color: #111111; border: 1.5px solid #111111; font-size: 0.9rem; max-width: 80%; }
.video.pending p span { display: block; font: 700 1.05rem var(--display); text-transform: uppercase; letter-spacing: 0.08em; }

details { border: 1px solid var(--rule); background: var(--sheet); margin-top: 12px; }
summary { cursor: pointer; padding: 12px; min-height: 44px; font: 600 0.95rem var(--display); text-transform: uppercase; letter-spacing: 0.06em; }
details[open] summary { border-bottom: 1px solid var(--rule); }
.chapters ol { list-style: none; margin: 0; padding: 8px 12px; columns: 2; column-gap: 24px; }
.chapters li { break-inside: avoid; padding: 2px 0; }
.chapters span { display: inline-block; min-width: 3.4em; font: 0.85rem var(--mono); color: var(--brand); }

/* the 3D viewer */
.viewer { position: relative; border: 1px solid var(--ink); background: #e6e7e4; overflow: hidden; }
.viewer .still { width: 100%; height: 400px; object-fit: contain; }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; opacity: 0; transition: opacity 0.4s; }
.viewer.live canvas { opacity: 1; }
.viewer.live .still { visibility: hidden; }
.viewer canvas:active { cursor: grabbing; }
.vbar { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1.5px solid #111111; background: #fafaf7; }
.seg button { font: 600 0.9rem var(--display); text-transform: uppercase; letter-spacing: 0.06em; border: 0; background: transparent; color: #111111; padding: 7px 14px; cursor: pointer; }
.seg button.on { background: #111111; color: #fafaf7; }
.vbar .btn.ghost { background: #fafaf7; color: #111111; border-color: #111111; padding: 7px 12px; }

/* the task: steps as tick boxes */
.task h2 { font: 700 1.1rem var(--display); text-transform: uppercase; letter-spacing: 0.05em; margin: 22px 0 8px; }
.task h2:first-child { margin-top: 0; }
.task p, .task li { max-width: 68ch; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: st; border-top: 1px solid var(--rule); }
.steps > li { counter-increment: st; position: relative; padding: 11px 10px 11px 52px; border-bottom: 1px solid var(--rule); cursor: pointer; user-select: none; }
.steps > li:hover { background: var(--sheet); }
.steps > li::before { content: counter(st, decimal-leading-zero); position: absolute; left: 8px; top: 10px; width: 30px; height: 26px;
  display: grid; place-items: center; font: 500 0.78rem var(--mono); border: 1.5px solid var(--line); color: var(--ink-2); }
.steps > li[aria-checked="true"] { color: var(--ink-2); }
.steps > li[aria-checked="true"]::before { content: "✓"; border-color: var(--ok); background: var(--ok); color: var(--sheet); font-size: 0.95rem; }

/* OP 40: the inspection report */
.report { border-top: 1.5px solid var(--ink); }
.check { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem auto auto 4.2rem; grid-template-areas: "char tol meas btn stamp" "res res res res res";
  align-items: center; gap: 6px 12px; padding: 12px 6px; border-bottom: 1px solid var(--rule); transition: background 0.2s; }
.char { grid-area: char; font-weight: 500; }
.tol { grid-area: tol; font: 0.82rem var(--mono); color: var(--ink-2); }
.meas { grid-area: meas; display: inline-flex; align-items: baseline; gap: 6px; }
.meas input { font: 500 1.05rem var(--mono); font-variant-numeric: tabular-nums; width: 8.5em; padding: 7px 9px; border: 0; border-bottom: 1.5px solid var(--ink);
  background: var(--sheet); color: var(--ink); border-radius: 0; }
.meas input:focus { outline: none; border-bottom-color: var(--brand); background: var(--brand-wash); }
.meas input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.meas input::placeholder { color: var(--ink-2); opacity: 1; }
.unit { font: 0.85rem var(--mono); color: var(--ink-2); display: inline-block; width: 2ch; } /* kept when empty: inputs line up */
.check .btn { grid-area: btn; padding: 9px 14px; }
.check .stamp { grid-area: stamp; justify-self: start; }
.result { grid-area: res; margin: 0; min-height: 1.3em; font-size: 0.93rem; }
.check.ok { background: var(--ok-wash); }
.check.ok .result { color: var(--ok); }
.check.no .result { color: var(--ng); }
.check.no .meas input { border-bottom-color: var(--ng); }
.shake { animation: shake 0.32s; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

/* the inspection stamp */
.stamp { display: none; font: 700 1.05rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ok);
  border: 2.5px solid var(--ok); padding: 5px 9px 4px; transform: rotate(-8deg); }
.check.ok .stamp { display: inline-block; animation: stamp 0.26s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes stamp { from { transform: rotate(-8deg) scale(1.9); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }

.solution summary { color: var(--ink); }
.solution-part { margin: 0; padding: 14px; border-bottom: 1px solid var(--rule); }
.solution-part:last-child { border-bottom: 0; }
.solution-part figcaption { font: 0.82rem var(--mono); color: var(--ink-2); }
.flat { width: 100%; max-height: 420px; margin: 6px 0; display: block; }
.flat .blank { fill: var(--steel); stroke: var(--ink); stroke-linejoin: miter; }
.flat .cut { fill: var(--sheet); stroke: var(--ink); }
.flat .bend { stroke: var(--layout); fill: none; }
.flat .dim { stroke: var(--ink-2); fill: none; }
.flat .dimtext { fill: var(--ink); font-family: var(--mono); }
.flatsize { margin: 4px 0 8px; font: 0.92rem var(--mono); }

/* the dimensioned drawings: the exercise's (OP 30) and the solution's */
.drawing-scroll { overflow-x: auto; margin: 6px 0; }
.drawing-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.flat.drawing { max-height: 720px; margin: 0 auto; }
.flat .bendnote { fill: var(--layout); }
.flat .lead { stroke: var(--layout); }
.flat .datum { stroke: var(--ink); fill: none; }
.sheet-drawing { margin: 0 0 22px; padding: 12px 14px; background: var(--sheet); border: 1px solid var(--rule); }
.sheet-drawing figcaption { font: 0.82rem var(--mono); color: var(--ink-2); margin: 4px 0 10px; max-width: 80ch; }
.sheet-meta { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 14px; align-items: start; }
.sheet-meta img { width: 100%; height: auto; border: 1px solid var(--rule); background: var(--paper); }
.drawing-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0; margin: 0; border-top: 1.5px solid var(--ink); }
.drawing-notes div { padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.drawing-notes dt { font: 500 0.7rem var(--body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.drawing-notes dd { margin: 2px 0 0; font: 0.92rem var(--mono); }
.typed-head { margin: 12px 0 4px; font: 500 0.7rem var(--body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.typed { margin: 0; padding-left: 1.1em; font: 0.85rem var(--mono); }
.typed li { margin: 2px 0; }
@media (max-width: 640px) {
  .drawing-scroll .flat.drawing { min-width: 600px; }
  .sheet-meta { grid-template-columns: 1fr; }
}
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font: 0.86rem var(--mono); font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th { font-weight: 500; color: var(--ink-2); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; border-bottom: 1.5px solid var(--ink); }
.downloads { display: flex; gap: 4px 16px; flex-wrap: wrap; margin: 10px 0 0; font: 0.85rem var(--mono); }
.downloads a { display: inline-flex; align-items: center; min-height: 44px; }

/* OP 50: quiz */
.q { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.q:first-child { padding-top: 0; }
.qtext { font-weight: 500; margin: 0 0 10px; display: flex; gap: 10px; }
.qn { font: 500 0.78rem/1.9 var(--mono); color: var(--brand); flex: none; }
.choices { display: grid; gap: 6px; }
.choice { display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; padding: 8px 10px; min-height: 44px; background: var(--sheet); color: var(--ink);
  border: 1px solid var(--rule); cursor: pointer; transition: border-color 0.12s; }
.choice:hover:not(:disabled) { border-color: var(--ink); }
.choice:disabled { cursor: default; color: var(--ink-2); }
.key { flex: none; width: 26px; height: 26px; display: grid; place-items: center; font: 500 0.8rem var(--mono); border: 1.5px solid var(--line); color: var(--ink-2); }
.choice.right { border-color: var(--ok); background: var(--ok-wash); color: var(--ink); }
.choice.right .key { background: var(--ok); border-color: var(--ok); color: var(--sheet); }
.choice.wrong { border-color: var(--ng); background: var(--ng-wash); color: var(--ink); }
.choice.wrong .key { background: var(--ng); border-color: var(--ng); color: var(--sheet); }
.why { margin: 10px 0 0; color: var(--ink-2); font-size: 0.95rem; }
.score { font: 500 0.9rem var(--mono); margin: 14px 0 0; }

/* the sheet is done */
.done { margin: 28px 0 8px; padding: 24px; border: 1.5px solid var(--ok); background: var(--sheet); display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.done p { margin: 0; flex: 1 1 14rem; }
.stamp.big { display: inline-block; font-size: 1.7rem; padding: 8px 14px 6px; border-width: 3px; }
.done.fresh .stamp.big { animation: stamp 0.32s cubic-bezier(.2, 1.4, .4, 1) both; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0 0; }
.pager a { display: flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--rule); background: var(--sheet); text-decoration: none;
  color: var(--ink); font: 600 1.05rem var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.pager a:hover { border-color: var(--brand); }
.pager small { font: 0.72rem var(--mono); color: var(--ink-2); letter-spacing: 0.08em; }
.pager .next { text-align: right; grid-column: 2; }

.prose { padding-block: 36px; max-width: 760px; }
.prose h1 { font: 700 2.4rem/1 var(--display); text-transform: uppercase; margin: 0 0 18px; }
.prose p { max-width: 66ch; }

.foot { margin-top: 32px; border-top: 1px solid var(--ink); padding-block: 14px 32px; color: var(--ink-2); font-size: 0.88rem; }
.foot p { margin: 0; max-width: 72ch; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .titleblock { grid-template-columns: 1fr; }
  .tb-main { border-right: 0; border-bottom: 1px solid var(--ink); }
  .tb-grid { grid-template-columns: 1fr 1fr; }
  .tb-grid div { border-right: 1px solid var(--rule); }
  .route { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .route li { flex: 0 0 auto; }
  .register a { grid-template-columns: 2.4rem 72px minmax(0, 1fr); gap: 10px; }
  .register img { width: 72px; }
  .register .min { display: none; }
  .register .st { grid-column: 3; text-align: left; }
  .check { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "char char" "tol stamp" "meas btn" "res res"; }
  .viewer .still { height: 300px; }
  .chapters ol { columns: 1; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
@media (pointer: coarse) {
  .seg button, .vbar .btn.ghost { min-height: 44px; }
  .meas input { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.steps-static { padding-left: 1.4em; display: grid; gap: 6px; }
.steps-static li { max-width: 68ch; }

.foot .legal { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.foot .legal a { min-height: 44px; display: inline-flex; align-items: center; }

/* the grievance officer's contact card (privacy notice and contact page) */
.contact-card { display: grid; gap: 0; margin: 0 0 12px; border: 1.5px solid var(--ink); background: var(--sheet); }
.contact-card div { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.contact-card div:last-child { border-bottom: 0; }
.contact-card dt { font: 500 0.78rem/1.9 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.contact-card dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .contact-card div { grid-template-columns: 1fr; gap: 2px; } }

/* each learner's own part (web/variants.js): which part, and New part with a confirm step */
.variant { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; padding: 10px 14px;
  background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--ink); }
.variant[hidden], .variant-confirm[hidden] { display: none; }
.variant-now { margin: 0; flex: 1 1 22rem; max-width: 68ch; }
.variant-now strong { font: 600 0.95rem var(--mono); }
.variant-confirm { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 10px;
  border-top: 1px solid var(--rule); }
.variant-confirm p { margin: 0; flex: 1 1 100%; }
.task .var { font-variant-numeric: tabular-nums; }
.variant-solution { padding: 10px 0; }

.pic-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.part-note { margin: 0; font-size: 0.85rem; color: var(--ink-2); }

/* the install page: the official release page, first */
.release-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 18px 0 8px; padding: 14px 16px;
  background: var(--sheet); border: 1.5px solid var(--ink); border-left: 6px solid var(--brand); }
.release-link span { flex: 1 1 18rem; color: var(--ink-2); font-size: 0.95rem; }
.release-link code { overflow-wrap: anywhere; }

/* ---------- the academy home ---------- */
.academy { padding-block: 44px 24px; }
.academy-hero { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: center; }
.academy-logo { width: 200px; height: 200px; }
.academy-hero h1 { font: 700 clamp(2.6rem, 6vw, 4.4rem)/0.95 var(--display); text-transform: uppercase; letter-spacing: 0.01em; margin: 0 0 18px; }
.courses { margin-top: 56px; }
.courses h2 { font: 700 1.6rem/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 12px; }
.course-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.course-card { border: 1.5px solid var(--ink); background: var(--sheet); }
.course-card > a { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; align-items: center; padding: 14px;
  color: var(--ink); text-decoration: none; }
.course-card > a:hover { background: var(--brand-wash); }
.course-card img { width: 240px; aspect-ratio: 3 / 2; object-fit: cover; background: #e6e7e4; border: 1px solid var(--rule); }
.course-card.soon { border-style: dashed; border-color: var(--line); padding: 14px; }
.course-what { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.course-no { font: 500 0.78rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand); }
.course-what strong { font: 700 1.7rem/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.course-desc { color: var(--ink-2); max-width: 60ch; }
.course-facts { font: 0.85rem var(--mono); color: var(--ink-2); }
.foot .foot-brand { margin-bottom: 6px; color: var(--ink); }
@media (max-width: 760px) {
  .academy-hero { grid-template-columns: 1fr; gap: 20px; }
  .academy-logo { width: 120px; height: 120px; }
  .course-card > a { grid-template-columns: 1fr; }
  .course-card img { width: 100%; }
  .course-mark { padding-left: 0; border-left: 0; min-height: 0; padding-bottom: 8px; }
}

/* the install page's video: its own thumbnail fills the frame */
.install-video { margin: 18px 0 26px; }
.install-video figcaption { margin-top: 8px; font: 0.82rem var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
/* the picture is the video's own thumbnail, with words on it: the play button and the note go in a strip below it,
   not over it; once playing, the box is 16:9 again for the player */
.video.facade.cover { aspect-ratio: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 0 0 12px;
  background: var(--sheet); place-items: initial; }
.video.facade.cover img { position: static; inset: auto; flex: 1 1 100%; width: 100%; height: auto; }
.video.facade.cover .play { margin-left: 12px; background: var(--ink); color: var(--paper); }
.video.facade.cover .play:hover { background: var(--brand); color: #fff; }
.video.facade.cover .yt-note { position: static; flex: 1 1 16rem; padding: 0 12px 0 0; background: none; color: var(--ink-2); }
.video.facade.cover .yt-note a { color: var(--ink); }
.course-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; padding: 12px 14px;
  border-top: 1px solid var(--rule); }
.course-links span { color: var(--ink-2); font-size: 0.92rem; }

/* in the dark themes the mark's ink frame would vanish into the page: a paper-coloured ring outlines it */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .academy-logo, :root:not([data-theme="light"]) .mark img { box-shadow: 0 0 0 2px #f2f2ee; }
}
:root[data-theme="dark"] .academy-logo, :root[data-theme="dark"] .mark img { box-shadow: 0 0 0 2px #f2f2ee; }
