:root {
  color-scheme: dark;
  --ground: #151e1a;
  --panel: #202b24;
  --ink: #f1eadb;
  --muted: #bdc8ba;
  --line: #3b4a3c;
  --mint: #b7d98a;
  --blue: #87beff;
  --orange: #ffab72;
  --red: #ff9e91;
  --mono: ui-monospace, "Courier New", monospace;
  font: 16px/1.6 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--ground);
  background-image: linear-gradient(#b7d98a08 1px, transparent 1px), linear-gradient(90deg, #b7d98a08 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
}
.shell { width: min(1248px, calc(100% - 48px)); margin-inline: auto; }
a { color: var(--mint); text-underline-offset: .23em; }
a:hover { color: var(--ink); }
:is(a, iframe):focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
p, figure, pre, h1, h2, h3 { margin: 0; }
p { color: var(--muted); }
h1, h2, h3 { line-height: 1.1; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 4.7vw, 4.5rem); letter-spacing: -.065em; }
h1 em { color: var(--mint); font-style: normal; }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.055em; }
h3 { font-size: 1.23rem; letter-spacing: -.025em; }
code, pre, .mast, .kicker, .actions, .preview, .links, .forest, .stats, .track-badge, .chapters, .footer { font-family: var(--mono); }
.mast, .footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 19px; font-size: .82rem; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #151e1af0;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.mast { padding-block: 10px; }
.mast .github { border-radius: 999px; padding: 6px 12px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.mast nav { display: flex; flex-wrap: wrap; gap: 20px; }
.mast a { text-decoration: none; }
.mast nav a { color: var(--muted); }
.mast nav a:hover { color: var(--mint); }
.brand { font-weight: 700; color: var(--ink); font-size: 1rem; white-space: nowrap; }
.brand span { display: inline-block; width: 10px; height: 10px; margin-right: 5px; background: var(--mint); box-shadow: 3px 3px #536743; }
.footer { color: var(--muted); }
.hero { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); align-items: center; gap: clamp(24px, 3.5vw, 52px); padding-block: clamp(44px, 6vw, 82px); }
.hero h1 + p { max-width: 36ch; margin-top: 20px; font-size: 1.15rem; }
.actions, .links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: .85rem; }
.actions { margin-top: 26px; }
.button { display: inline-flex; gap: 9px; align-items: center; padding: 10px 13px; background: var(--panel); border: 1px solid #667262; color: var(--ink); font-weight: 700; text-decoration: none; }
.button:hover { border-color: var(--mint); color: var(--mint); }
.primary { background: var(--mint); border-color: var(--mint); color: var(--ground); }
.primary:hover { background: var(--ink); color: var(--ground); }
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 450px;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  font-size: .72rem;
  color: var(--muted);
}
.stats li { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 6px 8px; line-height: 1.35; }
.stats strong { display: block; color: var(--ink); font-size: .88rem; }
.preview { border: 1px solid #52654d; border-radius: 12px; background: var(--panel); box-shadow: 0 14px 36px #0b120d96; font-size: .78rem; }
.preview figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.flag-motif { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); white-space: nowrap; }
.flag-motif i { width: 30px; height: 16px; border: 1px solid #71846c; border-radius: 999px; padding: 2px; }
.flag-motif i::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  background: var(--blue);
  border-radius: 50%;
  animation: flip-flag 4s ease-in-out;
}
@keyframes flip-flag {
  0%, 20%, 95%, 100% { transform: translateX(0); background: var(--blue); }
  40%, 75% { transform: translateX(14px); background: var(--orange); }
}
@media (prefers-reduced-motion: reduce) {
  .flag-motif i::after { animation: none; }
}
.preview-head, figcaption { padding: 10px 13px; color: var(--muted); }
.preview-head { display: flex; justify-content: space-between; gap: 10px; }
.preview-head code { color: var(--mint); }
.town { display: block; position: relative; aspect-ratio: 1168 / 440; overflow: hidden; }
.town iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.town img { position: absolute; display: block; width: 109.59%; height: auto; left: -4.8%; top: -40.9%; }
.section { scroll-margin-top: 88px; padding-block: clamp(32px, 5vw, 64px); border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1.4fr 1fr; align-items: end; gap: 12px 30px; margin-bottom: 22px; }
.section-heading > a { justify-self: end; }
.kicker { font-size: .78rem; color: var(--mint); margin-bottom: 8px; }
.arms, .tracks, .run-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.arm, .tracks article { background: var(--panel); border: 1px solid var(--line); padding: clamp(14px, 2.5vw, 25px); }
.arm { border-top: 3px solid var(--arm-color); }
.arm .kicker { color: var(--arm-color); }
.arm h3 { text-wrap: wrap; }
.arm p:last-child { margin-top: 8px; font-family: var(--mono); font-size: .82rem; }
.arm strong { color: var(--ink); font-size: 1.17rem; }
.control { --arm-color: var(--blue); }
.challenger { --arm-color: var(--orange); }
.forest {
  --zero: 87.5%;
  margin-top: 14px;
  padding: clamp(12px, 2.2vw, 24px);
  background: #111a15;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .82rem;
}
.forest figcaption { padding: 0; color: var(--ink); font-weight: 700; }
.forest figcaption span { color: var(--muted); font-weight: 400; margin-left: .5rem; }
.plot-legend, .forest-rows { list-style: none; margin: 0; padding: 0; }
.plot-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-block: 8px 14px; color: var(--muted); }
.plot-legend li::before { content: ""; display: inline-block; width: 14px; border-top: 2px solid var(--muted); margin-right: 6px; vertical-align: middle; }
.target { --threshold: 95%; --marker: var(--blue); }
.guardrail { --threshold: 85%; --marker: var(--orange); }
.plot-legend :is(.target, .guardrail)::before { border-top: 2px dashed var(--marker); }
.forest-row { display: grid; grid-template-columns: minmax(235px, 1fr) 3fr; border-top: 1px solid var(--line); }
.forest-label { display: grid; align-content: center; gap: 2px; padding: 9px 0; }
.forest-label span { color: var(--muted); }
.negative { color: var(--red); }
.neutral { color: var(--mint); }
.plot {
  --series: var(--mint);
  position: relative;
  min-height: 36px;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 25% 100%;
  border-right: 1px solid var(--line);
}
:is(.target, .guardrail) .plot { --series: var(--red); }
.plot::before, .threshold-line { position: absolute; top: 0; bottom: 0; }
.plot::before { content: ""; left: var(--zero); border-left: 2px solid var(--muted); }
.threshold-line { left: var(--threshold); border-left: 2px dashed var(--marker); }
.forest-row:not(.target, .guardrail) .threshold-line { display: none; }
.interval, .point { position: absolute; top: 50%; transform: translateY(-50%); }
.interval { left: var(--low); right: calc(100% - var(--high)); height: 12px; border-inline: 2px solid var(--series); }
.interval::before { content: ""; display: block; margin-top: 5px; border-top: 2px solid var(--series); }
.point { left: var(--point); width: 11px; height: 11px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--series); border: 2px solid #111a15; }
.plot-scale { position: relative; display: grid; grid-template-columns: repeat(4, 1fr) 0; margin-left: max(235px, 25%); color: var(--muted); border-top: 1px solid var(--line); font-size: .72rem; }
.plot-scale span { justify-self: start; transform: translateX(-50%); }
.plot-scale span:first-child { transform: none; }
.plot-scale span:last-child { justify-self: end; transform: none; }
.verdict { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 18px; padding: 14px 22px; margin: 14px 0; border-left: 4px solid var(--red); border-radius: 4px; background: #362522; }
.verdict strong { color: var(--red); font-size: clamp(1.7rem, 3.5vw, 2.75rem); letter-spacing: -.045em; }
small, .note { color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 0; margin: 0; list-style-position: inside; }
.steps li { border-top: 1px solid var(--line); padding-top: 15px; }
.steps li::marker { color: var(--mint); font-family: var(--mono); }
.steps h3 { display: inline; }
.steps p, .tracks h3 + p, .run-grid p { margin-top: 8px; }
pre { background: #101913; border: 1px solid var(--line); color: var(--ink); padding: 12px; margin-block: 12px; font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.tracks, .run-grid { margin-top: 20px; }
.tracks { grid-auto-rows: 1fr; }
.tracks article { display: flex; flex-direction: column; border-radius: 10px; }
.track-badge { align-self: flex-start; border: 1px solid #52654d; border-radius: 999px; padding: 2px 9px; color: var(--mint); font-size: .75rem; }
.track-metric { margin-block: 9px 14px; }
.track-metric strong { color: var(--mint); font-size: clamp(2.25rem, 5vw, 3.8rem); line-height: 1.05; letter-spacing: -.065em; margin-right: .2em; }
.tracks article:first-child .track-metric strong { color: var(--red); }
.tracks .links a { border: 1px solid #52654d; border-radius: 999px; padding: 5px 10px; text-decoration: none; font-size: .77rem; }
.tracks .links a:hover { border-color: var(--mint); }
.tracks .note { margin-top: 8px; font-size: .88rem; }
.tracks .links { margin-top: auto; padding-top: 16px; }
.run-grid { gap: 26px; }
.video { width: min(100%, 880px); margin-inline: auto; aspect-ratio: 16 / 9; background: #101913; border: 1px solid var(--line); border-radius: 12px; }
.video iframe, .video-poster, .video-poster img { display: block; width: 100%; height: 100%; border: 0; border-radius: inherit; }
.video-poster { position: relative; }
.play-icon {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: clamp(54px, 8vw, 84px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 6px #111a15b0;
}
.play-icon::after { content: ""; border: 11px solid transparent; border-right: 0; border-left: 17px solid var(--ground); margin-left: 4px; }
.video-poster:hover .play-icon { background: var(--ink); }
.chapters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 22px auto 0; max-width: 880px; font-size: .82rem; }
.chapters a { position: relative; border-top: 1px solid #71846c; padding: 9px 8px 0 0; }
.chapters a::before { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; background: var(--mint); border-radius: 50%; }
.chapters span { display: block; color: var(--muted); }
.limits ul { padding-left: 1.2rem; color: var(--muted); margin-bottom: 0; }
.limits li + li { margin-top: 7px; }
.footer { border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 32px); }
  .mast { display: grid; grid-template-columns: 1fr auto; row-gap: 8px; column-gap: 8px; }
  .mast nav { grid-row: 2; gap: 10px; }
  .mast .github { grid-row: 1; grid-column: 2; justify-self: end; }
  .mast .flag-motif { grid-row: 2; grid-column: 2; font-size: .7rem; }
  .section { scroll-margin-top: 96px; }
  .preview figcaption { font-size: .71rem; }
  .forest-row { grid-template-columns: 1fr; }
  .forest-label { padding-bottom: 6px; }
  .plot { margin-bottom: 6px; }
  .forest-row:last-child .plot { margin-bottom: 0; }
  .plot-scale { margin-left: 0; }
  .tracks { grid-auto-rows: auto; }
  .actions { gap: 8px; }
  .actions .button { padding-inline: 9px; }
  .section-heading, .tracks, .run-grid { grid-template-columns: 1fr; }
  .section-heading > a { justify-self: start; }
  .chapters { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
}

@media (max-width: 360px) {
  .mast .flag-motif { display: none; }
}
