/* Dukehoff: diff-gutter identity. Two accents only, the colours of a unified diff. */

@font-face {
  font-family: "Martian Mono";
  src: url("/assets/fonts/martian-mono.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/hanken-grotesk.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/hanken-grotesk-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f3f5f4;
  --surface: #ffffff;
  --ink: #142033;
  --muted: #556072;
  --rule: #d5dbda;
  --add: #0e7a57;
  --add-bg: #dcf1e6;
  --del: #b23a33;
  --del-bg: #f7e1de;

  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 72rem;
  --measure: 46rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f141c;
    --surface: #161d28;
    --ink: #e6eaee;
    --muted: #9aa5b4;
    --rule: #283244;
    --add: #4cc995;
    --add-bg: #12301f;
    --del: #f07a70;
    --del-bg: #3a1d1d;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-feature-settings: "ss01";
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--add); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--add); }
:focus-visible { outline: 2px solid var(--add); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { hyphens: auto; hyphenate-limit-chars: 10 4 4; overflow-wrap: break-word; font-family: var(--mono); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.75rem; text-wrap: balance; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); font-stretch: 112.5%; }
h3 { font-size: 1.05rem; font-stretch: 100%; }
p { margin: 0 0 1rem; }
code, .code { font-family: var(--mono); font-stretch: 80%; font-size: 0.86em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-family: var(--mono); font-stretch: 112.5%; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.02em; }
.wordmark:hover { color: inherit; }
/* Stand-alone links: at least 32 px high on touch screens; the negative margin keeps the layout */
.wordmark { padding-block: 0.375rem; margin-block: -0.375rem; }
.site-nav ul a, .footer-links a, .contact-list dd > a, .post-list h2 a, .more a, .post-back a { display: inline-block; padding-block: 0.375rem; margin-block: -0.375rem; }
.mark { width: 1.35rem; height: 1.35rem; flex: none; }
.mark-del { fill: var(--del); }
.mark-add { fill: var(--add); }
.mark-glyph { stroke: var(--paper); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.mark-wall { stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.mark-core { fill: var(--add); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 1.75rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; }
.site-nav a { text-decoration: none; font-weight: 500; }
.site-nav ul a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--add); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.lang { display: flex; gap: 0.125rem; margin-inline: -0.25rem; font-family: var(--mono); font-size: 0.78rem; }
.lang span[aria-current] { font-weight: 600; text-decoration: underline; text-decoration-color: var(--add); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.lang a, .lang span { padding: 0.375rem 0.25rem; }
.lang a { text-decoration: none; color: var(--muted); }
.lang a:hover { color: var(--add); }
.nav-toggle { display: none; margin-left: auto; font: 500 0.85rem var(--mono); background: none; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.4rem 0.8rem; cursor: pointer; }

@media (max-width: 52rem) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1rem var(--gutter) 1.5rem; }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0.75rem; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.6rem); font-stretch: 112.5%; line-height: 1.12; letter-spacing: -0.025em; max-width: 18ch; margin-bottom: 0; }
.hero-lead { max-width: 40rem; font-size: clamp(1.1rem, 1.6vw, 1.25rem); margin: 2rem 0 1.75rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }


/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.2rem; border-radius: var(--radius); font: 500 0.95rem/1 var(--sans); text-decoration: none; border: 1px solid var(--ink); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--add); border-color: var(--add); color: var(--paper); }
.btn-secondary { background: transparent; color: var(--ink); }
.btn-secondary:hover { border-color: var(--add); color: var(--add); }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--rule); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.25rem; margin-bottom: 2.25rem; max-width: var(--measure); }
.section-head p { color: var(--muted); margin: 0; }
.eyebrow { font: 500 0.75rem/1.4 var(--mono); font-stretch: 85%; color: var(--add); text-transform: lowercase; margin: 0 0 0.75rem; }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 52rem) { .split { grid-template-columns: minmax(0, 1fr); } .split > * { max-width: var(--measure); } }

/* Measured result: a single sourced sentence, not a stat wall */
.source { color: var(--muted); font-size: 0.9rem; max-width: var(--measure); margin-top: 1.5rem; }

/* Terminal-ish call listing */
.calls { margin: 0; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); font: 400 0.82rem/1.9 var(--mono); font-stretch: 80%; overflow-x: auto; }
.calls .tool { color: var(--add); font-weight: 600; }
.calls .c { color: var(--muted); }

/* Lists of offerings */
.offers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; border-top: 1px solid var(--rule); }
.offers li:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 40rem) { .offers { grid-template-columns: minmax(0, 1fr); } }
.offers li { padding: 1.5rem 1.5rem 1.5rem 0; border-bottom: 1px solid var(--rule); }
.offers p { color: var(--muted); margin: 0; }

/* Credentials */
.creds { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.creds li { font: 500 0.78rem/1 var(--mono); font-stretch: 85%; padding: 0.5rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); }

.portrait { border-radius: var(--radius); border: 1px solid var(--rule); width: 100%; max-width: 20rem; aspect-ratio: 1; object-fit: cover; }

/* Call to action band */
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cta > div { flex: 1 1 0; min-width: min(100%, 24rem); }
.cta p { margin: 0; color: var(--muted); max-width: 38rem; }

/* Tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.75rem 1rem; border-bottom: 1px solid var(--rule); }
tr:last-child td { border-bottom: 0; }
th { font: 500 0.75rem/1.4 var(--mono); font-stretch: 85%; color: var(--muted); text-transform: lowercase; }
td.num, th.num { text-align: right; font-family: var(--mono); font-stretch: 85%; font-variant-numeric: tabular-nums; white-space: nowrap; }
td code { white-space: nowrap; }
.table-scroll td:first-child { min-width: 12rem; }
.better { color: var(--add); font-weight: 600; }

/* Page header for inner pages */
.page-head { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.page-head h1 { font-size: clamp(1.8rem, 4.2vw, 3rem); font-stretch: 112.5%; }
.page-head p { font-size: 1.15rem; max-width: 42rem; color: var(--muted); }

/* Long-form text and legal pages */
.prose { max-width: var(--measure); }
.narrow { max-width: var(--measure); }
.prose h2 { font-size: 1.25rem; font-stretch: 100%; margin-top: 2.5rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul { padding-left: 1.2rem; }
.prose address { font-style: normal; margin-bottom: 1rem; }


.contact-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.75rem 2rem; margin: 0 0 2rem; }
.contact-list dt { font: 500 0.75rem/1.9 var(--mono); font-stretch: 85%; color: var(--muted); text-transform: lowercase; }
.contact-list dd { margin: 0; }
@media (max-width: 30rem) { .contact-list { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; } .contact-list dd { margin-bottom: 0.75rem; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 3rem 0 2rem; margin-top: 2rem; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
.footer-tagline { color: var(--muted); margin-top: 0.75rem; max-width: 24rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; align-content: start; }
.footer-links a { text-decoration: none; padding-block: 0.25rem; margin-block: -0.25rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem; }
@media (max-width: 40rem) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
.more { margin-top: 1.5rem; }
/* Measured evidence after a two-column block */
.split + .evidence { margin-top: 3rem; }

.prose > h2:first-child { margin-top: 0; }

/* Tools */
.tool-tagline { font-weight: 600; font-size: 1.1rem; }
.features { margin: 0; border-top: 1px solid var(--rule); }
.features > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.features dt { font: 500 0.85rem/1.6 var(--mono); font-stretch: 90%; color: var(--add); }
.features dd { margin: 0; }
.calls + .features { margin-top: 1.5rem; }
@media (max-width: 30rem) { .features > div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; } }

/* Blog */
.post-meta, .page-head .post-meta { font: 500 0.78rem/1.4 var(--mono); font-stretch: 85%; color: var(--muted); margin: 0 0 0.75rem; }
.post-meta time { white-space: nowrap; }
.draft { color: var(--del); }
.tag { color: var(--add); }
.post-list { list-style: none; margin: 0; padding: 0; max-width: var(--measure); border-top: 1px solid var(--rule); }
.section > .wrap > .post-list:first-child { border-top: 0; }
.section > .wrap > .post-list:first-child li:first-child { padding-top: 0; }
.post-list li { padding: 1.75rem 0; border-bottom: 1px solid var(--rule); }
.post-list h2 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); font-stretch: 100%; }
.post-list h2 a { text-decoration: none; }
.post-list h2 a:hover { color: var(--add); }
.post-list p:last-child { margin: 0; color: var(--muted); }
/* Tool head on the tools pages: logo beside eyebrow and name. */
.tool-head { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); column-gap: 1.25rem; align-items: center; margin-bottom: 0.75rem; }
.tool-head .tool-logo { width: 4.5rem; }
.tool-head h2 { margin: 0; }
@media (max-width: 30rem) { .tool-head { grid-template-columns: 3.5rem minmax(0, 1fr); column-gap: 1rem; } .tool-head .tool-logo { width: 3.5rem; } }
/* Tool logo: a post with `tool:` shows the tool's logo beside its title and in the blog list.
   Wide: it hangs left of the text column (post) or fills a logo column (list). Narrow: it sits
   beside the meta line and the title takes the full width. */
.tool-logo { display: block; height: auto; }
.has-tool { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 0.75rem; align-items: center; }
.has-tool > * { grid-column: 1 / -1; }
.has-tool > .tool-logo { grid-column: 1; width: 2.5rem; margin-bottom: 0.75rem; }
.has-tool > .post-meta { grid-column: 2; }
@media (min-width: 64rem) {
  .post .page-head .has-tool { display: block; position: relative; }
  .post .page-head .has-tool .tool-logo { position: absolute; top: 0; left: calc(var(--gutter) - 6rem); width: 4.5rem; margin: 0; }
}
@media (min-width: 40rem) {
  .post-list.has-tools li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); column-gap: 1.25rem; align-items: start; }
  .post-list.has-tools li > * { grid-column: 2; }
  .post-list.has-tools li > .tool-logo { grid-column: 1; grid-row: 1 / span 3; width: 3rem; margin: 0; }
}
.post .page-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); font-stretch: 100%; max-width: var(--measure); }
.post-body { border-top: 0; padding-top: 0; }
.post-body .prose { font-size: 1.1rem; line-height: 1.7; }
.post-body .prose h2 { font-size: 1.35rem; font-stretch: 100%; margin-top: 2.75rem; }
.post-body .prose ul, .post-body .prose ol { padding-left: 1.3rem; }
.post-body .prose li { margin-bottom: 0.75rem; }
.post-body .prose blockquote { margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 3px solid var(--add); color: var(--muted); }
.post-body .prose img { border-radius: var(--radius); border: 1px solid var(--rule); }
.post-body .prose .table-scroll { margin: 1.5rem 0; }
.results { margin: 1.5rem 0; border-top: 1px solid var(--rule); }
.results > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.results dt { font: 500 2rem/1 var(--mono); font-stretch: 90%; font-variant-numeric: tabular-nums; color: var(--add); white-space: nowrap; }
.results dt span { display: block; margin-top: 0.4rem; font-size: 0.75rem; font-stretch: 85%; color: var(--muted); text-transform: lowercase; }
.results dd { margin: 0; }
.results dd strong { display: block; }
.results .setup { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 30rem) { .results > div { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; } }
.post-body .prose hr + p { color: var(--muted); font-size: 0.9rem; }
.prose video { display: block; max-width: 100%; height: auto; margin: 1.5rem 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.post-body .prose :not(pre) > code { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 0.05em 0.35em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.post-back { margin: 2.5rem 0 0; }

/* Code blocks (Prism tokens, highlighted at build time) */
.prose pre, pre[class*="language-"] { margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow-x: auto; font: 400 0.84rem/1.7 var(--mono); font-stretch: 80%; tab-size: 4; }
.prose pre code, pre[class*="language-"] code { font: inherit; }
.token.comment, .token.prolog, .token.doctype { color: var(--muted); font-style: italic; }
.token.keyword, .token.boolean, .token.important { color: var(--add); font-weight: 600; }
.token.string, .token.char, .token.attr-value { color: var(--del); }
.token.annotation, .token.class-name, .token.function { font-weight: 600; }
.token.number, .token.operator, .token.punctuation { color: var(--muted); }
.token.inserted { background: var(--add-bg); }
.token.deleted { background: var(--del-bg); }
/* Posts: title and text share one centred reading column */
.post .wrap, .post-body .prose { max-width: calc(var(--measure) + 2 * var(--gutter)); }
/* Text cells keep a minimum width, so a wide table scrolls instead of squeezing them */
.post-body .prose .table-scroll td:not([style*="right"]) { min-width: 11rem; }
/* Number columns are the ones the author marked right-aligned (---: in Markdown) */
.post-body .prose th[style*="right"], .post-body .prose td[style*="right"] { font-family: var(--mono); font-stretch: 85%; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Business-card pages ---------- */
.offers.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.offers.three li:last-child:nth-child(odd) { grid-column: auto; }
.service h2 { margin-bottom: 1rem; }
.service p { color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.checklist li { padding: 0.8rem 0 0.8rem 1.75rem; border-bottom: 1px solid var(--rule); position: relative; }
.checklist li::before { content: "+"; position: absolute; left: 0.25rem; font-family: var(--mono); font-weight: 600; color: var(--add); }
.tech { margin: 0; border-top: 1px solid var(--rule); }
.tech > div { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); align-items: center; }
.tech dt { font: 500 0.85rem/1.6 var(--mono); font-stretch: 90%; color: var(--muted); }
.tech dd { margin: 0; }
/* Announcement: a pill link above a heading (home hero, a tool on the tools page). */
.announce { margin: 0 0 1.25rem; }
.announce a { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.85rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); font: 500 0.78rem/1.4 var(--mono); font-stretch: 85%; color: var(--ink); text-decoration: none; }
.announce a::before { content: ""; flex: none; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--add); }
.announce a:hover { border-color: var(--add); }
.aside-line { margin-top: 2.5rem; margin-bottom: 0; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 52rem) {
  .offers.three { grid-template-columns: minmax(0, 1fr); }
  .tech > div { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
}
