/* Kelly explorer — editorial, inside the NeoEnvs palette. No webfonts. */
:root {
  --kelly-bg: #040304;
  --kelly-fg: #fff5ee;
  --kelly-muted: #b8b0ab;
  --kelly-line: #211921;
  --kelly-alt: #0d0b0d;
  --kelly-teal: #10a0a0;
  --kelly-amber: #e8c468;
  --kelly-red: #e07a5f;
  --kelly-green: #7ee787;
}
@media (prefers-color-scheme: light) {
  :root {
    --kelly-bg: #f5f5f5;
    --kelly-fg: #1a1a1a;
    --kelly-muted: #5a5451;
    --kelly-line: #e5e5e5;
    --kelly-alt: #ffffff;
    --kelly-teal: #1c8989;
    --kelly-amber: #8a6d1f;
    --kelly-red: #b4432f;
    --kelly-green: #1e7a3a;
  }
}
* { box-sizing: border-box; }
body {
  background: var(--kelly-bg);
  color: var(--kelly-fg);
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  line-height: 1.65;
  margin: 0;
  font-size: 1.05rem;
}
a { color: var(--kelly-teal); text-decoration: none; }
a:hover { text-decoration: underline dotted; }
.kelly-page {
  max-width: 68ch;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}
.kelly-page h1 {
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0.4rem 0 1rem;
  font-weight: 700;
}
.kelly-page h2 {
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 2.6rem 0 0.8rem;
  font-weight: 700;
}
.kelly-page h2::before { content: "# "; color: var(--kelly-teal); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.9em; }
.kelly-page p, .kelly-page ul, .kelly-page ol { max-width: 65ch; }
.kelly-page code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--kelly-line);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.kelly-kicker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kelly-muted);
}
.kelly-lede { font-size: 1.18rem; line-height: 1.6; color: var(--kelly-fg); }
.kelly-page h1 + p { font-size: 1.18rem; line-height: 1.6; }
.kelly-home { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.85rem; margin: 0 0 0.3rem; }
.kelly-kicker { margin: 0 0 0.5rem; }
/* Formula block */
.kelly-page p code:first-child { background: transparent; padding: 0; }
.kelly-formula {
  background: var(--kelly-alt);
  border-left: 4px solid var(--kelly-teal);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.05rem;
  overflow-x: auto;
}
/* Lab card */
.kelly-lab {
  background: var(--kelly-alt);
  border: 1px solid var(--kelly-line);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0 0;
}
.kelly-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.2rem; }
.preset, .fraction {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  background: transparent;
  color: var(--kelly-fg);
  border: 1px solid var(--kelly-line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}
.preset:hover, .fraction:hover { border-color: var(--kelly-teal); }
.preset.is-active, .fraction.is-active {
  background: var(--kelly-fg);
  color: var(--kelly-bg);
  border-color: var(--kelly-fg);
}
.kelly-sliders { display: grid; gap: 1.1rem; }
.kelly-field label, .kelly-bankroll label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.kelly-bankroll label { margin-bottom: 0; }
.kelly-field output { font-variant-numeric: tabular-nums; font-weight: 700; }
.kelly-unit { color: var(--kelly-muted); font-size: 0.82rem; }
.kelly-scale { display: flex; justify-content: space-between; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.72rem; color: var(--kelly-muted); margin-top: 0.25rem; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--kelly-line); border-radius: 999px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--kelly-amber); border: 2px solid var(--kelly-bg);
  margin-top: -8px; box-shadow: 0 0 0 1px var(--kelly-line);
}
input[type="range"]::-moz-range-track { height: 4px; background: var(--kelly-line); border-radius: 999px; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--kelly-amber); border: 2px solid var(--kelly-bg); }
input[type="range"]:focus-visible { outline: 2px solid var(--kelly-teal); outline-offset: 4px; border-radius: 4px; }
.kelly-fraction { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1.3rem 0 1rem; }
.kelly-fraction-label { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.85rem; color: var(--kelly-muted); margin-right: 0.25rem; }
.kelly-bankroll { display: flex; align-items: center; gap: 0.75rem; margin: 0.6rem 0 1.1rem; }
.kelly-bankroll label { margin: 0; }
.kelly-bankroll input {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1rem; width: 10ch;
  background: var(--kelly-bg); color: var(--kelly-fg);
  border: 1px solid var(--kelly-line); border-radius: 6px; padding: 0.45rem 0.6rem;
}
.kelly-verdict {
  border-top: 1px solid var(--kelly-line);
  border-bottom: 1px solid var(--kelly-line);
  padding: 1rem 0;
  text-align: center;
}
.kelly-verdict-top { display: flex; justify-content: center; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
#kelly-fstar {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-variant-numeric: tabular-nums; font-weight: 700;
}
#kelly-decision {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 0.35rem 0.8rem; border-radius: 999px;
}
.kelly-bet { background: var(--kelly-amber); color: #1a1a1a; }
.kelly-nobet { background: var(--kelly-red); color: #fff; }
.kelly-stake { margin-top: 0.6rem; font-size: 1.05rem; }
.kelly-stake strong { font-variant-numeric: tabular-nums; }
.kelly-growth { color: var(--kelly-muted); font-size: 0.95rem; margin-top: 0.25rem; }
.kelly-growth strong { color: var(--kelly-fg); font-variant-numeric: tabular-nums; }
.kelly-muted { color: var(--kelly-muted); }
.kelly-chart-wrap { margin-top: 1.1rem; }
#kelly-chart { width: 100%; height: auto; display: block; }
.kelly-svg-label { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; fill: var(--kelly-muted); paint-order: stroke; stroke: var(--kelly-alt); stroke-width: 4px; stroke-linejoin: round; }
.kelly-chart-axis { display: flex; justify-content: space-between; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.75rem; color: var(--kelly-muted); margin-top: 0.3rem; }
.kelly-caption { font-size: 0.92rem; color: var(--kelly-muted); margin: 1rem 0 0; }
.kelly-caption code { background: transparent; padding: 0; }
.kelly-footer { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--kelly-line); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.82rem; color: var(--kelly-muted); }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
@media (max-width: 560px) {
  .kelly-lab { padding: 1rem 0.9rem; border-radius: 8px; }
  .kelly-page { padding: 1.6rem 1rem 2.2rem; }
}
