/* ===========================================================================
   The résumé, set the way LaTeX would set it: Computer Modern, a centred
   masthead, ruled section heads, justified body copy, tight leading — laid
   out on a Letter-sized page.
   =========================================================================== */

:root {
  --ink:   #111;
  --soft:  #333;
  --faint: #555;
  --rule:  #111;
  --page:  #fff;
  --desk:  #f2f2f3;

  --serif: "CMU Serif", "Latin Modern Roman", "EB Garamond",
           Georgia, "Times New Roman", Times, serif;

  --page-w: 8.5in;
  --margin: 0.55in;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 0 40px;
  background: var(--desk);
  color: var(--ink);
  font: 500 10pt/1.32 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 1.5px; }

/* ── toolbar (screen only) ──────────────────────────────────────────────── */

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: var(--page-w);
  max-width: 100%;
  margin: 0 auto;
  padding: 18px 2px 12px;
}
.tool {
  padding: 5px 12px;
  border: 1px solid #c9c9cc;
  border-radius: 3px;
  background: #fff;
  color: var(--faint);
  font: 500 10pt var(--serif);
  cursor: pointer;
}
.tool:hover { border-color: #8d8d92; color: var(--ink); text-decoration: none; }

/* ── the page ───────────────────────────────────────────────────────────── */

.pages { width: var(--page-w); max-width: 100%; margin: 0 auto; }

.sheet {
  width: 100%;
  min-height: 11in;
  padding: var(--margin);
  margin-bottom: 22px;
  background: var(--page);
  border: 1px solid #dcdcdf;
  box-shadow: 0 1px 3px #00000014, 0 8px 24px #0000000f;
}

.loading { padding: 40px; color: var(--faint); font-style: italic; }

/* ── masthead ───────────────────────────────────────────────────────────── */

.masthead { text-align: center; margin-bottom: 13px; }
.masthead h1 {
  margin: 0;
  font-size: 22pt;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .01em;
}
.role {
  margin: 2px 0 0;
  font-size: 11pt;
  font-style: italic;
  color: var(--soft);
}
.meta { margin: 5px 0 0; font-size: 9.4pt; color: var(--soft); }
.meta span + span::before { content: "|"; margin: 0 7px; color: #999; }
.meta.links { margin-top: 1px; }

/* ── \section ───────────────────────────────────────────────────────────── */

section { margin-top: 12px; }

h2 {
  margin: 0 0 5px;
  padding-bottom: 1.5px;
  border-bottom: .9px solid var(--rule);
  font-size: 11pt;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* ── entries ────────────────────────────────────────────────────────────── */

.entry { margin-bottom: 8px; break-inside: avoid; }
.entry:last-child { margin-bottom: 0; }

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.entry-head h3 {
  margin: 0;
  font-size: 11pt;
  font-weight: 700;
  line-height: 1.3;
}
.entry-head .at { font-weight: 500; }
.entry-head .org { font-weight: 700; }
.when {
  flex: none;
  font-size: 9.8pt;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sub {
  margin: 0 0 2px;
  font-size: 9.8pt;
  font-style: italic;
  color: var(--soft);
}
.sub .dot { margin: 0 6px; font-style: normal; }

.entry ul { margin: 2px 0 0; padding-left: 15px; }
.entry li {
  margin-bottom: 1.5px;
  text-align: justify;
  hyphens: auto;
}
.entry li::marker { font-size: .8em; }

.body { margin: 1px 0 2px; text-align: justify; hyphens: auto; }
.stack { margin: 0; font-size: 9.6pt; font-style: italic; color: var(--soft); }

/* ── skills table ───────────────────────────────────────────────────────── */

.skills {
  display: grid;
  grid-template-columns: 1.35in 1fr;
  gap: 2.5px 12px;
  margin: 0;
}
.skills dt { font-weight: 700; }
.skills dd { margin: 0; text-align: justify; }

/* ── markdown blocks ────────────────────────────────────────────────────── */

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 4px; text-align: justify; hyphens: auto; }
.prose h2, .prose h3 {
  margin: 6px 0 2px;
  padding: 0;
  border: 0;
  font-size: 10.6pt;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.prose ul, .prose ol { margin: 2px 0 4px; padding-left: 15px; }
.prose li { margin-bottom: 1.5px; text-align: justify; hyphens: auto; }
.prose li::marker { font-size: .8em; }
.prose blockquote {
  margin: 5px 0 5px 14px;
  font-style: italic;
  color: var(--soft);
}
.prose hr { display: none; }
.prose strong { font-weight: 700; }
.prose code { font-family: "CMU Typewriter Text", ui-monospace, monospace; font-size: .95em; }

/* ── case studies: their own page, like a second LaTeX section ──────────── */

.entry.case { margin-bottom: 13px; }
.entry.case h3 { margin: 0 0 3px; font-size: 10.8pt; font-weight: 700; }
.entry.case p { margin: 0 0 4px; text-align: justify; hyphens: auto; }
.entry.case:last-child { margin-bottom: 0; }

.colophon {
  margin-top: 16px;
  padding-top: 5px;
  border-top: .6px solid #bbb;
  font-size: 8.8pt;
  font-style: italic;
  color: var(--faint);
  text-align: center;
}

/* ── screens narrower than a page ───────────────────────────────────────── */

@media (max-width: 8.9in) {
  :root { --margin: 6vw; }
  body { font-size: 11pt; padding-bottom: 24px; }
  .pages, .toolbar { width: 100%; }
  .sheet { min-height: 0; margin-bottom: 0; border: 0; box-shadow: none; }
  .toolbar { padding: 14px 6vw 10px; }
  .entry-head { display: block; }
  .when { display: block; }
  .skills { grid-template-columns: 1fr; gap: 0; }
  .skills dd { margin-bottom: 6px; }
}

/* ── print: this is the document ────────────────────────────────────────── */

@page { size: letter; margin: 0.6in; }

@media print {
  body { background: #fff; padding: 0; font-size: 9.9pt; line-height: 1.3; }
  .toolbar, .colophon { display: none; }
  .pages { width: auto; }
  .sheet {
    width: auto;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
  }
  .sheet + .sheet { break-before: page; }
  .masthead h1 { font-size: 20pt; }
  section { margin-top: 10px; }
  a { text-decoration: none; }
}
