/* ============================================================
   Pixel Raptors Academy — shared design system
   Pixel Raptors FTC #28395
   One stylesheet for the hub + every course.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
/* Light, editorial theme. One restrained blue accent, hairline borders, flat
   surfaces, no ambient glow. Interactive canvases use a high-contrast palette
   designed for their near-white background. */
:root {
  /* surfaces */
  --bg:            #ffffff;
  --bg-2:          #f5f7fa;
  --surface:       #ffffff;
  --surface-2:     #f5f7fa;
  --surface-3:     #eceff4;
  --line:          #dfe3ea;
  --line-soft:     #eaedf2;

  /* text */
  --ink:           #12141a;   /* near-black headings */
  --ink-2:         #3b4252;   /* body copy */
  --ink-3:         #6b7280;   /* muted / labels */

  /* brand + a single accent */
  --accent:        #2f6feb;   /* blue — the one brand colour */
  --accent-2:      #2f6feb;   /* alias so old .accent-2 usages stay on-brand */
  --accent-ink:    #1e51c0;   /* darker blue for text-on-white links */

  /* categorical palette used by non-canvas UI */
  --c1:            #5eead4;
  --c2:            #a78bfa;
  --c3:            #fbbf24;
  --c4:            #fb7185;
  --c5:            #60a5fa;
  --c6:            #4ade80;
  --c7:            #f472b6;
  --c8:            #38bdf8;

  /* semantic (tuned for legibility on white) */
  --ok:            #15803d;
  --warn:          #b45309;
  --danger:        #be123c;
  --info:          #1d4ed8;

  /* canvas text: dark enough to read on the light visualization background */
  --viz-ink:  #0d0f14;
  --viz-ink2: #2c3340;
  --viz-ink3: #465064;

  /* figure strokes and fills retain the brighter categorical palette */
  --viz-line: #2b3766;
  --viz-a:    #5eead4;
  --viz-b:    #a78bfa;
  --viz-ok:   #4ade80;
  --viz-warn: #fbbf24;
  --viz-bad:  #fb7185;
  --viz-info: #60a5fa;

  /* type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* geometry */
  --r:    12px;
  --r-sm: 8px;
  --r-lg: 18px;
  --shadow:    0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.06);
  --shadow-lg: 0 6px 24px rgba(16,24,40,.10);
  --sidebar: 292px;
  --maxw: 900px;
}

/* ---------- 2. Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, canvas, svg, video { max-width: 100%; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 3. Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; gap: 16px;
  padding: 11px clamp(14px, 3vw, 28px);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px) saturate(120%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.4px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--accent);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px;
}
.brand small { display: block; font-size: 10.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .9px; text-transform: uppercase; line-height: 1; }
.topbar .spacer { flex: 1; }
.topbar-link { color: var(--ink-2); font-size: 13.5px; font-weight: 600; padding: 6px 11px; border-radius: 8px; }
.topbar-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }

/* reading-progress bar */
.readbar { position: fixed; top: 0; left: 0; height: 2px; z-index: 100;
  background: var(--accent); width: 0; transition: width .08s linear; }

/* ---------- 4. Shell / layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); gap: 0; align-items: start; }
.sidebar {
  position: sticky; top: 55px; align-self: start;
  height: calc(100vh - 55px); overflow-y: auto;
  padding: 22px 16px 60px; border-right: 1px solid var(--line-soft);
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.sidebar h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--ink-3); margin: 0 0 10px 8px; }
.sidebar .prog-wrap { margin: 0 8px 18px; }
.sidebar nav a {
  display: block; padding: 7px 11px; margin-bottom: 2px; border-radius: 8px;
  color: var(--ink-2); font-size: 13.6px; font-weight: 500; line-height: 1.45;
  border-left: 2px solid transparent;
}
.sidebar nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.sidebar nav a.active { background: var(--surface-2); color: var(--accent); border-left-color: var(--accent); font-weight: 700; }
.sidebar nav a .num { display: inline-block; width: 22px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.sidebar nav a.sub { padding-left: 34px; font-size: 12.8px; }
.sidebar .divider { height: 1px; background: var(--line-soft); margin: 14px 8px; }

.learning-ribbon {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin: 0 0 20px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink-3); font-size: 11.5px;
}
.learning-ribbon > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.learning-ribbon strong { color: var(--ink); font-size: 12px; }
.level-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(47,111,235,.09); }
.learning-ribbon button {
  flex: none; border: 1px solid #b9c8df; border-radius: 7px; padding: 5px 9px;
  background: #f7faff; color: var(--accent-ink); font: inherit; font-weight: 750; cursor: pointer;
}
.learning-ribbon button:hover { border-color: var(--accent); background: #eef4ff; }
.learning-ribbon button.complete { border-color: rgba(21,128,61,.25); background: rgba(21,128,61,.07); color: var(--ok); cursor: default; }
.ribbon-note { color: var(--ink-3); }
@media (max-width: 560px) {
  .learning-ribbon { align-items: flex-start; flex-direction: column; }
  .learning-ribbon button { width: 100%; min-height: 38px; }
}

main { padding: 34px clamp(16px, 4vw, 54px) 120px; min-width: 0; }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.wide { max-width: 1180px; margin: 0 auto; }

/* mobile nav */
.navtoggle { display: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 6px 10px; font-size: 18px; cursor: pointer; line-height: 1; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 95; top: 55px; left: 0; width: 300px;
    background: var(--bg); transform: translateX(-102%); transition: transform .24s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .navtoggle { display: block; }
}

/* ---------- 5. Type ---------- */
h1, h2, h3, h4, h5 { line-height: 1.24; letter-spacing: -.5px; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(30px, 4.4vw, 46px); }
h2 { font-size: clamp(23px, 2.9vw, 31px); margin-top: 2.1em; padding-bottom: .34em; border-bottom: 1px solid var(--line-soft); }
h3 { font-size: clamp(18.5px, 2.1vw, 22px); margin-top: 1.7em; color: var(--ink); }
h4 { font-size: 16.5px; margin-top: 1.4em; color: var(--ink); }
p { margin: 0 0 1.05em; color: var(--ink-2); }
main strong, main b { color: var(--ink); font-weight: 700; }
em { color: var(--ink); }
ul, ol { margin: 0 0 1.15em; padding-left: 1.35em; color: var(--ink-2); }
li { margin-bottom: .42em; }
li::marker { color: var(--ink-3); }
hr { border: 0; height: 1px; background: var(--line-soft); margin: 2.4em 0; }
blockquote { margin: 1.4em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--accent); color: var(--ink-2); font-style: italic; }
.lead { font-size: 19px; color: var(--ink); line-height: 1.68; }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
kbd { font-family: var(--mono); font-size: .84em; background: var(--surface-3); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: #fff; }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg-2);
  padding: clamp(26px, 4.4vw, 50px); margin-bottom: 34px;
}
.hero h1 { margin-bottom: .34em; }
.hero .kicker { font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero p { max-width: 74ch; font-size: 17.5px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }

/* Course 01 opens on the real sport, then uses the code-drawn widgets to
   explain it. The photograph and field-note overlays form one teaching
   figure rather than a decorative banner. */
.course-photo-hero {
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  padding: 0; background: #f8fbff;
}
.course-photo-copy { padding: clamp(27px, 4.2vw, 50px); align-self: center; }
.course-cover-photo {
  display: flex; flex-direction: column; min-width: 0; margin: 0;
  color: #fff; background: #0b1220;
}
.course-cover-photo .photo-stage { flex: 1; min-height: 430px; }
.course-cover-photo .photo-stage img { height: 100%; object-fit: cover; object-position: 52% center; }
.course-cover-photo figcaption {
  padding: 13px 16px 15px; color: #cbd5e1; font-size: 11.5px; line-height: 1.55;
  background: #0b1220;
}
.course-cover-photo figcaption strong { color: #fff; }
.course-cover-photo figcaption a { color: #93c5fd; }
@media (max-width: 880px) {
  .course-photo-hero { grid-template-columns: 1fr; }
  .course-cover-photo .photo-stage { min-height: 360px; }
}

/* ---------- 7. Badges / chips / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.badge.accent { background: rgba(47,111,235,.09); border-color: rgba(47,111,235,.34); color: var(--accent-ink); }
.badge.violet { background: rgba(47,111,235,.09); border-color: rgba(47,111,235,.34); color: var(--accent-ink); }
.badge.warn   { background: rgba(180,83,9,.09);   border-color: rgba(180,83,9,.32);   color: var(--warn); }
.badge.danger { background: rgba(190,18,60,.08);  border-color: rgba(190,18,60,.3);   color: var(--danger); }
.badge.ok     { background: rgba(21,128,61,.09);  border-color: rgba(21,128,61,.3);   color: var(--ok); }

.tagrow { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }

/* ---------- 8. Cards & grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 22px; margin: 20px 0;
}
.card.tight { padding: 15px 17px; }
.card h3:first-child, .card h4:first-child { margin-top: 0; }
.grid  { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); margin: 20px 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin: 20px 0; }
.grid3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 20px 0; }

/* Beginner courses open with a finite first-session plan, then show how the
   material ramps. This lets a new member get an early win without hiding the
   serious engineering that follows. */
.launch-plan {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,.8fr); gap: 18px 30px;
  align-items: center; margin: 28px 0; padding: clamp(22px,4vw,34px);
  border: 1px solid #b8cdf2; border-radius: var(--r-lg);
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
}
.launch-plan h2 { margin: 12px 0 7px; padding: 0; border: 0; font-size: 26px; }
.launch-plan p { margin: 0; font-size: 14.5px; }
.launch-plan ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.launch-plan li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; margin: 0; font-size: 13px; }
.launch-plan li strong { color: var(--accent-ink); }
.launch-plan .btn { justify-self: start; }
.depth-ramp { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; overflow: hidden; margin: 18px 0 30px; border: 1px solid var(--line); border-radius: var(--r); background: var(--line); }
.depth-ramp > div { display: grid; grid-template-columns: 34px 1fr; column-gap: 9px; align-items: center; padding: 14px 16px; background: #fff; }
.depth-ramp span { grid-row: 1 / 3; display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: var(--accent-ink); background: #eef4ff; font-family: var(--mono); font-size: 10px; font-weight: 800; }
.depth-ramp strong { font-size: 13px; }
.depth-ramp small { color: var(--ink-3); font-size: 10.5px; }
.depth-ramp .deep span { color: #fff; background: var(--ink); }
@media (max-width: 680px) {
  .launch-plan { grid-template-columns: 1fr; }
  .depth-ramp { grid-template-columns: 1fr; }
}

/* course cards on the hub */
.ccard {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 19px 20px; color: var(--ink); position: relative; overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.ccard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent); opacity: 0; transition: opacity .16s ease; }
.ccard:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.ccard:hover::before { opacity: 1; }
.ccard .ctop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ccard .cnum { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent-ink); letter-spacing: 1px; }
.ccard h3 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.ccard p { margin: 0; font-size: 14.2px; color: var(--ink-2); line-height: 1.6; }
.ccard .cfoot { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.ccard.done { border-color: rgba(21,128,61,.45); }
/* a course still being authored: visible in the catalog, but not a dead link */
.ccard.pending { opacity: .62; cursor: default; }
.ccard.pending::before { background: var(--line); opacity: 1; }
.ccard.pending:hover { transform: none; border-color: var(--line); box-shadow: none; }

/* stat tiles */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 15px 16px; }
.stat .v { font-size: 27px; font-weight: 800; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.stat .l { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .9px; margin-top: 4px; font-weight: 700; }
.stat .s { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

/* ---------- 9. Callouts ---------- */
.callout {
  position: relative; margin: 22px 0; padding: 15px 19px 15px 50px;
  border-radius: var(--r-sm); border: 1px solid var(--line); border-left-width: 3px;
  background: var(--surface); font-size: 15.4px;
}
/* Feather line icon injected by academy.js sits in the reserved left gutter. */
.callout > .ico { position: absolute; left: 16px; top: 15px; width: 19px; height: 19px; }
.callout > .ico svg { width: 19px; height: 19px; display: block; }
.callout > .t { display: block; font-weight: 700; color: var(--ink); margin-bottom: 4px; font-size: 13px;
  text-transform: uppercase; letter-spacing: .6px; }
.callout p:last-child, .callout ul:last-child, .callout ol:last-child { margin-bottom: 0; }
.callout.info   { border-left-color: var(--info);   background: rgba(29,78,216,.045); }
.callout.tip    { border-left-color: var(--ok);     background: rgba(21,128,61,.05); }
.callout.warn   { border-left-color: var(--warn);   background: rgba(180,83,9,.05); }
.callout.danger { border-left-color: var(--danger); background: rgba(190,18,60,.045); }
.callout.math   { border-left-color: var(--accent); background: rgba(47,111,235,.045); }
.callout.judge  { border-left-color: var(--c3);     background: rgba(180,83,9,.04); }
.callout.info   > .ico { color: var(--info); }
.callout.tip    > .ico { color: var(--ok); }
.callout.warn   > .ico { color: var(--warn); }
.callout.danger > .ico { color: var(--danger); }
.callout.math   > .ico { color: var(--accent); }
.callout.judge  > .ico { color: var(--c3); }

/* ---------- 10. Tables ---------- */
.tablewrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--r-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14.4px; }
thead th {
  background: var(--surface-2); color: var(--ink); text-align: left; font-weight: 700;
  padding: 10px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13px;
  text-transform: uppercase; letter-spacing: .6px;
}
tbody td { padding: 9px 13px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: rgba(16,24,40,.018); }
tbody tr:hover { background: rgba(47,111,235,.05); }
td strong { color: var(--ink); }
table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13.4px; }

/* ---------- 11. Code ---------- */
pre {
  background: #0b1020; border: 1px solid #0b1020; border-radius: var(--r-sm);
  padding: 15px 17px; overflow-x: auto; margin: 18px 0; font-size: 13.4px; line-height: 1.66;
}
pre code { font-family: var(--mono); color: #d6e2ff; }
code { font-family: var(--mono); font-size: .875em; background: var(--surface-3); color: var(--accent-ink);
  padding: 1.5px 6px; border-radius: 5px; }
pre code { background: none; padding: 0; color: #d6e2ff; }
.codehead {
  display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12px;
  color: #9fb0d4; background: #0f1526; border: 1px solid #0f1526; border-bottom: 0;
  border-radius: var(--r-sm) var(--r-sm) 0 0; padding: 7px 14px; margin: 18px 0 0;
}
.codehead + pre { margin-top: 0; border-radius: 0 0 var(--r-sm) var(--r-sm); }
/* tiny token colours (applied by academy.js highlighter) */
.tok-k  { color: #c792ea; }  /* keyword */
.tok-t  { color: #7fdbca; }  /* type */
.tok-s  { color: #ecc48d; }  /* string */
.tok-n  { color: #f78c6c; }  /* number */
.tok-c  { color: #667899; font-style: italic; }
.tok-f  { color: #82aaff; }  /* function */
.tok-a  { color: #addb67; }  /* annotation */

/* ---------- 12. Math ---------- */
.eq {
  display: block; margin: 18px auto; padding: 14px 18px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: 15.5px; color: var(--ink); overflow-x: auto;
}
.eq .lbl { float: right; color: var(--ink-3); font-size: 12.5px; }
.eq-in { font-family: var(--mono); color: var(--ink); background: var(--surface-3); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
sub, sup { font-size: .72em; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .9em; }
.frac > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 5px; }
.frac > span:last-child { padding: 0 5px; }

/* worked example block */
.worked { border: 1px solid var(--line); border-radius: var(--r); margin: 24px 0; overflow: hidden; }
.worked > .wh { background: var(--surface-2); padding: 11px 18px; font-weight: 700; color: var(--ink); font-size: 14.5px;
  display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.worked > .wh .ico { width: 17px; height: 17px; color: var(--accent); flex: none; }
.worked > .wb { padding: 16px 19px; background: var(--surface); }
.worked ol { counter-reset: step; list-style: none; padding-left: 0; }
.worked ol > li { counter-increment: step; position: relative; padding-left: 38px; margin-bottom: 14px; }
.worked ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px; width: 25px; height: 25px;
  background: var(--accent); color: #fff; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}

/* ---------- 13. Interactive viz panel ---------- */
/* Light panel matching the page. viz.js renders the canvas on a light surface
   (see --viz-bg + remapColor in viz.js), so widgets read as clean figures. */
.viz {
  margin: 26px 0; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); overflow: hidden;
}
.viz > .vh {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 17px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.viz > .vh .ttl { font-weight: 700; color: var(--ink); font-size: 14.6px; }
.viz > .vh .hint { font-size: 12.4px; color: var(--ink-3); margin-left: auto; }
.viz > .vb { padding: 17px; }
.viz canvas { display: block; width: 100%; border-radius: var(--r-sm); background: #fbfcfe; border: 1px solid var(--line-soft); }
.viz .cap { font-size: 13px; color: var(--ink-3); margin-top: 11px; line-height: 1.6; }

/* ---------- 13b. Photographs (real, CC-licensed imagery) ---------- */
/* Shares the .viz visual grammar so a photo and a widget read as one system.
   Every .figure MUST carry a <figcaption> and a .credit — the attribution is a
   licensing requirement, not decoration. See credits.html and fetch-images.js. */
figure.figure {
  margin: 26px 0; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); overflow: hidden;
}
figure.figure > img {
  display: block; width: 100%; height: auto; background: var(--surface-3);
  border-bottom: 1px solid var(--line);
}
.photo-stage { position: relative; overflow: hidden; background: #0b1220; }
.photo-stage img { display: block; width: 100%; height: auto; }
.photo-stage::after {
  content: ''; position: absolute; inset: -70% 0 auto; height: 45%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(96,165,250,.15), transparent);
  transform: translateY(-100%); animation: course-photo-scan 7s ease-in-out infinite;
}
.photo-note {
  position: absolute; z-index: 2; padding: 6px 9px; border: 1px solid rgba(255,255,255,.68);
  border-radius: 6px; color: #fff; background: rgba(7,16,30,.82);
  box-shadow: 0 8px 22px rgba(0,0,0,.22); backdrop-filter: blur(7px);
  font: 750 10.5px/1.1 var(--mono); letter-spacing: .35px; text-transform: uppercase;
}
.photo-note::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px;
  border-radius: 50%; background: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,.2);
}
.photo-note.note-a { left: 4%; top: 5%; }
.photo-note.note-b { left: 4%; bottom: 5%; }
.photo-note.note-c { right: 4%; bottom: 5%; }
.photo-note.note-d { right: 4%; top: 5%; }
.photo-leaders { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.photo-leaders path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.photo-leaders .leader-halo { stroke: rgba(255,255,255,.94); stroke-width: 4.5; }
.photo-leaders .leader-line { stroke: #1d4ed8; stroke-width: 2; }
.photo-leaders .leader-targets { fill: #1d4ed8; stroke: #fff; stroke-width: .55; }
.photo-lab .photo-stage.driver-hub-photo { aspect-ratio: 1; }
figure.figure.photo-lab .photo-stage.driver-hub-photo img {
  width: 100%; height: 100%; max-height: none; object-fit: contain; object-position: center;
}
.photo-lab .photo-stage img { max-height: 620px; object-fit: cover; }
.photo-lab:not(.photo-lab-wide) { max-width: 780px; }
.photo-lab:not(.photo-lab-wide) .photo-stage img { max-height: 500px; object-position: center; }
@keyframes course-photo-scan {
  0%, 48% { transform: translateY(-100%); opacity: 0; }
  55% { opacity: 1; }
  78%, 100% { transform: translateY(480%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-stage::after { animation: none; display: none; }
}
/* a side-by-side pair of photos in one figure */
figure.figure .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
figure.figure .duo img { display: block; width: 100%; height: 100%; object-fit: cover; }
figure.figure .duo img:first-child { border-right: 1px solid var(--line); }
@media (max-width: 620px) { figure.figure .duo { grid-template-columns: 1fr; } }
figure.figure > figcaption { padding: 12px 17px 13px; }
figure.figure > figcaption .capt {
  display: block; font-size: 13.5px; color: var(--ink-2); line-height: 1.6;
}
figure.figure > figcaption .capt b, figure.figure > figcaption .capt strong { color: var(--ink); }
figure.figure > figcaption .credit {
  display: block; margin-top: 7px; font-size: 11px; color: var(--ink-3);
  letter-spacing: .2px;
}
figure.figure > figcaption .credit a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
figure.figure > figcaption .credit a:hover { color: var(--accent); }

/* control rows */
.ctrls { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); margin-top: 15px; }
.ctrl { font-size: 13px; }
.ctrl label { display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  color: var(--ink-2); font-weight: 600; margin-bottom: 5px; }
.ctrl label .val { font-family: var(--mono); color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 3px;
  background: var(--surface-3); outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); cursor: pointer;
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  border: 2px solid #fff; cursor: pointer;
}
select, input[type=text], input[type=number] {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 7px; padding: 7px 10px; font-family: var(--font); font-size: 14px; width: 100%;
}
select:focus, input:focus { outline: 2px solid rgba(47,111,235,.5); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink);
  border-radius: 9px; padding: 8px 15px; font-size: 14px; font-weight: 700; font-family: var(--font);
  transition: all .14s ease;
}
.btn:hover { background: var(--surface-3); border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.violet { background: var(--accent); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 5px 11px; font-size: 12.7px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin: 14px 0; }

/* toggle-chip group */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { cursor: pointer; user-select: none; font-size: 12.8px; font-weight: 700; padding: 5px 12px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.chip:hover { border-color: var(--accent); }
.chip.on { background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: var(--accent); color: var(--accent); }

/* readouts */
.readouts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-top: 14px; }
.ro { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.ro .rv { font-family: var(--mono); font-size: 19px; font-weight: 700; color: var(--accent); line-height: 1.2;
  font-variant-numeric: tabular-nums; }
.ro .rl { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3); font-weight: 700; margin-top: 3px; }
.ro.warn .rv { color: var(--warn); }
.ro.danger .rv { color: var(--danger); }
.ro.ok .rv { color: var(--ok); }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12.8px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---------- 14. Labs / challenges ---------- */
.lab {
  margin: 28px 0; border: 1px solid var(--line); border-left: 3px solid var(--c3); border-radius: var(--r); overflow: hidden;
  background: var(--surface);
}
.lab > .lh {
  background: rgba(180,83,9,.05);
  padding: 12px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.lab > .lh .ttl { font-weight: 700; color: var(--ink); font-size: 15.4px; }
.lab > .lb { padding: 17px 19px; }
.lab .goal { background: var(--surface-2); border-left: 3px solid var(--c3); padding: 10px 14px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-bottom: 14px; font-size: 14.6px; }

/* difficulty dots */
.diff { display: inline-flex; gap: 3px; align-items: center; }
.diff i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: block; }
.diff i.on { background: var(--c3); }

/* checklists (interactive) */
.checklist { list-style: none; padding: 0; margin: 14px 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; margin-bottom: 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-size: 14.6px; }
.checklist li:hover { border-color: var(--accent); }
.checklist li:focus-visible { outline: 3px solid rgba(47,111,235,.28); outline-offset: 2px; }
.checklist li .box { flex: none; width: 19px; height: 19px; border-radius: 5px; border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 12px; color: transparent; margin-top: 2px; }
.checklist li.done { background: rgba(74,222,128,.08); border-color: rgba(74,222,128,.4); }
.checklist li.done .box { background: var(--ok); border-color: var(--ok); color: #062a12; }
.checklist li.done .box::after { content: "✓"; color: #062a12; font-weight: 900; }
.checklist li.done span:last-child { color: var(--ink-3); text-decoration: line-through; }

/* ---------- 15. Steps / timeline ---------- */
.steps { list-style: none; padding: 0; margin: 20px 0; position: relative; }
.steps::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.steps > li { position: relative; padding-left: 46px; margin-bottom: 20px; }
.steps > li::before {
  content: counter(list-item); position: absolute; left: 4px; top: 0; width: 25px; height: 25px; border-radius: 50%;
  background: var(--surface-3); border: 2px solid var(--accent); color: var(--accent);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 800;
}
.steps > li > b, .steps > li > strong { display: block; color: var(--ink); margin-bottom: 3px; }

/* ---------- 16. Accordion (FAQ / interview Q&A) ---------- */
details.acc {
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  margin-bottom: 9px; overflow: hidden;
}
details.acc > summary {
  cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--ink); list-style: none;
  display: flex; align-items: center; gap: 10px; font-size: 14.8px;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::before { content: "▸"; color: var(--accent); font-size: 13px; transition: transform .16s; flex: none; }
details.acc[open] > summary::before { transform: rotate(90deg); }
details.acc[open] > summary { background: var(--surface-2); border-bottom: 1px solid var(--line); }
details.acc .body { padding: 14px 17px 4px; }
details.acc .body > *:last-child { margin-bottom: 12px; }

/* ---------- 17. Glossary / definition list ---------- */
.dl { display: grid; gap: 0; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.dl > div { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 0; border-bottom: 1px solid var(--line-soft); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { padding: 11px 15px; font-weight: 700; color: var(--accent); background: var(--surface-2); font-size: 14.2px; margin: 0; }
.dl dd { padding: 11px 15px; margin: 0; color: var(--ink-2); font-size: 14.4px; }
@media (max-width: 620px) { .dl > div { grid-template-columns: 1fr; } .dl dt { border-bottom: 1px solid var(--line-soft); } }

/* ---------- 18. Compare / vs table ---------- */
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.vs > div { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 15px 17px; background: var(--surface); }
.vs > div h4 { margin-top: 0; }
.vs .pro { border-left: 3px solid var(--ok); }
.vs .con { border-left: 3px solid var(--danger); }
@media (max-width: 640px) { .vs { grid-template-columns: 1fr; } }

/* ---------- 19. Progress ---------- */
.prog { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.prog > i { display: block; height: 100%; width: 0; border-radius: 4px;
  background: var(--accent); transition: width .35s ease; }
.prog-lbl { font-size: 11.6px; color: var(--ink-3); font-weight: 700; margin-bottom: 5px;
  display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: .7px; }

/* ---------- 20. Quiz ---------- */
.quiz { margin: 26px 0; }
.quiz-resume {
  margin: 0 0 18px; padding: 13px 16px; border: 1px solid rgba(47,111,235,.28);
  border-left: 3px solid var(--accent); border-radius: var(--r-sm);
  background: rgba(47,111,235,.07); color: var(--ink-2); font-size: 14px;
}
.quiz-resume strong { color: var(--ink); }
.qcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 22px; margin-bottom: 18px; position: relative;
}
.qcard .qnum { font-family: var(--mono); font-size: 11.6px; font-weight: 700; color: var(--accent-2);
  letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.qcard .qtext { font-size: 16.6px; color: var(--ink); font-weight: 600; line-height: 1.6; margin-bottom: 15px; }
.qcard .qtext code { font-weight: 400; }
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer;
  padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); font-size: 15px; color: var(--ink-2); transition: all .13s ease;
}
.opt:hover { border-color: var(--accent); background: var(--surface-3); }
.opt .mk { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: var(--ink-3); margin-top: 1px; }
.opt.multi .mk { border-radius: 6px; }
.opt.sel { border-color: var(--accent); background: rgba(47,111,235,.08); color: var(--ink); }
.opt.sel .mk { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt.correct { border-color: var(--ok); background: rgba(21,128,61,.09); color: var(--ink); }
.opt.correct .mk { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--danger); background: rgba(190,18,60,.07); }
.opt.wrong .mk { background: var(--danger); border-color: var(--danger); color: #fff; }
.opt.locked { cursor: default; }
.qnum-in { display: flex; gap: 10px; align-items: center; max-width: 340px; }
.qnum-in input { max-width: 170px; font-family: var(--mono); }
.qnum-in .unit { color: var(--ink-3); font-size: 14px; }
.expl {
  margin-top: 14px; padding: 13px 16px; border-radius: var(--r-sm); font-size: 14.6px;
  background: var(--surface-2); border-left: 3px solid var(--accent); display: none;
}
.expl.show { display: block; }
.expl b { color: var(--ink); }
.qres { font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.qres.ok { background: rgba(21,128,61,.12); color: var(--ok); }
.qres.no { background: rgba(190,18,60,.1); color: var(--danger); }

/* order/sort question */
.sortlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.sortlist li { display: flex; align-items: center; gap: 11px; padding: 10px 13px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14.6px; cursor: grab; }
.sortlist li.dragging { opacity: .4; }
.sortlist li .grip { color: var(--ink-3); font-size: 15px; }
.sortlist li .idx { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 700; width: 16px; }
.sortlist li.correct { border-color: var(--ok); background: rgba(21,128,61,.08); }
.sortlist li.wrong { border-color: var(--danger); background: rgba(190,18,60,.07); }

/* scoreboard */
.score {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px; text-align: center;
  background: var(--surface); box-shadow: var(--shadow);
  margin: 26px 0; display: none;
}
.score.show { display: block; }
.score .pct { font-size: 62px; font-weight: 800; line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums; }
.score .verdict { font-size: 21px; font-weight: 800; margin: 10px 0 4px; }
.score.pass .verdict { color: var(--ok); }
.score.fail .verdict { color: var(--warn); }
.score .brk { display: flex; justify-content: center; gap: 26px; margin-top: 18px; flex-wrap: wrap; }
.score .brk div { font-size: 13px; color: var(--ink-3); }
.score .brk div b { display: block; font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* sticky quiz bar */
.qbar {
  position: sticky; bottom: 0; z-index: 40; margin-top: 26px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 17px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; box-shadow: var(--shadow);
}
.qbar .qcount { font-size: 13.4px; color: var(--ink-2); font-weight: 600; }
.qbar .prog { flex: 1; min-width: 120px; }
.qbar .qsave { font-size: 11.7px; color: var(--ok); font-weight: 700; white-space: nowrap; }

/* ---------- 21. Lesson chrome ---------- */
.lessonhead { margin-bottom: 26px; }
.lessonhead .crumb { font-size: 12.6px; color: var(--ink-3); font-weight: 600; margin-bottom: 10px; }
.lessonhead .crumb a { color: var(--ink-2); }
.objectives { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0; padding: 16px 20px; margin: 22px 0; }
.objectives h4 { margin: 0 0 9px; font-size: 12.4px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent); }
.objectives ul { margin: 0; padding-left: 1.2em; }

.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 54px;
  padding-top: 22px; border-top: 1px solid var(--line-soft); }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 12px 17px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); max-width: 47%; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a .d { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.pager a .t { font-weight: 700; color: var(--ink); font-size: 14.6px; }
.pager a.next { text-align: right; margin-left: auto; }

/* key-takeaways */
.takeaways { background: rgba(47,111,235,.045);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); padding: 19px 22px; margin: 30px 0; }
.takeaways h4 { margin: 0 0 11px; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent-ink); }
.takeaways ol { margin: 0; padding-left: 1.25em; }
.takeaways li { color: var(--ink); margin-bottom: 7px; }

/* judge-answer / interview drill */
.drill { border: 1px solid var(--line); border-left: 3px solid var(--c3); border-radius: var(--r); padding: 17px 20px; margin: 24px 0;
  background: rgba(180,83,9,.04); }
.drill h4 { margin-top: 0; color: var(--warn); font-size: 13px; letter-spacing: 1.1px; text-transform: uppercase; }

/* footer */
.foot { margin-top: 70px; padding: 26px 0 10px; border-top: 1px solid var(--line-soft);
  font-size: 13.2px; color: var(--ink-3); }
.foot a { color: var(--ink-2); }

/* ---------- 22. Reveal-on-scroll ---------- */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 23. Misc helpers ---------- */
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.mt2 { margin-top: 22px; } .mb2 { margin-bottom: 22px; }
.hide { display: none !important; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.swatch { display: inline-block; width: 13px; height: 13px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }

/* ---------- 24. Academy training hub ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: 10px; z-index: 200; transform: translateY(-150%);
  background: var(--ink); color: #fff; border-radius: 8px; padding: 8px 13px; font-weight: 700;
}
.skip-link:focus { transform: none; }
:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid rgba(47,111,235,.35); outline-offset: 3px;
}

.academy-hub { background: #f7f9fc; }
.academy-hub main { padding: 0 clamp(16px, 3vw, 42px) 80px; }
.academy-hub .wide { max-width: 1320px; }
.academy-hub h2 { border: 0; padding: 0; margin: 0; }
.academy-hub h3 { margin-top: 0; }
.academy-hub section { scroll-margin-top: 88px; }
.academy-hub .eyebrow,
.academy-hub .kicker {
  margin: 0 0 8px; color: var(--accent-ink); font-size: 11.5px; line-height: 1.2;
  font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
}

.hub-topbar { min-height: 64px; box-shadow: 0 1px 0 rgba(16,24,40,.02); }
.hubnav { display: flex; align-items: center; gap: 2px; }
.hubnav a { color: var(--ink-2); font-size: 13.5px; font-weight: 650; padding: 7px 10px; border-radius: 8px; }
.hubnav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.hub-menu-toggle {
  display: none; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--ink); width: 38px; height: 38px; font-size: 18px; cursor: pointer;
}

.academy-hero {
  min-height: 650px; display: grid; grid-template-columns: minmax(0,.88fr) minmax(520px,1.12fr);
  align-items: center; gap: clamp(20px, 4vw, 64px); margin: 24px 0 54px;
  padding: clamp(30px, 5vw, 76px); overflow: hidden; position: relative;
  background: linear-gradient(145deg, #fff 0%, #f5f8fd 52%, #edf4ff 100%);
  border: 1px solid var(--line); border-radius: 28px;
  box-shadow: 0 24px 80px rgba(31,54,88,.08);
}
.academy-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .42;
  background-image: linear-gradient(rgba(47,111,235,.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(47,111,235,.04) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: linear-gradient(90deg, #000, transparent 58%);
}
.hero-copy { position: relative; z-index: 4; }
.academy-hero h1 {
  max-width: 690px; margin: 0 0 22px; font-size: clamp(44px, 5.4vw, 76px);
  line-height: .98; letter-spacing: -3.8px;
}
.academy-hero .lead { max-width: 610px; margin-bottom: 28px; color: var(--ink-2); font-size: 18px; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .btn, .next-mission .btn { padding: 10px 17px; min-height: 44px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 34px; }
.hero-proof span { color: var(--ink-3); font-size: 12.5px; }
.hero-proof strong { display: block; color: var(--ink); font-size: 20px; line-height: 1.15; }

.hero-visual {
  --tilt-x: 0deg; --tilt-y: 0deg;
  position: relative; z-index: 2; min-height: 450px; align-self: stretch;
  perspective: 1100px; transform-style: preserve-3d;
}
.hero-visual img {
  position: absolute; z-index: 1; width: 150%; max-width: none; height: 112%; left: -33%; top: -6%;
  object-fit: cover; object-position: 70% center; border-radius: 22px;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateZ(0);
  transition: transform .16s ease-out; filter: saturate(.97) contrast(1.02);
  box-shadow: 0 30px 70px rgba(35,64,102,.16);
}
.hero-visual::after {
  content: ""; position: absolute; z-index: 2; inset: 0;
  background: linear-gradient(90deg, #f7f9fd 0%, rgba(247,249,253,.45) 18%, transparent 47%);
  pointer-events: none;
}
.hero-orbit {
  position: absolute; z-index: 3; border: 1px dashed rgba(47,111,235,.42); border-radius: 50%;
  transform-style: preserve-3d; pointer-events: none;
}
.orbit-one { width: 250px; height: 95px; right: 3%; top: 15%; transform: rotate(-9deg); animation: orbitFloat 7s ease-in-out infinite; }
.orbit-two { width: 150px; height: 55px; left: 15%; bottom: 12%; transform: rotate(14deg); animation: orbitFloat 5.5s ease-in-out -2s infinite reverse; }
.hero-scan {
  position: absolute; z-index: 3; top: 8%; right: 20%; width: 1px; height: 82%;
  background: linear-gradient(transparent, rgba(47,111,235,.65), transparent);
  box-shadow: 0 0 18px rgba(47,111,235,.45); animation: scan 5.8s ease-in-out infinite;
}
.visual-label {
  position: absolute; z-index: 4; padding: 5px 9px; background: rgba(255,255,255,.9);
  border: 1px solid rgba(47,111,235,.24); border-radius: 6px; color: var(--accent-ink);
  font-family: var(--mono); font-size: 10px; font-weight: 800; letter-spacing: 1.2px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px); animation: labelFloat 4.5s ease-in-out infinite;
}
.label-build { right: 3%; bottom: 23%; }
.label-test { left: 13%; top: 22%; animation-delay: -1.5s; }
.label-explain { right: 21%; top: 7%; animation-delay: -3s; }
@keyframes orbitFloat { 50% { transform: rotate(-4deg) translate3d(0,-13px,18px); } }
@keyframes scan { 0%,100% { transform: translateX(-80px); opacity: .15; } 50% { transform: translateX(100px); opacity: .75; } }
@keyframes labelFloat { 50% { transform: translateY(-7px) translateZ(24px); } }

.section-intro {
  display: flex; justify-content: space-between; align-items: end; gap: 34px; margin-bottom: 23px;
}
.section-intro h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -2px; }
.section-intro > p { max-width: 520px; margin: 0; color: var(--ink-3); font-size: 14.5px; }

.training-board { margin-bottom: 76px; }
.mission-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(330px,.65fr); gap: 16px; }
.next-mission,
.training-score {
  border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow);
}
.next-mission {
  position: relative; overflow: hidden; padding: clamp(26px, 4vw, 44px);
  background: linear-gradient(135deg, #0d1b33, #122849 60%, #16345e); color: #fff;
}
.next-mission::after {
  content: ""; position: absolute; width: 340px; height: 340px; right: -130px; top: -150px;
  border: 1px solid rgba(96,165,250,.22); border-radius: 50%; box-shadow: 0 0 0 45px rgba(96,165,250,.045), 0 0 0 90px rgba(96,165,250,.025);
}
.mission-kicker { color: #a9c7ff; text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: 1.3px; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #5eead4; box-shadow: 0 0 0 0 rgba(94,234,212,.5); animation: missionPulse 2.3s infinite; }
@keyframes missionPulse { 65% { box-shadow: 0 0 0 8px rgba(94,234,212,0); } }
.mission-path { color: #9fb0d4; margin: 27px 0 5px; font-size: 13px; }
.next-mission h3 { position: relative; z-index: 1; max-width: 760px; margin: 0 0 11px; color: #fff; font-size: clamp(26px, 3.2vw, 39px); letter-spacing: -1.3px; }
.next-mission > p:not(.mission-path) { position: relative; z-index: 1; max-width: 720px; color: #c7d4ec; }
.mission-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 23px 0; }
.mission-meta span { color: #bfcee7; border: 1px solid rgba(191,206,231,.25); border-radius: 999px; padding: 3px 9px; font-size: 11.5px; }
.next-mission .btn { position: relative; z-index: 1; background: #fff; color: #10213c; border-color: #fff; }
.next-mission .btn:hover { background: #eef5ff; }

.training-score { display: grid; grid-template-columns: 110px 1fr; align-content: center; gap: 12px 22px; padding: 28px; }
.training-score h3 { margin: 2px 0 7px; font-size: 20px; }
.training-score p { margin: 0; font-size: 13.5px; }
.score-ring {
  --progress: 0; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--progress) * 1%), var(--surface-3) 0);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; width: 80px; height: 80px; border-radius: 50%; background: #fff; }
.score-ring span { position: relative; z-index: 1; color: var(--ink); font-size: 22px; font-weight: 800; }
.score-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 13px 0 0; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.score-stats div { min-width: 0; }
.score-stats dt { min-height: 32px; color: var(--ink-3); font-size: 10.5px; line-height: 1.35; text-transform: uppercase; letter-spacing: .55px; }
.score-stats dd { margin: 4px 0 0; font-size: 23px; font-weight: 800; }

.paths-section { margin-bottom: 78px; }
.path-picker { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin-bottom: 16px; }
.path-choice {
  display: flex; align-items: center; gap: 11px; min-height: 72px; padding: 11px 13px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink-2); cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.path-choice:hover { transform: translateY(-2px); border-color: #aabedc; box-shadow: var(--shadow); }
.path-choice.active { border-color: var(--accent); background: #f5f8ff; box-shadow: 0 0 0 1px var(--accent); }
.path-mark { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); color: var(--accent-ink); font-family: var(--mono); font-size: 11px; font-weight: 800; }
.path-choice.active .path-mark { background: var(--accent); color: #fff; }
.path-choice strong { display: block; color: var(--ink); font-size: 13px; line-height: 1.3; }
.path-choice small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 10.5px; }
.roadmap-shell { padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.roadmap-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.roadmap-head h3 { margin: 0; font-size: 28px; letter-spacing: -1px; }
.roadmap-head > p { max-width: 520px; margin: 0; font-size: 14px; }
.roadmap { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin: 28px 0 0; padding: 0; list-style: none; }
.roadmap-step { margin: 0; }
.roadmap-step > a,
.roadmap-step > span:first-child { text-decoration: none; }
.roadmap-step > a,
.roadmap-step:not(:has(> a)) {
  display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px;
  min-height: 70px; padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: 11px; color: var(--ink);
  transition: background .15s ease, border-color .15s ease;
}
.roadmap-step > a:hover { background: var(--surface-2); border-color: #bac7da; text-decoration: none; }
.step-node { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-3); font-size: 12px; font-weight: 800; }
.roadmap-step.passed .step-node { background: rgba(21,128,61,.1); border-color: rgba(21,128,61,.3); color: var(--ok); }
.roadmap-step.started .step-node { background: rgba(47,111,235,.1); border-color: rgba(47,111,235,.3); color: var(--accent); }
.step-copy { min-width: 0; }
.step-copy small { display: block; color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: .65px; }
.step-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.step-time { color: var(--ink-3); font-size: 11px; white-space: nowrap; }
.roadmap-step.locked { opacity: .58; }
.roadmap-note { margin: 24px 0 0; padding: 14px 16px; border-left: 3px solid var(--accent); background: #f6f9ff; border-radius: 0 8px 8px 0; font-size: 13px; }

.practice-section { display: grid; grid-template-columns: 1.02fr .98fr; align-items: stretch; overflow: hidden; margin-bottom: 78px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.practice-photo { position: relative; min-height: 520px; overflow: hidden; background: #dce4ef; }
.practice-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.practice-section:hover .practice-photo img { transform: scale(1.025); }
.photo-caption { position: absolute; left: 18px; bottom: 18px; max-width: calc(100% - 36px); padding: 7px 10px; color: #fff; background: rgba(9,17,30,.82); border-radius: 7px; font-size: 11.5px; backdrop-filter: blur(8px); }
.practice-copy { padding: clamp(28px, 5vw, 60px); }
.practice-copy h2 { margin-bottom: 28px; font-size: clamp(30px, 4vw, 48px); line-height: 1.07; letter-spacing: -2px; }
.practice-loop { position: relative; padding: 0; margin: 0; list-style: none; }
.practice-loop::before { content: ""; position: absolute; left: 18px; top: 24px; bottom: 34px; width: 1px; background: var(--line); }
.practice-loop li { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 14px; margin: 0 0 18px; }
.practice-loop li > span { z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #bed0ed; border-radius: 50%; color: var(--accent-ink); background: #f6f9ff; font-family: var(--mono); font-size: 10px; font-weight: 800; }
.practice-loop strong { color: var(--ink); font-size: 14.5px; }
.practice-loop p { margin: 3px 0 0; font-size: 13px; line-height: 1.55; }

.field-story { margin-bottom: 78px; }
.story-grid { display: grid; grid-template-columns: .82fr 1fr 1.18fr; gap: 13px; perspective: 1200px; }
.story-card {
  position: relative; min-height: 430px; margin: 0; overflow: hidden; border: 1px solid var(--line);
  border-radius: 18px; background: #dfe6f0; box-shadow: var(--shadow);
  transform: rotateY(0) rotateX(0); transform-style: preserve-3d;
  transition: transform .28s ease, box-shadow .28s ease;
}
.story-card:hover { transform: rotateX(1.5deg) translateY(-5px); box-shadow: 0 22px 46px rgba(19,42,76,.14); }
.story-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.story-card:hover img { transform: scale(1.035); }
.story-cad { background: linear-gradient(145deg,#f8fafc,#dbe4ef); }
.story-cad img { object-fit: contain; padding: 22px; }
.story-card::after { content: ""; position: absolute; inset: 38% 0 0; background: linear-gradient(transparent,rgba(6,13,25,.9)); pointer-events: none; }
.story-card figcaption { position: absolute; z-index: 2; left: 19px; right: 19px; bottom: 18px; color: #fff; transform: translateZ(28px); }
.story-card figcaption span { display: inline-block; margin-bottom: 7px; color: #9fc0ff; font-family: var(--mono); font-size: 10px; font-weight: 800; }
.story-card figcaption strong { display: block; color: #fff; font-size: 18px; }
.story-card figcaption small { display: block; margin-top: 3px; color: #d0d8e5; font-size: 11.5px; line-height: 1.45; }

.systems-section { margin-bottom: 78px; }
.systems-section .viz { margin-top: 0; box-shadow: 0 20px 60px rgba(13,27,51,.09); }

.catalog-section { margin-bottom: 30px; }
.catalog-intro { margin-bottom: 17px; }
.filterbar {
  position: sticky; top: 64px; z-index: 50; display: flex; align-items: end; justify-content: space-between; gap: 18px;
  margin: 0 0 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255,255,255,.9); box-shadow: 0 5px 24px rgba(23,43,77,.05); backdrop-filter: blur(14px);
}
.filter-group { min-width: 0; }
.filter-label { display: block; margin: 0 0 6px 3px; color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: .9px; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  border: 1px solid transparent; border-radius: 999px; padding: 5px 9px; background: transparent;
  color: var(--ink-2); font: inherit; font-size: 11.5px; line-height: 1.2; cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip.on { color: var(--accent-ink); background: #eef4ff; border-color: #b8cdf2; font-weight: 750; }
.search-field { position: relative; display: block; flex: 0 1 280px; }
.search-field svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.search-field input { width: 100%; height: 40px; padding: 8px 12px 8px 35px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 12.5px; }
.search-field input::placeholder { color: #9299a6; }
.catalog-progress { display: grid; grid-template-columns: auto minmax(160px,360px); justify-content: end; align-items: center; gap: 14px; margin: 12px 2px 28px; }
.catalog-progress > div:first-child { display: flex; gap: 8px; color: var(--ink-3); font-size: 11.5px; }
.catalog-progress strong { color: var(--ink-2); }
.trackhead { display: flex; align-items: baseline; gap: 14px; margin: 42px 0 13px; }
.trackhead h3 { margin: 0; font-size: 23px; }
.trackhead p { margin: 0; color: var(--ink-3); font-size: 13px; }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.academy-hub .ccard { min-height: 286px; padding: 20px; border-radius: 14px; }
.academy-hub .ccard h3 { font-size: 17px; line-height: 1.3; }
.academy-hub .ccard p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.academy-hub .ccard.started::before { opacity: 1; }
.academy-hub .ccard.passed::before { opacity: 1; background: var(--ok); }
.academy-hub .ccard .cfoot { border-top: 1px solid var(--line-soft); }
.course-duration { margin-right: auto; color: var(--ink-3); font-size: 11.5px; font-weight: 700; }
.card-action { margin-top: 4px; color: var(--accent-ink); font-size: 12px; font-weight: 750; }
.catalog-empty { padding: 42px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; background: #fff; }
.catalog-empty p { margin: 5px 0 0; font-size: 13px; }
.catalog-tools { display: flex; justify-content: flex-end; margin-top: 28px; }
.hub-notice { display: flex; gap: 10px 18px; margin: 20px 0 -4px; padding: 12px 16px; border: 1px solid #e8c891; border-radius: 10px; background: #fff9ee; font-size: 13px; }
.hub-notice span { color: var(--ink-2); }
.academy-foot { margin-top: 70px; }

@media (max-width: 1080px) {
  .academy-hero { grid-template-columns: .9fr 1.1fr; min-height: 570px; padding: 40px; }
  .academy-hero h1 { font-size: clamp(42px, 6vw, 62px); }
  .path-picker { grid-template-columns: repeat(3,1fr); }
  .course-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .hub-menu-toggle { display: grid; place-items: center; margin-left: auto; }
  .hubnav {
    display: none; position: absolute; left: 12px; right: 12px; top: calc(100% + 7px); padding: 8px;
    border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.98); box-shadow: var(--shadow-lg);
  }
  .hubnav.open { display: grid; }
  .hubnav a { padding: 10px 12px; }
  .academy-hero { grid-template-columns: 1fr; padding: 42px 28px 0; }
  .academy-hero::before { mask-image: linear-gradient(#000, transparent 60%); }
  .hero-visual { min-height: 400px; }
  .hero-visual img { width: 128%; height: 108%; left: -14%; top: 0; }
  .mission-grid { grid-template-columns: 1fr; }
  .practice-section { grid-template-columns: 1fr; }
  .practice-photo { min-height: 390px; }
  .story-grid { grid-template-columns: 1fr 1fr; }
  .story-card { min-height: 360px; }
  .story-compete { grid-column: 1 / -1; min-height: 450px; }
  .roadmap-head, .section-intro { align-items: start; flex-direction: column; gap: 9px; }
}

@media (max-width: 620px) {
  .academy-hub main { padding-inline: 10px; }
  .academy-hero { min-height: 0; margin-top: 10px; padding: 34px 21px 0; border-radius: 19px; }
  .academy-hero h1 { font-size: 43px; letter-spacing: -2.4px; }
  .academy-hero .lead { font-size: 16px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-proof { gap: 13px; }
  .hero-proof span { flex: 1 1 28%; }
  .hero-visual { min-height: 300px; margin-inline: -21px; overflow: hidden; }
  .hero-visual img { width: 145%; height: 105%; left: -20%; border-radius: 0; }
  .label-test { left: 8%; }
  .section-intro h2, .practice-copy h2 { font-size: 34px; letter-spacing: -1.4px; }
  .training-board, .paths-section, .practice-section, .systems-section { margin-bottom: 58px; }
  .training-score { grid-template-columns: 88px 1fr; padding: 22px 18px; }
  .score-ring { width: 84px; height: 84px; }
  .score-ring::before { width: 65px; height: 65px; }
  .score-ring span { font-size: 18px; }
  .path-picker { grid-template-columns: 1fr 1fr; }
  .path-choice { min-height: 68px; }
  .roadmap { grid-template-columns: 1fr; }
  .roadmap-head { align-items: start; }
  .roadmap-step > a, .roadmap-step:not(:has(> a)) { grid-template-columns: 38px minmax(0,1fr); }
  .step-time { display: none; }
  .practice-photo { min-height: 280px; }
  .practice-copy { padding: 29px 22px; }
  .field-story { margin-bottom: 58px; }
  .story-grid { grid-template-columns: 1fr; }
  .story-card, .story-compete { grid-column: auto; min-height: 340px; }
  .filterbar { top: 63px; align-items: stretch; flex-direction: column; }
  .search-field { flex-basis: auto; max-width: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .chip { white-space: nowrap; }
  .catalog-progress { grid-template-columns: 1fr; gap: 7px; }
  .catalog-progress > div:first-child { justify-content: space-between; }
  .course-grid { grid-template-columns: 1fr; }
  .academy-hub .ccard { min-height: 0; }
  .trackhead { align-items: start; flex-direction: column; gap: 2px; }
  .hub-notice { flex-direction: column; }
}

/* ---------- 25. Print ---------- */
@media print {
  body { background: #fff; color: #111; }
  body::before, .topbar, .sidebar, .readbar, .qbar, .pager { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  main { padding: 0; }
  .card, .callout, .viz, .lab, figure.figure { border-color: #ccc; background: #fff; }
  figure.figure > img, figure.figure .duo img { border-color: #ccc; }
  figure.figure > figcaption .capt { color: #222; }
  figure.figure > figcaption .credit { color: #666; }
  a { color: #06c; }
}

/* --- account links (appended by site-chrome.mjs) --- */
.hub-account { flex: none; }
.hub-account a { white-space: nowrap; }
@media (max-width: 820px) {
  /* Stays in the bar on phones instead of collapsing into the menu. */
  .hubnav.hub-account { display: flex; position: static; padding: 0; border: 0; background: none; box-shadow: none; }
  .hubnav.hub-account a { padding: 7px 8px; }
  .hub-menu-toggle { margin-left: 4px; }
}
@media (max-width: 620px) { .hubnav.hub-account a { padding: 7px 6px; font-size: 13px; } }
