/* The font switch, for every page (27 Nov 2026: one file, so a font fix can no longer miss a page; deploy.sh refuses a
   page that does not link it). The app's Font choice: Mixed by default (Marc, 21 Nov 2026, "Yes, Mixed": pixel titles,
   headings, figures, chips and buttons, readable words); html.readable (the switch top right, kept in localStorage
   'traj-font', set by each page's one-line head script before first paint) sets everything in Space Grotesk.
   Linked AFTER styles.css (the main pages) or after the inline <style> (privacy, terms, delete-account): .seg button and
   .fontsw button weigh the same, so this file must come last. Self-contained on purpose: the legal pages carry none of
   styles.css. font.js does the tapping. */

/* readable (Marc, 20 Nov 2026: "still stuff left on pixel font, please fix"): every spot that names the pixel face takes
   Space Grotesk too, as the app's Readable font does (Theme.kt neoFace). 'Space Grotesk Head' is the medium cut under
   weight 400, so headings, chips, buttons and figures keep some weight without touching each rule. Only the wordmark
   (a logo, hand-kerned on the pixel grid) and the switch's own pixel "Aa" stay pixel. */
@font-face { font-family: 'Space Grotesk Head'; src: url('fonts/space_grotesk_medium.woff2?v=1') format('woff2'); font-display: swap; }
html.readable { --px: 'Space Grotesk Head', 'Space Grotesk', system-ui, sans-serif; }
html.readable body, html.readable body * { -webkit-font-smoothing: antialiased !important; font-variant-ligatures: normal !important; }
html.readable .logo, html.readable .fontsw button[data-font='pixel'] { font-family: 'Fixedsys Excelsior', ui-monospace, monospace; }
html.readable .logo, html.readable .logo *, html.readable .fontsw button[data-font='pixel'] { -webkit-font-smoothing: none !important; font-variant-ligatures: none !important; }

/* the switch: the site's two-tab control (styles.css .seg), pixel "Aa" and readable "Aa", the cyan thumb slides between
   them. html.rd-sw moves the thumb at once on a tap; html.readable swaps the words once they have faded out. */
.fontsw { position: relative; flex: none; display: inline-flex; gap: 2px; padding: 3px; border-radius: 13px; background: var(--field); border: 1px solid var(--field-edge, #1a2440); }
.fontsw button { position: relative; z-index: 1; width: 40px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; justify-content: center; font-family: var(--px); font-weight: 400; -webkit-font-smoothing: none; font-variant-ligatures: none; letter-spacing: 0; font-size: 16px; color: var(--cyan-soft, #8fd9ea); white-space: nowrap; transition: color .3s; }
.fontsw button[data-font='readable'] { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 500; -webkit-font-smoothing: antialiased; font-size: 15px; }
.fontsw .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: 40px; border-radius: 10px; background: var(--accent); transition: transform .45s var(--ease), width .45s var(--ease); }
.fontsw button[data-font='pixel'], html.rd-sw .fontsw button[data-font='readable'] { color: var(--on-accent); }
html.rd-sw .fontsw button[data-font='pixel'], .fontsw button[data-font='readable'] { color: var(--cyan-soft, #8fd9ea); }
html.rd-sw .fontsw .thumb { transform: translateX(42px); }
main, footer { transition: opacity .18s; }
html.fontswap main, html.fontswap footer { opacity: 0; }
/* phones, and laptops up to 1380px wide (including 125% zoom), where the full-size switch would run into the menu: 56x30 */
@media (max-width: 1380px) {
  .fontsw { padding: 2px; border-radius: 10px; }
  .fontsw button { width: 24px; height: 24px; font-size: 12px; border-radius: 8px; }
  .fontsw button[data-font='readable'] { font-size: 12px; }
  .fontsw .thumb { top: 2px; bottom: 2px; left: 2px; width: 24px; border-radius: 8px; }
  html.rd-sw .fontsw .thumb { transform: translateX(26px); }
}
@media (prefers-reduced-motion: reduce) { .fontsw .thumb, .fontsw button, main, footer { transition: none !important; } }
