/* UAFL Modern look - shared by the homepage and the forum: the c-only/m-only switch, design tokens (light and dark),
   base type, focus, the segmented look/theme switches and the flat wordmark. */

/* ---------- which bits belong to which look (shared by both) ---------- */
html.modern .c-only { display: none !important; }
html.classic .m-only { display: none !important; }

/* ---------- tokens ---------- */
html.modern {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fs: 15px; --fs-sm: 13px; --fs-xs: 12px;
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f3f5f8; --surface-3: #e9edf3;
  --border: #e4e8ef; --border-strong: #cfd6e1;
  --text: #0f1626; --text-2: #3a4458; --muted: #5d6779;
  --accent: #e8591c;             /* UAFL ember, from the speech bubble */
  --accent-ink: #b93e0a;          /* text-safe on white */
  --accent-bg: #fff2ea;
  --btn: #c8470f; --btn-hover: #ad3b0a; --btn-ink: #ffffff;
  --navy: #1d2f6b; --navy-bg: #eef1fb;
  --mark: #ffe58f; --mark-ink: #1a1400;
  --danger: #b42318; --danger-bg: #fef3f2; --danger-line: #fecdca;
  --ring: 0 0 0 4px rgba(232, 89, 28, .22);
  --sh-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --sh-2: 0 6px 16px -6px rgba(16, 24, 40, .12), 0 2px 4px -2px rgba(16, 24, 40, .06);
  --sh-pop: 0 24px 48px -12px rgba(16, 24, 40, .25), 0 6px 12px -6px rgba(16, 24, 40, .12);
  --r-lg: 16px; --r-md: 12px; --r-sm: 10px;
  --glass: rgba(255, 255, 255, .82);
  color-scheme: light;
}
html.modern[data-theme="dark"] {
  --bg: #0b1220; --surface: #111a2c; --surface-2: #162036; --surface-3: #1d2944;
  --border: #212d47; --border-strong: #2e3d5e;
  --text: #e8edf6; --text-2: #c4cbda; --muted: #96a1b7;
  --accent: #ff7a45; --accent-ink: #ff9a6b; --accent-bg: rgba(255, 122, 69, .13);
  --btn: #ff7a45; --btn-hover: #ff905f; --btn-ink: #1c0b03;
  --navy: #aebcf5; --navy-bg: rgba(130, 150, 235, .14);
  --mark: rgba(255, 210, 80, .3); --mark-ink: #fff6d6;
  --danger: #fda29b; --danger-bg: rgba(240, 68, 56, .12); --danger-line: rgba(240, 68, 56, .35);
  --ring: 0 0 0 4px rgba(255, 122, 69, .25);
  --sh-1: 0 0 0 1px rgba(255, 255, 255, .02), 0 1px 2px rgba(0, 0, 0, .3);
  --sh-2: 0 10px 24px -10px rgba(0, 0, 0, .6);
  --sh-pop: 0 28px 60px -16px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .04);
  --glass: rgba(11, 18, 32, .78);
  color-scheme: dark;
}
html.modern[data-size="large"] { --fs: 17px; --fs-sm: 14.5px; --fs-xs: 13px; }

/* ---------- base ---------- */
html.modern * { box-sizing: border-box; }
html.modern { background: var(--bg); -webkit-text-size-adjust: 100%; }
html.modern body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs)/1.6 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
html.modern a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: .2em; text-decoration-thickness: 1px; }
html.modern a:hover { text-decoration-color: currentColor; }
html.modern :focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
html.modern #main:focus, html.modern h2[tabindex="-1"]:focus { outline: none; }
html.modern .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html.modern .skip { position: absolute; left: -999px; top: 8px; z-index: 60; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: var(--r-sm); box-shadow: var(--sh-pop); }
html.modern .skip:focus { left: 12px; }
html.modern .small { font-size: var(--fs-sm); color: var(--muted); }
html.modern .ic:not([role="img"]) { display: none; }
html.modern .ic { width: 15px; height: 15px; vertical-align: -2px; }
html.modern .mi { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
html.modern kbd { font: 500 11px/1 var(--mono); color: var(--muted); background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 5px; padding: 2px 5px; }
html.modern h1, html.modern h2, html.modern h3 { font-family: var(--font-display); letter-spacing: -.015em; }
html.modern .linklike { font: inherit; color: var(--accent-ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .2em; }
html.modern .badge { display: block; }
html.modern mark { background: var(--mark); color: var(--mark-ink); border-radius: 3px; padding: 0 2px; }

/* segmented controls: the look switch and the theme switch */
html.modern .skin-switch, html.modern .theme-switch { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 11px; flex: none; }
html.modern .skin-switch button, html.modern .theme-switch button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  font: 500 13px/1 var(--font); color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer;
  transition: background-color .18s, color .18s, box-shadow .18s; }
html.modern .theme-switch button { padding: 0 8px; }
html.modern .skin-switch button:hover, html.modern .theme-switch button:hover { color: var(--text); }
html.modern .skin-switch button[aria-pressed="true"], html.modern .theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px var(--border); }
html.modern[data-theme="dark"] .skin-switch button[aria-pressed="true"], html.modern[data-theme="dark"] .theme-switch button[aria-pressed="true"] { background: var(--surface-3); }
html.modern .theme-switch .mi { width: 16px; height: 16px; }

/* the flat mark and wordmark */
html.modern .m-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; border-radius: 10px; }
html.modern .m-mark { width: 34px; height: 34px; display: block; }
html.modern .m-word { font: 750 19px/1 var(--font-display); letter-spacing: -.03em; color: var(--navy); }
html.modern[data-theme="dark"] .m-word { color: var(--text); }
html.modern .m-word span { font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: -.01em; }

@media (prefers-reduced-motion: reduce) {
  html.modern *, html.modern *::before, html.modern *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}
