:root {
  color-scheme: dark;
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --page: 72rem;
  --radius: 14px;

  --bg: #0e1015;
  --surface: #151820;
  --tint: #1c2029;
  --border: #252a35;
  --guide: #1b1f28;
  --text: #e6e8ee;
  --subtle: #a4abba;
  --muted: #7d8494;
  --accent: #5b9dff;
  --accent-strong: #2f74ff;
  /* The orange half of the palette: main buttons only, with dark text on it. */
  --spark: #ff8a3d;
  --spark-hover: #ffa366;
  --on-spark: #0e1015;

  /* The hero's sunset, from top left to bottom right; the pink keeps the
     orange-to-blue blend from going grey in the middle. */
  --sunset-1: #ff8a3d;
  --sunset-2: #e05aa0;
  --sunset-3: #2f74ff;
  --sunset-4: #4338ca;

  --pass: #22c55e;
  --fail: #f87171;
  --error: #c084fc;
  --timeout: #facc15;
  --crash: #e6e8ee;
  --kun: #5b9dff;
  --chrome: #4b5262;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--font-mono); font-size: 0.9em; }
pre { padding: 1rem; overflow-x: auto; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; }
h1 { font-size: 2.25rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.35rem; margin: 2.5rem 0 0.5rem; }

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

/* Header: the logo on the left, links in the middle, a pill on the right. */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.05rem; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--sunset-1), var(--sunset-2) 35%, var(--sunset-3) 75%, var(--sunset-4)); }
.brand .logo svg { display: block; width: 100%; height: 100%; }
.site-header nav { display: flex; gap: 1.75rem; margin: 0 auto; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.site-header nav a { color: var(--text); font-size: 0.9rem; }
.site-header nav a:hover { color: var(--accent); text-decoration: none; }
.site-header nav a[aria-current="page"] { color: var(--accent); }

/* Buttons. */
.button { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.1rem; border-radius: 999px; font-size: 0.9rem; font-weight: 500; color: var(--text); border: 1px solid var(--border); background: transparent; white-space: nowrap; }
.button:hover { text-decoration: none; border-color: var(--accent); }
.button.primary { background: var(--spark); border-color: var(--spark); color: var(--on-spark); }
.button.primary:hover { background: var(--spark-hover); border-color: var(--spark-hover); }
.button.light { background: #fff; border-color: #fff; color: #0e1015; }
.button.light:hover { background: #e6efff; }
.button.ghost { border-color: rgb(255 255 255 / 0.45); color: #fff; }
.button.ghost:hover { border-color: #fff; background: rgb(255 255 255 / 0.1); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* The page frame: faint guides down both sides of the content, as on a blueprint. */
main { padding-bottom: 4rem; border-left: 1px solid var(--guide); border-right: 1px solid var(--guide); }
.site-footer { border-top: 1px solid var(--guide); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1.25rem; padding-top: 1.5rem; padding-bottom: 2rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* Home: the gradient card. */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 0.5rem -8px 0;
  padding: 8rem 1.5rem;
  border-radius: 22px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(90% 80% at 0% 0%, var(--sunset-1) 0%, transparent 65%),
    radial-gradient(110% 100% at 100% 100%, var(--sunset-4) 0%, transparent 60%),
    linear-gradient(135deg, var(--sunset-1) 0%, var(--sunset-2) 30%, var(--sunset-3) 65%, var(--sunset-4) 100%);
}
/* A fine grain over the gradient, like print, which also hides its banding. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.55;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 auto 2rem; text-wrap: balance; }
.hero .actions { justify-content: center; }

/* Home: a heading on the left, prose on the right. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2rem 4rem; padding: 5rem 2rem; border-bottom: 1px solid var(--guide); }
.split h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0; }
.split .body p { margin-top: 0; color: var(--subtle); }
.split .actions { margin-top: 1.5rem; }
.home-section { padding: 4rem 2rem; border-bottom: 1px solid var(--guide); }
.home-section > h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 0.5rem; }
.home-section > p { color: var(--subtle); max-width: 40rem; margin-top: 0; }

.page-head { padding: 3rem 0 0.5rem; }
.page-head p { color: var(--subtle); max-width: 46rem; }
.crumbs { margin: 0 0 0.5rem; font-size: 0.9rem; }

/* Sections inside the framed main get a little air from the guides. */
main > section:not(.hero):not(.split):not(.home-section), main > article { padding-left: 1rem; padding-right: 1rem; }

/* Headline numbers. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 12px; margin-top: 1.5rem; }
.stat { position: relative; display: block; padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; overflow: hidden; }
.stat.link:hover { text-decoration: none; border-color: var(--accent); }
.stat.link::after { content: "→"; position: absolute; top: 1rem; right: 1.25rem; color: var(--muted); transition: transform 0.15s, color 0.15s; }
.stat.link:hover::after { color: var(--accent); transform: translateX(3px); }
.stat .label { font-size: 0.8rem; color: var(--muted); }
.stat .value { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; letter-spacing: -0.02em; }
.stat .value.small { font-size: 1.15rem; padding: 0.45rem 0; }
.stat .detail { font-size: 0.85rem; color: var(--subtle); }
.stat .meter { display: block; height: 4px; margin-top: 0.8rem; border-radius: 2px; background: var(--tint); overflow: hidden; }
.stat .meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--sunset-1), var(--sunset-2) 40%, var(--sunset-3)); }

/* The history chart. */
.chart { margin: 1rem 0 0; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font-mono); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .point { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart .point:hover { fill: var(--accent); }

/* Tables. */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.5rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-weight: 500; font-size: 0.8rem; color: var(--muted); background: var(--tint); }
tbody:last-child tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.name { padding-left: calc(0.85rem + var(--depth, 0) * 1.25rem); }
tr.sub td { color: var(--subtle); font-size: 0.88rem; }
tr.top td { font-weight: 550; }
.bar-cell { width: 40%; min-width: 10rem; }

/* Stacked outcome bars and the benchmark pairs. */
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--tint); }
.pair { display: flex; flex-direction: column; gap: 3px; }
.pair .seg { height: 7px; border-radius: 2px; }
.seg { display: block; height: 100%; }
.seg.pass { background: var(--pass); }
.seg.fail { background: var(--fail); }
.seg.error { background: var(--error); }
.seg.timeout { background: var(--timeout); }
.seg.crash { background: var(--crash); }
.seg.kun { background: var(--kun); }
.seg.chrome { background: var(--chrome); }

.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; color: var(--subtle); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 0.35rem; vertical-align: -1px; }

.raw p { color: var(--subtle); max-width: 46rem; }

/* Posts. */
.posts { list-style: none; padding: 0; margin: 0; }
.posts li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.posts li:last-child { border-bottom: 0; }
.posts time { color: var(--muted); font-size: 0.9rem; margin-left: 0.5rem; font-variant-numeric: tabular-nums; }
.posts .summary { color: var(--subtle); }
.post { max-width: 46rem; padding-top: 3rem; }
.post img { max-width: 100%; }

@media (max-width: 760px) {
  .site-header .wrap { gap: 1rem; }
  .site-header nav { gap: 1rem; margin: 0 0 0 auto; }
  .site-header .button { display: none; }
  .hero { margin: 0.5rem 0 0; padding: 5rem 1.25rem; border-radius: 16px; }
  .split { grid-template-columns: 1fr; padding: 3.5rem 1rem; }
  .home-section { padding: 3rem 1rem; }
  main { border: 0; }
  main > section:not(.hero):not(.split):not(.home-section), main > article { padding-left: 0; padding-right: 0; }
}
