/* FnExec design system: base. Reset, document, type, prose, layout primitives.
   Requires tokens.css and fonts.css before it. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; color-scheme: light dark; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
main:focus { outline: none; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

img, svg { display: block; max-width: 100%; }
b, strong { font-weight: 600; }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }

/* ---- headings ---- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 4.6vw, var(--display-xl)); line-height: 1.08; }
h2 { font-size: clamp(1.75rem, 3vw, var(--display-md)); line-height: 1.15; }
h3 { font-size: var(--display-xs); line-height: 1.25; }
h4 { font-family: var(--font-text); font-weight: 600; font-size: var(--text-md); letter-spacing: 0.01em; }

/* ---- layout ---- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-6); }
.narrow { max-width: 760px; }
.section { padding: var(--space-20) 0; border-top: 1px solid var(--line); }
.section-title { font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: var(--space-8); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-10); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; gap: var(--space-8); } .section { padding: var(--space-16) 0; } }

/* ---- prose ---- */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--space-5); }
.prose h2 { margin-top: var(--space-12); }
.prose h3 { margin-top: var(--space-10); }
.prose h2 + *, .prose h3 + * { margin-top: var(--space-4); }
.prose p.lead { font-size: var(--text-xl); color: var(--fg-muted); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--space-2); }
.prose .nerd { font-family: var(--font-mono); font-size: var(--text-md); line-height: var(--leading-loose); }
.prose h1.nerd, .prose h2.nerd, .prose h3.nerd { font-family: var(--font-display); font-size: inherit; line-height: inherit; }
.prose h1.nerd { font-size: clamp(2.25rem, 4.6vw, var(--display-xl)); line-height: 1.08; }
.prose h2.nerd { font-size: clamp(1.75rem, 3vw, var(--display-md)); line-height: 1.15; }
.prose h3.nerd { font-size: var(--display-xs); line-height: 1.25; }

/* ---- utilities ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; top: 8px; left: 24px; padding: 8px 16px; background: var(--bg-raised); color: var(--fg); z-index: 10; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--fg-muted); }

/* ---- print ---- */
@media print {
  :root { --bg: #fff; --bg-raised: #fff; --bg-sunken: #fff; --fg: #000; --fg-muted: #000; --fg-faint: #000; --line: #000; --accent: #000; }
  .masthead nav, .register, .skip { display: none !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
