:root {
  --paper: #f2f3ef;
  --panel: #fcfcfa;
  --ink: #1b2321;
  --ink-2: #576059;
  --teal: #2e6d6b;
  --teal-deep: #1d4c4b;
  --teal-pale: #cfe2df;
  --rule: #d2d7cf;
  --serif: "Iowan Old Style", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.62;
}

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

a {
  color: var(--teal-deep);
  text-decoration-color: var(--teal-pale);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-color: var(--teal); }
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 1px;
}

.page {
  max-width: 54rem;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
}

/* ---------- masthead ---------- */

.masthead {
  padding-bottom: 2.4rem;
  border-bottom: 1px solid var(--rule);
}

.portrait {
  width: 132px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--rule);
}

.name {
  font-size: clamp(2.6rem, 11vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
  font-weight: 600;
  margin: 0;
}

.standfirst {
  font-size: clamp(1.1rem, 4.4vw, 1.35rem);
  line-height: 1.42;
  margin: 1.35rem 0 0;
  max-width: 26ch;
  color: var(--ink);
}

.standfirst .keeps {
  display: block;
  color: var(--teal-deep);
}

.contact {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 1.9rem 0 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.86rem;
  letter-spacing: 0.005em;
}

.contact a { color: var(--ink); text-decoration-color: var(--teal); }
.contact a:hover { color: var(--teal-deep); }

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

section { padding-top: 2.6rem; }

h2 {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  margin: 0 0 1.1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--rule);
}

.prose { max-width: 34rem; }
.prose p { margin: 0 0 1.05rem; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- projects ---------- */

.project {
  padding: 1.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.project:first-of-type { border-top: 1px solid var(--rule); }

.project h3 {
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

.project p {
  margin: 0;
  max-width: 34rem;
  color: var(--ink);
}

.project figure {
  margin: 1.2rem 0 0;
}

.flow {
  width: 100%;
  height: auto;
  max-width: 420px;
}

.flow .box { fill: var(--panel); stroke: var(--ink); stroke-width: 1; }
.flow .box-gate { fill: var(--teal-pale); stroke: var(--teal-deep); stroke-width: 1.4; }
.flow .box-stop { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 3; }
.flow .wire { stroke: var(--teal); stroke-width: 1.4; fill: none; }
.flow .wire-stop { stroke: var(--ink-2); stroke-width: 1; fill: none; stroke-dasharray: 4 3; }
.flow text {
  font-family: var(--sans);
  font-size: 12.5px;
  fill: var(--ink);
  text-anchor: middle;
}
.flow .t-stop { fill: var(--ink-2); }

.legend {
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0.7rem 0 0;
  max-width: 30rem;
}

/* ---------- work ---------- */

.work { list-style: none; margin: 0; padding: 0; max-width: 40rem; }

.work li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.1rem 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.work li:first-child { border-top: 1px solid var(--rule); }

.work .role { font-weight: 600; }
.work .org { color: var(--ink); }
.work .when {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-2);
  white-space: nowrap;
}

.credentials { max-width: 36rem; }
.credentials p { margin: 0 0 0.8rem; }
.credentials p:last-child { margin-bottom: 0; }

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

footer {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-2);
}
footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 0 0 0.9rem;
  padding: 0;
}
footer a { color: var(--ink); }

/* ---------- wider screens ---------- */

@media (min-width: 40rem) {
  .work li { grid-template-columns: 1fr auto; align-items: baseline; }
  .work .when { grid-row: 1; grid-column: 2; text-align: right; }
  .work .org { grid-column: 1; }
}

@media (min-width: 48rem) {
  .page { padding: 3.5rem 2.5rem 5rem; }

  .masthead {
    display: grid;
    grid-template-columns: 1fr 168px;
    gap: 0 2.5rem;
    align-items: start;
  }
  .portrait {
    width: 168px;
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-bottom: 0;
  }
  .name { grid-column: 1; }
  .standfirst { grid-column: 1; max-width: 24ch; }
  .contact { grid-column: 1; }
}

@media (min-width: 56rem) {
  .project {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 372px;
    gap: 0 2.5rem;
    align-items: start;
  }
  .project h3 { grid-column: 1; }
  .project p { grid-column: 1; }
  .project figure { grid-column: 2; grid-row: 1 / span 3; margin-top: 0.2rem; }
}

/* resume request form */
.request { max-width: 34rem; }
.request p.lede { font-size: 1.05rem; margin-bottom: 1.6rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.1rem; }
.field label { font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.02em; color: var(--ink); }
.field label span { color: var(--muted, #5c6663); font-weight: normal; }
.field input { font: inherit; font-size: 1rem; padding: 0.6rem 0.7rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--panel); color: var(--ink); }
.field input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
button.send { font-family: var(--sans); font-size: 0.95rem; padding: 0.7rem 1.3rem; background: var(--teal); color: var(--paper); border: 0; border-radius: 3px; cursor: pointer; }
button.send:hover, button.send:focus-visible { background: var(--teal-deep); outline: 2px solid var(--teal-deep); outline-offset: 2px; }
.request .fine { font-family: var(--sans); font-size: 0.8rem; color: var(--muted, #5c6663); margin-top: 1rem; }
.back { font-family: var(--sans); font-size: 0.85rem; display: inline-block; margin-bottom: 2rem; }
