@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/newsreader-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader"; font-style: italic; font-weight: 300 700; font-display: swap;
  src: url(fonts/newsreader-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* One serif family, warm paper, a single centered column; Arkansas cardinal red only on links. */
:root {
  --bg: #f7f5f0;
  --ink: #1b1a17;
  --muted: #645f56;
  --rule: #dcd6cb;
  --accent: #9d2235;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151412; --ink: #ece8e0; --muted: #a59e92; --rule: #34302a; --accent: #f0959e; color-scheme: dark; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.6;
  font-optical-sizing: auto; font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page {
  max-width: 44rem; margin: 0 auto;
  padding: 0 max(1.25rem, env(safe-area-inset-right)) 0 max(1.25rem, env(safe-area-inset-left));
}

/* Masthead */
.masthead { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: 1.5rem; border-bottom: 1px solid var(--rule); font-size: 1rem; }
.masthead { align-items: center; }
.masthead .home { display: inline-flex; align-items: center; gap: 0.625rem; flex-shrink: 0; color: var(--ink); text-decoration: none; font-weight: 600; }
.masthead .home span { display: none; }
.masthead .avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; object-fit: cover; background: var(--rule); }
.masthead nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.masthead nav a { color: var(--muted); text-decoration: none; }
.masthead nav a:hover { color: var(--ink); }

/* Intro */
.intro { padding-block: 3rem 3rem; display: grid; grid-template-columns: minmax(0, 1fr); }
.portrait { width: 7.5rem; height: 7.5rem; border-radius: 50%; object-fit: cover; margin-bottom: 1.75rem; background: var(--rule); }
.kicker { font-style: italic; color: var(--muted); font-size: 1.0625rem; line-height: 1.45; }
.kicker span { white-space: nowrap; }
h1 {
  margin-top: 0.75rem; font-weight: 400; font-size: clamp(3rem, 12vw, 5.5rem);
  line-height: 0.98; letter-spacing: -0.025em; text-wrap: balance;
}
.lede { margin-top: 1.75rem; font-size: clamp(1.25rem, 3.6vw, 1.5rem); line-height: 1.45; text-wrap: pretty; }
.links { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 1.0625rem; }

/* At a glance */
.glance { display: grid; gap: 1.25rem 2rem; padding-block: 2rem; border-top: 1px solid var(--rule); }
.glance dt { font-style: italic; color: var(--muted); font-size: 0.9375rem; }
.glance dd { font-weight: 500; line-height: 1.4; }
.glance dd span { display: block; color: var(--muted); font-weight: 400; font-size: 1rem; }

/* Figures */
.figures { display: grid; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.figures li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; align-items: baseline; padding-block: 1.25rem; }
.figures li + li { border-top: 1px solid var(--rule); }
.figures b { font-weight: 400; font-size: 2.25rem; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.figures span { color: var(--muted); font-size: 1rem; line-height: 1.45; }

/* Sections */
section { padding-top: 4rem; }
h2 { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule); margin-bottom: 2rem; }
.prose p + p { margin-top: 1.25rem; }
.prose p { text-wrap: pretty; }

.path { margin-top: 2.25rem; display: grid; gap: 0.75rem; }
.path li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; font-size: 1.0625rem; }
.path .yr { color: var(--muted); font-variant-numeric: tabular-nums; }
.path .place { color: var(--muted); font-style: italic; }
.path li.now strong::after { content: ""; display: inline-block; width: 0.45em; height: 0.45em; border-radius: 50%; background: var(--accent); margin-left: 0.5em; vertical-align: 0.15em; }

.entry + .entry { margin-top: 2.5rem; }
.entry .head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 1rem; }
.entry h3 { font-size: 1.375rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.005em; }
.entry .when { color: var(--muted); font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry .role { font-style: italic; color: var(--muted); margin-top: 0.125rem; }
.entry ul { margin-top: 0.75rem; display: grid; gap: 0.5rem; }
.entry li { position: relative; padding-left: 1.25rem; text-wrap: pretty; }
.entry li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
.entry > p:not(.role):not(.label) { margin-top: 0.5rem; text-wrap: pretty; }
.entry .label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.photos { display: grid; gap: 1.5rem; margin-bottom: 2rem; }
.photos figure { margin: 0; }
.photos img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--rule); }
.photos figure:not(.wide) img { object-position: 50% 15%; }
.photos figcaption { margin-top: 0.5rem; font-style: italic; color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }
.photos.in-entry { margin: 1.5rem 0 0; }
.team-photo { margin: 1.5rem 0 0; }
.prose .team-photo { margin: 1.75rem 0; }
.team-photo img { display: block; width: 100%; height: auto; background: var(--rule); }
.team-photo figcaption { margin-top: 0.5rem; font-style: italic; color: var(--muted); font-size: 0.9375rem; }
.photos figure.wide img { object-position: 50% 40%; }
.photos figure.natural img { aspect-ratio: auto; }
.outside-note { margin-bottom: 1.75rem; max-width: 36em; text-wrap: pretty; }
.outside { font-size: 1.1875rem; }
.outside li { display: inline; }
.outside li + li::before { content: " · "; color: var(--muted); }

/* Contact */
.contact h2 { margin-bottom: 1.5rem; }
.contact .big { font-weight: 400; font-size: clamp(2.5rem, 9vw, 3.75rem); line-height: 1; letter-spacing: -0.02em; }
.contact p { margin-top: 1rem; text-wrap: pretty; }
.mailrow { margin-top: 1.75rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem 1.5rem; }
.mailrow #mail { font-size: clamp(1.125rem, 4.4vw, 1.5rem); overflow-wrap: anywhere; }
.textbtn { font: inherit; font-size: 1rem; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.textbtn:hover { color: var(--ink); }

footer { margin-top: 5rem; padding-block: 1.5rem 2.5rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; color: var(--muted); font-size: 0.9375rem; }

@media (min-width: 40rem) {
  .masthead .home span { display: inline; }
  .intro { padding-block: 5rem 3.5rem; grid-template-columns: minmax(0, 1fr) auto; column-gap: 2rem; }
  .intro > * { grid-column: 1 / -1; }
  .intro .portrait { grid-column: 2; grid-row: 1 / span 2; align-self: end; width: 10rem; height: 10rem; margin: 0 0 0.5rem; }
  .intro .kicker, .intro h1 { grid-column: 1; }
  .intro .kicker { grid-row: 1; align-self: end; }
  .intro h1 { grid-row: 2; }
  .glance { grid-template-columns: 1fr 1fr; }
  .figures { grid-template-columns: repeat(3, 1fr); }
  .figures li { grid-template-columns: 1fr; gap: 0.5rem; align-content: start; padding: 1.5rem 1.5rem 1.5rem 0; }
  .figures li + li { border-top: 0; border-left: 1px solid var(--rule); padding-left: 1.5rem; }
  .figures b { font-size: 3rem; }
  section { padding-top: 5.5rem; }
  .photos { grid-template-columns: 5fr 3fr; align-items: start; }
  .photos figure:not(.wide) img { aspect-ratio: 4 / 5; object-position: 50% 50%; }
}

/* ---- Multi-page additions ---- */
:root[data-theme="dark"] { --bg: #151412; --ink: #ece8e0; --muted: #a59e92; --rule: #34302a; --accent: #f0959e; color-scheme: dark; }
picture { display: contents; }
picture source { display: none; }
.skip { position: absolute; left: -999px; top: 0.75rem; background: var(--ink); color: var(--bg); padding: 0.5rem 0.875rem; z-index: 20; text-decoration: none; }
.skip:focus { left: max(1.25rem, env(safe-area-inset-left)); }
.masthead nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.35em; }

/* Sub-page header */
.page-head { padding-block: 3rem 0.5rem; }
.page-head h1 { font-size: clamp(2.5rem, 9vw, 4rem); margin-top: 0.5rem; }
.page-head .lede { margin-top: 1.25rem; }

/* Project facts: problem / approach / status */
.facts { margin-top: 0.875rem; display: grid; gap: 0.625rem; }
.facts div { display: grid; gap: 0.125rem; }
.facts dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.facts dd { text-wrap: pretty; }
.facts dd ol { list-style: decimal; padding-left: 1.25rem; display: grid; gap: 0.25rem; }
.facts dd ol li { padding-left: 0.125rem; }
.facts dd ol li::before { content: none; }
.entry .more, .more { display: inline-block; margin-top: 0.75rem; font-size: 1rem; }

.buckets { display: grid; gap: 1.25rem; margin-top: 1rem; }
.bucket ul { margin-top: 0.375rem; }

/* Home photo strip */
.strip { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.strip figure { margin: 0; }
.strip figure:first-child { grid-column: 1 / -1; }
.strip img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--rule); }
.strip figure:first-child img { aspect-ratio: 3 / 2; object-position: 50% 30%; }
.strip img.pos-end { object-position: 100% 50%; }
.strip img.pos-right { object-position: 93% 50%; }
.strip figcaption { margin-top: 0.5rem; font-style: italic; color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }
.solo { margin: 1.5rem 0 0; max-width: 20rem; }
.solo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--rule); }
.solo figcaption { margin-top: 0.5rem; font-style: italic; color: var(--muted); font-size: 0.9375rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.25rem 0; font-size: 1.1875rem; }
.chips li + li::before { content: "·"; color: var(--muted); padding: 0 0.6em; }

/* Gentle motion: intro settles in on load; pages cross-fade where the browser supports it */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  .intro > *, .page-head > * { animation: rise 0.6s cubic-bezier(.2, .7, .2, 1) both; }
  .intro > :nth-child(2), .page-head > :nth-child(2) { animation-delay: 0.06s; }
  .intro > :nth-child(3), .page-head > :nth-child(3) { animation-delay: 0.12s; }
  .intro > :nth-child(n+4), .page-head > :nth-child(n+4) { animation-delay: 0.18s; }
  .photos img, .strip img, .solo img, .team-photo img { transition: opacity 0.2s ease; }
}
@keyframes rise { from { opacity: 0.001; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (min-width: 40rem) {
  .page-head { padding-block: 4.5rem 1rem; }
  .strip { grid-template-columns: 5fr 3fr 3fr; }
  .strip figure:first-child { grid-column: auto; }
  .strip img { aspect-ratio: 9 / 10; }
  .strip figure:first-child img { aspect-ratio: 3 / 2; }
  .facts div { grid-template-columns: 8.5rem 1fr; gap: 1rem; }
  .facts dt { padding-top: 0.3rem; }
  .buckets { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
}

/* ---- Project pages ---- */
.back { margin-top: 3.5rem; font-size: 1rem; }
.page-head + .figures { margin-top: 2rem; }
ul.plain, ol.steps { display: grid; gap: 0.625rem; }
ul.plain li { position: relative; padding-left: 1.25rem; text-wrap: pretty; }
ul.plain li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
ol.steps { counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding-left: 2rem; text-wrap: pretty; }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 0.1rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1px solid var(--rule); font-size: 0.8125rem; display: grid; place-items: center; color: var(--muted); font-variant-numeric: tabular-nums; }
section .chips { margin-top: 1.25rem; font-size: 1rem; color: var(--muted); }

/* Workflow diagram, built in HTML so it reflows on phones */
.flow { display: grid; }
.flow .step { border: 1px solid var(--rule); background: color-mix(in srgb, var(--ink) 3%, var(--bg)); padding: 0.875rem 1rem; line-height: 1.45; text-wrap: pretty; }
.flow .step .n { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; margin-right: 0.6rem; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 0.8125rem; vertical-align: 0.1em; }
.flow .arrow { text-align: center; color: var(--muted); line-height: 1; padding: 0.35rem 0; }
.flow .branch { display: grid; gap: 1.25rem; }
.flow .fork { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; text-align: center; }

/* ExpertMatch value chain */
.chain { display: flex; flex-wrap: wrap; gap: 0.5rem 0; margin-bottom: 1.5rem; font-size: 1rem; }
.chain li { display: inline-flex; align-items: center; }
.chain li + li::before { content: "→"; color: var(--accent); padding: 0 0.6rem; }

@media (min-width: 40rem) {
  .flow .branch { grid-template-columns: 1fr 1fr; }
}

/* Company logos beside entries: small full-color tiles */
.entry.has-logo { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 1rem; align-items: start; }
.entry .logo { width: 2.5rem; height: 2.5rem; margin-top: 0.15rem; background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 2px; object-fit: contain; }
.entry-body { min-width: 0; }
.entry-body > p:not(.role):not(.label):not(.when) { margin-top: 0.5rem; text-wrap: pretty; }
@media (min-width: 40rem) {
  .entry.has-logo { grid-template-columns: 3rem minmax(0, 1fr); column-gap: 1.25rem; }
  .entry .logo { width: 3rem; height: 3rem; }
}

/* About page header with portrait */
.page-head.with-photo { display: grid; gap: 1.75rem; }
.page-head.with-photo > * { animation: none; }
.page-head-text > * { animation: rise 0.6s cubic-bezier(.2, .7, .2, 1) both; }
.about-portrait { display: block; width: 100%; max-width: 15rem; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--rule); }
@media (prefers-reduced-motion: reduce) { .page-head-text > * { animation: none; } }
@media (min-width: 40rem) {
  .page-head.with-photo { grid-template-columns: minmax(0, 1fr) 13rem; align-items: end; column-gap: 2.5rem; }
  .about-portrait { max-width: none; grid-column: 2; grid-row: 1; }
}
