@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f4ef;
  --ink: #1b1b18;
  --muted: #5d5b55;
  --rule: #dcd8ce;
  --accent: #1f5c4a;
  --accent-hover: #143f33;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --measure: 40rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151513;
    --ink: #e9e6de;
    --muted: #a19e95;
    --rule: #34332f;
    --accent: #7cc4a8;
    --accent-hover: #a5dcc6;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, dl, dd {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
}

.skip:focus {
  left: 0.5rem;
}

/* Layout: a fixed identity column on the left, the reading column on the right. */

.page {
  display: grid;
  grid-template-columns: minmax(15rem, 19rem) minmax(0, var(--measure));
  gap: 0 clamp(3rem, 7vw, 7rem);
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 6rem) clamp(1.5rem, 5vw, 4rem) 4rem;
}

.masthead {
  position: sticky;
  top: clamp(3rem, 8vh, 6rem);
  align-self: start;
}

.name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.role {
  margin-top: 0.9rem;
  font-size: 1.05rem;
  line-height: 1.4;
}

.place {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact {
  list-style: none;
  padding: 0;
  margin-top: 1.75rem;
  display: grid;
  gap: 0.15rem;
  font-size: 0.95rem;
}

.contact a {
  display: inline-block;
  padding: 0.3rem 0;
}

.toc {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0.1rem;
  font-size: 0.875rem;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
}

.toc a:hover {
  color: var(--ink);
}

main {
  min-width: 0;
}

main p + p {
  margin-top: 0.9rem;
}

/* Introduction */

.lede {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  line-height: 1.3;
  font-weight: 450;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.intro p:not(.lede) {
  color: var(--ink);
  text-wrap: pretty;
}

.lede + p {
  margin-top: 1.5rem;
}

.tools {
  margin-top: 2rem;
  display: grid;
  gap: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tools div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
}

.tools dt {
  color: var(--muted);
}

/* Sections */

.block {
  margin-top: 4.5rem;
}

.label {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.label-sub {
  margin-top: 2.5rem;
}

/* Project entries */

.entry {
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}

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

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
}

.entry h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.status {
  font-size: 0.85rem;
  color: var(--muted);
}

.entry .summary {
  margin-top: 0.6rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.entry .summary + p {
  margin-top: 1rem;
}

.entry p {
  text-wrap: pretty;
}

.entry .meta {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.entry .links {
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

.entry .links:not(:has(a)) {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Experience */

.job {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
}

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

.job-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1.5rem;
  align-items: baseline;
}

.job h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.job .org {
  grid-column: 1;
  grid-row: 2;
  color: var(--muted);
  font-size: 0.95rem;
}

.job .dates {
  grid-column: 2;
  grid-row: 1;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.job-head + p {
  margin-top: 0.7rem;
  text-wrap: pretty;
}

/* Education */

.plain {
  list-style: none;
  padding: 0;
}

.plain li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}

.plain li:last-child {
  border-bottom: 0;
}

.plain strong {
  font-weight: 600;
}

.colophon {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

/* Narrow screens: one column, identity block on top. */

@media (max-width: 52rem) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 2.5rem;
  }

  .masthead {
    position: static;
    margin-bottom: 3rem;
  }

  .contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
  }

  .contact a {
    padding: 0.55rem 0;
  }

  .toc {
    display: none;
  }
}

@media (max-width: 30rem) {
  .tools div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .job-head {
    grid-template-columns: 1fr;
  }

  .job .dates {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  .masthead {
    position: static;
  }

  .toc,
  .skip {
    display: none;
  }

  .page {
    display: block;
    padding: 0;
  }

  a {
    color: inherit;
  }
}
