/* MOVE.B header (menu) and footer: the theme's (header.php, footer.php), and the ChipTrace site's (its pages get
   them from site/tools/chiptrace_frame.py, with this file). Scoped to .site-header and .site-footer, with their own
   tokens, so that they look the same on the dark ChipTrace pages. */

.site-header, .site-footer {
  --mb-ink: #121539; --mb-text: #2a3352; --mb-muted: #5b6782; --mb-line: #dde4ef; --mb-line-strong: #c3cfe0;
  --mb-brand: #282665; --mb-surface: #ffffff; --mb-surface-2: #eef3f9; --mb-signal: #0a9fd4;
  --mb-head: "Outfit", "Inter", system-ui, sans-serif; --mb-body: "Inter", system-ui, sans-serif;
  --mb-gutter: clamp(16px, 5vw, 64px);
  --mb-shadow: 0 1px 2px rgba(18, 21, 57, 0.05), 0 8px 24px rgba(18, 21, 57, 0.06);
  --mb-shadow-hover: 0 2px 4px rgba(18, 21, 57, 0.06), 0 16px 40px rgba(18, 21, 57, 0.12);
  font-family: var(--mb-body);
}
.site-header *, .site-footer * { box-sizing: border-box; }
/* each family's colour (--tone: lines, dots, borders) and its darker shade for small text (--tone-text: 4.5:1) */
.t-cyan { --tone: #0a9fd4; --tone-text: #0679a8; } .t-orange { --tone: #e07820; --tone-text: #a3560c; }
.t-green { --tone: #1f9d5c; --tone-text: #187a47; } .t-purple { --tone: #7b4fd0; --tone-text: #6a3fc0; }
.t-grey { --tone: #5b6782; --tone-text: #5b6782; }
.site-header .wrap, .site-footer .wrap { max-width: calc(1200px + 2 * var(--mb-gutter)); margin: 0 auto; padding: 0 var(--mb-gutter); }
.site-header img, .site-footer img { display: block; max-width: 100%; height: auto; }
.site-header a, .site-footer a { text-decoration: none; }
.site-footer h2 { font-family: var(--mb-body); font-weight: 600; line-height: 1.3; background: none; }
.site-footer p { margin: 0; line-height: 1.6; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--mb-line); }
.site-header .wrap { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header .brand img { width: 150px; height: auto; }
.site-header .wrap { position: relative; }
.site-header .nav .menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.site-header .nav { display: flex; align-items: center; gap: 4px; }
.site-header .nav .nav-account { display: flex; align-items: center; gap: 7px; padding: 9px 4px 9px 12px; color: var(--mb-text); font: 500 14.5px/1.2 var(--mb-body); white-space: nowrap; border-radius: 8px; }
.site-header .nav .nav-account:hover, .site-header .nav .nav-account[aria-current] { color: var(--mb-brand); }
.site-header .nav .nav-account svg { flex: none; }
@media (max-width: 1280px) and (min-width: 1181px) {      /* little room left: the icon alone, its name for screen readers */
  .site-header .nav .nav-account { padding: 10px; }
  .site-header .nav .nav-account span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.site-header .nav .menu > li { position: relative; display: flex; align-items: center; }
.site-header .nav .menu > li > a, .site-header .nav .nav-top { display: block; padding: 9px 11px; color: var(--mb-text); font: 500 14.5px/1.2 var(--mb-body); background: none; border: 0; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.site-header .nav .menu > li > a:hover, .site-header .nav .nav-top:hover, .site-header .nav .menu > li:has(:focus-visible) > a, .site-header .nav .menu > li.open > .nav-top { color: var(--mb-brand); background: var(--mb-surface-2); }
.site-header .nav .menu > li.current-menu-item > a, .site-header .nav .menu > li.current-menu-ancestor > a, .site-header .nav .menu > li.current-menu-ancestor > .nav-top, .site-header .nav .menu > li.current-page-ancestor > a, .site-header .nav .menu > li.current_page_parent > a { color: var(--mb-brand); box-shadow: inset 0 -2px 0 var(--mb-signal); border-radius: 8px 8px 0 0; }
.site-header .nav .menu > li.menu-item-has-children > a::after, .site-header .nav .nav-top::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); opacity: 0.6; }
.site-header .nav .menu > li:last-child > a { border: 1px solid var(--mb-line-strong); color: var(--mb-brand); font-weight: 600; margin-left: 8px; padding: 9px 15px; }
.site-header .nav .menu > li:last-child > a:hover { border-color: var(--mb-brand); background: var(--mb-surface); }
.site-header .nav .sub-arrow { display: none; }
.site-header .nav .sub-menu { list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 250px; background: #fff; border: 1px solid var(--mb-line); border-radius: 12px; box-shadow: var(--mb-shadow-hover); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s; }
.site-header .nav .menu > li:hover > .sub-menu, .site-header .nav .menu > li:has(:focus-visible) > .sub-menu, .site-header .nav .menu > li.open > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.site-header .nav .sub-menu a { display: block; padding: 8px 12px; border-radius: 7px; color: var(--mb-text); font-size: 14px; line-height: 1.35; }
.site-header .nav .sub-menu a:hover, .site-header .nav .sub-menu a[aria-current] { background: var(--mb-surface-2); color: var(--mb-brand); }
.site-header .nav .menu > li.mega { position: static; }
/* the mega menu spans the header's width (.wrap) from the end of the logo, and opens right under its item, like the
   other drop-downs (item: 36 px high, centred in the 76 px bar), without covering the logo's tagline */
.site-header .nav .mega > .sub-menu { top: calc(50% + 18px); left: calc(var(--mb-gutter) + 170px); right: var(--mb-gutter); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 18px; padding: 22px; }
@media (min-width: 1181px) { .site-header .nav .mega > .sub-menu:has(> li:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); } }   /* four families, or five */
.site-header .nav .mega > .sub-menu > li > a { display: flex; align-items: flex-start; font: 700 15px/1.3 var(--mb-head); color: var(--mb-ink); border-bottom: 2px solid var(--mb-line); border-radius: 0; padding: 6px 4px 9px; margin-bottom: 6px; }   /* flex: a name on two lines stays clear of its dot */
.site-header .nav .mega > .sub-menu > li > a:hover { background: none; border-bottom-color: var(--tone, var(--mb-signal)); }
/* a family's colour: a dot before its name; its rule takes the colour on hover and on its own pages */
.site-header .nav .mega > .sub-menu > li[class*="t-"] > a::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--tone); flex: none; margin: 0.36em 8px 0 0; transition: transform 0.15s ease; }
.site-header .nav .mega > .sub-menu > li[class*="t-"] > a:hover::before { transform: scale(1.3); }
.site-header .nav .mega > .sub-menu > li[class*="t-"] > .sub-menu a:hover { color: var(--tone-text, var(--mb-ink)); }
.site-header .nav .mega > .sub-menu > li.current-menu-item > a, .site-header .nav .mega > .sub-menu > li.current-menu-ancestor > a { border-bottom-color: var(--tone, var(--mb-signal)); }
.site-header .nav .mega > .sub-menu > li { display: grid; grid-row: span 2; grid-template-rows: subgrid; align-content: start; }   /* a heading on two lines: the others' rules level with it */
.site-header .nav .mega > .sub-menu > li > a { align-self: end; }
/* visibility: inherit, not visible: the sub-families would stay hoverable (though transparent) while the panel is closed, and open it from the page */
.site-header .nav .sub-menu .sub-menu { position: static; opacity: 1; visibility: inherit; transform: none; box-shadow: none; border: 0; padding: 0; min-width: 0; background: none; }
.site-header .nav .sub-menu .sub-menu a { font-size: 13.5px; color: var(--mb-muted); padding: 6px 4px; }
.site-header .nav .sub-menu .sub-menu a:hover { background: none; color: var(--mb-brand); }
.site-header .nav-toggle { display: none; width: 44px; height: 44px; background: none; border: 1px solid var(--mb-line-strong); border-radius: 10px; color: var(--mb-ink); padding: 0; cursor: pointer; font-size: 21px; line-height: 1; }
/* the way back to the ChipTrace page left (frame.js), under the header, in ChipTrace's colours */
.site-header .ct-return { background: #0f1135; border-top: 1px solid rgba(70, 199, 246, 0.18); }
.site-header .ct-return .wrap { height: 42px; justify-content: flex-start; gap: 12px; }
.site-header .ct-return a { display: inline-flex; align-items: baseline; gap: 8px; color: #46c7f6; font: 600 14px/1.2 var(--mb-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-header .ct-return a:hover { color: #fff; }
.site-header .ct-return-page { color: #a9aed6; font-weight: 500; }
.site-header .ct-return-page::before { content: "·"; margin-right: 8px; color: #7f85bd; }
.site-header .ct-return button { margin-left: auto; width: 34px; height: 34px; background: none; border: 0; border-radius: 8px; color: #7f85bd; font-size: 20px; line-height: 1; cursor: pointer; }
.site-header .ct-return button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.site-footer { background: #14163f; padding: 60px 0 28px; font-size: 14px; color: #a9aed6; }
.site-footer .footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .footer-logo { width: 140px; height: auto; }
.site-footer h2 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: #7f85bd; margin: 0 0 12px; font-family: var(--mb-body); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: #d3d6f3; } .site-footer a:hover { color: #fff; }
.site-footer .footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: #7f85bd; }
@media (max-width: 1180px) {
  .site-header .nav-toggle { display: block; }
  .site-header .nav { display: none; position: absolute; top: 76px; left: 0; right: 0; max-height: calc(100vh - 76px); overflow: auto; background: #fff; border-bottom: 1px solid var(--mb-line); padding: 8px var(--mb-gutter) 18px; box-shadow: var(--mb-shadow); }
  .site-header .nav.open { display: block; }
  .site-header .nav .menu { flex-direction: column; align-items: stretch; gap: 0; }
  .site-header .nav .menu > li { flex-wrap: wrap; border-bottom: 1px solid var(--mb-line); }
  .site-header .nav .menu > li > a, .site-header .nav .nav-top { flex: 1; padding: 13px 0; text-align: left; border-radius: 0; background: none !important; box-shadow: none !important; }
  .site-header .nav .menu > li.menu-item-has-children > a::after { display: none; }
  .site-header .nav .sub-arrow { display: block; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; color: var(--mb-muted); }
  .site-header .nav .sub-arrow::after { content: ""; display: inline-block; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
  .site-header .nav .sub-menu, .site-header .nav .mega > .sub-menu { position: static; display: none; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 12px 12px; min-width: 0; width: 100%; grid-template-columns: 1fr; }
  .site-header .nav .menu > li:hover > .sub-menu, .site-header .nav .menu > li:has(:focus-visible) > .sub-menu { display: none; }
  .site-header .nav .menu > li.open > .sub-menu { display: block; }
  .site-header .nav .mega > .sub-menu > li > a { border-bottom: 0; margin: 6px 0 0; padding: 6px 4px; font-size: 14.5px; }
  .site-header .nav .mega > .sub-menu > li { display: block; }
  .site-header .nav .sub-menu .sub-menu { display: block; padding: 0 0 0 10px; }
  .site-header .nav .menu > li:last-child { border-bottom: 0; }
  .site-header .nav .menu > li:last-child > a { margin: 14px 0 0; text-align: center; border: 1px solid var(--mb-line-strong) !important; border-radius: 10px; }
  .site-header .nav .nav-account { justify-content: center; margin-top: 8px; padding: 13px 0; }
}
@media (max-width: 820px) {
  .site-header .brand img { width: 128px; }
}
@media (max-width: 1080px) { .site-footer .footer-grid { grid-template-columns: 1fr 1fr; } }
/* phones: the two lists of links side by side, the presentation and the contact across */
@media (max-width: 620px) {
  .site-footer { padding-top: 44px; }
  .site-footer .footer-grid { gap: 28px 20px; }
  .site-footer .footer-grid > :first-child, .site-footer .footer-grid > :last-child { grid-column: 1 / -1; }
  .site-footer .footer-bottom { margin-top: 32px; }
}

/* consent banner (inc/consent.php, assets/consent.js) */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; max-width: 720px; margin: 0 auto; background: #fff; border: 1px solid #c3cfe0; border-radius: 14px; box-shadow: 0 2px 4px rgba(18, 21, 57, 0.06), 0 16px 40px rgba(18, 21, 57, 0.12); padding: 18px 20px; display: flex; gap: 18px; align-items: center; font-family: "Inter", system-ui, sans-serif; box-sizing: border-box; }
.consent[hidden] { display: none; }
.consent p { margin: 0; font-size: 13.5px; line-height: 1.55; color: #2a3352; }
.consent a { color: #0679a8; }
.consent-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.consent-btn { font: 600 13.5px/1 "Inter", system-ui, sans-serif; padding: 9px 15px; border-radius: 10px; border: 1px solid #c3cfe0; background: #fff; color: #282665; cursor: pointer; }
.consent-btn:hover { border-color: #282665; }
@media (max-width: 620px) { .consent { flex-direction: column; align-items: stretch; } .consent-btn { flex: 1; } }

/* for the old hands (frame.js): the logo's 68000 note, the mnemonics' notes, the page modes */
.site-header .brand { position: relative; display: block; }
.site-header .brand-egg { position: absolute; top: calc(100% + 12px); left: 0; width: max-content; max-width: 300px; padding: 10px 12px; border-radius: 8px; background: #121539; color: #c9d3ea; font-size: 12px; line-height: 1.5; box-shadow: var(--mb-shadow-hover); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s, visibility 0s 0.2s; }
.site-header .brand-egg code { display: block; margin-bottom: 4px; color: #3fd4ff; font: 600 13px/1.4 ui-monospace, Consolas, "Courier New", monospace; background: none; padding: 0; }
@media (hover: hover) {
  .site-header .brand:hover .brand-egg { opacity: 1; visibility: visible; transition: opacity 0.25s 1.2s, visibility 0s 1.2s; }
}
.mb-egg-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 95; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 8px; background: #121539; color: #3fd4ff; font: 13px/1.5 ui-monospace, Consolas, "Courier New", monospace; box-shadow: 0 16px 40px rgba(18, 21, 57, 0.25); }
html.mb-stop { filter: grayscale(1) brightness(0.92); transition: filter 0.3s; }
html.mb-stop body { pointer-events: none; }
html.mb-phosphor { filter: invert(1) grayscale(1) sepia(1) saturate(6) hue-rotate(65deg) brightness(0.95); }
.site-header .brand-reel { position: absolute; left: 83.4025%; top: 0; width: 16.3209%; height: 48%; overflow: hidden; background: #fff; visibility: hidden; }
.site-header .brand.rolling .brand-reel { visibility: visible; }
.site-header .brand-reel > span { display: flex; flex-direction: column; height: 400%; transition: transform 0.45s cubic-bezier(0.3, 0.7, 0.2, 1); }
.site-header .brand-reel svg { display: block; width: 100%; height: 25%; flex: 0 0 25%; overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .site-header .brand-reel > span { transition: none; } }
.site-header .brand-egg small { display: block; margin: -2px 0 4px; color: #7f85bd; font: 11.5px/1.4 ui-monospace, Consolas, "Courier New", monospace; }
.site-footer .night-egg { color: #7f85bd; font-style: italic; }
/* the course cards' chips (app.css): the core's year on a long hover */
@media (hover: hover) {
  .course-card .chip[data-egg] { position: relative; }
  .course-card .chip[data-egg]::after { content: attr(data-egg); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 5; padding: 6px 9px; border-radius: 6px; background: #121539; color: #3fd4ff; font: 500 12px/1.3 ui-monospace, Consolas, "Courier New", monospace; white-space: nowrap; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s, visibility 0s 0.2s; }
  .course-card .chip[data-egg]:hover::after { opacity: 1; visibility: visible; transition: opacity 0.25s 1s, visibility 0s 1s; }
}
