:root {
  color-scheme: light;
  --paper: #f4efe5;
  --paper-deep: #e9e1d2;
  --ink: #25231f;
  --muted: #716c63;
  --line: #cfc5b4;
  --accent: #a74627;
  --accent-dark: #7f301b;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --content: 1180px;
  --radius: 2px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, transparent calc(100% - 1px), rgb(37 35 31 / 4%) 1px),
    var(--paper);
  background-size: min(8vw, 96px) 100%;
  font-size: 17px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

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

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.05;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.page-shell {
  width: min(calc(100% - 48px), var(--content));
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  min-height: 94px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.wordmark__icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.nav-list {
  display: flex;
  margin: 0;
  padding: 0;
  gap: clamp(18px, 3vw, 38px);
  list-style: none;
}

.nav-list a {
  font-size: 0.85rem;
  text-decoration: none;
}

.nav-list a[aria-current="page"] {
  padding-bottom: 5px;
  border-bottom: 1px solid var(--accent);
}

.eyebrow {
  margin-bottom: 16px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero {
  max-width: 1040px;
  padding: clamp(90px, 14vw, 180px) 0 90px;
}

.hero h1 {
  max-width: 1000px;
  margin-bottom: 30px;
  font-size: clamp(3.4rem, 8.2vw, 7.5rem);
}

.hero h1 em {
  color: var(--accent);
  font-weight: inherit;
}

.hero__lede,
.lede {
  max-width: 720px;
  color: #4b4740;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  margin-top: 36px;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 19px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-dark);
  color: #fff;
}

.button--secondary {
  background: transparent;
  color: var(--ink);
}

.availability {
  display: flex;
  margin-top: 34px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.availability span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52784a;
  box-shadow: 0 0 0 4px rgb(82 120 74 / 12%);
}

.metrics {
  display: grid;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(3, 1fr);
}

.metrics div {
  display: flex;
  min-height: 96px;
  align-items: baseline;
  padding: 12px clamp(20px, 4vw, 46px);
  border-right: 1px solid var(--line);
  gap: 16px;
}

.metrics div:first-child {
  padding-left: 0;
}

.metrics div:last-child {
  border: 0;
}

.metrics strong {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  font-weight: 500;
}

.metrics span {
  max-width: 150px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.section-block {
  padding: clamp(90px, 12vw, 150px) 0;
}

.section-heading {
  display: flex;
  margin-bottom: 48px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2,
.principles h2,
.cv-section > h2 {
  margin-bottom: 0;
  font-size: clamp(2.6rem, 5vw, 4.5rem);
}

.text-link {
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
}

.project-grid {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(2, 1fr);
}

.project-card {
  display: flex;
  min-height: 390px;
  padding: clamp(28px, 4vw, 50px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex-direction: column;
}

.project-card__meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card h3 {
  margin: auto 0 22px;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.project-card h3 a {
  text-decoration: none;
}

.project-card p {
  max-width: 520px;
  color: var(--muted);
}

.tag-list {
  display: flex;
  margin: 8px 0 26px;
  padding: 0;
  gap: 7px;
  flex-wrap: wrap;
  list-style: none;
}

.tag-list li {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 0.67rem;
}

.project-card .text-link {
  margin-top: auto;
}

.principles {
  display: grid;
  border-top: 1px solid var(--line);
  gap: clamp(50px, 8vw, 120px);
  grid-template-columns: minmax(280px, 0.8fr) 1.2fr;
}

.principle-list article {
  position: relative;
  padding: 32px 0 32px 56px;
  border-bottom: 1px solid var(--line);
}

.principle-list article:first-child {
  padding-top: 0;
}

.principle-list span {
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
}

.principle-list h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.principle-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.page-intro,
.project-hero {
  padding: clamp(80px, 12vw, 150px) 0 clamp(70px, 9vw, 115px);
  border-bottom: 1px solid var(--line);
}

.page-intro h1,
.project-hero h1 {
  max-width: 1000px;
  margin-bottom: 26px;
  font-size: clamp(2.8rem, 5vw, 5rem);
}

.project-grid--all {
  margin: 72px 0 28px;
}

.cache-note {
  margin-bottom: 90px;
  color: var(--muted);
  font-size: 0.75rem;
}

.timeline {
  margin-bottom: 110px;
}

.timeline__item {
  display: grid;
  padding: 54px 0;
  border-bottom: 1px solid var(--line);
  gap: 40px;
  grid-template-columns: minmax(180px, 0.4fr) 1fr;
}

.timeline__when {
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline__item h2 {
  margin-bottom: 16px;
  font-family: var(--sans);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 550;
  letter-spacing: -0.025em;
}

.timeline__item p:not(.eyebrow, .outcome) {
  max-width: 670px;
  color: var(--muted);
}

.outcome {
  display: inline-block;
  margin: 8px 0 0;
  padding: 10px 14px;
  border-left: 2px solid var(--accent);
  background: rgb(167 70 39 / 5%);
  font-family: var(--serif);
}

.page-intro--about,
.cv-intro {
  display: grid;
  align-items: end;
  gap: clamp(42px, 8vw, 110px);
  grid-template-columns: 1fr auto;
}

.portrait {
  width: clamp(220px, 28vw, 320px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  filter: grayscale(100%) contrast(1.05);
  object-fit: cover;
}

.prose {
  max-width: 720px;
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.75;
}

.prose h2 {
  margin: 70px 0 18px;
  font-family: var(--sans);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.prose a {
  color: var(--accent-dark);
}

.prose--wide {
  max-width: 840px;
  margin: 90px auto;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
}

.about-details,
.education {
  display: grid;
  margin-bottom: 110px;
  padding: 38px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  gap: 35px;
  grid-template-columns: repeat(3, 1fr);
}

.about-details p:last-child,
.education p {
  margin-bottom: 0;
}

.project-hero .back-link {
  display: inline-block;
  margin-bottom: 42px;
  color: var(--muted);
  font-size: 0.8rem;
}

.project-facts {
  display: grid;
  margin-top: 44px;
  gap: 28px;
  grid-template-columns: repeat(3, 1fr);
}

.project-facts span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-facts strong {
  font-size: 0.9rem;
  font-weight: 600;
}

.case-study {
  display: grid;
  padding: 68px 0 96px;
  gap: clamp(48px, 8vw, 110px);
  grid-template-columns: minmax(230px, 0.45fr) 1fr;
}

.case-study aside {
  align-self: start;
  padding: 26px;
  border: 1px solid var(--line);
}

.outcome-list {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.outcome-list li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

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

.cv-intro .button {
  margin-bottom: 12px;
}

.cv-section {
  padding: 70px 0;
  border-bottom: 1px solid var(--line);
}

.skills-grid {
  display: grid;
  gap: 44px;
  grid-template-columns: repeat(2, 1fr);
}

.skills-grid h2 {
  margin-bottom: 12px;
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.skills-grid p,
.technology-line,
.education {
  color: var(--muted);
}

.technology-line {
  max-width: 900px;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.education {
  margin: 0;
  grid-template-columns: repeat(2, 1fr);
}

.not-found {
  min-height: 65vh;
  padding: 120px 0;
}

.not-found h1 {
  max-width: 760px;
  font-size: clamp(3rem, 7vw, 6rem);
}

.site-footer {
  display: grid;
  margin-top: 80px;
  padding: 56px 0 34px;
  border-top: 1px solid var(--ink);
  gap: 44px;
  grid-template-columns: 1fr auto;
}

.site-footer__prompt {
  max-width: 650px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.site-footer__links {
  display: flex;
  align-items: end;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer__links a {
  font-size: 0.84rem;
}

.site-footer__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  grid-column: 1 / -1;
}

.site-footer--compact {
  margin-top: 40px;
  padding-top: 32px;
  grid-template-columns: 1fr;
}

.site-footer--compact .site-footer__links {
  align-items: center;
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .page-shell {
    width: min(calc(100% - 30px), var(--content));
  }

  .site-header {
    min-height: auto;
    padding: 20px 0;
    align-items: flex-start;
  }

  .wordmark__name {
    display: none;
  }

  .nav-list {
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero {
    padding-top: 80px;
  }

  .hero h1 {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .metrics,
  .project-grid,
  .principles,
  .timeline__item,
  .page-intro--about,
  .cv-intro,
  .project-facts,
  .case-study,
  .skills-grid,
  .about-details,
  .education,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .metrics div,
  .metrics div:first-child {
    min-height: auto;
    padding: 25px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metrics div:last-child {
    border-bottom: 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-card {
    min-height: 0;
    padding: 28px 24px;
  }

  .project-card h3 {
    margin: 42px 0 18px;
  }

  .project-card p {
    font-size: 0.92rem;
  }

  .project-card__evidence {
    font-size: 0.98rem;
  }

  .project-card .tag-list li:nth-child(n + 4) {
    display: none;
  }

  .project-card .text-link {
    font-size: 0.92rem;
  }

  .timeline__item {
    gap: 16px;
  }

  .portrait {
    width: 220px;
  }

  .case-study aside {
    order: 2;
  }

  .site-footer__links {
    align-items: flex-start;
  }
}

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

/* Engineer's Codex: a restrained layer of notebook structure and historical study. */
:root {
  --umber: #745b42;
  --verdigris: #52675a;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

body {
  background:
    radial-gradient(circle at 82% 7%, rgb(116 91 66 / 6%), transparent 24rem),
    linear-gradient(90deg, transparent calc(100% - 1px), rgb(37 35 31 / 4%) 1px),
    var(--paper);
  background-size: auto, min(8vw, 96px) 100%, auto;
}

.hero--codex {
  display: grid;
  max-width: none;
  align-items: center;
  gap: clamp(40px, 6vw, 90px);
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  overflow: clip;
}

.hero__copy {
  position: relative;
  z-index: 2;
}

.hero--codex h1 {
  font-size: clamp(3.4rem, 6.4vw, 6.6rem);
}

.project-card--flagship {
  background: rgb(116 91 66 / 4%);
}

.project-card--flagship h3::before {
  display: block;
  width: 44px;
  margin-bottom: 20px;
  border-top: 1px solid var(--accent);
  content: "";
}

.project-card__meta {
  font-family: var(--mono);
  font-size: 0.68rem;
}

.project-card__evidence {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink) !important;
  font-family: var(--serif);
  font-size: 0.92rem;
}

.project-card__evidence span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.principles {
  grid-template-columns: minmax(260px, 0.65fr) 1fr;
}

.codex-figure {
  position: relative;
  margin: 0;
}

.codex-figure img,
.credit-item img {
  width: 100%;
  height: auto;
  border: 1px solid rgb(116 91 66 / 28%);
  filter: sepia(58%) saturate(60%) contrast(1.05);
  mix-blend-mode: multiply;
}

.codex-figure figcaption {
  display: grid;
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.5;
}

.codex-figure figcaption a {
  width: fit-content;
}

.codex-figure__index {
  position: absolute;
  z-index: 1;
  top: -42px;
  right: -8px;
  color: rgb(167 70 39 / 22%);
  font-family: var(--serif);
  font-size: 8rem;
  font-style: italic;
  line-height: 1;
}

.codex-figure--hero::before,
.codex-figure--hero::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgb(82 103 90 / 25%);
  border-radius: 50%;
  content: "";
}

.codex-figure--hero::before {
  width: 72%;
  aspect-ratio: 1;
  top: -18%;
  right: -15%;
}

.codex-figure--hero::after {
  width: 42%;
  aspect-ratio: 1;
  bottom: 8%;
  left: -12%;
}

.codex-figure--study {
  width: min(100%, 680px);
  margin: 70px 0 0 auto;
  grid-column: 1 / -1;
}

.codex-figure--study img {
  height: 440px;
  background: rgb(233 225 210 / 34%);
  filter: sepia(35%) saturate(75%) contrast(1.4);
  mix-blend-mode: normal;
  object-fit: contain;
}

.annotation {
  position: absolute;
  z-index: 1;
  top: 18px;
  left: -46px;
  padding: 7px 10px;
  transform: rotate(-90deg) translateX(-100%);
  transform-origin: left top;
  background: var(--paper);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-hero::after {
  display: block;
  width: min(360px, 48%);
  margin: 50px 0 -38px auto;
  border-top: 1px solid var(--umber);
  content: "study / evidence / consequence";
  color: var(--umber);
  font-family: var(--mono);
  font-size: 0.58rem;
  text-align: right;
  text-transform: uppercase;
}

.project-detail .prose h2 {
  display: grid;
  align-items: baseline;
  gap: 14px;
  grid-template-columns: auto 1fr;
}

.project-detail .prose h2::after {
  border-top: 1px solid var(--line);
  content: "";
}

.credit-list {
  margin-bottom: 120px;
}

.credit-item {
  display: grid;
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  gap: clamp(36px, 8vw, 100px);
  grid-template-columns: minmax(240px, 0.75fr) 1fr;
}

.credit-item img {
  max-height: 380px;
  object-fit: contain;
}

.credit-item h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.contact-grid {
  display: grid;
  margin: 56px 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(3, 1fr);
}

.contact-card {
  position: relative;
  display: flex;
  min-height: 240px;
  padding: clamp(26px, 4vw, 46px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
}

.contact-card:hover {
  background: rgb(116 91 66 / 5%);
}

.contact-card strong {
  margin: auto 0 10px;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500;
  line-height: 1;
}

.contact-card > :last-child {
  color: var(--muted);
  font-size: 0.8rem;
}

.contact-card__index {
  position: absolute;
  top: 18px;
  right: 24px;
  color: rgb(167 70 39 / 25%);
  font-family: var(--serif);
  font-size: 4rem;
  font-style: italic;
}

.contact-note {
  max-width: 720px;
  margin: 0 0 72px auto;
  padding: 30px 0 30px 70px;
  border-left: 1px solid var(--accent);
  font-family: var(--serif);
  font-size: 1.25rem;
}

.contact-note p:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .hero--codex,
  .credit-item,
  .principles,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .codex-figure--hero {
    width: calc(100% - 28px);
    margin: 25px 0 0 auto;
  }

  .codex-figure__index {
    top: -28px;
    font-size: 6rem;
  }

  .nav-list {
    gap: 9px 14px;
  }

  .nav-list a {
    display: inline-block;
    min-height: 32px;
    padding: 6px 0;
    font-size: 0.78rem;
  }

  .project-card__meta,
  .project-card__evidence span,
  .codex-figure figcaption {
    font-size: 0.64rem;
  }

  .codex-figure--study {
    width: calc(100% - 22px);
  }

  .codex-figure--study img {
    height: 320px;
  }

  .annotation {
    top: 10px;
    left: 10px;
    transform: none;
  }

  .contact-card {
    min-height: 160px;
  }

  .contact-note {
    margin-bottom: 64px;
    padding-left: 24px;
  }

  .project-hero {
    padding: 64px 0 58px;
  }

  .project-hero .back-link {
    margin-bottom: 36px;
  }

  .project-facts {
    margin-top: 38px;
  }

  .case-study {
    padding: 58px 0 72px;
    gap: 44px;
  }
}
