/*
  gleon.rs
  Black and white, with two kinds of colour:
  - the colours gleon paints into a diff image: red for a failing area, yellow for tolerated pixels;
  - one colour for each product, from its language: the CLI orange (Rust), the Flutter package
    blue (Dart), the next SDKs green (Playwright). They mark rules and dots, never text.
*/

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens: light by default, dark when the system asks for it. */
:root {
  --bg: #ffffff;
  --surface: #f4f5f7;
  --ink: #15181c;
  --muted: #5c6470;
  --rule: #d9dde3;
  --red: #d42227;
  --yellow: #f2c230;
  --focus: #15181c;
  --cli: #e8590c;      /* Rust orange */
  --flutter: #0175c2;  /* Dart and Flutter blue */
  --next: #24942a;     /* Playwright green, a hint at what comes next */
  --shot-bg: #fafafa;  /* the app screens in the hero strip */
  --shot-ink: #1d1f23;
  --shot-bar: #e6e8ec;
  --shot-tolerated: #d9a400;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
  --gap: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #1a1d24;
    --ink: #e2e8f0;
    --muted: #94a3b8;
    --rule: #2e323a;
    --red: #f0433f;
    --yellow: #f5cb3c;
    --focus: #e2e8f0;
    --cli: #ff7a33;
    --flutter: #54c5f8;
    --next: #45ba4b;
    --shot-bg: #22262e;
    --shot-ink: #e2e8f0;
    --shot-bar: #2e333d;
    --shot-tolerated: #f5cb3c;
    color-scheme: dark;
  }
}
/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.55;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; }
img, svg { display: block; max-width: 100%; }
code, pre, kbd { font-family: var(--mono); }
code { font-size: 0.875em; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--yellow); color: #15181c; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  padding: 8px 12px;
  background: var(--ink); color: var(--bg);
}
.skip:focus { top: 8px; }

/* Banner and header */
.banner { border-bottom: 1px solid var(--rule); font-size: 0.875rem; color: var(--muted); }
.banner .wrap { padding-block: 8px; }
.banner strong { color: var(--ink); font-weight: 600; }
.banner a { color: var(--ink); }

.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 32px;
  padding-block: 20px;
}
.wordmark {
  font-size: 1.5rem; font-weight: 760; letter-spacing: -0.03em; line-height: 1;
  font-variation-settings: "opsz" 48;
  text-decoration: none;
}
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 24px; list-style: none; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }

/* Type */
h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.4vw, 4.75rem);
  font-weight: 700;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.035em;
  line-height: 1;
  text-wrap: balance;
}
h2 {
  max-width: 18em;
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem);
  font-weight: 700;
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
}
h3 {
  font-size: 1.375rem;
  font-weight: 650;
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.intro { margin-top: 16px; max-width: 40em; color: var(--muted); text-wrap: pretty; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: transparent; color: var(--ink); }
.btn-plain:hover { background: var(--surface); }
.btn:disabled {
  border-style: dashed;
  border-color: var(--muted);
  background: transparent;
  color: var(--muted);
  cursor: not-allowed;
}

/* Code blocks: one click selects a command, long lines scroll inside the block. */
.code {
  padding: 14px 16px;
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.8125rem;
  line-height: 1.65;
  overflow-x: auto;
  tab-size: 2;
}
.code code { font-size: inherit; }
.code .sel { user-select: all; }
.code .prompt, .code .comment { color: var(--muted); user-select: none; }
.code .del { color: var(--muted); text-decoration: line-through; }
.code .fail { color: var(--red); }
.code.wrap-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.cursor {
  display: inline-block;
  width: 0.6em; height: 1.2em;
  vertical-align: text-bottom;
  background: var(--cli);
}
@media (prefers-reduced-motion: no-preference) {
  .cursor { animation: blink 1.1s steps(1) infinite; }
}
@keyframes blink { 50% { opacity: 0; } }

/* Sections */
.section { border-top: 1px solid var(--rule); }
.section > .wrap { padding-block: clamp(56px, 8vw, 104px); }
.section-body { margin-top: clamp(32px, 5vw, 56px); }

/* Hero */
.hero .wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 40px var(--gap);
  align-items: start;
  padding-block: clamp(32px, 7vw, 88px) clamp(56px, 8vw, 104px);
}
.hero-copy { grid-column: 1 / span 5; }
.hero-proof { grid-column: 6 / span 7; }
.hero .lede { margin-top: 24px; max-width: 34em; font-size: 1.1875rem; color: var(--muted); text-wrap: pretty; }
.hero .lede code { color: var(--ink); }
.hero .actions { margin-top: 32px; }
.hero .run { margin-top: 24px; }

/* The strip: golden, candidate, diff. The screens are drawn in CSS, not real goldens, so they follow the theme. */
.panes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 16px); list-style: none; }
.pane { min-width: 0; }
.shot {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--shot-bg);
  color: var(--shot-ink);
  font-family: var(--sans);
}
.shot .bar {
  display: flex; align-items: center;
  height: 15cqi;
  padding-inline: 7cqi;
  background: var(--shot-bar);
  font-size: 6.4cqi; font-weight: 600;
}
.shot .msg {
  position: absolute; top: 52cqi; left: 10cqi; right: 10cqi;
  font-size: 6cqi; line-height: 1.35; text-align: center;
}
.shot .count {
  position: absolute; top: 74cqi; left: 0; right: 0;
  font-size: 30cqi; font-weight: 700; line-height: 1; text-align: center;
  font-variation-settings: "opsz" 96;
}
.shot .fab {
  position: absolute; right: 8cqi; bottom: 8cqi;
  display: grid; place-items: center;
  width: 20cqi; height: 20cqi;
  border-radius: 6cqi;
  background: var(--shot-ink); color: var(--shot-bg);
  font-size: 12cqi; line-height: 1;
}
/* The candidate was rendered on Linux: its glyphs differ a little. */
.candidate .bar, .candidate .msg { letter-spacing: 0.02em; font-weight: 500; }
.candidate .bar { font-weight: 640; }
/* The diff: the golden dimmed, tolerated text yellow, the failing area red. */
.diff .bar { background: color-mix(in srgb, var(--shot-bar) 16%, var(--shot-bg)); color: var(--shot-tolerated); }
.diff .msg { color: var(--shot-tolerated); }
.diff .fab { opacity: 0.16; }
.diff .count { color: var(--red); }
.diff .count span { position: absolute; left: 0; right: 0; }
.diff .count span + span { opacity: 0.85; }
.diff .area {
  position: absolute; top: 70cqi; left: 30cqi; right: 30cqi; height: 40cqi;
  border: 0.8cqi dashed var(--red); border-radius: 1cqi;
}
.diff .area-label { position: absolute; top: 112cqi; left: 30cqi; font-size: 5cqi; font-weight: 600; color: var(--red); }

.pane-cap { margin-top: 10px; font-size: 0.8125rem; line-height: 1.35; color: var(--muted); }
.pane-cap b { display: block; font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.pane-cap code { font-size: 0.75rem; overflow-wrap: anywhere; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 20px; list-style: none; font-size: 0.875rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 8px; }
.swatch { flex: none; width: 12px; height: 12px; border-radius: 2px; }
.swatch-y { background: var(--yellow); }
.swatch-r { background: var(--red); }

/* Products: three equal columns, each marked with the colour of its language. */
.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px var(--gap);
  list-style: none;
}
.product {
  --lang: var(--ink);
  display: flex; flex-direction: column;
  padding-top: 20px;
  border-top: 4px solid var(--lang);
  scroll-margin-top: 24px;
}
.product .code { margin-top: auto; }
.lang-cli { --lang: var(--cli); }
.lang-flutter { --lang: var(--flutter); }
.lang-next { --lang: var(--next); }
.product h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.status { font-size: 0.8125rem; font-weight: 500; font-variation-settings: "opsz" 14; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--lang); }
.product .tagline { margin-top: 6px; color: var(--muted); }
.product .points { margin: 18px 0 20px; list-style: none; }
.product .points li { padding-block: 8px; border-top: 1px solid var(--rule); }
.product .points li:last-child { border-bottom: 1px solid var(--rule); }
.product .more { padding-top: 18px; font-weight: 600; }
.product .more a { text-decoration-color: var(--lang); }

/* What changes when you use gleon */
.compare-head, .compare-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: var(--gap);
}
.compare-head { padding-bottom: 12px; border-bottom: 1px solid var(--ink); font-size: 0.9375rem; font-weight: 600; }
.compare-head span:first-child { color: var(--muted); }
.compare-row { padding-block: 22px; border-bottom: 1px solid var(--rule); }
.compare dt { max-width: 30em; color: var(--muted); }
.compare dd { max-width: 36em; }

/* How it works: a real sequence, so it is numbered. */
.steps { list-style: none; counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 3rem minmax(0, 4fr) minmax(0, 7fr);
  gap: 12px var(--gap);
  padding-block: 28px;
  border-top: 1px solid var(--rule);
  counter-increment: step;
}
.step::before {
  content: counter(step);
  font-size: 2.25rem; font-weight: 700; line-height: 1;
  font-variation-settings: "opsz" 96;
  color: var(--muted);
}
.step p { margin-top: 8px; color: var(--muted); }
.step .code, .ci .code { align-self: start; }
.ci { display: grid; grid-template-columns: 3rem minmax(0, 4fr) minmax(0, 7fr); gap: 16px var(--gap); padding-top: 40px; border-top: 1px solid var(--ink); }
.ci > div { grid-column: 1 / 3; }
.ci p { margin-top: 8px; color: var(--muted); }

/* Speed and proof */
.speed { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px var(--gap); align-items: start; }
.table-scroll { overflow-x: auto; }
.bench { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.bench caption { padding-bottom: 12px; text-align: left; font-weight: 600; }
.bench th, .bench td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; white-space: nowrap; }
.bench thead th { border-bottom-color: var(--ink); font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.bench .num { text-align: right; }
.bench .x { font-weight: 650; }
.bench .bars { width: 34%; min-width: 120px; padding-left: 14px; }
.bar-track { display: grid; gap: 4px; }
.bar-track span { display: block; height: 6px; border-radius: 1px; }
.bar-builtin { width: 100%; background: var(--rule); }
.bar-gleon { width: var(--r); min-width: 2px; background: var(--ink); }
.bench-note { margin-top: 14px; font-size: 0.875rem; color: var(--muted); max-width: 44em; }

.proof { list-style: none; }
.proof li { padding-block: 16px; border-top: 1px solid var(--rule); }
.proof li:first-child { padding-top: 0; border-top: 0; }
.proof b { display: block; font-size: 1.25rem; font-weight: 650; font-variation-settings: "opsz" 36; letter-spacing: -0.01em; }
.proof span { color: var(--muted); }
.proof .code { margin-top: 10px; }

/* Platforms */
.platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px var(--gap); }
.platforms h3 { padding-bottom: 12px; border-bottom: 3px solid var(--lang, var(--ink)); }
.hosts { list-style: none; }
.hosts li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-block: 12px; border-bottom: 1px solid var(--rule); }
.hosts code { overflow-wrap: anywhere; }
.hosts span { color: var(--muted); }
.platforms-note { margin-top: 32px; max-width: 48em; color: var(--muted); }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px var(--gap); }
.plan { padding-top: 22px; border-top: 1px solid var(--ink); }
.plan-free { border-top-width: 3px; padding-top: 20px; }
.plan .price { margin-top: 10px; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); font-weight: 700; font-variation-settings: "opsz" 72; letter-spacing: -0.02em; line-height: 1.1; }
.plan .when { margin-top: 6px; color: var(--muted); }
.plan ul { margin-top: 20px; list-style: none; }
.plan li { padding-block: 8px; border-top: 1px solid var(--rule); }
.plan li:last-child { border-bottom: 1px solid var(--rule); }
.plan .actions { margin-top: 24px; align-items: center; }
.plan .later { font-size: 0.9375rem; color: var(--muted); }
.license-text { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px var(--gap); margin-top: clamp(40px, 6vw, 64px); }
.license-text h3 { font-size: 1.125rem; }
.license-text p + p { margin-top: 12px; }
.license-text p { max-width: 40em; }

/* Install */
.install { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px var(--gap); scroll-margin-top: 24px; }
.install h3 { padding-bottom: 12px; border-bottom: 3px solid var(--lang, var(--ink)); }
.install p { margin-top: 16px; max-width: 40em; color: var(--muted); }
.install p a, .install p code { color: var(--ink); }
.install .code { margin-top: 16px; }
.install .soon { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); }
.install .soon .status { font-size: 0.9375rem; color: var(--ink); }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); font-size: 0.9375rem; }
.site-foot .wrap { padding-block: 48px 40px; }
.foot-cols { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px var(--gap); }
.foot-cols .wordmark { font-size: 1.25rem; }
.foot-cols p { margin-top: 10px; max-width: 22em; color: var(--muted); }
.foot-cols h2 { max-width: none; font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; font-variation-settings: "opsz" 14; }
.foot-cols ul { margin-top: 10px; list-style: none; }
.foot-cols li + li { margin-top: 6px; }
.foot-cols a { color: var(--muted); text-decoration: none; }
.foot-cols a:hover { color: var(--ink); text-decoration: underline; }
.fineprint { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 0.8125rem; color: var(--muted); }

/* 404 */
.lost .wrap { padding-block: clamp(64px, 12vw, 160px); }
.lost p { margin-top: 20px; max-width: 34em; color: var(--muted); }
.lost .actions { margin-top: 32px; }
.lost + .site-foot .fineprint { margin-top: 0; padding-top: 0; border-top: 0; }

/* Layout breakpoints */
@media (max-width: 960px) {
  .speed { grid-template-columns: minmax(0, 1fr); }
  .foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-cols > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 880px) {
  .hero-copy, .hero-proof { grid-column: 1 / -1; }
  .step { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .step .code { grid-column: 2; }
  .ci, .license-text { grid-template-columns: minmax(0, 1fr); }
  .products { grid-template-columns: minmax(0, 1fr); }
  .ci > div { grid-column: auto; }
}
@media (max-width: 720px) {
  .platforms, .pricing, .install { grid-template-columns: minmax(0, 1fr); }
  .bench .bars { display: none; }
  .bench { font-size: 0.875rem; }
  .bench th, .bench td { padding-right: 8px; }
}
@media (max-width: 640px) {
  .compare-head { display: none; }
  .compare-row { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .compare dt::before { content: "Without gleon: "; font-weight: 600; color: var(--ink); }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .banner, .site-nav, .skip, .actions { display: none; }
  .section { break-inside: avoid-page; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
