/* Shared academic site and responsive navigation. */
:root {
  color-scheme: light;
  --ink: #24292f;
  --muted: #57606a;
  --accent: #175a9c;
  --line: #d8dee4;
  --soft: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: #fff;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: #10416f; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: -6rem; padding: .5rem 1rem; background: #fff; z-index: 2; }
.skip-link:focus { top: .5rem; }
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.header-inner { max-width: 1250px; margin: 0 auto; padding: .7rem 1.5rem; display: flex; gap: 1rem 1.6rem; align-items: center; justify-content: space-between; }
.site-name { font-size: 1.25rem; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.site-nav ul { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .15rem .3rem; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; padding: .45rem .55rem; font-size: .875rem; font-weight: 500; color: var(--ink); text-decoration: none; border-radius: .3rem; }
.site-nav a:hover { color: var(--accent); background: var(--soft); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--soft); font-weight: 650; }
.page-content { max-width: 980px; margin: 0 auto; padding: 2rem 1.5rem 3.5rem; overflow-wrap: anywhere; }
.page-content > :first-child { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.3; margin: 1.5em 0 .65em; font-weight: 650; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p, ul, ol { margin: 0 0 1rem; }
li + li { margin-top: .25rem; }
.site-nav li + li { margin-top: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.75rem 0; }
img { max-width: 100%; height: auto; }
pre { overflow-x: auto; padding: 1rem; background: var(--soft); }
code { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: .45rem; }
  .site-nav { width: 100%; }
  .site-nav ul { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .header-inner { padding: .85rem 1rem; }
  .site-nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem .45rem; }
  .site-nav a { min-height: 44px; display: flex; align-items: center; padding: .4rem .55rem; font-size: .9rem; line-height: 1.35; }
  .page-content { padding: 1.5rem 1rem 2.5rem; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  .page-content ul, .page-content ol { padding-left: 1.5rem; }
}
