:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--background); }

.taiga {
  --background: #f2f6ef;
  --surface: #fff;
  --subtle: #edf4ed;
  --ink: #172a22;
  --muted: #4b6055;
  --line: #cddacf;
  --brand: #13583f;
  --button-text: #fff;
  --hero: #143b30;
  --hero-muted: #d3e8db;
  --art: #8dd9a9;
  --art-grid: #49745f;
  --failed: #9c343d;
  --shadow: 0 6px 24px #172a2209;
}

.leshy {
  --background: #f2f4fb;
  --surface: #fff;
  --subtle: #edf0fb;
  --ink: #202341;
  --muted: #565b76;
  --line: #d2d7ef;
  --brand: #393799;
  --button-text: #fff;
  --hero: #282760;
  --hero-muted: #dbe2fd;
  --art: #a7befc;
  --art-grid: #6669a3;
  --failed: #9c343d;
  --shadow: 0 6px 24px #2023410b;
}

@media (prefers-color-scheme: dark) {
  .taiga {
    --background: #142520;
    --surface: #1d3129;
    --subtle: #233b30;
    --ink: #edf6ef;
    --muted: #bfd0c3;
    --line: #385448;
    --brand: #a0e2b4;
    --button-text: #12281c;
    --hero: #1b4134;
    --hero-muted: #d9e9de;
    --failed: #ffb5a9;
    --shadow: none;
  }
  .leshy {
    --background: #191b36;
    --surface: #252846;
    --subtle: #2e3256;
    --ink: #f2f3ff;
    --muted: #c2c7e4;
    --line: #434a72;
    --brand: #c7cdff;
    --button-text: #222451;
    --hero: #323168;
    --hero-muted: #e2e4ff;
    --failed: #ffb5a9;
    --shadow: none;
  }
}

a { color: var(--brand); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: .18rem solid var(--brand); outline-offset: .22rem; }
main:focus { outline: none; }

.site { width: min(100% - 3rem, 67rem); margin: 0 auto; }
.skip {
  position: fixed;
  inset: .6rem auto auto .6rem;
  z-index: 1;
  background: var(--surface);
  color: var(--brand);
  padding: .6rem 1rem;
  clip-path: inset(50%);
}
.skip:focus { clip-path: none; }

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1.45rem;
  min-height: 5.2rem;
  padding-block: .85rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: .65rem;
  color: var(--ink);
  font-weight: 750;
  line-height: 1.25;
  text-decoration: none;
}
.brand img { flex: 0 0 auto; border-radius: .55rem; }
nav { display: flex; flex-wrap: wrap; gap: .16rem .75rem; }
nav a, .language {
  color: var(--muted);
  padding: .35rem .15rem;
  font-size: .92rem;
  font-weight: 630;
  text-decoration: none;
}
nav a:hover, .language:hover, nav a[aria-current] { color: var(--brand); text-decoration: underline; }
.language { text-align: right; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.6rem;
  padding: clamp(1.6rem, 4vw, 3.2rem);
  border-radius: 1.35rem;
  min-height: 12.5rem;
  background: var(--hero);
  color: #fff;
}
.leshy .hero { border-radius: .65rem 2rem .65rem .65rem; }
.hero h1, .article h1 {
  margin: 0;
  font-size: clamp(2.05rem, 4.7vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -.05em;
  text-wrap: balance;
}
.hero p { max-width: 39rem; margin: .8rem 0 0; color: var(--hero-muted); font-size: clamp(1rem, 2vw, 1.16rem); }
.hero-art { position: relative; min-width: 0; height: clamp(6.5rem, 16vw, 9.5rem); color: var(--art); }
.hero-art svg { width: 100%; height: 100%; display: block; position: relative; }
.art-grid { stroke: var(--art-grid); stroke-width: 1; }
.art-dashes { stroke-width: 4; stroke-linecap: round; }
.art-wave { stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.art-dot { fill: currentColor; }

.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.taiga .quick, .leshy .download { grid-column: 1 / -1; }
.tool, .article, .notice {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: clamp(1.1rem, 3vw, 1.65rem);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.leshy .tool { border-radius: .68rem; }
.tool-header h2, .article h2 { margin: 0; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.02em; }
.tool-header p, .article p { margin: .45rem 0 0; color: var(--muted); }
.readout {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: .8rem 1.25rem;
  margin-top: 1.2rem;
}
.field-label { display: block; color: var(--muted); font-size: .875rem; font-weight: 650; }
output {
  display: block;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  line-height: 1.18;
  margin-top: .25rem;
  letter-spacing: -.045em;
}
.taiga .quick output, .leshy .download output { font-size: clamp(1.95rem, 6vw, 3.65rem); }

button {
  border: 1px solid var(--brand);
  border-radius: .62rem;
  min-height: 2.75rem;
  background: var(--brand);
  color: var(--button-text);
  padding: .58rem .85rem;
  font: inherit;
  font-weight: 680;
  text-align: center;
  cursor: pointer;
}
button:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--button-text); }
button.secondary { background: var(--surface); color: var(--brand); }
button.secondary:hover:not(:disabled) { background: var(--subtle); }
button:disabled, button[aria-disabled="true"] { opacity: .63; cursor: default; }
.status, .protocol, .copy-status, .progress-label {
  color: var(--muted);
  font-size: .92rem;
  margin: .7rem 0 0;
  min-height: 1.4em;
}
.status:empty, .copy-status:empty { display: none; }
.protocol { margin-top: .2rem; }
.progress-label { font-variant-numeric: tabular-nums; }

.samples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.8rem), 1fr));
  gap: .42rem;
  list-style: none;
  padding: 0;
  margin: .85rem 0 0;
}
.samples li {
  display: flex;
  gap: .5rem;
  justify-content: space-between;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
  padding: .35rem .55rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--subtle);
}
.samples li > span:first-child { color: var(--muted); }
.samples li.failed > span:last-child { color: var(--failed); font-weight: 650; }

.chart {
  --chart-height: 3.8rem;
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: clamp(1px, .4vw, 4px);
  height: var(--chart-height);
  margin-top: .45rem;
}
.chart span { position: relative; overflow: hidden; min-width: 0; border-radius: .2rem; background: var(--subtle); }
.chart span.failed { border-bottom: .28rem solid var(--failed); }
.chart span.skipped { border-bottom: .28rem solid var(--line); }
.chart span.ok::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: var(--bar-height);
  background: var(--brand);
  border-radius: .2rem;
}
.chart [data-level="1"] { --bar-height: 5%; }
.chart [data-level="2"] { --bar-height: 10%; }
.chart [data-level="3"] { --bar-height: 15%; }
.chart [data-level="4"] { --bar-height: 20%; }
.chart [data-level="5"] { --bar-height: 25%; }
.chart [data-level="6"] { --bar-height: 30%; }
.chart [data-level="7"] { --bar-height: 35%; }
.chart [data-level="8"] { --bar-height: 40%; }
.chart [data-level="9"] { --bar-height: 45%; }
.chart [data-level="10"] { --bar-height: 50%; }
.chart [data-level="11"] { --bar-height: 55%; }
.chart [data-level="12"] { --bar-height: 60%; }
.chart [data-level="13"] { --bar-height: 65%; }
.chart [data-level="14"] { --bar-height: 70%; }
.chart [data-level="15"] { --bar-height: 75%; }
.chart [data-level="16"] { --bar-height: 80%; }
.chart [data-level="17"] { --bar-height: 85%; }
.chart [data-level="18"] { --bar-height: 90%; }
.chart [data-level="19"] { --bar-height: 95%; }
.chart [data-level="20"] { --bar-height: 100%; }
.per-request { margin-top: .65rem; font-size: .92rem; }
.per-request summary { color: var(--brand); cursor: pointer; font-weight: 650; }

.history { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.actions button { font-size: .91rem; }
.comparison { margin-top: .9rem; }
.comparison p { margin: 0 0 .45rem; color: var(--muted); font-size: .9rem; }
.comparison table { table-layout: fixed; border-collapse: collapse; width: 100%; text-align: left; font-size: .86rem; }
.comparison th, .comparison td { padding: .32rem .25rem; border-bottom: 1px solid var(--line); }
.comparison thead th { color: var(--muted); font-weight: 650; }
.comparison thead th:first-child { width: 40%; }
.comparison tbody th { font-weight: 600; }
.copy-status textarea {
  width: 100%;
  min-height: 5rem;
  border: 1px solid var(--line);
  border-radius: .48rem;
  padding: .55rem;
  margin-top: .5rem;
  color: var(--ink);
  background: var(--subtle);
  font: inherit;
}

.article { max-width: 46rem; margin: 0 auto; }
.article h1 { font-size: clamp(1.85rem, 5vw, 2.75rem); margin-bottom: .9rem; }
.article section { margin-top: 1.35rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.article button { margin-top: .75rem; }
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem 1.15rem;
  margin-top: 1.2rem;
  padding: .95rem 0 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .91rem;
}
.footer a { color: var(--muted); }

@media (max-width: 46rem) {
  .site { width: calc(100% - 1.65rem); }
  .masthead { grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .65rem; }
  .masthead nav { grid-row: 2; grid-column: 1 / -1; }
  .hero { gap: .6rem; grid-template-columns: minmax(0, 2.35fr) minmax(0, 1fr); min-height: auto; }
  .tools { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 31rem) {
  .hero { display: block; }
  .hero-art { display: none; }
  .readout { align-items: start; flex-direction: column; }
  .comparison table { overflow-wrap: anywhere; }
}
@media (forced-colors: active) {
  button:focus-visible, a:focus-visible { outline-color: Highlight; }
  .chart span.failed { border-color: Mark; }
}
