/* Ecoverity — site stylesheet
   Layout idea: a well-typeset working paper. One column of text on a 12-col grid,
   figures and tables with numbered captions, rules instead of cards. */

@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-latin-wght-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #FBFCFA;
  --ink: #15201A;
  --muted: #56625B;
  --rule: #D3DAD5;
  --accent: #1B5E3B;
  --tint: #EAF2ED;

  --display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
}

* { 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(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}

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

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

/* Header */
.masthead { border-bottom: 1px solid var(--ink); }
/* The header stays at the top of the window while the page scrolls (25 Nov 2026). Only on screens wide enough to
   spare the room: on a phone the links wrap to two or three rows and would cover too much of the page. The
   scroll-padding line makes a jump to a section (#practice and the like) stop below the header, not under it. */
@media (min-width: 761px) {
  html { scroll-padding-top: 84px; }
  .masthead { position: sticky; top: 0; z-index: 50; background: var(--paper); }
}
.masthead .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; padding-top: 22px; padding-bottom: 16px; }
.wordmark { font-family: var(--display); font-size: 27px; font-weight: 560; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.wordmark span { color: var(--accent); }
nav ul { display: flex; flex-wrap: wrap; gap: 4px 28px; list-style: none; margin: 0; padding: 0; }
nav a { font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; padding: 4px 0; }
nav a:hover { color: var(--accent); }

/* Type */
h1, h2, h3 { font-family: var(--display); font-weight: 480; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(38px, 6.2vw, 68px); line-height: 1.04; letter-spacing: -0.022em; }
h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.12; letter-spacing: -0.015em; }
h3 { font-size: 22px; line-height: 1.25; font-weight: 520; }
p { margin: 0; max-width: 62ch; }
.label { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px 56px; align-items: end; padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero-text { display: grid; gap: 24px; }
.hero-text p { font-size: 19px; color: var(--muted); max-width: 52ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-top: 8px; }
.button { display: inline-block; background: var(--accent); color: #fff; font-weight: 500; font-size: 16px; text-decoration: none; padding: 12px 20px; border-radius: 2px; }
.button:hover { background: var(--ink); }
.plain-link { font-weight: 500; font-size: 16px; }

figure { margin: 0; }
figure svg { display: block; width: 100%; height: auto; }
figcaption, .note { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 12px; max-width: 60ch; }
figcaption b, .note b, caption b { font-weight: 600; color: var(--ink); }

.fig-axis { stroke: var(--ink); stroke-width: 1; fill: none; }
.fig-grid { stroke: var(--rule); stroke-width: 1; }
.fig-ctrl { stroke: var(--muted); stroke-width: 2; fill: none; }
.fig-treat { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.fig-cf { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 5; fill: none; }
.fig-start { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 4; }
.fig-effect { fill: var(--tint); }
.fig-t { font-family: var(--mono); font-size: 14px; fill: var(--muted); }
.fig-t.ink { fill: var(--ink); }
.fig-t.acc { fill: var(--accent); font-weight: 500; }

/* Sections */
section { border-top: 1px solid var(--rule); }
section .wrap { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(48px, 7vw, 88px); }
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px 56px; }
.split > header { display: grid; gap: 14px; align-content: start; }
.stack { display: grid; gap: 20px; }
.stack.gap-lg { gap: 36px; }
.stack.gap-sm { gap: 14px; }
.note.tight { margin-top: -12px; }
.aside { color: var(--muted); font-size: 16px; }

/* Table 1 */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
caption { caption-side: top; text-align: left; font-size: 14px; color: var(--muted); padding-bottom: 12px; }
thead th { font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 20px 10px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
tbody th, tbody td { text-align: left; vertical-align: top; padding: 20px 20px 20px 0; border-bottom: 1px solid var(--rule); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 2px solid var(--ink); }
tbody th { font-family: var(--display); font-size: 23px; font-weight: 500; font-style: italic; line-height: 1.2; width: 30%; white-space: nowrap; }
tbody td.methods { font-size: 14.5px; color: var(--muted); width: 28%; }

/* Approach */
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 48px; }
.principles > div { display: grid; gap: 8px; align-content: start; border-top: 1px solid var(--ink); padding-top: 16px; }
.principles p { color: var(--muted); font-size: 16px; }

/* Process */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 0; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.steps li:first-child { border-top: 1px solid var(--ink); }
.steps li::before { content: counter(step); grid-row: 1 / span 2; font-family: var(--mono); font-size: 14px; color: var(--accent); padding-top: 5px; }
.steps h3 { font-size: 20px; }
.steps p { color: var(--muted); font-size: 16px; }
td b { font-weight: 600; }

/* Clients */
dl { margin: 0; display: grid; gap: 0; }
dl > div { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
dl > div:first-child { border-top: 1px solid var(--ink); }
dt { font-weight: 500; }
dd { margin: 0; color: var(--muted); font-size: 16px; }

/* About: the one sentence set larger, in the display face, with a hairline in the accent colour */
.standout { font-family: var(--display); font-size: clamp(21px, 2.5vw, 26px); line-height: 1.35; font-weight: 460; color: var(--ink); text-wrap: balance; padding-left: 18px; border-left: 2px solid var(--accent); }

/* Contact */
.contact { background: var(--tint); }
.contact .email { font-family: var(--display); font-size: clamp(24px, 3.4vw, 34px); font-weight: 480; letter-spacing: -0.01em; overflow-wrap: anywhere; }
address { font-style: normal; color: var(--muted); }

footer { border-top: 1px solid var(--ink); }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-top: 20px; padding-bottom: 28px; font-size: 14px; color: var(--muted); }

/* Narrow screens */
@media (max-width: 820px) {
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); }
  .principles { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  dl > div { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table, tbody, tr, tbody th, tbody td { display: block; width: auto; }
  caption { display: block; }
  tbody tr { border-top: 1px solid var(--ink); padding: 18px 0; }
  tbody tr:last-child { border-bottom: 2px solid var(--ink); }
  tbody th, tbody td, tbody tr:last-child th, tbody tr:last-child td { border: 0; padding: 0; }
  tbody th { white-space: normal; margin-bottom: 8px; }
  tbody td.methods { width: auto; margin-top: 8px; }
}
