/* ==========================================================================
   Peter Farah — site.css ("Cedar")
   Sage engineering-pad paper by day, cedar green by evening, brass for the
   few things that should catch the eye. Zilla Slab carries the voice, Fira
   Sans does the reading, Fira Code appears only inside code blocks.

   Loaded by every page: the root pages and the queue simulator
   (FUN/AQMgame.html), which adds its own layout in an inline <style>.
   ========================================================================== */

/* -------------------------------------------------------------- fonts --- */
/* Self-hosted WOFF2 subsets (SIL OFL 1.1, see Files/fonts/LICENSE.md). The
   latin-ext files only download when a page uses those code points. */
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('Files/fonts/zilla-slab-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('Files/fonts/zilla-slab-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('Files/fonts/zilla-slab-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('Files/fonts/zilla-slab-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('Files/fonts/zilla-slab-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('Files/fonts/zilla-slab-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('Files/fonts/fira-sans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('Files/fonts/fira-sans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fira Sans'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('Files/fonts/fira-sans-400italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fira Sans'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('Files/fonts/fira-sans-400italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('Files/fonts/fira-sans-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('Files/fonts/fira-sans-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('Files/fonts/fira-sans-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('Files/fonts/fira-sans-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('Files/fonts/fira-code-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('Files/fonts/fira-code-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ------------------------------------------------------------- tokens --- */
/* Day is the default. Evening applies when chosen, or when nothing is saved
   and the visitor's system prefers dark (the head boot script decides; the
   media query below covers visitors without JavaScript). Contrast is
   measured against each theme's page colour: graphite 12.7:1, lichen
   captions 5.1:1; linen 13:1, lamp brass 7.6:1. */
:root {
  --bg: #E4E9DF;            /* sage paper */
  --sheet: #F4F6F0;         /* cards, diagrams, the index card */
  --well: #D9E0D3;          /* code */
  --ink: #1D2521;           /* graphite */
  --ink-2: #45524A;         /* moss */
  --muted: #56635A;         /* lichen */
  --head: #1F3B30;          /* cedar */
  --action: #1F3B30;
  --action-hover: #152B22;
  --on-action: #EEEADC;
  --brass: #C98F2E;         /* lines and marks only on paper, never text */
  --brass-ink: #7E5510;
  --brass-wash: rgba(201, 143, 46, .16);
  --warn: #9A3B1E;
  --rule: #C6D0C0;
  --rule-strong: #93A28E;
  --link: #1F3B30;
  --focus: #A86F12;
  --grid: rgba(31, 59, 48, .06);
  --print: #FBFCF8;
  --print-ink: #46504A;
  --print-head: #26302A;
  --shadow: 0 1px 0 rgba(29, 37, 33, .07), 0 18px 34px -22px rgba(23, 48, 38, .55);
  --card-line: rgba(31, 59, 48, .14);
  --band: #1F3B30;
  --on-band: #EEEADC;
  --band-2: #C5CBBC;
  --band-accent: #E3AE52;
  --band-rule: rgba(238, 234, 220, .22);

  --font-slab: 'Zilla Slab', Rockwell, 'Roboto Slab', Georgia, serif;
  --font-sans: 'Fira Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-code: 'Fira Code', Consolas, 'Courier New', monospace;
  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16241E; --sheet: #1F3229; --well: #0F1A15;
    --ink: #ECE7D6; --ink-2: #C8CCBD; --muted: #A3AC9D; --head: #F2ECDC;
    --action: #E0A846; --action-hover: #EDBB62; --on-action: #16241E;
    --brass: #E0A846; --brass-ink: #E6B25A; --brass-wash: rgba(224, 168, 70, .14);
    --warn: #F08A64; --rule: #2D4438; --rule-strong: #4C6657;
    --link: #E6B25A; --focus: #E6B25A; --grid: rgba(236, 231, 214, .04);
    --print: #F3F0E6;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 22px 40px -24px rgba(0, 0, 0, .8);
    --card-line: rgba(236, 231, 214, .09);
    --band: #0E1813; --on-band: #ECE7D6; --band-2: #B9BFB0; --band-accent: #E6B25A;
    --band-rule: rgba(236, 231, 214, .16);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16241E; --sheet: #1F3229; --well: #0F1A15;
  --ink: #ECE7D6; --ink-2: #C8CCBD; --muted: #A3AC9D; --head: #F2ECDC;
  --action: #E0A846; --action-hover: #EDBB62; --on-action: #16241E;
  --brass: #E0A846; --brass-ink: #E6B25A; --brass-wash: rgba(224, 168, 70, .14);
  --warn: #F08A64; --rule: #2D4438; --rule-strong: #4C6657;
  --link: #E6B25A; --focus: #E6B25A; --grid: rgba(236, 231, 214, .04);
  --print: #F3F0E6;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 22px 40px -24px rgba(0, 0, 0, .8);
  --card-line: rgba(236, 231, 214, .09);
  --band: #0E1813; --on-band: #ECE7D6; --band-2: #B9BFB0; --band-accent: #E6B25A;
  --band-rule: rgba(236, 231, 214, .16);
  color-scheme: dark;
}

/* --------------------------------------------------------------- base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;   /* short pages keep the footer at the bottom */
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  /* the engineering-pad grid: 24 px squares at 6 % ink */
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .45s ease, color .45s ease;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-slab); font-weight: 600; color: var(--head); text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
img, svg { max-width: 100%; }
img { display: block; height: auto; }
strong, b { font-weight: 600; }
::selection { background-color: rgba(201, 143, 46, .32); color: var(--ink); }

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color .2s ease, text-decoration-thickness .2s ease, color .2s ease, background-color .2s ease;
}
a:hover { text-decoration-color: var(--brass); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
main { flex: 1 0 auto; }
main:focus, [tabindex="-1"]:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 6px;
  background-color: var(--action); color: var(--on-action); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sec { padding-top: clamp(88px, 9vw, 132px); }
.slab { font-family: var(--font-slab); }
.cap { font-size: 15px; line-height: 1.5; color: var(--muted); }
.h2 {
  font-family: var(--font-slab); font-weight: 600;
  font-size: clamp(40px, 4.4vw, 60px); line-height: 1.04; letter-spacing: -.012em; color: var(--head);
}
.intro { margin-top: 18px; max-width: 36em; font-size: 19px; line-height: 1.6; color: var(--ink-2); }

/* ------------------------------------------------------------ buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 6px;
  border: 1.5px solid var(--action);
  font: 500 17px/1 var(--font-sans);
  text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary { background-color: var(--action); color: var(--on-action); }
.btn-primary:hover { background-color: var(--action-hover); border-color: var(--action-hover); color: var(--on-action); }
.btn-ghost { background-color: transparent; color: var(--head); }
.btn-ghost:hover { background-color: var(--brass-wash); color: var(--head); }
.btn-text {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0;
  border: 0; background: none; cursor: pointer;
  font: 500 17px/1 var(--font-sans); color: var(--link);
  text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .22em;
}
.btn-text:hover { text-decoration-color: var(--brass); text-decoration-thickness: 2px; }
button:disabled { cursor: progress; opacity: .7; }

/* ---------------------------------------------------- header and nav --- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background-color: var(--bg);
  border-bottom: 1px solid var(--rule);
  transition: background-color .45s ease;
}
.site-nav { height: 76px; display: flex; align-items: center; gap: 24px; }
.wordmark {
  margin-right: auto;
  font-family: var(--font-slab); font-weight: 700; font-size: 25px; letter-spacing: -.01em;
  color: var(--head); text-decoration: none;
}
.wordmark:hover { color: var(--head); }
.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; font-size: 17px; }
.nav-links a { color: var(--ink); text-decoration-line: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] {
  text-decoration-line: underline; text-decoration-color: var(--brass);
  text-decoration-thickness: 2px; text-underline-offset: .32em;
}
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--rule-strong); border-radius: 999px; }
.theme-switch button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  min-height: 38px; padding: 0 16px; border-radius: 999px;
  font: 500 15px/1 var(--font-sans); color: var(--ink-2);
  transition: background-color .3s ease, color .3s ease;
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background-color: var(--action); color: var(--on-action); }
.menu-btn {
  display: none; align-items: center; gap: 9px;
  min-height: 44px; padding: 0 14px; border-radius: 6px;
  border: 1.5px solid var(--rule-strong); background: transparent; color: var(--ink);
  font: 500 16px/1 var(--font-sans); cursor: pointer;
}
.menu-btn svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------ menu sheet --- */
.menu-sheet {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  padding-bottom: env(safe-area-inset-bottom);
  visibility: hidden; opacity: 0; transform: translateY(-8px);
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
.menu-sheet.open { visibility: visible; opacity: 1; transform: none; transition: opacity .25s ease, transform .25s ease; }
.menu-head {
  flex: none; height: 64px; padding-inline: var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}
.menu-head .wordmark { font-size: 23px; }
.menu-body { flex: 1 0 auto; padding: 28px var(--gutter) 0; }
.menu-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.menu-list li { border-bottom: 1px solid var(--rule); }
.menu-list a { display: flex; flex-direction: column; gap: 2px; padding: 16px 0 15px; text-decoration: none; }
.menu-list .t { font-family: var(--font-slab); font-weight: 600; font-size: 32px; line-height: 1.1; color: var(--head); }
.menu-list .d { font-size: 15px; color: var(--muted); }
.menu-list a[aria-current="page"] .t { text-decoration: underline; text-decoration-color: var(--brass); text-decoration-thickness: 2px; text-underline-offset: .16em; }
.menu-theme { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 15px; color: var(--muted); }
.menu-foot {
  flex: none; padding: 22px var(--gutter) 28px; margin-top: 28px; border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 12px; font-size: 16px; font-weight: 500;
}
.menu-foot div { display: flex; gap: 24px; }
.menu-sheet.open .menu-list li { animation: pf-drop .45s var(--ease) both; }
.menu-sheet.open .menu-list li:nth-child(2) { animation-delay: .04s; }
.menu-sheet.open .menu-list li:nth-child(3) { animation-delay: .08s; }
.menu-sheet.open .menu-list li:nth-child(4) { animation-delay: .12s; }
.menu-sheet.open .menu-list li:nth-child(5) { animation-delay: .16s; }

/* ------------------------------------------------------------- footer --- */
.band { background-color: var(--band); color: var(--on-band); }
.band a { color: var(--on-band); text-decoration-color: var(--band-rule); }
.band a:hover { text-decoration-color: var(--band-accent); }
.band :focus-visible { outline-color: var(--band-accent); }
.site-foot { background-color: var(--band); color: var(--on-band); }
.foot-inner {
  padding-top: 32px; padding-bottom: 44px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 18px 40px;
}
.site-foot.joined .foot-inner { border-top: 1px solid var(--band-rule); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 16px; }
.footer-links a { color: var(--on-band); text-decoration-color: var(--band-rule); }
.footer-links a:hover, .footer-links a[aria-current="page"] { text-decoration-color: var(--band-accent); text-decoration-thickness: 2px; }
.foot-note { font-size: 15px; color: var(--band-2); }
.site-foot :focus-visible { outline-color: var(--band-accent); }

/* ------------------------------------------------------------- prints --- */
.print { background-color: var(--print); padding: 10px; border-radius: 2px; box-shadow: var(--shadow); }
.print img { width: 100%; border-radius: 1px; }
.print figcaption { padding: 12px 4px 4px; font-size: 15px; line-height: 1.5; color: var(--print-ink); }
.print figcaption b { display: block; font-weight: 600; color: var(--print-head); }
.print a { color: var(--print-head); }
/* Prints below the fold develop like film the first time they are seen. */
html.js .print.armed img { filter: sepia(.8) saturate(.25) brightness(1.3) contrast(.7); }
html.js .print.armed.developed img { filter: none; transition: filter 2.4s cubic-bezier(.3, .5, .2, 1); }

/* --------------------------------------------------------------- hero --- */
.hero { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 56px 64px; padding-top: clamp(48px, 6vw, 80px); }
.hero-copy { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.hero-name {
  font-family: var(--font-slab); font-weight: 700;
  font-size: clamp(64px, 10vw, 148px); line-height: .9; letter-spacing: -.025em; color: var(--head);
}
.hero-name span { display: block; }
.hero-title { font-size: clamp(60px, 8.4vw, 124px); } /* a page's one-word title in the home hero (Research) */
.hero-lede {
  margin-top: 10px; max-width: 20em;
  font-family: var(--font-slab); font-weight: 400;
  font-size: clamp(24px, 2.2vw, 31px); line-height: 1.3; color: var(--ink);
}
.hero-text { max-width: 33em; font-size: 19px; line-height: 1.65; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 10px; }
.hero-actions .mail { margin-left: 4px; font-weight: 500; }
.hero-photo { flex: 0 1 420px; min-width: 0; position: relative; padding-bottom: 150px; }
.hero-photo .print img { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 30%; }
.hero-photo .cap { margin: 12px 2px 0; text-align: right; }

.now-card {
  position: absolute; left: -56px; bottom: 16px; z-index: 2; width: 304px;
  border-radius: 3px; box-shadow: var(--shadow);
  padding: 16px 22px 14px;
  /* an index card: a header band, a brass rule, then ruled lines every 32 px */
  background:
    linear-gradient(var(--sheet), var(--sheet)) 0 0 / 100% 54px no-repeat,
    linear-gradient(180deg, transparent 31px, var(--card-line) 31px) 0 54px / 100% 32px repeat-y;
  background-color: var(--sheet);
}
.now-card::before { content: ""; position: absolute; left: 0; right: 0; top: 52px; height: 2px; background-color: var(--brass); }
.now-card h2 { margin: 0 0 2px; font-size: 22px; line-height: 36px; color: var(--head); }
.now-card p { font-size: 17px; line-height: 32px; }
.now-card p + p { color: var(--ink-2); }

/* The arrival: the one orchestrated moment on the page. */
html.js .hero-name { animation: pf-rise .9s var(--ease) .05s both; }
html.js .hero-lede { animation: pf-rise .9s var(--ease) .18s both; }
html.js .hero-text { animation: pf-rise .9s var(--ease) .3s both; }
html.js .hero-actions { animation: pf-rise .9s var(--ease) .42s both; }
html.js .hero-photo .print img { animation: pf-develop 3s cubic-bezier(.3, .5, .2, 1) .3s both; }

/* -------------------------------------------------------------- trace --- */
/* A CoDel delay trace drawn after the testbed captures: arches as the queue
   fills and drains, a notch where a packet is dropped. It draws in once,
   then drifts left at about 27 px a second and loops without a seam. */
.trace { position: relative; height: 150px; overflow: hidden; margin-top: 40px; color: var(--brass); }
.trace-floor { position: absolute; left: 0; right: 0; top: 128px; height: 1px; background-color: var(--rule-strong); }
.trace-run { display: flex; width: 3840px; animation: pf-drift 70s linear 4s infinite; }
.trace svg { flex: none; display: block; max-width: none; }
.trace-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pf-draw 3.2s cubic-bezier(.45, .05, .25, 1) .7s forwards; }
.trace-cap { margin-top: 14px; max-width: 46em; }

/* ------------------------------------------------------------- work --- */
.case { display: flex; flex-wrap: wrap; align-items: center; gap: 40px 64px; margin-top: 88px; }
.case.flip { flex-direction: row-reverse; }
.case-fig { flex: 1 1 560px; min-width: 0; }
.case-text { flex: 1 1 360px; min-width: 0; }
.case-text h3 { font-size: clamp(30px, 2.7vw, 38px); line-height: 1.1; letter-spacing: -.008em; }
.case-text .desc { margin-top: 18px; font-size: 19px; line-height: 1.6; color: var(--ink-2); }
.case-fig .print img.wide { aspect-ratio: 16 / 9; object-fit: cover; }
.case-fig .print img.four-three { aspect-ratio: 4 / 3; object-fit: cover; }
.facts {
  display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 10px 18px;
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--rule);
}
.facts dt { font-weight: 600; font-size: 15px; line-height: 1.7; color: var(--muted); }
.facts dd { font-size: 17px; line-height: 1.55; }
.links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 26px; font-weight: 500; }

.diagram-sheet { background-color: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; padding: clamp(12px, 2vw, 24px); }
.diagram-sheet svg { display: block; width: 100%; height: auto; }
.diagram figcaption { margin-top: 12px; }
.dg-frame { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.dg-box { fill: var(--sheet); stroke: var(--ink-2); stroke-width: 1.3; }
.dg-key { fill: var(--brass-wash); stroke: var(--brass); stroke-width: 2; }
.dg-line { fill: none; stroke: var(--ink-2); stroke-width: 1.3; }
.dg-thin { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; }
.dg-arrow { fill: none; stroke: var(--ink-2); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.dg-edge { fill: none; stroke: var(--rule-strong); stroke-width: 1.6; stroke-dasharray: 1 7; stroke-linecap: round; }
.dg-tunnel { fill: none; stroke: var(--brass); stroke-width: 3.5; stroke-linecap: round; }
.dg-t { font: 500 14px var(--font-sans); fill: var(--ink); }
.dg-h { font: 600 15px var(--font-sans); fill: var(--head); }
.dg-s { font: 400 12px var(--font-sans); fill: var(--muted); }
/* The diagram draws its wires the first time it is seen. */
html.js .diagram.armed .dg-line, html.js .diagram.armed .dg-arrow, html.js .diagram.armed .dg-tunnel { stroke-dasharray: 1; stroke-dashoffset: 1; }
html.js .diagram.armed .dg-thin, html.js .diagram.armed .dg-edge { opacity: 0; }
html.js .diagram.armed.drawn .dg-line, html.js .diagram.armed.drawn .dg-arrow { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s var(--ease) .15s; }
html.js .diagram.armed.drawn .dg-tunnel { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease) .8s; }
html.js .diagram.armed.drawn .dg-thin, html.js .diagram.armed.drawn .dg-edge { opacity: 1; transition: opacity .8s ease .6s; }

.minis-head { margin-top: 120px; font-size: 30px; line-height: 1.2; }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 0 64px; margin-top: 28px; }
.mini { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 26px 0 30px; border-top: 1px solid var(--rule); }
.mini h4 { font-size: 23px; line-height: 1.2; }
.mini p { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.mini .cap { color: var(--muted); }

/* ----------------------------------------------------- the route --- */
.route { list-style: none; margin: 56px 0 0; padding: 0; position: relative; }
.route::before, .route::after {
  content: ""; position: absolute; left: 10px; top: 14px; bottom: 60px; width: 2px;
}
.route::before { background-color: var(--rule-strong); }
/* the brass rail fills with the reader; site.js sets --route-progress */
.route::after { background-color: var(--brass); transform-origin: top; transform: scaleY(0); }
.route.armed::after { transform: scaleY(var(--route-progress, 0)); }
.hop { position: relative; display: flex; flex-wrap: wrap; gap: 6px 32px; padding: 0 0 52px 56px; }
.hop:last-child { padding-bottom: 0; }
.hop::before {
  content: ""; position: absolute; left: 3px; top: 9px; width: 16px; height: 16px; border-radius: 50%;
  background-color: var(--bg); border: 2px solid var(--head);
  transition: background-color .3s ease;
}
.hop.lit::before { background-color: var(--head); }
.hop.now::before { background-color: var(--brass); border-color: var(--brass); box-shadow: 0 0 0 6px var(--brass-wash); }
.hop-when { flex: 0 0 236px; display: flex; gap: 18px; align-items: baseline; }
.hop-n { flex: none; width: 22px; font-family: var(--font-slab); font-weight: 600; font-size: 30px; line-height: 1; color: var(--head); }
.hop-dates { display: flex; flex-direction: column; font-size: 16px; line-height: 1.5; }
.hop-dates b { font-weight: 500; color: var(--ink); }
.hop-body { flex: 1 1 420px; min-width: 0; }
.hop-body h3 { font-size: 27px; line-height: 1.2; }
.hop-body .org { margin-top: 4px; font-size: 17px; font-weight: 500; color: var(--ink-2); }
.hop-body p { margin-top: 10px; font-size: 17px; line-height: 1.6; }
.hop-body ul { margin-top: 10px; padding-left: 1.1em; font-size: 17px; line-height: 1.6; }
.hop-body li { padding: 2px 0; }
.hop-body li::marker { color: var(--brass); }

/* ------------------------------------------------------------ tools --- */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 40px 48px; margin-top: 48px; }
.tools h3 { margin-bottom: 10px; font-size: 23px; }
.tools ul { list-style: none; margin: 0; padding: 0; font-size: 17px; line-height: 1.95; }
.languages { margin-top: 44px; font-size: 19px; color: var(--ink-2); }

/* ---------------------------------------------------- photo strip --- */
.strip-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 48px; }
.strip-head > div { flex: 1 1 520px; min-width: 0; }
.strip {
  display: flex; align-items: flex-start; gap: 28px;
  --strip-inset: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
  margin-top: 44px; padding: 10px var(--strip-inset) 30px;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--strip-inset);
  scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent;
}
.strip .print { flex: none; scroll-snap-align: start; }
.strip .print img { height: 320px; object-fit: cover; }
.strip .portrait { width: 260px; }
.strip .landscape { width: 447px; }
.strip:focus-visible { outline-offset: -2px; }

/* -------------------------------------------------------- honors --- */
.creds { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.creds li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 32px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.creds .what { font-family: var(--font-slab); font-weight: 600; font-size: 22px; line-height: 1.3; color: var(--head); }
.creds .who { display: block; font-family: var(--font-sans); font-weight: 400; font-size: 16px; color: var(--ink-2); }
.creds .when { font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- contact --- */
.contact-inner {
  padding-top: clamp(80px, 8vw, 120px); padding-bottom: clamp(56px, 6vw, 88px);
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 48px 96px;
}
.contact-inner > div { flex: 1 1 560px; min-width: 0; }
.contact h2 { color: var(--on-band); font-size: clamp(44px, 5vw, 68px); line-height: 1; letter-spacing: -.015em; }
.contact p { margin-top: 22px; max-width: 32em; font-size: 19px; line-height: 1.6; color: var(--band-2); }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 30px; }
.band a.email {
  font-family: var(--font-slab); font-weight: 600; font-size: clamp(28px, 3.4vw, 46px); line-height: 1.2;
  color: var(--band-accent); text-decoration-color: var(--band-accent); text-decoration-thickness: 2px; text-underline-offset: .16em;
  overflow-wrap: anywhere;
}
.copy {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 6px;
  border: 1.5px solid var(--band-rule); background: transparent; color: var(--on-band);
  font: 500 15px/1 var(--font-sans); cursor: pointer; transition: border-color .2s ease;
}
.copy:hover { border-color: var(--band-accent); }
.contact-links { list-style: none; margin: 0; padding: 0; flex: 0 1 300px; display: flex; flex-direction: column; gap: 14px; font-size: 19px; font-weight: 500; }

/* ------------------------------------------------- page headers --- */
.page-head { padding-top: 64px; }
.page-title { font-weight: 700; font-size: clamp(48px, 6vw, 84px); line-height: .98; letter-spacing: -.02em; }
.page-intro { margin-top: 22px; max-width: 32em; font-size: 20px; line-height: 1.6; color: var(--ink-2); }

/* ------------------------------------------------------- research --- */
.reading { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px 72px; margin-top: 96px; }
.toc { flex: 0 0 232px; position: sticky; top: 110px; max-height: calc(100vh - 130px); overflow-y: auto; font-size: 15px; line-height: 1.5; }
.toc h2 { font-family: var(--font-sans); font-size: 15px; font-weight: 600; color: var(--muted); }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.toc ol ol { margin: 6px 0 4px 14px; gap: 4px; }
.toc a { color: var(--ink); text-decoration-line: none; }
.toc a:hover, .toc a[aria-current] { text-decoration-line: underline; text-decoration-color: var(--brass); text-decoration-thickness: 2px; }
.toc > ol > li > a { font-weight: 600; color: var(--head); }
.posts { flex: 1 1 560px; min-width: 0; max-width: 800px; }
.post + .post { margin-top: 140px; padding-top: 72px; border-top: 2px solid var(--head); }
.post-title { font-weight: 700; font-size: clamp(34px, 4vw, 54px); line-height: 1.05; letter-spacing: -.015em; }
.post-stand { margin-top: 18px; max-width: 30em; font-family: var(--font-slab); font-size: clamp(20px, 2vw, 25px); line-height: 1.38; color: var(--ink); }
.post-meta { margin-top: 14px; font-size: 16px; }
.post-cover { margin-top: 36px; }
.post-cover img { aspect-ratio: 2 / 1; object-fit: cover; }
.post-cover.tall img { aspect-ratio: 4 / 3; object-position: 50% 40%; }

.prose { margin-top: 40px; font-size: 19px; line-height: 1.7; }
.prose > * + * { margin-top: 20px; }
.prose > p, .prose > ul, .prose > ol { max-width: 680px; }
.prose h3 { margin-top: 64px; font-size: 32px; line-height: 1.15; letter-spacing: -.008em; }
.prose h4 { margin-top: 40px; font-size: 23px; line-height: 1.25; }
.prose h3 + *, .prose h4 + * { margin-top: 14px; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: 8px 0; }
.prose li::marker { color: var(--brass); }
.prose ol li::marker { font-weight: 600; color: var(--head); }
.prose strong { color: var(--head); }
.prose code { font-family: var(--font-code); font-size: .84em; background-color: var(--well); padding: 2px 6px; border-radius: 3px; overflow-wrap: anywhere; }
.prose figure { margin-top: 40px; }
.prose > figure + * { margin-top: 32px; }
.prose figcaption b { display: inline; }
.prose .legend { font-size: 16px; color: var(--ink-2); }
.codeblock {
  max-width: 680px; padding: 18px 22px; border-radius: 4px;
  background-color: var(--well); color: var(--ink);
  font-family: var(--font-code); font-size: 14.5px; line-height: 1.8;
  white-space: pre; overflow-x: auto;
}
.codeblock .prompt, .codeblock .comment { color: var(--muted); }
.pull { max-width: 640px; margin-top: 44px !important; font-family: var(--font-slab); font-weight: 600; font-size: 30px; line-height: 1.3; color: var(--head); }
.next {
  display: flex; flex-wrap: wrap; align-items: center; gap: 22px 36px;
  margin-top: 96px; padding: 24px; border-radius: 4px;
  background-color: var(--sheet); border: 1px solid var(--rule); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
}
.next img { width: 132px; height: 132px; object-fit: cover; border-radius: 2px; flex: none; }
.next span { display: flex; flex-direction: column; gap: 6px; flex: 1 1 300px; min-width: 0; }
.next .t { font-family: var(--font-slab); font-weight: 600; font-size: 26px; line-height: 1.2; color: var(--head); }
.next:hover .t { text-decoration: underline; text-decoration-color: var(--brass); text-decoration-thickness: 2px; }

/* ---------------------------------------------------------- homelab --- */
.panel-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px 64px; }
.panel-row > div:first-child { flex: 1 1 560px; min-width: 0; }
.probe {
  flex: 0 1 400px; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: 22px 24px; border-radius: 4px; background-color: var(--sheet); border: 1px solid var(--rule);
}
.probe p { font-size: 17px; line-height: 1.5; }
.probe-note { margin-top: 32px; max-width: 46em; font-size: 16px; }
.list-head { margin: 72px 0 18px; font-size: 30px; }
.svc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.svc-row {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(170px, auto);
  align-items: center; gap: 6px 32px; padding: 20px 0; border-bottom: 1px solid var(--rule);
}
.svc-open { font-family: var(--font-slab); font-weight: 600; font-size: 23px; line-height: 1.25; color: var(--head); }
.svc-what { display: block; margin-top: 2px; font-size: 16px; color: var(--ink-2); }
.svc-host { font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.svc-stat { font-size: 16px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-stat[data-state="reach"], .svc-stat[data-state="ok"] { color: var(--head); }
.svc-stat[data-state="fail"] { color: var(--warn); }
.svc-stat[data-state="busy"] { color: var(--muted); }

/* ------------------------------------------- filter-style buttons --- */
/* The queue simulator's algorithm picker: one pressed button at a time. */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.filters button {
  appearance: none; cursor: pointer; min-height: 44px; padding: 0 18px; border-radius: 6px;
  border: 1.5px solid var(--rule-strong); background: transparent; color: var(--ink);
  font: 500 16px/1 var(--font-sans);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.filters button:hover { border-color: var(--head); }
.filters button[aria-pressed="true"] { background-color: var(--action); border-color: var(--action); color: var(--on-action); }

/* ---------------------------------------------------- simple pages --- */
.doc { max-width: 760px; }
.doc .prose { margin-top: 48px; }
.doc .prose h2 { margin-top: 56px; font-size: 32px; line-height: 1.15; }
.doc .prose h2:first-child { margin-top: 0; }
.updated { font-size: 16px; color: var(--muted); }

.lost { padding-top: 96px; padding-bottom: 120px; display: flex; flex-wrap: wrap; align-items: center; gap: 56px 80px; }
.lost > div { flex: 1 1 480px; min-width: 0; }
.lost-fig { flex: 1 1 460px; min-width: 0; }
.lost-fig svg { display: block; width: 100%; height: auto; }
.lost .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 32px; }
.wire { fill: none; stroke: var(--ink-2); stroke-width: 1.6; }
.wire-done { fill: none; stroke: var(--brass); stroke-width: 3; stroke-linecap: round; }
.wire-gone { fill: none; stroke: var(--rule-strong); stroke-width: 1.6; stroke-dasharray: 3 9; stroke-linecap: round; }
.node { fill: var(--sheet); stroke: var(--ink-2); stroke-width: 1.6; }
.node-on { fill: var(--brass-wash); stroke: var(--brass); stroke-width: 2.5; }
.node-gone { fill: none; stroke: var(--rule-strong); stroke-width: 1.6; stroke-dasharray: 4 5; }
.cross { fill: none; stroke: var(--brass); stroke-width: 3; stroke-linecap: round; }
.nlb { font: 600 15px var(--font-sans); fill: var(--ink); }
.nlb-m { font: 400 14px var(--font-sans); fill: var(--muted); }

/* ------------------------------------------------------------- motion --- */
/* Full motion for every visitor (AGENTS.md): no preference, device or idle
   gates. Hidden tabs pause decorative loops; they resume when visible. */
@keyframes pf-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pf-develop { from { filter: sepia(.8) saturate(.25) brightness(1.3) contrast(.7); } to { filter: none; } }
@keyframes pf-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pf-drift { from { transform: translateX(0); } to { transform: translateX(-1920px); } }
@keyframes pf-drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
html.bg-hidden .trace-run, html.bg-hidden .trace-draw { animation-play-state: paused; }

/* --------------------------------------------------------- responsive --- */
@media (max-width: 900px) {
  .nav-links, .site-nav > .theme-switch { display: none; }
  .menu-btn { display: inline-flex; }
  .site-nav { height: 64px; }
  .wordmark { font-size: 23px; }
  .hero-photo { padding-bottom: 0; }
  .now-card { position: relative; left: auto; bottom: auto; width: auto; margin-top: 18px; }
  .toc { position: static; max-height: none; flex-basis: 100%; }
  .svc-row { grid-template-columns: 1fr; }
}
/* Without JavaScript the menu button cannot open anything, so the links
   stay in the bar and wrap instead. */
@media (max-width: 900px) {
  html:not(.js) .site-nav { height: auto; flex-wrap: wrap; padding-block: 14px; }
  html:not(.js) .nav-links { display: flex; flex-wrap: wrap; gap: 8px 20px; width: 100%; }
  html:not(.js) .menu-btn { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .mail { margin-left: 0; align-self: flex-start; }
  .hop { padding-left: 44px; }
  .hop-when { flex-basis: 100%; }
  .facts { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 14px; }
  .strip .print img { height: 260px; }
  .strip .portrait { width: 215px; }
  .strip .landscape { width: 367px; }
  .prose { font-size: 18px; }
}

/* -------------------------------------------------------------- print --- */
@media print {
  .site-head, .menu-sheet, .trace, .theme-switch, .menu-btn, .copy, .skip-link, .probe button { display: none !important; }
  body { background: #fff !important; color: #000; font-size: 12pt; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .band, .site-foot { background: #fff !important; color: #000 !important; }
  .band a, .site-foot a, .band a.email { color: #000 !important; }
  .contact h2, .contact p { color: #000 !important; }
  .print { box-shadow: none; border: 1px solid #ccc; }
  .print img, html.js .print.armed img { filter: none !important; }
  .now-card { position: static; width: auto; box-shadow: none; border: 1px solid #ccc; }
  .hero-photo { padding-bottom: 0; }
  .route::after { transform: scaleY(1) !important; }
  .strip { overflow: visible; flex-wrap: wrap; }
  .toc { position: static; }
  a { text-decoration: underline; }
}
