/* PatchProvenance. One dark theme; every colour, size and space is named once, here. */
:root {
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #16161a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --ink: #fafafa;
  --ink-soft: #a1a1aa;
  /* at least 4.5:1 (WCAG 2.2 AA, text) on every surface it is used on, the lit tile included */
  --ink-faint: #93939c;
  /* at least 3:1 (WCAG 2.2 AA, non-text) against the page, a tile and a field: a field's edge */
  --field-line: #71717a;
  --accent: #22d3a6;
  --accent-strong: #10b981;
  --accent-glow: rgba(34, 211, 166, 0.16);
  --accent-line: rgba(34, 211, 166, 0.35);
  --accent-bg: rgba(34, 211, 166, 0.1);
  --button: #22d3a6;
  --button-ink: #04140f;
  --focus: #fbbf24;

  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.1);
  --warn-line: rgba(251, 191, 36, 0.35);
  --mute-bg: rgba(255, 255, 255, 0.05);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  --text-xs: 0.75rem;
  --text-s: 0.875rem;
  --text-m: 1rem;
  --text-l: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.875rem;
  --text-3xl: 3rem;
  --text-figure: 3.25rem;
  --tight: -0.03em;

  --radius: 0.75rem;
  --radius-s: 0.375rem;
  --radius-pill: 999px;
  --border: 1px;
  --width: 70rem;
  --width-narrow: 42rem;
  --width-text: 46rem;
  --width-table: 44rem;
  --doc-height: 30rem;
  --glow-width: 60rem;
  --glow-height: 32rem;
  --dot: 0.625rem;
  --mark: 1.625rem;

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

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--space-16); color-scheme: dark; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-m);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--width); margin: 0 auto; padding: 0 var(--space-5); }
.wrap.narrow { max-width: var(--width-narrow); }
.wide { max-width: var(--width-text); color: var(--ink-soft); }

h1, h2, h3 { margin: 0 0 var(--space-4); line-height: 1.1; letter-spacing: var(--tight); font-weight: 650; }
h1 { font-size: var(--text-3xl); max-width: var(--width-text); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-l); }
p, ul, ol { margin: 0 0 var(--space-4); }
ul, ol { padding-left: var(--space-5); }
li { margin-bottom: var(--space-2); }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-s); }

code, pre, .figure, .count, .label, .pill, .chips, .file, .amount, .tablist button { font-family: var(--mono); }
code { font-size: 0.875em; color: var(--ink); background: var(--mute-bg); border: var(--border) solid var(--line); border-radius: var(--radius-s); padding: 0 var(--space-1); }
pre code { background: none; border: 0; padding: 0; }
.hash, .status { overflow-wrap: anywhere; }

section { padding: var(--space-16) 0; border-top: var(--border) solid var(--line); }
.note { font-size: var(--text-s); color: var(--ink-faint); }

.skip { position: absolute; left: var(--space-4); top: -10rem; background: var(--button); color: var(--button-ink); padding: var(--space-2) var(--space-4); border-radius: var(--radius-s); }
.skip:focus { top: var(--space-2); z-index: 3; }

.draft { background: var(--warn-bg); border-bottom: var(--border) solid var(--warn-line); color: var(--warn); font-family: var(--mono); font-size: var(--text-s); text-align: center; padding: var(--space-2) var(--space-4); margin: 0; }

.top { position: sticky; top: 0; z-index: 2; background: rgba(9, 9, 11, 0.8); backdrop-filter: blur(12px); border-bottom: var(--border) solid var(--line); }
.top-row { display: flex; align-items: center; gap: var(--space-6); padding-top: var(--space-3); padding-bottom: var(--space-3); }
.brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 650; letter-spacing: var(--tight); color: var(--ink); text-decoration: none; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mark { width: var(--mark); height: var(--mark); flex: none; color: var(--accent); }
.word { color: var(--ink); }
.word span { color: var(--accent); }
.top nav { display: flex; gap: var(--space-5); margin-left: auto; font-size: var(--text-s); }
.top nav a { color: var(--ink-soft); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.top .button { margin-left: auto; }
.top nav + .button { margin-left: 0; }

.button { display: inline-block; background: var(--button); color: var(--button-ink); border: var(--border) solid var(--button); border-radius: var(--radius-s); padding: var(--space-3) var(--space-5); font: inherit; font-weight: 600; font-size: var(--text-s); text-decoration: none; cursor: pointer; transition: opacity 120ms ease, border-color 120ms ease; }
.button:hover { color: var(--button-ink); background: var(--accent-strong); border-color: var(--accent-strong); }
.button:active { transform: translateY(1px); }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button.ghost:hover { color: var(--ink); background: transparent; border-color: var(--accent); }
.button.small { padding: var(--space-2) var(--space-4); }
.more { font-size: var(--text-s); color: var(--ink-soft); }
.more::after { content: " →"; }

.hero { position: relative; border-top: 0; padding-top: var(--space-24); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0 0 auto 50%; width: var(--glow-width); height: var(--glow-height); transform: translateX(-50%); background: radial-gradient(closest-side, var(--accent-glow), transparent); pointer-events: none; }
.hero .wrap { position: relative; }
.eyebrow { margin-bottom: var(--space-5); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin: var(--space-6) 0; }
/* The first screen, on the page's own grid: the question and the price, the demo beside them,
   what the price covers under them. In one column the demo comes second, so its counts are on
   the first screen of a phone. The flexible second row takes what the demo is taller by. */
.first { grid-template-rows: auto 1fr; }
.first > .pitch, .first > .covers { grid-column: 1 / span 3; }
.first > .demo { grid-column: 4 / span 3; grid-row: 1 / span 2; align-self: start; }
.pitch > :last-child, .covers > :last-child { margin-bottom: 0; }
.demo .actions { margin-top: 0; }
/* the three counts of the demo; a count of a large file wraps rather than leave its column */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.trio li { margin: 0; min-width: 0; }
.trio .figure { font-size: var(--text-3xl); overflow-wrap: anywhere; }

.pill { display: inline-block; font-size: var(--text-xs); line-height: 1.6; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: var(--border) solid var(--line-strong); background: var(--mute-bg); color: var(--ink-soft); white-space: nowrap; }
/* One hue, three strengths: the stronger the evidence, the more of the brand colour. */
.pill.l1 { color: var(--button-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.pill.l2, .pill.s-affected { color: var(--accent); background: var(--accent-bg); border-color: var(--accent-line); }
.pill.l3 { color: var(--ink-soft); background: transparent; border-color: var(--accent-line); }
/* what the script hides stays hidden, though its class sets a display of its own */
.pill[hidden], .copy[hidden] { display: none; }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-4); margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.tile { background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius); padding: var(--space-6); margin: 0; min-width: 0; }
.tile > :last-child { margin-bottom: 0; }
/* the last child shown: one the script keeps hidden until it has something to show */
.tile > :has(+ [hidden]:last-child) { margin-bottom: 0; }
.tile p { color: var(--ink-soft); }
.tile.lit { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-glow), transparent 70%), var(--surface); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }

.figure { font-size: var(--text-figure); font-weight: 600; line-height: 1; letter-spacing: var(--tight); color: var(--ink); margin-bottom: var(--space-3); }
.tile p.figure { color: var(--ink); }
.lit .figure, .tile.lit p.figure { color: var(--accent); }
.caption { font-size: var(--text-s); }
.label, h2.label, h3.label { font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--space-4); }
.tile p.label { color: var(--ink-faint); }

.counts, .legend, .plain { list-style: none; padding: 0; margin: 0; }
.counts li { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) 0; margin: 0; border-bottom: var(--border) solid var(--line); }
.counts li:last-child { border-bottom: 0; }
/* the before/after bar of the local check: each part's flex-grow is its count, set by site.js */
.posture { margin: var(--space-6) 0; }
.bars { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-3); align-items: center; margin-bottom: var(--space-4); }
.bar-label { font-size: var(--text-xs); color: var(--ink-faint); }
.bar { display: flex; height: var(--space-3); border-radius: var(--radius-pill); overflow: hidden; background: var(--mute-bg); }
.seg { flex: 0 1 0; min-width: 0; }
.seg.open, .swatch.open { background: var(--warn); }
.seg.strong, .swatch.strong { background: var(--accent); }
.seg.weak, .swatch.weak { background: var(--accent-line); }
.seg.inactive, .swatch.inactive { background: var(--line-strong); }
.swatch { display: inline-block; width: var(--dot); height: var(--dot); border-radius: var(--radius-pill); margin-right: var(--space-2); }
.copy { display: grid; gap: var(--space-2); justify-items: start; margin-bottom: var(--space-4); }
.copy .actions { margin: 0; }
.copy textarea { width: 100%; font-family: var(--mono); font-size: var(--text-xs); }
.count { font-size: var(--text-l); color: var(--ink); }
.legend li { display: grid; grid-template-columns: 7.5rem 1fr; gap: var(--space-4); align-items: baseline; padding: var(--space-2) 0; margin: 0; color: var(--ink-soft); font-size: var(--text-s); }
.plain li { position: relative; padding-left: var(--space-5); color: var(--ink-soft); font-size: var(--text-s); }
.plain li::before { content: "—"; position: absolute; left: 0; color: var(--ink-faint); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.chip { font-size: var(--text-s); color: var(--ink); background: var(--mute-bg); border: var(--border) solid var(--line); border-radius: var(--radius-s); padding: 0 var(--space-2); }

.steps .label { color: var(--accent); }
.price .amount { font-size: var(--text-2xl); font-weight: 600; letter-spacing: var(--tight); color: var(--ink); margin-bottom: var(--space-3); }
.price .amount span { font-family: var(--sans); font-size: var(--text-s); font-weight: 400; letter-spacing: 0; color: var(--ink-faint); }

/* the picture of the demo beside the sample package: as wide as the text above it */
.shot { max-width: var(--width-text); margin: 0 0 var(--space-6); }
.shot img { display: block; width: 100%; height: auto; border: var(--border) solid var(--line); border-radius: var(--radius); }
.shot figcaption { margin-top: var(--space-2); }

.window { border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-4); background: var(--surface-2); border-bottom: var(--border) solid var(--line); min-height: var(--space-12); }
.dots { display: flex; gap: var(--space-2); }
.dots i { width: var(--dot); height: var(--dot); border-radius: var(--radius-pill); background: var(--line-strong); }
.tablist { display: none; flex-wrap: wrap; gap: var(--space-1); }
.js .tablist { display: flex; }
.tablist button { font-size: var(--text-xs); color: var(--ink-faint); background: transparent; border: 0; border-bottom: 2px solid transparent; padding: var(--space-4) var(--space-3); cursor: pointer; }
.tablist button:hover { color: var(--ink); }
.tablist button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.js .panel[hidden] { display: none; }
.file { font-size: var(--text-xs); color: var(--ink-faint); margin: 0; padding: var(--space-3) var(--space-6); border-bottom: var(--border) solid var(--line); }
.doc { margin: 0; padding: var(--space-6); max-height: var(--doc-height); overflow: auto; font-size: var(--text-s); }
pre.doc { line-height: 1.7; color: var(--ink-soft); }

.prose { color: var(--ink-soft); }
.prose h1 { color: var(--ink); margin-bottom: var(--space-2); }
.prose h2 { font-size: var(--text-xl); color: var(--ink); margin-top: var(--space-12); }
.prose h3, .prose h4, .prose h5 { font-size: var(--text-m); color: var(--ink); letter-spacing: 0; margin-top: var(--space-6); }
.prose > :first-child { margin-top: 0; }
.prose strong { color: var(--ink); }
.prose table { width: 100%; min-width: var(--width-table); border-collapse: collapse; margin: 0 0 var(--space-4); font-size: var(--text-xs); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: var(--space-2) var(--space-3); border-bottom: var(--border) solid var(--line); }
.prose thead th { color: var(--ink-faint); font-weight: 500; }
.prose blockquote { margin: 0 0 var(--space-4); padding-left: var(--space-4); border-left: 2px solid var(--line-strong); }

.form { display: grid; gap: var(--space-4); }
.field { display: grid; gap: var(--space-2); }
.field label { font-size: var(--text-s); font-weight: 500; color: var(--ink-soft); }
.optional { color: var(--ink-faint); font-weight: 400; }
input, select, textarea { font: inherit; font-size: var(--text-s); color: var(--ink); background: var(--surface); border: var(--border) solid var(--field-line); border-radius: var(--radius-s); padding: var(--space-3); width: 100%; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-faint); }
/* The file input's own button takes the look of .button.ghost. A rule of its own: a browser
   that does not know ::file-selector-button drops the whole rule it appears in. */
input[type="file"]::file-selector-button { margin-right: var(--space-3); padding: 0 var(--space-3); font: inherit; font-weight: 600; color: var(--ink); background: transparent; border: var(--border) solid var(--line-strong); border-radius: var(--radius-s); cursor: pointer; transition: border-color 120ms ease; }
input[type="file"]::file-selector-button:hover { border-color: var(--accent); }
input[type="file"]::file-selector-button:active { transform: translateY(1px); }
/* a field on a tile, one step lighter than the tile, as a field of the order form is than the page */
.tile input { background: var(--surface-2); }
.form .button { justify-self: start; }
.tile.form { align-content: start; }

.bottom { border-top: var(--border) solid var(--line); padding: var(--space-8) 0; color: var(--ink-soft); font-size: var(--text-s); }
.bottom p { margin-bottom: var(--space-2); }
.bottom .brand { margin-bottom: var(--space-3); }

@media (max-width: 52rem) {
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  .top nav { display: none; }
  .bento { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4, .span-6 { grid-column: auto; }
  .first > .pitch, .first > .covers, .first > .demo { grid-column: auto; grid-row: auto; }
  section { padding: var(--space-12) 0; }
  .hero { padding-top: var(--space-8); }
  .trio .figure { font-size: var(--text-2xl); }
  /* both buttons of the demo on one row of a phone, so its counts stay on the first screen */
  .demo .actions { gap: var(--space-3); }
  .demo .button { padding: var(--space-3) var(--space-4); }
  .legend li { grid-template-columns: 1fr; gap: var(--space-1); }
  .window-bar { flex-wrap: wrap; }
}
