:root {
  --paper: #f0f0f0;
  --ink: #0f0f0f;
  --muted: #6f6f6f;
  --line: rgba(15, 15, 15, 0.12);
  --pad: clamp(16px, 3vw, 40px);
  --cell: 14px;
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }

/* Shared four-column grid, with hairlines drawn behind the page */

.grid,
.grid-lines {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 var(--pad);
}

.grid-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.grid-lines span { border-left: 1px solid var(--line); }
.grid-lines span:last-child { border-right: 1px solid var(--line); }

.cell { padding: 0 var(--cell); min-width: 0; }
.span-3 { grid-column: span 3; }

.site-header, main, .contact { position: relative; z-index: 1; }

.small {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 18px 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 500;
}

.brand { display: flex; align-items: center; }

.plus {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
}

.plus::before,
.plus::after {
  content: "";
  position: absolute;
  background: var(--ink);
}

.plus::before { left: 5px; top: 0; width: 4px; height: 14px; }
.plus::after { left: 0; top: 5px; width: 14px; height: 4px; }

.nav { display: flex; gap: 0; }
.nav a { flex: 1; }
.nav a:hover, .contact a:hover { opacity: 0.55; }

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
  min-height: calc(100svh - 56px);
  padding-top: clamp(20px, 4vw, 48px);
}

.wordmark {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0 var(--pad);
  font-size: 14.2vw;
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.8;
  letter-spacing: 0;
  user-select: none;
}

.hero-grid { margin-top: clamp(48px, 12vh, 140px); }

.statement {
  grid-column: span 2;
  max-width: 22em;
  margin: 0;
  font-size: clamp(1.25rem, 2.1vw, 1.9rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.hero-foot {
  margin-top: auto;
  padding-top: 48px;
  padding-bottom: 20px;
  color: var(--muted);
}

/* Sections */

.section {
  padding: clamp(56px, 9vw, 120px) 0;
  border-top: 1px solid var(--line);
}

.label {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.45;
}

.label span {
  display: block;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lead {
  max-width: 24em;
  margin-bottom: 1.6em;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: calc(var(--cell) * 2);
}

.two-col p { max-width: 34em; }
.two-col p:first-child { grid-column: 2; }
.two-col p:last-child { grid-column: 3; }

.stats { margin-top: clamp(48px, 7vw, 96px); }

.stats strong {
  display: block;
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stats span {
  display: block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Selected work */

.work {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: calc(var(--cell) * 2);
  row-gap: 48px;
  margin: 0;
  list-style: none;
  counter-reset: work;
}

.work li {
  counter-increment: work;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
}

.work li::before {
  content: counter(work, decimal-leading-zero);
  display: block;
  margin-bottom: 28px;
  font-size: 0.8rem;
  color: var(--muted);
}

.work h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.work p { margin: 0; font-size: 0.95rem; color: #3a3a3a; }

/* Rows: experience and writing */

.group {
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.rows + .group { margin-top: 64px; }

.row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: calc(var(--cell) * 2);
  padding: 22px 0 26px;
  border-top: 1px solid var(--ink);
}

.row > div { grid-column: span 2; }

.when {
  margin: 4px 0 0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.row h4 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.role {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.row .role + p {
  max-width: 44em;
  margin: 14px 0 0;
  font-size: 0.95rem;
  color: #3a3a3a;
}

/* Credentials */

.cred p { margin-bottom: 1.4em; font-size: 0.9rem; color: #3a3a3a; }
.cred strong { font-weight: 500; font-size: 1rem; color: var(--ink); }

/* Contact */

.contact {
  padding: clamp(56px, 9vw, 120px) 0 24px;
  background: var(--ink);
  color: var(--paper);
}

.contact .label span { color: #8a8a8a; }

.big-link {
  display: inline-block;
  font-size: clamp(2.6rem, 9vw, 9rem);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.contact-foot {
  margin-top: clamp(64px, 12vw, 160px);
  padding-top: 18px;
  border-top: 1px solid rgba(240, 240, 240, 0.2);
}

/* Reveal on scroll */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in { opacity: 1; transform: none; }

/* Smaller screens */

@media (max-width: 900px) {
  .two-col { display: block; }
  .work { grid-template-columns: repeat(2, 1fr); }
  .cred { grid-column: span 2; margin-top: 32px; }
  .section .label { grid-column: span 4; margin-bottom: 28px; }
  .section .span-3 { grid-column: span 4; }
  .section .label span { display: inline; margin-right: 8px; }
}

@media (max-width: 640px) {
  .grid-lines span:nth-child(n + 2) { border-left: 0; }

  .site-header .grid { grid-template-columns: auto 1fr; row-gap: 6px; }
  .site-header .brand { grid-row: span 3; padding-right: 24px; }
  .nav a { flex: 0 0 50%; }

  .hero { min-height: 0; padding-bottom: 24px; }
  .hero-grid { margin-top: 40px; row-gap: 20px; }
  .hero-grid .small { grid-column: span 2; }
  .statement { grid-column: span 4; margin-top: 16px; }
  .hero-foot { display: none; }

  .stats { row-gap: 32px; }
  .stats .cell { grid-column: span 2; }

  .work { grid-template-columns: 1fr; row-gap: 32px; }
  .work li::before { margin-bottom: 14px; }

  .row { display: block; }
  .when { margin: 0 0 8px; color: var(--muted); }

  .cred { grid-column: span 4; }

  .contact .label, .contact .span-3 { grid-column: span 4; }
  .contact .label { margin-bottom: 28px; }
  .contact-foot { row-gap: 10px; }
  .contact-foot .cell { grid-column: span 2; }
}
