/* AfterGreen site. Palette and type come from brand/colors.json and
   brand/guidelines.md; nothing here adds a colour. Muted text on ivory is
   charcoal at reduced opacity, because slate is not text-safe on ivory. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --charcoal: #101416;
  --ivory: #f5f4ef;
  --green: #b5f36c;
  --coral: #f27964;
  --slate: #899397;

  --ink-muted: rgb(16 20 22 / 0.74);    /* ~8:1 on ivory */
  --rule: rgb(16 20 22 / 0.16);
  --rule-strong: var(--charcoal);
  --rule-dark: rgb(137 147 151 / 0.35); /* slate, decorative on charcoal */

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 75rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --space: clamp(4rem, 9vw, 7.5rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; }
h2 { font-size: clamp(2rem, 4.6vw, 3.25rem); max-width: 18ch; }
h3 { font-size: 1.25rem; letter-spacing: -0.015em; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 1rem; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--charcoal);
  outline-offset: 3px;
}
.section--dark :focus-visible,
.footer :focus-visible { outline-color: var(--green); }

.mono, code, pre { font-family: var(--mono); font-feature-settings: "calt" 0; }
.mono { font-size: 0.92em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--charcoal); color: var(--ivory);
  padding: 0.6rem 1rem; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Masthead ─────────────────────────────────────────── */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.5rem;
}
.masthead__logo { display: block; width: clamp(9.5rem, 22vw, 12.5rem); }
/* The lockup's viewBox has ~5.8% padding on the left; pull it to the grid. */
.masthead__logo img { margin-inline-start: -5.8%; width: 100%; }
.masthead__nav ul {
  display: flex; gap: clamp(1rem, 2.4vw, 2rem);
  margin: 0; padding: 0; list-style: none;
}
.masthead__nav a {
  font-size: 0.9375rem; font-weight: 500; text-decoration: none;
  display: inline-block; padding-block: 0.5rem;
}
.masthead__nav a:hover { text-decoration: underline; }
@media (max-width: 52rem) { .nav-section { display: none; } }

/* ── Hero ─────────────────────────────────────────────── */
.hero { padding-block: clamp(3rem, 8vw, 6.5rem) var(--space); }
.hero__grid {
  display: grid; gap: clamp(2.5rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
}
@media (min-width: 60rem) {
  .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}

.kicker {
  font-family: var(--mono); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 1.5rem;
}
h1 {
  font-size: clamp(3.25rem, 10vw, 7.25rem);
  letter-spacing: -0.045em; line-height: 0.95;
  margin-bottom: 1.75rem;
}
.hero__lede { font-size: clamp(1.1875rem, 2vw, 1.4375rem); line-height: 1.45; max-width: 30ch; color: var(--ink-muted); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.75rem 1.375rem;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 2px solid var(--charcoal); border-radius: 2px;
}
.btn--primary { background: var(--charcoal); color: var(--ivory); }
.btn--primary:hover { background: transparent; color: var(--charcoal); }
.btn--secondary { color: var(--charcoal); }
.btn--secondary:hover { background: var(--charcoal); color: var(--ivory); }
.btn--light { border-color: var(--ivory); color: var(--ivory); margin-top: 0.5rem; }
.btn--light:hover { background: var(--ivory); color: var(--charcoal); }
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 120ms linear, color 120ms linear; }
}

/* Evidence figure: reported plane (lime) over observed plane (coral), in
   the same order as the mark. */
.evidence { margin: 0; }
.evidence__panel {
  background: var(--charcoal); color: var(--ivory);
  font-family: var(--mono); font-size: 0.875rem; line-height: 1.5;
  padding: 1.25rem clamp(1rem, 3vw, 1.75rem) 1.5rem;
}
.evidence__head {
  display: flex; justify-content: space-between; gap: 1rem;
  color: var(--slate); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding-bottom: 0.875rem; margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule-dark);
}
.evidence__group { margin: 0 0 1.25rem; padding-left: 1rem; border-left: 4px solid; }
.evidence__group dd { margin: 0; }
.evidence__group--reported { border-left-color: var(--green); }
.evidence__group--observed { border-left-color: var(--coral); }
.evidence__label {
  color: var(--slate); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 0.375rem;
}
.evidence__rows { margin: 0; }
.evidence__rows > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-block: 0.25rem;
}
.evidence__rows dt { color: var(--ivory); }
.evidence__rows dd { margin: 0; font-weight: 600; }
.evidence__verdict {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  margin: 1.5rem 0 0; padding-top: 1rem;
  border-top: 1px solid var(--rule-dark);
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--slate);
}
.evidence__verdict strong {
  background: var(--coral); color: var(--charcoal);
  font-size: 1.125rem; letter-spacing: 0.04em; padding: 0.25rem 0.625rem;
}
.evidence figcaption {
  font-size: 0.875rem; line-height: 1.5; color: var(--ink-muted);
  margin-top: 0.875rem; max-width: 52ch;
}

.t-green { color: var(--green); }
.t-coral { color: var(--coral); }
.t-slate { color: var(--slate); }

/* ── Sections ─────────────────────────────────────────── */
.section { padding-block: var(--space); border-top: 1px solid var(--rule-strong); }
.section--rule { border-top-color: var(--rule-strong); }
.section--dark { background: var(--charcoal); color: var(--ivory); border-top: 0; }
.section__grid {
  display: grid; gap: 1.5rem 2.5rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 60rem) {
  .section__grid { grid-template-columns: 7rem minmax(0, 1fr); }
}
.section__num {
  font-family: var(--mono); font-size: 0.875rem; font-weight: 500;
  letter-spacing: 0.06em; margin: 0; padding-top: 0.6rem;
  color: var(--ink-muted);
}
.section--dark .section__num { color: var(--slate); }
.section__body > h2 { margin-bottom: 1.5rem; }
.lede { font-size: clamp(1.125rem, 1.8vw, 1.3125rem); line-height: 1.5; max-width: 54ch; margin-bottom: 2.5rem; }
.section:not(.section--dark) .lede { color: var(--ink-muted); }
.section--dark .lede { color: var(--ivory); }
.note { font-size: 0.9375rem; color: var(--ink-muted); max-width: 60ch; }
.section--dark .note { color: var(--slate); }

/* Problem */
.contrast-table {
  width: 100%; border-collapse: collapse; margin-bottom: 2.5rem;
  font-size: 1rem;
}
.contrast-table th, .contrast-table td {
  text-align: left; vertical-align: top;
  padding: 1rem 1.5rem 1rem 0; border-bottom: 1px solid var(--rule);
}
.contrast-table thead th {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted);
  border-bottom: 1px solid var(--charcoal); padding-top: 0;
}
.contrast-table tbody th { font-weight: 700; width: 34%; }
.contrast-table + p { font-size: 1.1875rem; max-width: 54ch; font-weight: 500; }
@media (max-width: 40rem) {
  .contrast-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .contrast-table, .contrast-table tbody, .contrast-table tr, .contrast-table th, .contrast-table td { display: block; width: auto; }
  .contrast-table tr { border-bottom: 1px solid var(--rule); padding-block: 1rem; }
  .contrast-table th, .contrast-table td { border: 0; padding: 0; }
  .contrast-table tbody th { width: auto; margin-bottom: 0.25rem; }
}

/* Verdicts: the word, the exit code and the border style each identify the
   verdict, so none of them depends on colour. */
.verdicts {
  list-style: none; margin: 0 0 2.5rem; padding: 0;
  display: grid; gap: 2rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.verdict { padding-top: 1.25rem; border-top: 4px solid; }
.verdict p:last-child { margin: 0; }
.verdict--verified { border-top-color: var(--green); }
.verdict--failed { border-top-color: var(--coral); }
.verdict--unknown { border-top: 4px dashed var(--slate); }
.verdict__word {
  font-family: var(--mono); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: 0.02em; margin-bottom: 0.25rem; line-height: 1.2;
}
.verdict--verified .verdict__word { color: var(--green); }
.verdict--failed .verdict__word { color: var(--coral); }
.verdict--unknown .verdict__word { color: var(--ivory); }
.verdict__exit { font-family: var(--mono); font-size: 0.875rem; color: var(--slate); margin-bottom: 1rem; }
.callout {
  margin: 0; padding: 1.25rem 0 0; max-width: 60ch;
  border-top: 1px solid var(--rule-dark);
}

/* How it works */
.split {
  display: grid; gap: 2.5rem 3.5rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 60rem) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split--action { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 1rem 0 1rem 2.75rem; border-top: 1px solid var(--rule);
  color: var(--ink-muted);
}
.steps li:first-child { border-top-color: var(--charcoal); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 1.15rem;
  font-family: var(--mono); font-size: 0.875rem; font-weight: 600;
  color: var(--charcoal);
}
.steps strong { display: block; color: var(--charcoal); }

.code-stack { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.code { background: var(--charcoal); color: var(--ivory); position: relative; min-width: 0; }
.code__title {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  margin: 0; padding: 0.625rem 1rem;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em;
  color: var(--slate); border-bottom: 1px solid var(--rule-dark);
  min-height: 2.75rem;
}
.code__title > span { min-width: 0; overflow-wrap: anywhere; }
.code pre {
  margin: 0; padding: 1rem 1.125rem 1.125rem;
  font-size: 0.875rem; line-height: 1.6;
  overflow-x: auto; tab-size: 2;
}
.code pre:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.code--output { background: transparent; color: var(--charcoal); border: 1px solid var(--charcoal); }
.code--output .code__title { color: var(--ink-muted); border-bottom-color: var(--rule); }
/* Coral is not text-safe on ivory; the output block keeps the verdict in ink
   and marks it with a coral underline instead. */
.code--output .t-coral { color: var(--charcoal); font-weight: 700; text-decoration: underline 3px var(--coral); text-underline-offset: 0.25em; }
.code--output .t-slate { color: var(--ink-muted); }
.code--output pre:focus-visible { outline-color: var(--charcoal); }
.code--dark { border: 1px solid var(--rule-dark); }
.code-stack .note { margin-top: 0.25rem; }

.copy {
  font: 600 0.75rem/1 var(--mono); letter-spacing: 0.04em;
  color: var(--ivory); background: transparent;
  border: 1px solid var(--slate); border-radius: 2px;
  padding: 0.5rem 0.75rem; min-height: 2rem; min-width: 4.5rem; cursor: pointer;
  flex: none;
}
.copy:hover { border-color: var(--ivory); }
.copy:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.copy[data-state="done"] { border-color: var(--green); color: var(--green); }

/* Capabilities: ruled cells, not cards. */
.caps {
  display: grid; grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--charcoal); margin-bottom: 3rem;
}
@media (min-width: 44rem) { .caps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cap {
  padding: 1.75rem 0; border-bottom: 1px solid var(--rule);
  display: flex; flex-direction: column;
}
@media (min-width: 44rem) {
  .cap:nth-child(odd) { padding-right: 2.5rem; border-right: 1px solid var(--rule); }
  .cap:nth-child(even) { padding-left: 2.5rem; }
}
.cap h3 { margin-bottom: 0.375rem; }
.cap__cmd { color: var(--ink-muted); margin-bottom: 1rem; }
.cap p { color: var(--ink-muted); }
.cap__where {
  margin: auto 0 0; padding-top: 0.5rem;
  font-family: var(--mono); font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.cap p.cap__where { color: var(--charcoal); }

.table-scroll { overflow-x: auto; margin-bottom: 1rem; }
.table-scroll:focus-visible { outline-offset: 2px; }
.matrix { border-collapse: collapse; width: 100%; font-size: 1rem; }
.matrix caption, .outcomes caption {
  text-align: left; font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; padding-bottom: 0.75rem;
}
.matrix caption { color: var(--ink-muted); }
.matrix th, .matrix td { text-align: left; padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1px solid var(--rule); }
.matrix thead th { border-bottom-color: var(--charcoal); font-weight: 600; }
.matrix tbody th { font-weight: 500; }
.matrix td { font-family: var(--mono); font-size: 0.9375rem; width: 24%; }

/* GitHub Action */
.action-notes { min-width: 0; }
.action-notes p { color: var(--ivory); max-width: 46ch; }
.outcomes { border-collapse: collapse; width: 100%; margin-bottom: 1.75rem; }
.outcomes caption { color: var(--slate); }
.outcomes th, .outcomes td { text-align: left; padding: 0.625rem 1rem 0.625rem 0; border-bottom: 1px solid var(--rule-dark); }
.outcomes thead th { font-weight: 500; color: var(--slate); font-size: 0.875rem; }
.outcomes tbody th { font-family: var(--mono); font-weight: 600; }
.code--dark pre { font-size: 0.8125rem; }

/* Open source */
.status { margin: 0; border-top: 1px solid var(--charcoal); }
.status > div {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem;
  padding-block: 0.875rem; border-bottom: 1px solid var(--rule);
}
.status dt { font-weight: 700; }
.status dd { margin: 0; color: var(--ink-muted); }
@media (max-width: 30rem) { .status > div { grid-template-columns: minmax(0, 1fr); gap: 0.125rem; } }

.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--charcoal); align-self: start; }
.links a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  padding: 1.125rem 0; border-bottom: 1px solid var(--rule);
  text-decoration: none; font-size: 1.1875rem; font-weight: 600;
}
.links a::after { content: "→"; order: 3; font-weight: 400; }
.links .mono { font-size: 0.875rem; font-weight: 400; color: var(--ink-muted); margin-left: auto; }
.links a:hover span:first-child { text-decoration: underline; text-underline-offset: 0.2em; }

/* ── Footer ───────────────────────────────────────────── */
.footer { background: var(--charcoal); color: var(--ivory); padding-block: 3.5rem; }
.footer__row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 2rem;
}
.footer__brand img { width: 11rem; margin-inline-start: -5.8%; margin-bottom: 0.5rem; }
.footer__brand p { margin: 0; color: var(--slate); font-size: 0.9375rem; }
.footer__brand a { color: var(--ivory); }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.footer nav a { display: inline-block; padding-block: 0.5rem; font-size: 0.9375rem; text-decoration: none; }
.footer nav a:hover { text-decoration: underline; }

/* ── 404 ──────────────────────────────────────────────── */
.notfound { padding-block: var(--space); }
.notfound h1 { font-size: clamp(2.75rem, 8vw, 5.5rem); }
.notfound .evidence__panel { max-width: 34rem; margin-bottom: 2rem; }

@media print {
  .masthead__nav, .copy, .skip { display: none; }
  .section--dark, .footer, .evidence__panel, .code { background: none; color: #000; }
}
