/* resume.css — the CV page (/resume.html). Load after style.css.
 *
 * The resume's markup is unchanged. On a wide screen <body> becomes a two-column grid: section
 * labels (the h2s) sit in a left rail beside the first row of their section, everything else in
 * the right column. Each h2 takes column 1 and the element after it takes column 2, so grid
 * auto-placement puts them on the same row. Below 860px and in print it is one column. */

html { max-width: 64rem; }

body {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 46rem);
  column-gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
/* <main> only carries the landmark; its children join the body grid directly */
main { display: contents; }
body > *, main > * { grid-column: 2; min-width: 0; }
body > .back-link, main > h1, main > .standfirst, main > .figures, body > footer { grid-column: 1 / -1; }
body > .back-link { justify-self: start; }

/* ── Masthead ────────────────────────────────────────────────────────────── */
h1 {
  margin: 0.5rem 0 0;
  font-size: clamp(3.4rem, 1.6rem + 6.4vw, 6rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}
.standfirst {
  margin: 1.1rem 0 2.2rem;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  line-height: 1.7;
  color: var(--fg-3);
}
.standfirst a { color: var(--fg-2); text-decoration-color: var(--line-strong); }
.standfirst a:hover { color: var(--link); }

.lede {
  max-width: 40rem;
  margin: 0 0 2rem;
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.32rem);
  line-height: 1.45;
  color: var(--fg-2);
}

/* three headline results, set as large figures */
.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem clamp(1.2rem, 3vw, 2.6rem);
  margin: 0 0 1rem;
  padding: 1.5rem 0 1.6rem;
  border-top: 2px solid var(--head);
  border-bottom: 1px solid var(--line-strong);
}
.figure strong {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--f-display);
  font-size: clamp(2.1rem, 1.4rem + 2.2vw, 3.1rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--head);
  text-shadow: 0.04em 0.03em 0 var(--coral-a);
  white-space: nowrap;
}
.figure span {
  display: block;
  max-width: 17rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--fg-2);
}

/* ── Section labels in the left rail ─────────────────────────────────────── */
h2 {
  grid-column: 1;
  margin: 3rem 0 0;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--sage-ink);
}
h2::before { content: ""; display: block; width: 1.7rem; height: 5px; margin-bottom: 0.7rem; background: var(--sage); }
h2 .when {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--fg-3);
}
h2 + .rule { display: none; }
h2 + .rule + * { margin-top: 3rem; }

/* ── Experience ──────────────────────────────────────────────────────────── */
.role {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1.2rem;
  margin: 0 0 0.6rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line-strong);
}
.role strong {
  font-family: var(--f-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
  color: var(--head);
}
.role span { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--fg-3); }

ul { margin: 0 0 1.2rem; padding-left: 1.2rem; }
li { margin-bottom: 0.85rem; }
li b {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--head);
}
/* the links after each entry: mono, quiet, underlined on hover */
ul:not(.skills):not(.pubs) li > a {
  font-family: var(--f-mono);
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  color: var(--fg-2);
  text-decoration-color: var(--coral-a2);
}
ul:not(.skills):not(.pubs) li > a:hover { color: var(--link); text-decoration-color: currentColor; }

/* ── Skills ──────────────────────────────────────────────────────────────── */
.skills { list-style: none; padding-left: 0; }
.skills li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0 1rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.skills li b {
  font-family: var(--f-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding-top: 0.2rem;
}

/* ── Publications ────────────────────────────────────────────────────────── */
.pubs { list-style: none; padding-left: 0; }
.pubs li { margin-bottom: 0.55rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--line); font-size: 0.97rem; }
.pubs li a { font-family: var(--f-display); font-weight: 560; font-size: 1.04rem; }

footer { margin-top: 4rem; }

/* ── One column ──────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  body { display: block; }
  main { display: block; }
  h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.2rem 1rem;
    margin: 2.6rem 0 0;
    padding-top: 0.9rem;
    position: relative;
  }
  h2::before { position: absolute; top: 0; left: 0; margin: 0; }
  h2 .when { display: inline; margin: 0; }
  h2 + .rule + * { margin-top: 1.1rem; }
  .figures { grid-template-columns: 1fr; }
  .figure span { max-width: none; }
}
@media (max-width: 520px) {
  .skills li { grid-template-columns: 1fr; }
  .skills li b { padding-top: 0; }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  html { max-width: none; font-size: 10.5pt; line-height: 1.35; }
  body { display: block; }
  body > footer { display: none; }
  main { display: block; }
  h1 { font-size: 30pt; text-shadow: none; margin-top: 0; }
  .standfirst { margin: 0.4rem 0 1rem; color: #333; }
  .lede { max-width: none; font-size: 11.5pt; color: #222; }
  .figures { grid-template-columns: repeat(3, 1fr); padding: 0.7rem 0; border-color: #666; }
  .figure strong { font-size: 18pt; text-shadow: none; color: #000; }
  .figure span { font-size: 9pt; color: #333; }
  h2 {
    display: block;
    margin: 1.2em 0 0.5em;
    padding: 0;
    color: #000;
    border-bottom: 1px solid #888;
    break-after: avoid;
  }
  h2::before { display: none; }
  h2 .when { display: inline; margin-left: 0.8em; color: #333; }
  h2 + .rule + * { margin-top: 0; }
  li { margin-bottom: 0.2em; break-inside: avoid; }
  li b, .role strong { color: #000; }
  .role { border-bottom: 0; padding-bottom: 0; }
  .skills li, .pubs li { border-bottom: 0; padding-bottom: 0; margin-bottom: 0.15em; }
  a { color: inherit; text-decoration: none; }
}
