/* ---------------------------------------------------------------
   personal site — print typography, one centre column, lowercase.
   rule · name · double rule · content · menu at the foot.
   --------------------------------------------------------------- */

/* AVHershey Complex — the smplotlib / Super-Mongo plotting font.
   Self-hosted from github.com/AstroJacobLi/smplotlib (Hershey vector fonts).
   Used for the masthead only; see the note at .name below. */
@font-face {
  font-family: "AVHershey Complex";
  src: url("fonts/AVHersheyComplexMedium.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "AVHershey Complex";
  src: url("fonts/AVHersheyComplexHeavy.ttf") format("truetype");
  font-weight: 600 700;
  font-display: swap;
}

:root {
  --paper:  #ffffff;
  --ink:    #1b1a17;
  --muted:  #6d6a63;
  --rule:   #d9d5cc;
  --accent: #8a2b20;

  --measure: 36rem;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype",
           Palatino, Georgia, "Times New Roman", serif;
  --hershey: "AVHershey Complex", var(--serif);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #14140f;
    --ink:    #e8e4da;
    --muted:  #9a958a;
    --rule:   #34322b;
    --accent: #d98878;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 1.5rem 5rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "onum" 1, "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.column { max-width: var(--measure); margin: 0 auto; }

/* --- masthead: double rule, name, double rule ----------------- */

.masthead {
  position: relative;
  margin-top: 5rem;
  padding: 0.8rem 0;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  text-align: left;
}

/* the hairlines that pair with each heavy rule */
.masthead::before,
.masthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--ink);
}

.masthead::before { top: -6px; }
.masthead::after  { bottom: -7px; }

/* the AVHershey face is still loaded above: swap var(--serif) for
   var(--hershey) here (or on body) to bring the plotting font back. */
.name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.name a { color: inherit; text-decoration: none; }

@media (max-width: 30rem) {
  .masthead { margin-top: 2.25rem; }
  body { padding-bottom: 3rem; }
}

/* --- portrait ------------------------------------------------- */

/* photo and opening paragraph as two columns — no text runs under
   the picture, so no orphan line dangling beneath it */
.intro {
  display: grid;
  grid-template-columns: 10.5rem 1fr;
  gap: 0 1.35rem;
  align-items: start;
}

.portrait {
  width: 100%;
  height: auto;
  margin-top: 0.3rem;
}

/* on a phone the opening paragraph comes first, the photo after it */
@media (max-width: 30rem) {
  .intro { display: flex; flex-direction: column; }
  .intro p { order: 1; }
  .intro .portrait {
    order: 2;
    width: 8.5rem;
    height: auto;            /* back to natural proportions on a phone */
    margin: 1.1rem 0 0.4rem;
  }
}

/* --- body copy ------------------------------------------------ */

main { margin-top: 2.5rem; }

/* a full-measure divider between blocks */
hr {
  margin: 2.4rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

p { margin: 0 0 1.2rem; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.17em;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 120ms ease, color 120ms ease;
}

a:hover { color: var(--accent); text-decoration-color: currentColor; }

h2 {
  margin: 2.6rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--muted);
}

h3 {
  margin: 0 0 0.15rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

/* --- entry lists ---------------------------------------------- */

.entries { margin: 0; padding: 0; list-style: none; }

.entry {
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  gap: 0 1.25rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
}

.entry:last-child { border-bottom: 0; }

.entry .when {
  padding-top: 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: lining-nums;
}

.entry .what p { margin: 0.1rem 0 0; color: var(--muted); }
.entry .where { color: var(--muted); font-style: italic; }

@media (max-width: 30rem) {
  .entry { grid-template-columns: 1fr; gap: 0.1rem; }
  .entry .when { padding-top: 0; order: -1; }
}

/* --- footnote ------------------------------------------------- */

/* the marker in the text: raised, small, no underline */
.fn-ref {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  text-decoration: none;
  padding-left: 0.1em;
}

/* the note itself: short rule, small type, hanging indent */
.footnote {
  margin: 2.6rem 0 0;
  padding-left: 1.1rem;
  text-indent: -1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.footnote + .footnote { margin-top: 0.2rem; }

.footnote a {
  text-decoration: none;
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
}

/* --- cv: one line per fact, right-aligned dates ---------------- */

.cv h2,
.pubs-page h2 {
  margin: 2.2rem 0 0.8rem;
  border-bottom: 0;
  text-align: center;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.16em;
}

.cv h2:first-child,
.pubs-page h2:first-child { margin-top: 0; }

.cv-list { margin: 0; padding: 0; list-style: none; }

.cv-list li { margin-bottom: 0.7rem; }
.cv-list li:last-child { margin-bottom: 0; }

.cv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  line-height: 1.4;
}

.cv-row .right {
  flex: none;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

.cv-row .role { color: var(--muted); }

/* awards: a single line each, tighter */
.cv-list.tight li { margin-bottom: 0.12rem; }

/* a wrapped entry indents under itself rather than under the year */
.cv-row .left { padding-left: 1rem; text-indent: -1rem; }

.cv-note {
  margin-top: 2.2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 30rem) {
  .cv-row { flex-direction: column; gap: 0; }
  .cv-row .right { text-align: left; }
}

/* --- publications -------------------------------------------- */

.pubs-page h3.pub-sub {
  margin: 1.5rem 0 0.8rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.pubs { margin: 0; padding: 0; list-style: none; }

.pub { margin-bottom: 1.05rem; }
.pub:last-child { margin-bottom: 0; }

.pub .title { display: block; line-height: 1.4; }

.pub .meta {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.pub .me { color: var(--ink); }

/* --- contact -------------------------------------------------- */

.address {
  margin: 0 0 2rem;
  line-height: 1.75;
}

.elsewhere { margin-top: 2rem; }

.todo {
  color: var(--accent);
  border-bottom: 1px dotted currentColor;
}

/* --- contact links -------------------------------------------------- */

.contact-list { margin: 0; padding: 0; list-style: none; }

.contact-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.contact-list .label {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

/* --- menu at the foot ----------------------------------------- */

nav.tabs {
  margin-top: 1.5rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

nav.tabs a {
  display: inline-block;
  margin: 0 0.55rem;
  padding-bottom: 1px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

nav.tabs a:hover { color: var(--ink); border-bottom-color: var(--rule); }
nav.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

nav.tabs .sep { color: var(--rule); }

.updated {
  margin: 0.9rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- print ---------------------------------------------------- */

@media print {
  :root { --paper:#fff; --ink:#000; --muted:#444; --rule:#bbb; }
  body { font-size: 10.5pt; padding: 0; }
  nav.tabs { display: none; }
  .masthead { margin-top: 0; }
  a { text-decoration: none; }
  .entry { break-inside: avoid; }
}
