/* /free-courses (seo/pages/free_courses.py, templates/free_courses.html; owner-approved design round 2, R4.1).
 *
 * ONE TYPE SCALE, the site's tokens, the same size for the same role everywhere on the page:
 *   H1 the page name   --fs-h1 (40 → 30)   800    .fc-h1       "Free courses": the largest text on the page
 *   hero subheading    --fs-sub (24 → 20)  600    .fc-tagline  (smaller than the H1, larger than the lede)
 *   H2 section         --fs-h2 (28 → 24)   700    .fc-h2       (also the closing band's title)
 *   sub / lede         --fs-lead 16        500    .fc-sub, .fc-lede
 *   H3 tile / card     --fs-lead 16        700    .fc-h3       (rank cards, subject tiles)
 *   course card title  --fs-md 14.5        700    (the shared courseCard, the H4 tile role)
 *   body, links        --fs-md 14.5        500-600
 *   meta, chips, rank share  --fs-sm 13.5  600
   nothing on the page is smaller than --fs-sm: a course card's provider, meta, description and
   badges are lifted to it here (the shared card uses --fs-xs elsewhere)
 *   figures            --fs-figure (26 → 22) 800
 * NO EYEBROWS (owner, 14 Nov): nothing small sits above a bigger heading; the order is always title > sub-line > body.
 * RHYTHM (owner, 15 Nov: "spacing is not adequate"): a section is 48px top and bottom (36 on phones), so 96 (72)
 *   between sections; a head's sub-line sits 8px under its title and the head 24px (20) above its content; cards and
 *   tiles are 20px apart (12 on phones) with 20px inside (16).
 * COLOUR: six hue pairs (fc-c0..5: violet, blue, mint, pink, amber, teal), each a tint + a dark ink
 * (AA on the tint) + a strong mark colour, redefined for dark mode. Bands use the palette's violet / mint
 * band tokens. Text is always an ink token (no grey). */

.fc-page { --fc-pad: 48px; --fc-gap: 20px; --fc-in: 20px; }
.fc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fc-wrap { max-width: 1180px; margin: 0 auto; }

/* ---- hues ---- */
.fc-page {
  --fc-h0-bg: #EEE7FF; --fc-h0-ink: #3B1F91; --fc-h0-mark: #6A45E0;
  --fc-h1-bg: #E1EBFF; --fc-h1-ink: #183577; --fc-h1-mark: #2F64D9;
  --fc-h2-bg: #DCF4E8; --fc-h2-ink: #134A36; --fc-h2-mark: #1E8C62;
  --fc-h3-bg: #FBE2F0; --fc-h3-ink: #721A51; --fc-h3-mark: #C53D8E;
  --fc-h4-bg: #FFF0CB; --fc-h4-ink: #573A00; --fc-h4-mark: #C28A00;
  --fc-h5-bg: #D8F1F5; --fc-h5-ink: #0F4E59; --fc-h5-mark: #1B8DA0;
  --fc-art-tile: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fc-page {
    --fc-h0-bg: #2B1E55; --fc-h0-ink: #ECE4FF; --fc-h0-mark: #A88BFF;
    --fc-h1-bg: #172A55; --fc-h1-ink: #DFE9FF; --fc-h1-mark: #7EA6FF;
    --fc-h2-bg: #113629; --fc-h2-ink: #D5F6E7; --fc-h2-mark: #4FD49D;
    --fc-h3-bg: #3C1530; --fc-h3-ink: #FCDFEF; --fc-h3-mark: #F07DC0;
    --fc-h4-bg: #372A09; --fc-h4-ink: #FFEDC4; --fc-h4-mark: #F2C04A;
    --fc-h5-bg: #0E3540; --fc-h5-ink: #D4F2F7; --fc-h5-mark: #5BCFE2;
    --fc-art-tile: #F6F3FF;
  }
}
:root[data-theme="dark"] .fc-page {
  --fc-h0-bg: #2B1E55; --fc-h0-ink: #ECE4FF; --fc-h0-mark: #A88BFF;
  --fc-h1-bg: #172A55; --fc-h1-ink: #DFE9FF; --fc-h1-mark: #7EA6FF;
  --fc-h2-bg: #113629; --fc-h2-ink: #D5F6E7; --fc-h2-mark: #4FD49D;
  --fc-h3-bg: #3C1530; --fc-h3-ink: #FCDFEF; --fc-h3-mark: #F07DC0;
  --fc-h4-bg: #372A09; --fc-h4-ink: #FFEDC4; --fc-h4-mark: #F2C04A;
  --fc-h5-bg: #0E3540; --fc-h5-ink: #D4F2F7; --fc-h5-mark: #5BCFE2;
  --fc-art-tile: #F6F3FF;
}
.fc-c0 { --tile-mark: #6A45E0; --bg: var(--fc-h0-bg); --ink-h: var(--fc-h0-ink); --mark: var(--fc-h0-mark); }
.fc-c1 { --tile-mark: #2F64D9; --bg: var(--fc-h1-bg); --ink-h: var(--fc-h1-ink); --mark: var(--fc-h1-mark); }
.fc-c2 { --tile-mark: #1A7F59; --bg: var(--fc-h2-bg); --ink-h: var(--fc-h2-ink); --mark: var(--fc-h2-mark); }
.fc-c3 { --tile-mark: #B8327F; --bg: var(--fc-h3-bg); --ink-h: var(--fc-h3-ink); --mark: var(--fc-h3-mark); }
.fc-c4 { --tile-mark: #946400; --bg: var(--fc-h4-bg); --ink-h: var(--fc-h4-ink); --mark: var(--fc-h4-mark); }
.fc-c5 { --tile-mark: #16808F; --bg: var(--fc-h5-bg); --ink-h: var(--fc-h5-ink); --mark: var(--fc-h5-mark); }

/* ---- type ---- */
.fc-h1 { margin: 0; font-family: var(--font-display); font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 800; letter-spacing: var(--ls-h1); color: var(--ink-heading); text-wrap: balance; }
.fc-tagline { margin: 12px 0 0; font-family: var(--font-display); font-size: var(--fs-sub); line-height: var(--lh-h2); font-weight: 600; letter-spacing: var(--ls-h2); color: var(--ink-heading); text-wrap: balance; }
.fc-h2 { margin: 0; font-family: var(--font-display); font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 700; letter-spacing: var(--ls-h2); color: var(--ink-heading); text-wrap: balance; }
.fc-h3 { margin: 0; font-size: var(--fs-lead); line-height: 1.35; font-weight: 700; color: inherit; }
.fc-sub, .fc-lede { margin: 8px 0 0; font-size: var(--fs-lead); line-height: 1.5; font-weight: 500; color: var(--ink); max-width: 68ch; }
.fc-lede { margin-top: 16px; }

/* ---- sections and bands ---- */
.fc-sec { padding: var(--fc-pad) 24px; }
.fc-band--violet { background: var(--band-violet-bg); }
.fc-band--mint { background: var(--band-mint-bg); }
.fc-band--violet .fc-h2 { color: var(--band-violet-heading); }
.fc-band--mint .fc-h2 { color: var(--band-mint-heading); }
.fc-band--violet .fc-sub { color: var(--band-violet-ink); }
.fc-band--mint .fc-sub { color: var(--band-mint-ink); }
.fc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.fc-more { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: var(--fs-md); font-weight: 700; color: var(--accent-deep); text-decoration: none; white-space: nowrap; }
.fc-band--violet .fc-more { color: var(--band-violet-link); }
.fc-band--mint .fc-more { color: var(--band-mint-link); }
.fc-more:hover { text-decoration: underline; }

/* ---- hero ---- */
.fc-hero { padding: 40px 24px 48px; background: var(--wash-hero); }
.fc-hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 16px 40px; align-items: center; }
.fc-search { display: flex; align-items: center; gap: 8px; margin-top: 28px; padding: 6px 6px 6px 16px; max-width: 620px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--pill); box-shadow: var(--shadow); }
.fc-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.fc-search__ic { display: inline-flex; color: var(--accent-deep); }
.fc-search input[type=search] { flex: 1; min-width: 0; padding: 12px 4px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-lead); font-weight: 600; }
.fc-search input::placeholder { color: var(--sub); opacity: 1; }
.fc-search .xbtn { border-radius: var(--pill); }
.fc-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; }
.fc-chips__label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.fc-chip { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: 5px 12px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.fc-chip:hover { border-color: var(--accent); color: var(--accent-deep); }

.fc-hero__art { position: relative; height: 320px; }
.fc-hero__blob { position: absolute; inset: 18px 30px; border-radius: 46% 54% 52% 48% / 52% 44% 56% 48%;
  background: radial-gradient(circle at 35% 30%, var(--fc-h5-bg), transparent 60%), radial-gradient(circle at 70% 70%, var(--fc-h3-bg), transparent 60%), var(--fc-h0-bg); }

.fc-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 24px 0 0; padding: 0; list-style: none; }
.fc-stats li { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px; border-radius: var(--r-lg); background: var(--bg); color: var(--ink-h); }
.fc-stats__ic { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 12px; background: var(--fc-art-tile); color: var(--tile-mark); }
.fc-stats li > span:last-child { display: grid; }
.fc-stats b { font-size: var(--fs-figure); line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.fc-stats li > span:last-child > span { font-size: var(--fs-sm); font-weight: 600; }

/* ---- demand: #1 large, then 8 ranking cards ---- */
.fc-ranks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr); gap: var(--fc-gap); }
.fc-ranks__rest { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--fc-gap); margin: 0; padding: 0; list-style: none; }
.fc-ranks__rest > li { display: flex; }
.fc-rank { position: relative; display: flex; flex-direction: column; gap: 10px; width: 100%; padding: var(--fc-in); border-radius: var(--r-lg);
  background: var(--bg); color: var(--ink-h); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out); }
.fc-rank:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fc-rank:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fc-rank__top { display: flex; align-items: center; justify-content: space-between; }
.fc-rank__ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--fc-art-tile); }
.fc-rank__pos { font-size: var(--fs-sm); font-weight: 800; padding: 2px 10px; border-radius: var(--pill); background: var(--fc-art-tile); color: #3B1F91; }
.fc-bar { display: block; height: 8px; border-radius: var(--pill); background: color-mix(in srgb, var(--mark) 22%, transparent); overflow: hidden; }
.fc-bar i { display: block; height: 100%; border-radius: inherit; background: var(--mark); }
.fc-rank__share { font-size: var(--fs-sm); font-weight: 600; }
.fc-rank--lead { justify-content: center; padding: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.fc-rank--lead .fc-h3 { color: var(--ink-heading); }
.fc-rank--lead .fc-rank__fig b { color: var(--accent-deep); }
.fc-rank--lead .fc-rank__go { margin-top: 4px; }
.fc-rank--lead .fc-rank__pos { position: absolute; top: 16px; left: 16px; }
.fc-rank__art { display: grid; place-items: center; width: 120px; height: 120px; margin: 24px auto 8px; border-radius: 32px; background: var(--fc-art-tile); box-shadow: var(--shadow); }
.fc-rank__fig { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.fc-rank__fig b { display: block; font-size: var(--fs-figure); font-weight: 800; line-height: 1.1; }
.fc-rank__go { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; font-size: var(--fs-md); font-weight: 800; }
.fc-ranks .fc-rank:not(.fc-rank--lead) .fc-h3 { color: var(--ink-h); }
/* Two lines for every name, so the bars and figures line up across a row. */
.fc-ranks__rest .fc-h3 { min-height: calc(2 * 1.35em); }
.fc-rank--lead .fc-rank__pos { background: var(--accent-soft); color: var(--accent-deep); }

/* ---- subjects: illustrated tiles ---- */
.fc-subjects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--fc-gap); margin: 0; padding: 0; list-style: none; }
.fc-subject { position: relative; display: flex; flex-direction: column; gap: 12px; padding: var(--fc-in); border-radius: var(--r-lg); background: var(--bg); color: var(--ink-h); overflow: hidden; }
.fc-subject__art { display: grid; place-items: center; width: 100%; height: 108px; border-radius: 14px; background: var(--fc-art-tile); }
.fc-subject__art img { width: 84px; height: 84px; }
.fc-subject__skills { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.fc-subject__skills a { min-height: 44px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; color: var(--ink-h); font-size: var(--fs-md); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--mark) 22%, transparent); }
.fc-subject__skills li:last-child a { border-bottom: 0; }
.fc-subject__skills b { font-size: var(--fs-sm); font-weight: 800; font-variant-numeric: tabular-nums; }
.fc-subject__skills a:hover span { text-decoration: underline; }

/* ---- course shelves: the server's list (JavaScript off, and what crawlers read), then the cards ---- */
.fc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px var(--fc-gap); margin: 0; padding: 0; list-style: none; }
.fc-list li { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.fc-list a { font-size: var(--fs-md); font-weight: 700; color: var(--ink); }
.fc-list span { font-size: var(--fs-sm); color: var(--ink); }
.fc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--fc-gap); margin: 0; padding: 0; list-style: none; }
.fc-grid > li { display: flex; min-width: 0; }
.fc-page .wz-course__provider, .fc-page .wz-course__meta, .fc-page .wz-course__desc, .fc-page .wz-course__xlat, .fc-page .wz-course__badge { font-size: var(--fs-sm); }
/* At this size a meta line may take two lines rather than cut "Intermediate" short. */
.fc-page .wz-course__meta { display: flex; flex-wrap: wrap; row-gap: 2px; white-space: normal; text-overflow: clip; min-height: 0; }
.fc-page .wz-course__meta > span { white-space: nowrap; }
/* Gap-only spacing, as the job card's fact line: a wrapped line never starts with a "·". */
.fc-page .wz-course__meta { column-gap: 12px; }
.fc-page .wz-course__meta > span + span::before { content: none; }

/* ---- filter bar: a native <details> menu per facet, each item a link into Browse (free-courses.js closes the others) ---- */
.fc-fb { position: relative; min-width: 0; padding: 14px 24px; background: var(--surface); border-block: 1px solid var(--line); }
.fc-fb__row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; min-width: 0; }
.fc-fb__label { font-size: var(--fs-md); font-weight: 700; color: var(--ink); }
.fc-fb__menus { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.fc-fb__menu { position: relative; }
.fc-fb__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; box-sizing: border-box; padding: 8px 12px 8px 16px; border-radius: var(--pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: var(--fs-md); font-weight: 700; cursor: pointer; list-style: none; user-select: none; }
.fc-fb__btn::-webkit-details-marker { display: none; }
.fc-fb__btn::marker { content: ""; }
.fc-fb__btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.fc-fb__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fc-fb__chev { flex: none; transition: transform var(--dur-1) var(--ease-out); }
.fc-fb__menu[open] > .fc-fb__btn { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }
.fc-fb__menu[open] .fc-fb__chev { transform: rotate(180deg); }
.fc-fb__panel { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; display: grid; gap: 4px; width: max-content; min-width: 240px; max-width: min(360px, calc(100vw - 32px));
  max-height: min(400px, 60vh); overflow: auto; padding: 8px; box-sizing: border-box; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg, var(--shadow)); }
.fc-fb__items { display: grid; margin: 0; padding: 0; list-style: none; }
.fc-fb__items a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; box-sizing: border-box; padding: 8px 12px; border-radius: var(--r-md);
  color: var(--ink); font-size: var(--fs-md); font-weight: 600; text-decoration: none; }
.fc-fb__items a:hover, .fc-fb__items a:focus-visible { background: var(--surface-2); color: var(--accent-deep); }
.fc-fb__items a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fc-fb__items b { flex: none; font-size: var(--fs-sm); font-weight: 800; font-variant-numeric: tabular-nums; }
.fc-fb__panel .fc-more { padding: 0 12px; border-top: 1px solid var(--line); }

.fc-fb + .fc-sec { padding-top: 56px; }

/* ---- where the courses come from: three columns, a count over logo + name rows, thin dividers ---- */
.fc-orgs { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); padding: 28px 0; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.fc-orgs__col { min-width: 0; padding: 0 28px; }
.fc-page { --fc-rule: color-mix(in srgb, var(--ink) 18%, transparent); }   /* the band's dividers: visible in dark mode too */
.fc-orgs__col + .fc-orgs__col { border-left: 1px solid var(--fc-rule); }
.fc-orgs__title { margin: 0 0 16px; font-size: var(--fs-lead); line-height: 1.3; font-weight: 700; color: var(--ink-heading); }
.fc-orgs__title b { display: block; font-family: var(--font-display); font-size: clamp(30px, 2.6vw, 36px); line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-deep); }
.fc-orgs__list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
/* Universities: two sub-columns, read down the first, then the second (as the owner's reference). */
.fc-orgs__col--universities .fc-orgs__list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(7, auto); grid-auto-flow: column; column-gap: 32px; }
.fc-orgs__list a { display: flex; align-items: center; gap: 12px; min-height: 56px; box-sizing: border-box; margin: 0 -8px; padding: 4px 8px; border-radius: var(--r-md);
  color: var(--ink); font-size: var(--fs-md); line-height: 1.3; font-weight: 600; text-decoration: none; transition: background var(--dur-1) var(--ease-out); }
.fc-orgs__list a:hover { background: var(--surface-2); }
.fc-orgs__list a:hover .fc-orgs__name { text-decoration: underline; }
.fc-orgs__list a:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.fc-orgs .lg-tile { --lg: 48px; }
.fc-orgs__name { min-width: 0; overflow-wrap: anywhere; }   /* never cut short: each is a real name */
/* Our tiles sit on white with the same inset; a monogram is one quiet tint, so the real logos stand out. */
.fc-orgs .lg-tile:not(.fc-orgs__mono) { background: var(--fc-art-tile); }
.fc-orgs .lg-tile img { box-sizing: border-box; padding: 6px; object-fit: contain; }
.fc-orgs__mono { background: var(--accent-soft); color: var(--accent-deep); }
.fc-orgs__tm { margin: 12px 0 0; font-size: var(--fs-sm); color: var(--ink); }

/* ---- closing band ---- */
.fc-cta { display: flex; align-items: center; gap: 28px; padding: 28px 36px; border-radius: 24px; background: var(--band-violet-bg); }
.fc-cta .fc-h2 { color: var(--band-violet-heading); }
.fc-cta .fc-sub { color: var(--band-violet-ink); }
.fc-cta__bot { width: 150px; height: auto; flex-shrink: 0; }
.fc-cta__text { flex: 1; }
.fc-cta__go { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ---- smaller screens ---- */
@media (max-width: 1100px) {
  .fc-orgs { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .fc-orgs__col--universities { grid-column: 1 / -1; }
  .fc-orgs__col--universities + .fc-orgs__col { border-left: 0; }
  .fc-orgs__col--universities ~ .fc-orgs__col { padding-top: 24px; border-top: 1px solid var(--fc-rule); }
  .fc-ranks { grid-template-columns: minmax(0, 1fr); }
  .fc-ranks__rest, .fc-subjects, .fc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-rank--lead { display: grid; grid-template-columns: auto 1fr; column-gap: 20px; align-items: center; }
  .fc-rank--lead .fc-rank__art { grid-row: 1 / span 4; margin: 0; width: 96px; height: 96px; }
  .fc-rank--lead .fc-rank__pos { position: static; justify-self: start; }
}
@media (max-width: 760px) {
  .fc-page { --fc-pad: 36px; --fc-gap: 12px; --fc-in: 16px; }
  .fc-sec { padding-left: 16px; padding-right: 16px; }
  .fc-hero { padding: 24px 16px 36px; }
  .fc-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .fc-hero__art { height: 140px; }   /* after the copy: the H1 is the first thing on a phone (R4.1 UX review) */
  .fc-hero__blob { inset: 6px 18%; }
  .fc-search { border-radius: var(--r-lg); padding-left: 12px; }
  .fc-search .xbtn { padding: 0 14px; border-radius: var(--r-md); }
  .fc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fc-stats li { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .fc-head { flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 20px; }
  .fc-rank--lead { grid-template-columns: auto 1fr; }
  .fc-rank--lead .fc-rank__art { width: 80px; height: 80px; border-radius: 22px; }
  .fc-rank--lead .fc-rank__art img { width: 60px; height: 60px; }
  .fc-subjects { grid-template-columns: minmax(0, 1fr); }
  .fc-subject { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 8px 12px; }
  .fc-subject__art { width: 56px; height: 56px; border-radius: 12px; }
  .fc-subject__art img { width: 40px; height: 40px; }
  .fc-subject__skills { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
  .fc-subject__skills li:nth-last-child(2) a { border-bottom: 0; }
  .fc-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; gap: 12px; margin: 0 -16px; padding: 2px 16px 8px; }
  .fc-grid > li { flex: 0 0 74%; scroll-snap-align: start; }
  .fc-cta { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px 20px; }
  .fc-cta__bot { width: 120px; }
  .fc-cta__go { align-items: flex-start; }
  .fc-list { grid-template-columns: minmax(0, 1fr); }
  .fc-fb { padding: 12px 16px; }
  /* One row of menus that scrolls sideways (a fade at the right edge says there is more), the label above. */
  .fc-fb__row { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; }   /* a wrapping column sizes
                                            its line to the widest item, the menus: the page would scroll sideways */
  .fc-fb__menus { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -16px; padding: 0 40px 2px 16px; }
  /* The fade is an overlay, not a mask: a mask would hide the open panel too (it paints inside the scroller). */
  .fc-fb::after { content: ""; position: absolute; right: 0; bottom: 12px; width: 40px; height: 46px; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--surface)); }
  .fc-fb__menus::-webkit-scrollbar { display: none; }
  .fc-fb__menus > li { flex: none; scroll-snap-align: start; }
  .fc-fb__menu { position: static; }     /* the panel opens under the whole bar, full width (.fc-fb is its box, so the
                                            sideways scroller does not clip it) */
  .fc-fb__panel { top: calc(100% - 4px); left: 16px; right: 16px; width: auto; min-width: 0; max-width: none; }
  .fc-orgs { grid-template-columns: minmax(0, 1fr); padding: 20px 0; border-radius: 20px; }
  .fc-orgs__col { padding: 0 16px; }
  .fc-orgs__col + .fc-orgs__col { border-left: 0; padding-top: 20px; border-top: 1px solid var(--fc-rule); }
  /* Phones: one column, the first seven (the rest are in the University menu above). */
  .fc-orgs__col--universities .fc-orgs__list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .fc-orgs__col--universities .fc-orgs__list > li:nth-child(n+8) { display: none; }
  .fc-orgs__title b { font-size: var(--fs-figure); }
  .fc-orgs .lg-tile { --lg: 40px; }
}

/* ---- hero art (R4.1, owner: our own, animated, not /list-your-course's picture) ----------------------------------
   A skill typed into a search, and three course cards shuffling to answer it: every 3 s the front card lifts away to
   the back and the next comes forward (one 9 s loop, each card a third behind the one before); the search types
   "Python", clears, then "Excel". CSS only, no script. EVERY element's own style is the STILL FRAME (a word typed,
   the cards fanned): under prefers-reduced-motion the animations are switched off and that frame is what shows.
   The stage is drawn at 360 x 300 and scaled to the art box. Text is --ink. */
.fca { --fca-s: 1; }
.fca-stage { position: absolute; left: 50%; top: 50%; width: 360px; height: 300px; transform: translate(-50%, -50%) scale(var(--fca-s)); }
.fca-search { position: absolute; left: 14px; right: 14px; top: 14px; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 6px 0 16px;
  border-radius: var(--pill); background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1.5px var(--accent); color: var(--accent-deep); z-index: 4; }
.fca-q { display: flex; align-items: center; flex: 1; min-width: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.fca-w { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; }
.fca-w--1 { max-width: 4em; }
.fca-w--2 { max-width: 0; }
.fca-caret { flex: none; width: 2px; height: 20px; margin-left: 4px; border-radius: 1px; background: var(--accent); }
.fca-go { padding: 10px 16px; border-radius: var(--pill); background: var(--btn-accent); color: var(--btn-accent-ink); font-size: 13.5px; font-weight: 700; line-height: 1.1; }
.fca-card { position: absolute; left: 96px; top: 104px; display: flex; flex-direction: column; gap: 8px; width: 168px; padding: 10px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-lg, var(--shadow)), inset 0 0 0 1px var(--line); color: var(--ink); transform-origin: 50% 90%; }
.fca-cover { display: grid; place-items: center; height: 86px; border-radius: 10px; background: var(--bg); }
.fca-cover img { box-sizing: content-box; padding: 7px; border-radius: 12px; background: var(--fc-art-tile); }   /* the icon stays readable on a dark tile */
.fca-bars { display: grid; gap: 6px; }
.fca-bars i { display: block; height: 9px; border-radius: var(--pill); background: var(--line-strong); }
.fca-bars i + i { width: 62%; background: var(--line); }
.fca-free { align-self: flex-start; padding: 3px 10px; border-radius: var(--pill); background: var(--fc-h2-bg); color: var(--fc-h2-ink); font-size: 12px; font-weight: 800; }
/* The three slots: front, back right, back left (the still frame: card 1 in front). */
.fca-card--1 { z-index: 3; transform: none; }
.fca-card--2 { z-index: 2; transform: translate(78px, -6px) rotate(8deg) scale(.88); }
.fca-card--3 { z-index: 1; transform: translate(-78px, -10px) rotate(-9deg) scale(.88); }
.fca-tag { position: absolute; padding: 6px 12px; border-radius: var(--pill); background: var(--bg); color: var(--ink-h); font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow); z-index: 4; }
.fca-tag--1 { left: 2px; bottom: 2px; transform: rotate(-5deg); }
.fca-tag--2 { right: 4px; bottom: 54px; transform: rotate(6deg); }

@media (prefers-reduced-motion: no-preference) {
  /* 3 s apart, each started mid-hold in its still-frame slot: front 13%, back right 46%, back left 80%. */
  .fca-card { animation: fca-shuffle 9s cubic-bezier(.45, 0, .25, 1) -1.2s infinite both; }
  .fca-card--2 { animation-delay: -4.2s; }
  .fca-card--3 { animation-delay: -7.2s; }
  .fca-w--1 { animation: fca-type1 9s steps(6, end) infinite both; }
  .fca-w--2 { animation: fca-type2 9s steps(5, end) infinite both; }
  .fca-caret { animation: fca-blink 1s steps(1, end) infinite; }
  .fca-tag--1 { animation: fca-float1 6s ease-in-out infinite; }
  .fca-tag--2 { animation: fca-float2 7s ease-in-out infinite; }
}
/* front (0-26%) -> lifted away (30%) -> back right (34-59%) -> back left (64-92%) -> front again (100%). */
@keyframes fca-shuffle {
  0%, 26% { z-index: 3; transform: none; }
  30% { z-index: 3; transform: translate(60px, -54px) rotate(10deg) scale(.94); }
  34%, 59% { z-index: 2; transform: translate(78px, -6px) rotate(8deg) scale(.88); }
  64%, 92% { z-index: 1; transform: translate(-78px, -10px) rotate(-9deg) scale(.88); }
  100% { z-index: 3; transform: none; }
}
@keyframes fca-type1 { 0%, 4% { max-width: 0; } 16%, 42% { max-width: 4em; } 47%, 100% { max-width: 0; } }
@keyframes fca-type2 { 0%, 52% { max-width: 0; } 63%, 90% { max-width: 3.4em; } 95%, 100% { max-width: 0; } }
@keyframes fca-blink { 50% { opacity: 0; } }
@keyframes fca-float1 { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-8px) rotate(-2deg); } }
@keyframes fca-float2 { 0%, 100% { transform: translateY(0) rotate(6deg); } 50% { transform: translateY(7px) rotate(3deg); } }
@media (max-width: 1100px) { .fca { --fca-s: .9; } }
@media (min-width: 761px) and (max-width: 1023px) { .fca { --fca-s: .68; } }   /* the art column is ~255 px wide at 768: 360 x .68 fits (at .9 it ran off the right edge) */
/* Phones: the page's own search sits just above, so the art drops its search bar and shows the cards larger; the
   chips' words are drawn larger so they stay readable at this scale. */
@media (max-width: 760px) {
  .fca { --fca-s: .66; }
  .fca-stage { transform: translate(-50%, -64%) scale(var(--fca-s)); }
  .fca-search { display: none; }
  .fca-tag, .fca-free { font-size: 16px; }
}
@media (forced-colors: active) { .fca-search, .fca-card { border: 1px solid CanvasText; } }
