/* The site: the index (short paragraphs, then plain lists of writing and
   projects), the research note and the project pages, all in Mona Sans.
   /tvc keeps its report stylesheet, styles.css, with tvc.css on top. Inter
   supplies µ and β, which Mona Sans lacks. */
@font-face { font-family: "Mona Sans"; src: url(/assets/fonts/mona-sans-latin-wdth-wght-normal.woff2) format("woff2"); font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: "Mona Sans"; font-style: italic; src: url(/assets/fonts/mona-sans-latin-wdth-wght-italic.woff2) format("woff2"); font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: "Inter Fallback"; src: url(/assets/fonts/inter-fallback-opsz-wght-normal.woff2) format("woff2"); unicode-range: U+00B5, U+03B2, U+2020, U+2079, U+207B; font-weight: 100 900; font-display: swap; }

:root {
  --ground: #fbfbf9;
  --ink: #111110;
  --body: #55544f;
  --quiet: #6b6963;
  --faint: #74726c;
  --rule: #e6e5e0;
  --fill: #f1f0ec;
  --link-line: #c9c7c0;
  --signal: #111110;
  --signal-wash: rgba(17, 17, 16, .1);
  --hack: #d9480f;
  --neutral: #918f88;
  --neutral-2: #d8d6cf;
  --sans: "Mona Sans", "Inter Fallback", ui-sans-serif, system-ui, sans-serif;
  --code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0b0b0b;
    --ink: #f3f2ee;
    --body: #a7a59f;
    --quiet: #8f8d87;
    --faint: #85837d;
    --rule: #232322;
    --fill: #161615;
    --link-line: #4d4c49;
    --signal: #f3f2ee;
    --signal-wash: rgba(243, 242, 238, .12);
    --hack: #ff7b45;
    --neutral: #6a6863;
    --neutral-2: #353432;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 19px/1.8 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--link-line); text-decoration-thickness: 1px; text-underline-offset: .28em; font-weight: 500; }
a:hover { text-decoration-color: var(--ink); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--signal-wash); }

.hbar, main, .hfoot { width: 100%; max-width: 46rem; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
.hbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1.5rem; padding-top: 2.2rem; }
.home-link { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; text-decoration: none; padding: .55rem 0; }
.hbar nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; font-size: .95rem; letter-spacing: .01em; }
.hbar nav a { color: var(--quiet); text-decoration: none; font-weight: 450; padding: .55rem 0; }
.hbar nav a:hover, .hbar nav a[aria-current="page"], .hbar nav a.is-here { color: var(--ink); }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: .5rem 1rem; background: var(--ink); color: var(--ground); font-size: .95rem; text-decoration: none; }
.skip:focus-visible { top: 1rem; }

main { flex: 1; }
.home main { padding-top: clamp(3.5rem, 9vw, 6rem); }
.about p { color: var(--body); margin: 0 0 1.45rem; text-wrap: pretty; }

.index { margin: 4.5rem 0 0; }
.index + .index { margin-top: 4rem; }
.index h2 { font-size: .95rem; font-weight: 500; color: var(--quiet); margin: 0 0 .9rem; }
.index ol { list-style: none; margin: 0; padding: 0; font-size: 1rem; line-height: 1.5; }
.index li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto 3.75rem; column-gap: 1rem; align-items: baseline; padding: .85rem 0; border-top: 1px solid var(--rule); }
.index li:last-child { border-bottom: 1px solid var(--rule); }
.index .yr, .index .kind, .index .dt { color: var(--faint); font-variant-numeric: tabular-nums; }
.index .dt { text-align: right; white-space: nowrap; }
.index .dt-yr { display: none; }
.index a { text-decoration: none; font-weight: 500; }
.index a:hover { text-decoration: underline; text-decoration-color: var(--ink); }
.projects li { grid-template-columns: 4.5rem minmax(0, 1fr) auto; }
.projects .what { display: flex; flex-direction: column; gap: .1rem; }
.projects .desc { color: var(--body); font-size: .95rem; }
.projects .dt { white-space: nowrap; }

.hfoot { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem 2rem; padding-top: 6rem; padding-bottom: 2.6rem; font-size: .95rem; color: var(--quiet); }
.hfoot p { margin: 0; }
.hfoot a { color: var(--quiet); text-decoration: none; font-weight: 450; }
.hfoot a:hover { color: var(--ink); }
.hfoot-links { display: flex; gap: 0 1.4rem; flex-wrap: wrap; }
.hfoot-links a { padding: .55rem 0; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 40rem) {
  body { font-size: 18px; line-height: 1.72; }
  .hbar, main, .hfoot { padding-left: 1.15rem; padding-right: 1.15rem; }
  .index li { grid-template-columns: minmax(0, 1fr) auto; row-gap: .1rem; }
  .index .yr { display: none; }
  .index li > a { grid-column: 1 / -1; }
  .index .kind { grid-column: 1; }
  .index .dt { grid-column: 2; }
  .index .dt-yr { display: inline; }
  .projects li { grid-template-columns: minmax(0, 1fr); }
  .projects .what { grid-column: 1; }
  .projects .dt { grid-column: 1; text-align: left; }
}

/* ---- The research note and the project pages: a large title, a quiet body. ---- */
.note-head { margin: 5.5rem 0 3.4rem; }
.kicker { font-size: .92rem; color: var(--quiet); margin: 0 0 1.4rem; font-weight: 450; }
.note-head h1 { font-size: clamp(2.9rem, 8.4vw, 5rem); font-weight: 760; font-stretch: 96%; line-height: .98; letter-spacing: -.048em; margin: 0 0 1.8rem; margin-left: -.04em; text-wrap: balance; }
.dek { font-size: 1.28rem; line-height: 1.55; color: var(--ink); margin: 0 0 1.4rem; font-weight: 420; text-wrap: pretty; }
.byline { color: var(--faint); font-size: .95rem; margin: 0; }
.byline a { color: var(--quiet); }
.opening { font-size: 1.12rem; color: var(--ink); margin: 0 0 3.6rem; text-wrap: pretty; }
.note p, .note li { color: var(--body); }
.note p { margin: 0 0 1.4rem; text-wrap: pretty; }
.note section { margin: 0 0 4.2rem; }
.note h2 { font-size: 1.6rem; line-height: 1.15; letter-spacing: -.028em; font-weight: 680; margin: 0 0 1.2rem; color: var(--ink); text-wrap: balance; }
.note h2 .num { color: var(--faint); font-weight: 500; margin-right: .6rem; font-variant-numeric: tabular-nums; }
.note h3 { font-size: 1.02rem; font-weight: 620; margin: 0 0 .3rem; color: var(--ink); }
.note h3 .at { color: var(--faint); font-weight: 450; margin-left: .35rem; }
.note strong { color: var(--ink); font-weight: 600; }
.note li { margin: 0 0 .8rem; }
.note li::marker { color: var(--faint); }
.summary h2 { font-size: .95rem; font-weight: 500; color: var(--quiet); letter-spacing: 0; }
.summary ol { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); counter-reset: s; }
.summary li { counter-increment: s; position: relative; padding: 1rem 0 1rem 2.4rem; margin: 0; border-bottom: 1px solid var(--rule); color: var(--ink); }
.summary li::before { content: counter(s); position: absolute; left: 0; color: var(--faint); font-variant-numeric: tabular-nums; }
.steps, .limits { padding-left: 1.25rem; }
.events article { margin: 0 0 1.8rem; }
.events p { margin-bottom: .7rem; }
code { font-family: var(--code); font-size: .84em; color: var(--ink); }
pre { font-family: var(--code); font-size: .82rem; line-height: 1.65; background: var(--fill); padding: 1rem 1.2rem; border-radius: 6px; overflow-x: auto; margin: .2rem 0 1.4rem; }
pre code { font-size: 1em; }
pre .c { color: var(--quiet); }
.posthoc .flag { display: inline-block; font-size: .85rem; color: var(--quiet); margin: 0 0 .7rem; font-weight: 500; }
.posthoc .flag::before { content: ""; display: inline-block; width: .55rem; height: .55rem; margin-right: .5rem; background: var(--hack); border-radius: 50%; }
.table-note { font-size: 1rem; line-height: 1.65; }
.credit p { font-size: .92rem; line-height: 1.65; }
.link-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.note .link-list li { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); column-gap: 1rem; padding: .85rem 0; margin: 0; border-bottom: 1px solid var(--rule); font-size: 1rem; line-height: 1.5; }
.link-list a { text-decoration: none; }
.link-list a:hover { text-decoration: underline; }
.link-list span { color: var(--quiet); }

.table-wrap { overflow-x: auto; margin: 1.4rem 0 .8rem; }
.table-wrap.is-wide, .fig.is-wide { width: min(60rem, calc(100vw - 2.5rem)); margin-left: 50%; transform: translateX(-50%); }
.table-cap { font-size: .85rem; color: var(--quiet); margin: 1.4rem 0 0; }
.table-cap + .table-wrap { margin-top: .6rem; }
.table-cap.is-wide { width: min(60rem, calc(100vw - 2.5rem)); margin-left: 50%; transform: translateX(-50%); }
table { border-collapse: collapse; width: 100%; font-size: .85rem; line-height: 1.5; }
thead th { font-weight: 500; text-align: left; vertical-align: bottom; color: var(--quiet); padding-bottom: .6rem; }
th, td { padding: .7rem 1rem .7rem 0; vertical-align: top; border-top: 1px solid var(--rule); color: var(--body); }
thead th { border-top: 0; }
tbody th { text-align: left; font-weight: 600; white-space: nowrap; color: var(--ink); }
td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
table a { overflow-wrap: anywhere; }
.fig { --fig-fs: .8rem; margin: 3.2rem 0; }
@media (max-width: 60rem) { .table-wrap.is-wide, .fig.is-wide, .table-cap.is-wide { width: auto; margin-left: 0; transform: none; } }
@media (max-width: 40rem) { .note-head { margin-top: 3.6rem; } .note .link-list li { grid-template-columns: 1fr; } }
.table-wrap:focus-visible, pre:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
