:root {
  --accent: #17645b;
  --bg: #fafbf9;
  --fg: #172e3c;
  --muted: #4d626a;
  --line: #c4d1cf;
  --code: #e9efed;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.65 var(--sans);
  overflow-wrap: break-word;
}
.wrap { max-width: 74rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem); }
/* Reading width everywhere; only the home page's hero uses the full width. */
main.wrap > :not(.hero) { max-width: 44rem; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--fg); color: var(--bg); padding: 0.75rem 1rem; z-index: 1; }
.skip:focus { top: 1rem; }

/* Header: wordmark and a nav that wraps rather than hides. */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1.5rem; padding-block: 0.5rem; }
.brand { font: 750 1.55rem/1 var(--sans); text-decoration: none; padding: 0.75rem 0; }
.brand { letter-spacing: -0.055em; color: var(--accent); }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: 0.875rem; }
nav a { display: inline-block; font: 0.875rem/1 var(--sans); padding: 0.875rem 0; min-height: 44px; text-decoration: none; }
@media (min-width: 40rem) { nav ul { column-gap: 1.25rem; } nav a { font-size: 0.95rem; } }
nav a:hover, nav a[aria-current] { text-decoration: underline; text-underline-offset: 0.35em; }
nav a[aria-current="page"] { text-decoration-thickness: 2px; }


/* Type. Mono for structure, sans for reading. */
h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem); margin: 2.5rem 0 1rem; }
h2 { font-size: 1.375rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.125rem; margin: 2rem 0 0.5rem; }

p, ul, ol, dl, pre, table { margin: 0 0 1rem; }
.lead { font-size: 1.1875rem; color: var(--fg); max-width: 38rem; }
.crumbs, .meta, time, .status, .count { font-family: var(--sans); font-size: 0.875rem; color: var(--muted); }
.crumbs { margin: 2rem 0 -1.5rem; }
.crumbs a { display: inline-block; padding: 0.75rem 0; }
.crumbs a::before { content: "← "; content: "← " / ""; }
main { padding-bottom: 3rem; }

/* The one call to action. */
.button {
  display: inline-flex; align-items: center; max-width: 100%; overflow-wrap: anywhere; min-height: 44px; padding: 0.625rem 1rem;
  font: 600 1rem/1.3 var(--sans); text-decoration: none;
  border: 2px solid var(--accent); border-radius: 0.35rem; background: var(--accent); color: white;
}
.button:hover { background: var(--bg); color: var(--fg); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 1.5rem; }
.actions > a:not(.button) { padding: 0.75rem 0; }
.intro { padding-bottom: 0.5rem; }
.contact-card .button { font-size: 1.125rem; }

/* Lists of things: projects, posts. */
.entries { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.entries li { padding: 0.875rem 0; border-bottom: 1px solid var(--line); }
.entries li > a { font: 600 1.0625rem/1.4 var(--sans); }
.entries li p { margin: 0.25rem 0 0; color: var(--muted); }
.entries time { display: block; margin-top: 0.125rem; }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font: 0.875rem var(--sans); }
.tags a { display: inline-block; padding: 0.625rem 0; }
.tags a::before { content: "#"; content: "#" / ""; }

/* Facts about a project or the company. */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.375rem 1.25rem; font-size: 0.9375rem; }
.facts dt { font-family: var(--sans); color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
.facts time { font: inherit; color: inherit; }
@media (max-width: 30rem) { .facts { grid-template-columns: 1fr; row-gap: 0; } .facts dd { margin-bottom: 0.75rem; } }

/* Long-form text. */
.prose { max-width: 40rem; }
.prose li + li { margin-top: 0.25rem; }
.prose blockquote { margin: 0 0 1rem; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.prose img { max-width: 100%; height: auto; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--code); padding: 0.1em 0.3em; }
pre { background: var(--code); border: 1px solid var(--line); padding: 0.875rem 1rem; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto; line-height: 1.5; tab-size: 4; }
.table { max-width: 100%; overflow-x: auto; margin: 0 0 1rem; }
table { border-collapse: collapse; }
th, td { border: 1px solid var(--line); padding: 0.375rem 0.625rem; text-align: left; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* Home: the offer, set large; everything else stays at reading size. */
.hero {
  margin-block: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.5rem, 6vw, 5rem);
  border-radius: 0.5rem;
  background: #163d46;
  color: white;
}
.hero h1 { max-width: 21ch; margin: 0 0 1.25rem; font-size: clamp(2.25rem, 5vw, 4.25rem); line-height: 1.04; letter-spacing: -0.045em; }
.hero .lead { color: #deebe8; max-width: 48ch; }
.hero .actions > a { min-width: 0; overflow-wrap: anywhere; }
.hero .actions { margin-bottom: 0; }
.hero .button { background: #dcf0e9; border-color: #dcf0e9; color: #163d46; }
.hero .button:hover { background: white; }
.hero :focus-visible { outline-color: white; }
main.wrap { padding-bottom: 3rem; }
.home-body ol { padding-left: 1.5rem; }
.home-body li { margin-bottom: 0.5rem; }
.closing { margin-top: 3.5rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }

.pager ul { list-style: none; padding: 0; }
.pager li { padding: 0.375rem 0; }
.cta { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

.site-footer { border-top: 1px solid var(--line); font: 0.875rem/1.6 var(--sans); color: var(--muted); padding: 1.25rem 0 2rem; }
.site-footer p { margin: 0 0 0.5rem; max-width: 40rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; column-gap: 1.25rem; }
.site-footer a { display: inline-block; padding: 0.625rem 0; color: var(--fg); }

/* Moving between pages: a short cross-fade, with the header held still (browsers without
   cross-document view transitions just navigate). Off for anyone who asks for less motion. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
@media print {
  /* Paper gets black on white, not a page of navy ink. */
  :root { --bg: #fff; --fg: #000; --muted: #333; --line: #999; --code: #f2f2f2; color-scheme: light; }
  .site-header nav, .skip, .cta { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
