/* Public-page overrides, linked by the head-extras transform in .eleventy.js.
   Kept out of site.css because site.css (with base.njk, page.njk, print.css, lib/markdown.js and the
   print template) is an input of the résumé PDF freshness hash; editing it would force a new PDF. */

/* Theme toggle: reserve its box from first paint. The inline head script adds .js to <html>;
   without JS the button would do nothing, so it is removed from layout and focus order. */
html:not(.js) #theme-toggle { display: none; }

/* Header: logo and toggle share the first row on narrow screens, nav gets the full second row,
   so the header is the same height with or without the toggle and never wraps to a third row. */
.logo { order: 1; }
#theme-toggle { order: 2; margin-left: auto; }
.nav { order: 3; flex: 1 1 100%; }
/* Narrow phones: the four nav links (24 characters of the 10px pixel font + 24px padding each) are 354px wide and wrapped onto
   two rows at <= 360px. 4px side padding fits them on one row at 320px (278px of 284px) and keeps 44px targets. */
@media (max-width: 479px) {
  .nav ul { gap: 4px 2px; }
  .nav a { padding: 0 4px; }
}
@media (min-width: 720px) {
  .nav { order: 2; flex: 1 1 auto; }
  #theme-toggle { order: 3; }
}

/* Cyber: the scanline overlay (rgba(0,0,0,.18) on 1px of every 3) darkens text and background alike;
   the brand orange falls to 3.71:1 on a dark row. A lighter orange keeps >= 5.3:1 on every row. */
[data-theme="cyber"] .nav a[aria-current="page"] { color: #ff8a5c; }

/* Font fallbacks sized to the pixel fonts' advance widths (Press Start 2P: 1.006em, VT323: 0.4em, against a 0.6em
   Courier New / Liberation Mono / Cousine), so a late font swap keeps every line the same width and wrap.
   Overrides are relative to the adjusted size: ascent = font ascent / size-adjust. site.css cannot change
   (résumé hash), so the stacks are redefined here; site.css loads first and these win by order. */
@font-face { font-family: "Press Start 2P Fallback"; src: local("Courier New"), local("Liberation Mono"), local("Cousine"), local("Courier");
  size-adjust: 167.6%; ascent-override: 59.7%; descent-override: 0%; line-gap-override: 0%; }
@font-face { font-family: "VT323 Fallback"; src: local("Courier New"), local("Liberation Mono"), local("Cousine"), local("Courier");
  size-adjust: 66.7%; ascent-override: 120%; descent-override: 30%; line-gap-override: 0%; }
:root {
  --pixel: "Press Start 2P", "Press Start 2P Fallback", ui-monospace, "Courier New", monospace;
  --mono: "VT323", "VT323 Fallback", ui-monospace, "Courier New", monospace;
}
