:root {
  --film: #eef1ef;
  --sheet: #f7f9f8;
  --ink: #1c2730;
  --graphite: #5e6b73;
  --rule: #c9d1d3;
  --fibre: #00737f;
  --grid: rgba(28, 39, 48, 0.05);

  --sans: "Archivo", "Arial Narrow", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;

  --wrap: 72rem;
  --measure: 66ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--film);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.15;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--fibre);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--fibre);
}

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--fibre);
  outline-offset: 3px;
}

code {
  font-family: var(--sans);
  font-stretch: 85%;
  font-size: 0.9em;
  font-weight: 500;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  font-family: var(--sans);
}

.brand {
  font-weight: 650;
  font-stretch: 110%;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-size: 1rem;
  font-stretch: 90%;
}

.site-header nav a {
  text-decoration: none;
}

.site-header nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--fibre);
}

.site-header nav .nav-icon {
  display: inline-flex;
  align-self: center;
  padding: 2px;
}

.site-header nav .nav-icon svg {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 13rem;
  align-items: end;
  gap: 2.5rem 4rem;
  padding-top: clamp(3.5rem, 9vw, 7rem);
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.75rem);
  font-stretch: 118%;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.015em;
  max-width: 12ch;
}

.role {
  margin: 1.25rem 0 0;
  font-family: var(--sans);
  font-size: 1.25rem;
  font-stretch: 85%;
  font-weight: 500;
  color: var(--graphite);
}

.lede {
  margin: 1.75rem 0 0;
  max-width: 34em;
  font-size: 1.3rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2.25rem;
}

.hero-actions p {
  margin: 0;
  font-size: 1rem;
  color: var(--graphite);
}

.button {
  display: inline-block;
  padding: 0.8rem 1.3rem;
  background: var(--ink);
  color: var(--film);
  font-family: var(--sans);
  font-size: 1rem;
  font-stretch: 95%;
  font-weight: 600;
  text-decoration: none;
  border-radius: 2px;
  transition: background-color 0.15s ease;
}

.button:hover {
  background: var(--fibre);
  color: var(--film);
}

.portrait {
  width: 13rem;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 20%;
  align-self: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  padding: 6px;
  background: var(--sheet);
}

/* Sections */

.section {
  border-top: 1px solid var(--rule);
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}

.section h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  font-stretch: 112%;
  letter-spacing: -0.01em;
  margin-bottom: 2.5rem;
}

/* Case studies */

.case + .case {
  margin-top: clamp(4rem, 8vw, 6rem);
}

.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding-top: 0.85rem;
  border-top: 2px solid var(--ink);
}

.case-head h3 {
  font-size: 1.5rem;
  font-stretch: 100%;
}

.case-context {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-stretch: 85%;
  color: var(--graphite);
}

.case h4 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
  font-stretch: 85%;
  font-weight: 600;
  color: var(--graphite);
}

.case-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 1.5rem 3rem;
  margin: 1.75rem 0 2rem;
}

.case-body p,
.case-outcome p {
  max-width: var(--measure);
}

.diagram {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--rule);
  background-color: var(--sheet);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow-x: auto;
}

.diagram img,
.diagram svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

.diagram .d-bg {
  fill: none;
}

.case-outcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem 3rem;
  margin-top: 1.75rem;
}

.case-link {
  font-family: var(--sans);
  font-size: 1rem;
  font-stretch: 95%;
  font-weight: 600;
  white-space: nowrap;
}

/* Skills */

.skills {
  margin: 0;
  border-bottom: 1px solid var(--rule);
}

.skills > div {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 0.25rem 2rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}

.skills dt {
  font-family: var(--sans);
  font-weight: 600;
  font-stretch: 95%;
}

.skills dd {
  margin: 0;
  max-width: var(--measure);
}

/* Experience */

.roles {
  list-style: none;
  margin: 0;
  padding: 0;
}

.roles li {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 0.25rem 2rem;
}

.roles li + li {
  margin-top: 2.25rem;
}

.when {
  margin: 0.2rem 0 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-stretch: 85%;
  font-variant-numeric: tabular-nums;
  color: var(--graphite);
}

.roles h3 {
  font-size: 1.25rem;
}

.org {
  margin: 0.15rem 0 0.6rem;
  font-family: var(--sans);
  font-stretch: 90%;
  color: var(--graphite);
}

.roles li p:not(.when):not(.org) {
  max-width: var(--measure);
}

.credentials {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.credentials > div:first-child {
  grid-column: 2;
}

.credentials h3 {
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
}

.credentials ul {
  margin: 0;
  padding-left: 1.1em;
}

.cv-links {
  margin: 2.5rem 0 0 16rem;
}

/* Contact */

.contact-note {
  max-width: var(--measure);
}

.contact-list {
  margin: 1.5rem 0 0;
}

.contact-list > div {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule);
  max-width: 34rem;
}

.contact-list dt {
  font-family: var(--sans);
  font-stretch: 90%;
  color: var(--graphite);
}

.contact-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-stretch: 90%;
  color: var(--graphite);
}

/* CV page */

.cv-page .cv-head {
  padding-top: clamp(3rem, 7vw, 5rem);
  padding-bottom: 2.5rem;
}

.cv-page .cv-head h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-stretch: 118%;
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.cv-page .cv-head .role {
  margin-top: 0.9rem;
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-stretch: 90%;
}

.cv-contact p {
  margin: 0;
}

.cv-section {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 0.5rem 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}

.cv-section h2 {
  font-size: 1.25rem;
  font-stretch: 100%;
}

.cv-section > div {
  max-width: var(--measure);
}

.cv-role + .cv-role {
  margin-top: 2rem;
}

.cv-role h3 {
  font-size: 1.15rem;
}

.cv-role .org {
  margin-bottom: 0.5rem;
}

.cv-section ul {
  margin: 0;
  padding-left: 1.1em;
}

.cv-section li + li {
  margin-top: 0.3rem;
}

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
}

/* Small screens */

@media (max-width: 760px) {
  body {
    font-size: 1.0625rem;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .portrait {
    grid-row: 1;
    width: 7.5rem;
  }

  .lede {
    font-size: 1.15rem;
  }

  .case-body,
  .case-outcome,
  .skills > div,
  .roles li,
  .credentials,
  .cv-section {
    grid-template-columns: 1fr;
  }

  .credentials > div:first-child {
    grid-column: auto;
  }

  .cv-links {
    margin-left: 0;
  }

  .case-link {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  a,
  .button {
    transition: none;
  }
}

@media print {
  .site-header,
  .cv-actions {
    display: none;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .cv-section {
    break-inside: avoid;
  }
}
