/* Campus Filing: design tokens, reset, and typography.
   Loaded first on every page. Nothing here is page specific. */

/* Fonts are served from this site, not from Google. A webfont request
   carries the visitor's IP address and the page they are on to a third
   party, which is a strange thing for a tax tool to do while promising
   that nothing leaves the tab. Self-hosting also means the site renders
   identically on a campus network that blocks external font hosts.

   Latin subsets only, and only the weights actually used: 100KB in total,
   less than the Google request it replaces. Public Sans and Newsreader
   are both under the SIL Open Font License. */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/public-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/public-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/public-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/newsreader-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/newsreader-latin-500-normal.woff2") format("woff2");
}

:root {
  --ink: #101519;
  --slate: #3A464D;
  --muted: #6E7A80;
  --navy: #123B5E;
  --navy-dark: #0D2E4A;
  --blue: #1E6BA8;
  --blue-soft: #E8F0F7;
  --forest: #1B6B4C;
  --forest-dark: #155840;
  --sage: #E4EFE8;
  --amber: #8A5A0B;
  --amber-soft: #FBF1DE;
  --rust: #9A3324;
  --rust-soft: #FAEAE7;
  --paper: #FAF9F6;
  --sand: #EFEDE7;
  --line: #DCD8CF;
  --line-soft: #E9E6DF;
  --white: #FFFFFF;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 21, 25, .06), 0 4px 12px rgba(16, 21, 25, .04);
  --measure: 68ch;
  --wide: 1200px;

  /* Filled controls carry their own pair. An accent used as a background
     cannot simply be flipped for dark mode: --forest is dark enough for
     white text on paper and light enough to read on a dark surface, and
     those are not the same colour. Keeping the pair explicit is what
     stops a dark theme from producing white-on-pale buttons. */
  --btn-primary-bg: #123B5E;
  --btn-primary-bg-hover: #0D2E4A;
  --btn-primary-fg: #FFFFFF;
  --btn-accent-bg: #1B6B4C;
  --btn-accent-bg-hover: #155840;
  --btn-accent-fg: #FFFFFF;
  --prefill-bg: #F4FAF6;
  --drop-bg: var(--paper);
}

/* Dark theme. Opt in only.

   The system preference is deliberately NOT consulted. This site is
   demonstrated on projectors and on machines nobody controls, and a dark
   render on a washed out projector is worse than a plain one. Light is the
   default everywhere; the control in the footer is the only way into dark,
   and the choice it writes is the single value this site keeps in browser
   storage. */

:root[data-theme="dark"] {
  --ink: #E6ECF0;
  --slate: #AFBAC2;
  --muted: #8A959D;
  --navy: #8CC0E8;
  --navy-dark: #A7D2F2;
  --blue: #6BAEDE;
  --blue-soft: #17242E;
  --forest: #74CBA0;
  --forest-dark: #8FDBB5;
  --sage: #14271E;
  --amber: #E0AC52;
  --amber-soft: #2B2316;
  --rust: #E89181;
  --rust-soft: #2D1C18;
  --paper: #0F1418;
  --sand: #1E262D;
  --line: #2E3840;
  --line-soft: #242D34;
  --white: #171E24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  --btn-primary-bg: #3E8FCC;
  --btn-primary-bg-hover: #58A3DC;
  --btn-primary-fg: #06121C;
  --btn-accent-bg: #2E9B6E;
  --btn-accent-bg-hover: #3FB081;
  --btn-accent-fg: #04140D;
  --prefill-bg: #16291F;
  --drop-bg: #131A1F;
}

:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  letter-spacing: -.012em;
  line-height: 1.22;
  margin: 0 0 .5rem;
}

h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; font-family: "Public Sans", sans-serif; font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1rem; max-width: var(--measure); }

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue); }

ul, ol { max-width: var(--measure); }

strong { font-weight: 600; }

hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }

code, .formref {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .86em;
  background: var(--sand);
  padding: 1px 6px;
  border-radius: 3px;
}

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
  z-index: 100;
}

.skip:focus { left: 8px; top: 8px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
