:root {
  --paper: #e8e5dd;
  --ink: #161714;
  --muted: #57554f;
  --rule: #c9c4b8;
  --accent: #1e6b42;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --logo: "Bricolage Grotesque", var(--sans);
  --hand: "Caveat", cursive;

  --page: 1180px;
  --gutter: 32px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-wrap: balance; }
p { margin: 0; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 32px;
}

.logo {
  font-family: var(--logo);
  font-weight: 800;
  font-size: 28px;
  text-decoration: none;
  color: var(--ink);
}
.logo span { color: var(--accent); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a { padding: 8px 0; text-decoration: none; }
.site-nav a.resume,
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); }

/* ---------- intro ---------- */

.intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 56px 88px;
  padding-top: 96px;
  padding-bottom: 80px;
}

.intro-text {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4rem, 10vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 34ch;
  font-size: 24px;
  line-height: 1.45;
  font-weight: 500;
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 28px;
  font-weight: 600;
  white-space: nowrap;
}

.portrait {
  flex: 1 1 260px;
  max-width: 340px;
  margin: 48px 0 0;
  position: relative;
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--ink);
  transform: rotate(1.5deg);
}

.note {
  position: absolute;
  top: -52px;
  left: -96px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--hand);
  font-size: 26px;
  font-weight: 600;
  color: var(--accent);
  transform: rotate(-6deg);
}
.note svg { margin-bottom: -26px; }

/* education card, right side of the homepage intro */
.edu {
  flex: 1 1 300px;
  max-width: 420px;
  margin-top: 24px;
  border: 1px solid var(--ink);
  padding: 20px 24px 12px;
  transform: rotate(-1deg);
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
}
.edu h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1;
}
.edu-place { margin-top: 4px; font-weight: 600; font-size: 15px; }
.edu-place::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 10px;
  background: var(--accent);
}
.edu dl { margin: 10px 0 0; }
.edu dl > div {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  padding: 6px 0;
  border-top: 1px solid var(--rule);
}
.edu dt { flex: 0 0 84px; padding-top: 2px; font-size: 12px; }
.edu dd { margin: 0; flex: 1 1 160px; font-size: 14px; line-height: 1.45; }

/* ---------- what I do ---------- */

.range {
  border-top: 1px solid var(--ink);
  padding-top: 40px;
  margin-bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.range-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 24px;
}
.range-line:nth-child(2) { padding-left: 10%; }
.range-line:nth-child(3) { padding-left: 20%; }
.range-line p {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.05;
}
.range-line a { font-family: var(--mono); font-size: 13px; }

/* ---------- sections ---------- */

.section {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 64px;
  padding-bottom: 104px;
  scroll-margin-top: 24px;
}

.section > h2 {
  flex: 1 1 200px;
  max-width: 260px;
  margin: 0;
  padding-top: 28px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 48px;
  line-height: 1;
}

.section-body {
  flex: 999 1 560px;
  min-width: 0;
  border-top: 1px solid var(--ink);
}

/* work rows + off-the-clock rows share one shape */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.row > .mono { flex: 0 0 150px; padding-top: 3px; }
.row > div:last-child { flex: 1 1 380px; min-width: 0; }
.row h3 { margin: 0 0 6px; font-size: 19px; font-weight: 700; }
.row h3 span { font-weight: 500; color: var(--muted); }
.row p { max-width: 62ch; }

/* projects */
.projects {
  display: flex;
  flex-direction: column;
  gap: 64px;
  padding-top: 28px;
}
.project { display: flex; flex-direction: column; gap: 12px; }
.project:nth-child(2) { padding-left: 14%; }
.project:nth-child(4) { padding-left: 22%; }
.project h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.1;
}
.project p { max-width: 56ch; }
.project.featured h3 { font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.05; }
.project.featured p { max-width: 60ch; }
.live { color: var(--accent); }
.big-number { font-family: var(--serif); font-size: 1.35em; }

/* off the clock */
.about { padding-top: 28px; display: flex; flex-direction: column; gap: 40px; }
.about > p { max-width: 58ch; font-size: 20px; line-height: 1.6; }
.facts { margin: 0; }
.facts .row { padding: 14px 0; }
.facts dd { margin: 0; }
.facts em { font-family: var(--serif); font-size: 1.2em; }

/* also */
.also { padding-top: 28px; display: flex; flex-wrap: wrap; gap: 40px 56px; }
.also > div { flex: 1 1 260px; min-width: 0; }
.also h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.also p, .also li { color: var(--muted); }
.also ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.also strong { color: var(--ink); font-weight: 600; }

/* ---------- courses: a plain document, one font, one column ---------- */

.doc { padding-top: 72px; padding-bottom: 104px; }
.doc > * { max-width: 68ch; }
.doc h1 { margin: 0 0 16px; font-size: 40px; font-weight: 700; line-height: 1.1; }

.toc { margin-top: 40px; }
.toc h2 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc li { display: flex; flex-wrap: wrap; gap: 0 16px; padding: 4px 0; }
.toc li .mono { flex: 0 0 110px; padding-top: 3px; }

.term > h2 {
  margin: 56px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.course { padding: 24px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 24px; }
.course:last-child { border-bottom: 0; }
.course h3 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.3; }
.course .meta { margin: 4px 0 14px; }
.course p + p { margin-top: 12px; }
.anchor { margin-left: 4px; color: var(--muted); font-weight: 400; text-decoration: none; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--ink); }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px 48px;
  padding-top: 40px;
  padding-bottom: 48px;
}
.signature { display: flex; align-items: center; gap: 16px; }
.signature span { font-family: var(--serif); font-size: 24px; }

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .intro { padding-top: 56px; gap: 40px; }
  .lede { font-size: 20px; }
  .portrait { margin: 32px auto 0; max-width: 280px; }
  .edu { margin-top: 8px; max-width: none; transform: none; box-shadow: 4px 4px 0 var(--ink); }
  .note { left: -8px; top: -44px; font-size: 22px; }
  .range-line:nth-child(n), .project:nth-child(n) { padding-left: 0; }
  .range { margin-bottom: 80px; }
  .section { padding-bottom: 72px; }
  .section > h2 { max-width: none; font-size: 40px; }
  .row > .mono { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- connect button ---------- */

.connect-btn {
  margin-block: -3px;
  padding: 3px 12px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--accent);
}
.connect-btn:hover { color: var(--paper); background: var(--accent); border-color: var(--accent); box-shadow: 3px 3px 0 var(--ink); }
