:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #5b5f5a;
  --card: #ffffff;
  --line: #d8dcd5;
  --accent: #111111;
  --accent-2: #185183;
  --teal: #006b5f;
  --steel: #405d7a;
  --gold: #a96c07;
  --violet: #6c3aa2;
}
[data-theme="autistic-minimalism"] {
  --bg: #f7f7f5;
  --ink: #101315;
  --muted: #475159;
  --card: #ffffff;
  --line: #d6dde2;
  --accent: #0b5fff;
  --accent-2: #185183;
  --teal: #127169;
  --steel: #32608e;
  --gold: #8e6506;
  --violet: #4954ad;
}
[data-theme="autistic-minimalism-dark"] {
  --bg: #050607;
  --ink: #f4f7f8;
  --muted: #9aa6ad;
  --card: #0c1012;
  --line: #273137;
  --accent: #7dd3fc;
  --accent-2: #20c997;
  --teal: #2dd4bf;
  --steel: #8aa4ff;
  --gold: #f4b860;
  --violet: #d8b4fe;
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Aptos", "IBM Plex Sans", "Segoe UI", sans-serif;
  overflow-x: hidden;
}
[data-theme="autistic-minimalism"] body {
  background: var(--bg);
}
[data-theme="autistic-minimalism-dark"] body {
  background:
    linear-gradient(90deg, rgba(244,247,248,0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 80px 100%, auto;
}
.shell { width: min(1400px, 100%); margin: 0 auto; padding: 16px; }
.hero {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 20px;
  border-radius: 6px;
}
[data-theme="autistic-minimalism"] .hero {
  background: var(--card);
  border-radius: 4px;
}
[data-theme="autistic-minimalism-dark"] .hero {
  background: #07090a;
  border-color: #344149;
  border-radius: 2px;
}
.kicker { margin: 0; letter-spacing: .16em; color: var(--accent); font-size: 12px; font-weight: 700; }
.hero-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.hero-controls label {
  font-size: 12px;
  color: var(--muted);
}
.hero-controls select {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
}
[data-theme="autistic-minimalism-dark"] .hero-controls select {
  background: #090d0f;
  color: var(--ink);
  border-color: #344149;
}
h1 { margin: 8px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 5vw, 58px); line-height: .92; letter-spacing: 0; max-width: 980px; }
[data-theme="autistic-minimalism"] h1 {
  font-family: "IBM Plex Sans", "Aptos", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
[data-theme="autistic-minimalism-dark"] h1 {
  font-family: "IBM Plex Sans", "Aptos", "Segoe UI", sans-serif;
  line-height: 1.02;
}
.sub { margin: 0; color: var(--muted); }
.hero-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.hero-grid article { border: 1px solid var(--line); background: rgba(255,255,255,0.82); padding: 10px; border-radius: 4px; min-height: 72px; }
.hero-grid small { color: var(--muted); font-size: 11px; display: block; }
.hero-grid b { font-size: 22px; color: var(--accent); overflow-wrap: anywhere; }
.thesis { display: grid; gap: 8px; margin-top: 12px; }
.thesis article { border-left: 5px solid var(--accent); background: #fffdf8; padding: 12px; box-shadow: inset 0 0 0 1px var(--line); border-radius: 4px; }
.thesis span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.thesis b { display: block; margin-top: 4px; font-size: 15px; line-height: 1.35; }
.panel { margin-top: 16px; border: 1px solid var(--line); background: var(--card); padding: 14px; border-radius: 6px; min-width: 0; }
h2 { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; letter-spacing: 0; }
.compare { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.compare article { border: 1px solid var(--line); padding: 10px; background: #fff; border-radius: 4px; }
.compare .label { color: var(--muted); font-size: 12px; }
.compare b { font-size: 20px; }
.chart-grid { display: grid; gap: 10px; }
.chart-grid article { border: 1px solid var(--line); padding: 10px; background: #fff; border-radius: 4px; }
h3 { margin: 0 0 8px; font-size: 14px; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 8px; font-size: 12px; }
.track { height: 14px; background: #f0e9dd; border: 1px solid #e0d7c8; position: relative; }
.fill { position: absolute; inset: 0 auto 0 0; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 8px; font-size: 11px; color: var(--muted); }
.stack-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stack-legend i { position: static; display: inline-block; width: 12px; height: 12px; border: 1px solid rgba(0,0,0,0.15); }
.stack-bars { display: grid; gap: 6px; }
.stack-row { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 8px; font-size: 12px; }
.stack-track { display: flex; overflow: hidden; }
.stack-track .fill { position: static; height: 100%; min-width: 1px; }
.stack-segment {
  appearance: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  padding: 0;
  transition: filter 120ms ease, outline-color 120ms ease, transform 120ms ease;
}
.stack-segment:hover,
.stack-segment:focus-visible {
  filter: brightness(1.18) saturate(1.12);
  outline: 2px solid #171511;
  outline-offset: -2px;
  transform: translateY(-1px);
}
.stack-segment[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px #171511, inset 0 0 0 4px rgba(255,255,255,0.65);
  filter: brightness(1.12) saturate(1.18);
}
.stack-readout {
  margin-top: 10px;
  min-height: 62px;
  border: 1px solid var(--line);
  background: #fbf6ec;
  border-radius: 4px;
  padding: 8px 10px;
  display: grid;
  gap: 3px;
}
.stack-readout span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.stack-readout b {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.stack-readout small {
  color: var(--muted);
}
.fill.black { background: linear-gradient(90deg, #b82020, #7d1010); }
.fill.mint { background: var(--steel); }
.fill.burn { background: var(--gold); }
.fill.swap { background: var(--teal); }
.fill.collect { background: #6f6f6f; }
.fill.narrow { background: var(--violet); }
.fill.single { background: #9b1c1c; }
.fill.loop { background: var(--teal); }
.fill.zero { background: var(--accent); }
.fill.pull { background: var(--gold); }
.fill.capital { background: linear-gradient(90deg, var(--steel), var(--accent-2)); }
.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { border: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
th { background: #efe8dc; }
td small { color: var(--muted); display: block; margin-top: 2px; }
.note { margin: 0 0 10px; color: var(--muted); }
ul { margin: 0; padding-left: 18px; }
#method, #caveat { color: var(--muted); margin: 8px 0 0; font-size: 13px; }
.mono { font-family: "IBM Plex Mono", Menlo, monospace; }
.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.downloads a {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 4px;
}
.downloads a:hover,
.downloads a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.footer {
  margin: 14px 2px 18px;
  color: var(--muted);
  font-size: 12px;
}
.footer a {
  color: var(--accent);
}

[data-theme="autistic-minimalism-dark"] .hero-grid article,
[data-theme="autistic-minimalism-dark"] .thesis article,
[data-theme="autistic-minimalism-dark"] .compare article,
[data-theme="autistic-minimalism-dark"] .chart-grid article,
[data-theme="autistic-minimalism-dark"] .downloads a {
  background: #0b0f11;
}
[data-theme="autistic-minimalism-dark"] .thesis article {
  box-shadow: inset 0 0 0 1px var(--line);
}
[data-theme="autistic-minimalism-dark"] h2 {
  font-family: "IBM Plex Sans", "Aptos", "Segoe UI", sans-serif;
}
[data-theme="autistic-minimalism-dark"] .track {
  background: #10161a;
  border-color: #26333a;
}
[data-theme="autistic-minimalism-dark"] .stack-segment:hover,
[data-theme="autistic-minimalism-dark"] .stack-segment:focus-visible {
  outline-color: #f4f7f8;
}
[data-theme="autistic-minimalism-dark"] .stack-segment[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px #f4f7f8, inset 0 0 0 4px rgba(5,6,7,0.75);
}
[data-theme="autistic-minimalism-dark"] .stack-readout {
  background: #080b0d;
}
[data-theme="autistic-minimalism-dark"] th {
  background: #11181c;
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: repeat(4, 1fr); }
  .chart-grid { grid-template-columns: repeat(3, 1fr); }
  .thesis { grid-template-columns: 0.8fr 1.2fr; }
}

@media (max-width: 720px) {
  .shell { padding: 10px; }
  .compare, .hero-grid { grid-template-columns: 1fr; }
  .bar-row, .stack-row { grid-template-columns: 78px 1fr; }
  .bar-row b, .stack-row b { grid-column: 2; }
  .hero-controls {
    justify-content: flex-start;
  }
}
