/* micromarkets explainer: companion-brand shell around exact contract math. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: fixed; z-index: 20; left: 12px; top: 10px; padding: 8px 12px;
  border-radius: 6px; background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 13px; transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.mono { font-family: var(--mono); }
/* inline code carries unbreakable tokens (earliestResolutionDate + 7 days) */
code { overflow-wrap: anywhere; }
.phosphor {
  color: var(--amber);
  text-shadow: none;
}
.phosphor.no, .no .phosphor { color: var(--no); text-shadow: none; }

a { color: var(--amber); text-decoration-color: rgba(145,105,36,.35); text-underline-offset: 3px; }
a:hover { color: var(--amber-hot); }

/* ── reveals ─────────────────────────────────────────────────────── */
.reveal-load { opacity: 0; transform: translateY(18px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--d) * 130ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-load { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  * { animation-duration: .01s !important; }
}

/* ═══ HERO ═══ */
.hero { padding: 64px 24px 48px; border-bottom: 1px solid var(--panel-edge); position: relative; overflow: hidden; }
.hero-inner { max-width: var(--max); margin: 0 auto; position: relative; }
.hero-kicker { font-family: var(--sans); font-size: 10px; letter-spacing: 2px; color: var(--ink-dim); font-weight: 700; margin: 0 0 20px; }
.hero-title {
  font-family: var(--display); font-weight: 400; font-size: clamp(42px, 7vw, 82px);
  line-height: 1.06; margin: 0 0 24px; letter-spacing: 0;
}
.hero-em { font-style: italic; font-weight: 400; color: var(--amber-hot); }
.hero-sub { max-width: 680px; font-size: 20px; color: var(--ink-dim); margin: 0 0 34px; }
.hero-sub strong, .hero-sub em { color: var(--ink); }

.tote {
  display: inline-block; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 22px; margin-bottom: 36px;
  box-shadow: none;
  position: relative; overflow: hidden;
}
.tote-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.tote-label { font-family: var(--mono); font-size: 13px; letter-spacing: .2em; color: var(--yes); }
.tote-label.no { color: var(--no); }
.tote-label.dim { color: var(--ink-faint); }
.tote-digits { font-family: var(--mono); font-size: 38px; font-weight: 600; color: var(--amber); text-shadow: none; font-variant-numeric: tabular-nums; }
.tote-digits.no { color: var(--no); text-shadow: none; }
.tote-note { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: .08em; margin-left: 10px; }

.stage-rail { display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.rail-arrow { align-self: center; color: var(--amber-deep); font-size: 22px; }
.stage-chip {
  display: flex; flex-direction: column; gap: 3px; min-width: 180px;
  padding: 14px 18px; border: 1px solid var(--panel-edge); border-radius: 8px;
  background: var(--surface);
  text-decoration: none; color: var(--ink);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.stage-chip:hover { transform: translateY(-2px); border-color: var(--amber-deep); box-shadow: 0 8px 22px rgba(30, 26, 21, .08); }
.stage-chip.grad { border-color: var(--gold-edge, var(--panel-edge)); }
.stage-num { font-family: var(--mono); font-size: 11px; color: var(--amber-deep); }
.stage-name { font-family: var(--display); font-weight: 620; font-size: 19px; letter-spacing: .04em; }
.stage-desc { font-size: 14px; color: var(--ink-dim); }
.hero-cta { font-family: var(--sans); font-size: 14px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hero-cta .text-link { font-weight: 700; }

/* ═══ CHAPTERS ═══ */
.chapter { max-width: var(--max); margin: 0 auto; padding: 96px 24px 36px; }
.ch-head { display: flex; align-items: baseline; gap: 22px; margin-bottom: 40px; flex-wrap: wrap; }
.ch-no {
  font-family: var(--mono); font-size: 15px; color: var(--amber);
  border: 1px solid var(--amber-deep); border-radius: 999px; padding: 5px 14px;
  letter-spacing: .15em; background: rgba(255,181,46,.06);
}
.ch-head h2 {
  font-family: var(--display); font-weight: 560; font-size: clamp(30px, 4vw, 46px);
  margin: 0; letter-spacing: -.01em; font-variation-settings: "opsz" 100;
}
.ch-head h2 em { color: var(--amber-hot); }
.h-mono { font-size: .82em; color: var(--amber); }

.ch-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: start; }
.ch-grid.flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.ch-grid.flip .ch-prose { order: 2; }
.ch-grid.flip .ch-fig { order: 1; }
@media (max-width: 900px) {
  /* minmax(0,1fr), not 1fr: a bare 1fr track's min is min-content, so one
     long unbreakable code token widens the column past the viewport */
  .ch-grid, .ch-grid.flip { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .ch-grid.flip .ch-prose { order: 1; }
  .ch-grid.flip .ch-fig { order: 2; }
}
.ch-prose p, .ch-prose-wide p { margin: 0 0 20px; color: var(--ink-dim); }
.ch-prose strong, .ch-prose-wide strong { color: var(--ink); font-weight: 600; }
.ch-prose em, .ch-prose-wide em { color: var(--amber-hot); }
.ch-prose-wide { max-width: 780px; }

.fine { font-size: 15px; color: var(--ink-faint); border-left: 2px solid var(--panel-edge); padding-left: 16px; font-style: italic; }
.callout {
  border: 1px solid var(--panel-edge); border-left: 3px solid var(--amber);
  background: rgba(255,181,46,.05); padding: 18px 22px; border-radius: 6px;
}
.callout.warn { border-left-color: var(--no); background: rgba(255,110,110,.05); }

.formula {
  font-family: var(--mono); font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--panel-edge); border-radius: 8px;
  padding: 16px 20px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.f-frac { display: inline-flex; flex-direction: column; text-align: center; vertical-align: middle; font-size: 14px; }
.f-frac span:first-child { border-bottom: 1px solid var(--ink-dim); padding: 0 6px 2px; }
.f-frac span:last-child { padding: 2px 6px 0; }

figure { margin: 0; }
figcaption { font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); margin-top: 14px; letter-spacing: .04em; }

.panel {
  background: var(--surface);
  border: 1px solid var(--panel-edge); border-radius: 12px; padding: 22px;
  box-shadow: 0 10px 30px rgba(30, 26, 21, .05);
}
.panel-title { font-family: var(--mono); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--amber-deep); margin: 0 0 12px; }

.tag {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; font-weight: 600;
  padding: 3px 9px; border-radius: 4px; white-space: nowrap;
}
.tag.yes { color: var(--yes); background: var(--yes-deep); }
.tag.no { color: var(--no); background: var(--no-deep); }

/* ═══ 01 escrow animation ═══ */
.escrow-anim { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 26px 18px; background: var(--surface); border: 1px solid var(--panel-edge); border-radius: 12px; }
.esc-you { font-family: var(--mono); font-size: 14px; letter-spacing: .12em; text-align: center; color: var(--ink); }
.esc-you span { font-size: 10.5px; color: var(--ink-faint); letter-spacing: .05em; }
.esc-lane { position: relative; height: 48px; border-bottom: 1px dashed var(--panel-edge); }
.esc-factory {
  position: absolute; inset: 0 0 auto; text-align: center;
  color: var(--ink-faint); font-family: var(--mono); font-size: 9px;
  font-weight: 700; letter-spacing: .08em;
}
.esc-chip {
  position: absolute; top: 20px; left: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold-bg, #fdf4df);
  border: 1px solid var(--amber-deep);
  color: var(--amber); font-family: var(--mono); font-weight: 600; font-size: 13px;
  display: grid; place-items: center;
  animation: chip-fly 3.6s linear infinite;
}
.esc-chip.c2 { animation-delay: 1.2s; }
.esc-chip.c3 { animation-delay: 2.4s; }
@keyframes chip-fly {
  0% { left: 0; opacity: 0; transform: scale(.6); }
  12% { opacity: 1; transform: scale(1); }
  82% { opacity: 1; }
  100% { left: calc(100% - 24px); opacity: 0; transform: scale(.7); }
}
.esc-vault { width: 232px; }
.esc-vault-title { font-family: var(--mono); letter-spacing: .3em; font-size: 12px; color: var(--amber); margin-bottom: 2px; }
.esc-detail { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); margin-bottom: 12px; }
.esc-gate-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.esc-bar { flex: 1; height: 9px; background: var(--panel); border-radius: 5px; overflow: hidden; border: 1px solid var(--panel-edge); }
.esc-bar i { display: block; height: 100%; width: 0; border-radius: 5px; }
.esc-bar .yes-fill { background: var(--yes); animation: gate-fill 7s ease-in-out infinite; }
.esc-bar .no-fill { background: var(--no); animation: gate-fill 7s ease-in-out infinite 1s; }
@keyframes gate-fill {
  0% { width: 0; } 38% { width: 100%; } 82% { width: 100%; } 92% { width: 100%; opacity: 1; } 100% { width: 0; }
}
.esc-req { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.esc-verdict { height: 22px; }
.esc-launch { font-family: var(--mono); font-size: 11.5px; color: var(--amber); opacity: 0; animation: launch-blink 7s ease-in-out infinite; }
@keyframes launch-blink { 0%, 42% { opacity: 0; } 50%, 85% { opacity: 1; } 95%, 100% { opacity: 0; } }

/* ═══ 02 pool widget ═══ */
.pw-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pw-row input[type=range] { flex: 1; accent-color: var(--amber); }
.pw-row output { min-width: 70px; text-align: right; color: var(--ink); font-size: 15px; }
.pw-bar { height: 14px; border-radius: 7px; overflow: hidden; background: var(--no-deep); margin: 6px 0 18px; border: 1px solid var(--panel-edge); }
.pw-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--yes-deep), var(--yes)); width: 60%; transition: width .3s ease; }
.pw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pw-stat { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.pw-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-faint); text-transform: uppercase; }
.pw-v { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pw-foot { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin: 14px 0 0; }
@media (max-width: 560px) { .pw-stats { grid-template-columns: 1fr; } }

/* ═══ 03 graduation ═══ */
.grad-fig { max-width: 880px; margin: 18px auto 26px; }
.grad-pot-bar { display: flex; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--panel-edge); }
.grad-seg { display: grid; place-items: center; padding: 8px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.45; text-align: center; }
.grad-seg.dist { flex: 85; background: repeating-linear-gradient(135deg, var(--yes-deep) 0 14px, var(--panel) 14px 28px); color: var(--yes); }
.grad-seg.pol { flex: 15; background: repeating-linear-gradient(135deg, var(--no-deep) 0 14px, var(--gold-bg) 14px 28px); color: var(--no); }
.in .grad-seg.pol { animation: pol-pulse 2.6s ease-in-out infinite; }
@keyframes pol-pulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.grad-pot-label { text-align: center; font-size: 11.5px; letter-spacing: .25em; color: var(--ink-faint); margin-top: 10px; }
.grad-arrows { display: flex; justify-content: space-around; font-size: 26px; color: var(--amber-deep); margin: 6px 0; }
.ga { animation: drip 1.8s ease-in-out infinite; }
.ga2 { animation-delay: .9s; }
@keyframes drip { 0% { transform: translateY(-4px); opacity: .2; } 50% { transform: translateY(4px); opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }
.grad-out { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .grad-out { grid-template-columns: 1fr; } }
.grad-card { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 18px 20px; }
.grad-card h4 { font-family: var(--display); font-size: 20px; margin: 0 0 8px; font-weight: 600; }
.grad-card p { font-size: 15.5px; color: var(--ink-dim); margin: 0 0 8px; }
.grad-card .sm { font-size: 13px; color: var(--amber); }
.grad-card.pol-card { border-color: rgba(255,181,46,.4); }

/* ═══ 04 curve widget ═══ */
.curve-widget svg { width: 100%; height: auto; display: block; background: var(--paper); border: 1px solid var(--panel-edge); border-radius: 10px; }
.cw-controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 10px; }
.cw-stats { display: flex; gap: 22px; font-size: 13px; color: var(--ink-faint); flex-wrap: wrap; }
.cw-stats b { color: var(--ink); font-weight: 600; margin-left: 6px; }

.btn {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; cursor: pointer;
  padding: 9px 14px; border-radius: 7px; border: 1px solid var(--panel-edge);
  background: var(--surface); color: var(--ink);
  transition: transform .15s ease, filter .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.18); border-color: var(--amber-deep); }
.btn:active { transform: translateY(0); }
.btn.yes { background: var(--yes-deep); color: var(--yes); border-color: var(--yes-edge); }
.btn.no { background: var(--no-deep); color: var(--no); border-color: var(--no-edge); }
.btn.amber { background: #fdf4df; color: var(--amber-hot); border-color: var(--amber-deep); }
.btn.ghost { background: transparent; color: var(--ink-faint); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; filter: none; }

/* ═══ 05 waterfall ═══ */
.wf-anim { background: var(--surface); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 26px 22px 18px; text-align: center; }
.wf-src { display: flex; justify-content: center; gap: 18px; margin-bottom: 4px; }
.wf-tank { font-family: var(--mono); font-size: 11px; line-height: 1.5; padding: 12px 16px; border-radius: 8px; }
.wf-tank.pol { background: #fdf4df; color: var(--amber-hot); }
.wf-tank.fees { background: var(--yes-deep); color: var(--yes); }
.wf-stream { display: flex; justify-content: center; gap: 10px; height: 34px; align-items: flex-start; }
.wf-stream i { width: 3px; height: 16px; border-radius: 2px; background: var(--amber); display: block; animation: stream 1.4s linear infinite; opacity: 0; }
.wf-stream i:nth-child(2) { animation-delay: .25s; }
.wf-stream i:nth-child(3) { animation-delay: .5s; }
.wf-stream i:nth-child(4) { animation-delay: .75s; }
.wf-stream i:nth-child(5) { animation-delay: 1s; }
@keyframes stream { 0% { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }
.wf-pot { display: inline-block; border: 1px solid var(--amber-deep); background: rgba(255,181,46,.08); color: var(--amber); border-radius: 8px; padding: 10px 26px; font-size: 13px; letter-spacing: .1em; }
.wf-dest { display: flex; justify-content: center; gap: 14px; margin-top: 2px; }
.wf-cup { font-family: var(--mono); font-size: 11.5px; color: var(--yes); background: var(--yes-deep); padding: 8px 14px; border-radius: 6px; }
.wf-note { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin: 16px 0 0; }

/* ═══ 06 hatches ═══ */
.hatch-line { max-width: 880px; margin: 10px 0 34px; border-left: 2px solid var(--amber-deep); }
.hatch { display: flex; gap: 18px; align-items: baseline; padding: 14px 0 14px 22px; position: relative; }
.hatch::before { content: ""; position: absolute; left: -6px; top: 22px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); }
.hatch-state { min-width: 96px; color: var(--amber); font-size: 13px; letter-spacing: .1em; }
.hatch-what { color: var(--ink-dim); font-size: 16.5px; }
.cannot { max-width: 780px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 26px 30px; }
.cannot h3 { font-family: var(--display); margin: 0 0 14px; font-size: 23px; font-weight: 600; }
.cannot ul { margin: 0 0 16px; padding-left: 22px; color: var(--ink-dim); }
.cannot li { margin-bottom: 7px; }

/* ═══ SIMULATOR ═══ */
.sim-section { max-width: 1320px; margin: 0 auto; padding: 110px 24px 60px; }
.sim-no { background: var(--amber); color: var(--paper); border-color: var(--amber); font-weight: 600; }
.sim-sub { flex-basis: 100%; color: var(--ink-dim); margin: 6px 0 0; max-width: 720px; }
.sim-presets { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 26px 0 18px; }
.preset-label { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); letter-spacing: .15em; }
.btn.preset { background: var(--surface); }

.sim { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 6fr) minmax(0, 6fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .sim { grid-template-columns: 1fr 1fr; } .sim-state { grid-column: 1 / -1; } }
@media (max-width: 760px) { .sim { grid-template-columns: 1fr; } }
.sim-col { display: flex; flex-direction: column; gap: 18px; }

.sim-statebar { display: flex; gap: 6px; flex-wrap: wrap; }
.state-pill {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--panel-edge);
  color: var(--ink-faint); background: transparent;
}
.state-pill.now { color: var(--paper); background: var(--amber); border-color: var(--amber); font-weight: 600; box-shadow: none; }
.state-pill.past { color: var(--amber-deep); border-color: var(--amber-deep); }

.sim-tote { background: var(--surface); }
.st-price { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.st-k { font-family: var(--mono); font-size: 12px; letter-spacing: .2em; color: var(--yes); }
.st-k.no { color: var(--no); margin-left: 8px; }
.st-v { font-size: 44px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.st-pools { font-size: 13px; color: var(--ink-dim); margin-bottom: 10px; }
.st-meter { height: 12px; border-radius: 6px; overflow: hidden; background: var(--no-deep); border: 1px solid var(--panel-edge); margin-bottom: 14px; }
.st-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--yes-deep), var(--yes)); width: 50%; transition: width .45s cubic-bezier(.2,.7,.2,1); }
#sim-chart { width: 100%; height: 120px; background: var(--paper); border: 1px solid var(--panel-edge); border-radius: 8px; }

.sim-vitals { font-size: 12.5px; color: var(--ink-dim); display: grid; grid-template-columns: 1fr 1fr; gap: 7px 18px; }
.sim-vitals b { color: var(--ink); font-weight: 500; float: right; font-variant-numeric: tabular-nums; }
.sim-vitals .vk { display: flex; justify-content: space-between; gap: 10px; }

.sim-grad { font-size: 13px; }

.sim-params { font-size: 12.5px; }
.sim-params .pr { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.sim-params label { color: var(--ink-dim); }
.sim-params .pr-in { display: flex; align-items: center; gap: 6px; }
.sim-params input {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink); text-align: right;
  background: var(--surface); border: 1px solid var(--panel-edge); border-radius: 5px; padding: 4px 8px;
  width: 74px;
}
.sim-params input.nondefault { border-color: var(--amber-deep); color: var(--amber-hot); }
.sim-params .pr-unit { color: var(--ink-faint); font-size: 11.5px; width: 1.2em; }
.sim-params .btn { margin-top: 6px; font-size: 12px; padding: 5px 10px; }
.sim-params .pr-hint { color: var(--amber); font-size: 11.5px; margin: 8px 0 0; }

.sim-proj { font-size: 12.5px; }
.sim-proj .pj { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr 1fr 1fr; gap: 4px 10px; margin-bottom: 5px; text-align: right; }
.sim-proj .pj span:first-child { text-align: left; }
.sim-proj .pj-head { color: var(--ink-faint); font-size: 11px; letter-spacing: .08em; }
.sim-proj .pj-head .pos-yes { color: var(--yes); } .sim-proj .pj-head .pos-no { color: var(--no); }
.sim-proj .pj-who { color: var(--c, var(--ink)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-proj .pj-note { color: var(--ink-faint); font-size: 11.5px; margin: 8px 0 0; }
.sim-proj .t-dim { color: var(--ink-faint); }
.grad-check { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); margin-bottom: 8px; }
.grad-check .ok { color: var(--yes); } .grad-check .nok { color: var(--no); }
.grad-progress { height: 8px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 4px; overflow: hidden; margin: 4px 0 10px; }
.grad-progress i { display: block; height: 100%; background: var(--amber); transition: width .4s ease; }

#sim-controls .ctrl-group { margin-bottom: 18px; }
#sim-controls h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--amber-deep); margin: 0 0 10px; }
.ctrl-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.ctrl-row label { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.ctrl-row input[type=text], .ctrl-row input[type=number], .ctrl-row select {
  font-family: var(--mono); font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 8px 10px;
  width: 110px;
}
.ctrl-row select { width: auto; }
.bettor-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.bchip {
  font-family: var(--mono); font-size: 12px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--panel-edge); background: transparent; color: var(--ink-dim); cursor: pointer;
}
.bchip.sel { border-color: var(--c, var(--amber)); color: var(--c, var(--amber)); background: rgba(255,181,46,.06); }
.quote-preview { font-family: var(--mono); font-size: 12px; color: var(--amber); background: rgba(255,181,46,.05); border: 1px dashed var(--amber-deep); border-radius: 6px; padding: 9px 12px; margin-top: 4px; min-height: 18px; }
.quote-preview.empty { color: var(--ink-faint); border-color: var(--panel-edge); }

.sim-log-wrap { display: flex; flex-direction: column; }
.sim-log { font-family: var(--mono); font-size: 12px; line-height: 1.8; max-height: 320px; overflow-y: auto; color: var(--ink-dim); }
.sim-log .le { padding: 2px 0; border-bottom: 1px dotted var(--line); animation: log-in .4s ease; }
@keyframes log-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; } }
.le .t-yes { color: var(--yes); } .le .t-no { color: var(--no); }
.le .t-amber { color: var(--amber); } .le .t-err { color: var(--no); font-style: italic; }
.le .t-dim { color: var(--ink-faint); }

.sim-table-wrap { overflow-x: auto; }
.sim-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sim-table th { text-align: right; font-weight: 500; color: var(--ink-faint); letter-spacing: .08em; padding: 4px 8px; border-bottom: 1px solid var(--panel-edge); }
.sim-table th:first-child, .sim-table td:first-child { text-align: left; }
.sim-table td { text-align: right; padding: 6px 8px; border-bottom: 1px dotted var(--line); color: var(--ink-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sim-table .who { color: var(--c, var(--ink)); font-weight: 600; }
.sim-table .pos-yes { color: var(--yes); } .sim-table .pos-no { color: var(--no); }
.sim-table .pnl-pos { color: var(--yes); } .sim-table .pnl-neg { color: var(--no); }

.sim-conserve { font-size: 12px; color: var(--ink-dim); line-height: 2; }
.sim-conserve b { color: var(--ink); float: right; font-variant-numeric: tabular-nums; }
.sim-conserve .dust { color: var(--amber); }
.conserve-ok { color: var(--yes); font-weight: 600; letter-spacing: .1em; }

/* ═══ footer ═══ */
.foot { border-top: 1px solid var(--panel-edge); margin-top: 80px; padding: 40px 24px 60px; text-align: center; color: var(--ink-faint); font-size: 14.5px; }
.foot .mono { font-size: 12.5px; color: var(--amber-deep); }

/* ═══ phones ═══
   Keep this block LAST: the overrides share specificity with the base rules
   above, so they only win the cascade by coming later in the file. */
@media (max-width: 640px) {
  /* hero tote: smaller digits so YES 0.60 / NO 0.40 stays one line; note drops below */
  .tote-digits { font-size: 28px; }
  .tote-note { flex-basis: 100%; margin-left: 0; }
  /* stage rail stacks vertically — hide the between-chip arrows */
  .rail-arrow { display: none; }
  .stage-chip { flex: 1 1 100%; min-width: 0; }
  /* editorial chapter spacing is desktop rhythm; tighten on phones */
  .chapter { padding-top: 56px; }
  .sim-section { padding-top: 64px; }
  /* escrow figure: the fixed-width vault forces sideways scroll on small phones */
  .esc-vault { width: auto; max-width: 232px; min-width: 0; }
  /* pool-widget sliders: let the range track shrink instead of the row overflowing */
  .pw-row input[type=range] { min-width: 0; }
}

/* ================================================================== *
 *  MICRO MARKETS BRAND LAYER — official identity (brand kit, Jul 2026)
 *  Same layer as web/companion: Ink #01100D · Green #008400 ·
 *  Lime #87F900 · Rust #C23B00 · Orange #FF6C2B; Host Grotesk heads
 *  (-2% kerning) + Inter body. Light pairing (white page): Green
 *  leads, Rust seconds. Asset URLs are relative to this file so the
 *  page works standalone AND under the companion's /explainer/ mount.
 * ================================================================== */

@font-face {
  font-family: "Host Grotesk"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../brand/fonts/host-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Host Grotesk"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../brand/fonts/host-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../brand/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../brand/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* — official brand tokens — */
  --mm-ink:    #01100D;
  --mm-white:  #FFFFFF;
  --mm-green:  #008400;
  --mm-lime:   #87F900;
  --mm-rust:   #C23B00;
  --mm-orange: #FF6C2B;

  /* — neutrals: White paper, Ink text — */
  --paper: #ffffff;
  --surface: #ffffff;
  --panel: #f4f7f4;
  --panel-edge: #e4eae5;
  --line: #d2dcd4;
  --ink: #01100D;
  --ink-dim: #5b6a63;
  --ink-faint: #86948c;
  --muted: var(--ink-dim);
  --muted2: var(--ink-dim);
  --hair: var(--panel-edge);
  --faint: var(--ink-faint);

  /* — the page's lead accent (was amber) → Green family — */
  --amber: #008400;
  --amber-hot: #005f00;
  --amber-deep: #58a441;
  --gold-bg: #edf7e3;
  --gold-edge: #c4e2ad;

  /* — sides: Green / Rust (light-background pairing) — */
  --yes: #008400;  --yes-deep: #ecf6e5;  --yes-edge: #bfe0ab;
  --no:  #C23B00;  --no-deep:  #faece4;  --no-edge:  #eec3aa;

  /* — type — */
  --display: "Host Grotesk", "Inter", system-ui, sans-serif;
  --body:  "Inter", system-ui, Helvetica, Arial, sans-serif;
  --sans:  "Inter", system-ui, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1120px;
}

:root[data-theme="dark"] {
  --paper: var(--mm-ink);
  --surface: #0a1a16;
  --panel: #0a1a16;
  --panel-edge: #1b2b26;
  --line: #273832;
  --ink: var(--mm-white);
  --ink-dim: #b1c2ba;
  --ink-faint: #8ea69d;

  --amber: var(--mm-lime);
  --amber-hot: #99ff2b;
  --amber-deep: #72d800;
  --gold-bg: #0d2a10;
  --gold-edge: #2c5a1c;

  --yes: var(--mm-lime); --yes-deep: #0d2a10; --yes-edge: #2c5a1c;
  --no: var(--mm-orange); --no-deep: #2a1108; --no-edge: #63301a;
}

body { line-height: 1.6; }
::selection { background: var(--mm-lime); color: var(--mm-ink); }

/* — headings: Host Grotesk, -2% kerning, semibold — */
.hero-title { font-weight: 700; letter-spacing: -0.02em; }
.hero-em { font-style: normal; font-weight: 700; color: var(--mm-green); }
.ch-head h2 { font-weight: 600; letter-spacing: -0.02em; }
.ch-head h2 em { font-style: normal; color: var(--mm-green); }
.stage-name, .grad-card h4, .cannot h3 { font-weight: 600; letter-spacing: -0.02em; }
.ch-prose em, .ch-prose-wide em, .hero-sub em { font-style: normal; color: var(--mm-green); font-weight: 600; }
.fine { font-style: normal; }

/* — labels: slanted green tick from the symbol — */
.hero-kicker { letter-spacing: .14em; }
.hero-kicker::before {
  content: ""; display: inline-block; width: 6px; height: 10px;
  margin-right: 8px; vertical-align: -1px;
  background: var(--mm-green); transform: skewX(-14deg);
}

[data-theme="dark"] .hero-em,
[data-theme="dark"] .ch-head h2 em,
[data-theme="dark"] .ch-prose em,
[data-theme="dark"] .ch-prose-wide em,
[data-theme="dark"] .hero-sub em { color: var(--mm-lime); }
[data-theme="dark"] .hero-kicker::before,
[data-theme="dark"] .panel-title::before,
[data-theme="dark"] #sim-controls h4::before { background: var(--mm-lime); }

/* — hero: the symbol's market columns rising out of the fold — */
.hero::after {
  content: ""; position: absolute; pointer-events: none;
  right: -10px; bottom: -40px; width: 300px; height: 270px;
  background: url("../brand/mm-bars-accent-light.svg") center / contain no-repeat;
  opacity: 0.9;
}
[data-theme="dark"] .hero::after { background-image: url("../brand/mm-bars-accent.svg"); }
@media (max-width: 900px) { .hero::after { width: 170px; height: 153px; right: -24px; bottom: -26px; opacity: .5; } }

/* — re-tint the old amber washes to the green family — */
.ch-no { background: rgba(0, 132, 0, 0.05); border-color: var(--gold-edge); }
.callout { background: rgba(0, 132, 0, 0.04); border-left-color: var(--mm-green); }
.callout.warn { border-left-color: var(--mm-rust); background: rgba(194, 59, 0, 0.05); }
.btn.amber { background: var(--gold-bg); color: var(--amber-hot); border-color: var(--gold-edge); }
.esc-chip { background: var(--gold-bg); border-color: var(--gold-edge); }
.wf-pot { background: rgba(0, 132, 0, 0.06); border-color: var(--gold-edge); }
.bchip.sel { background: rgba(0, 132, 0, 0.06); }
.quote-preview { background: rgba(0, 132, 0, 0.05); border-color: var(--gold-edge); }
.sim-params .pr-hint { color: var(--mm-green); }
.state-pill.now { background: var(--mm-green); border-color: var(--mm-green); color: #fff; }
.state-pill.past { color: var(--mm-green); border-color: var(--gold-edge); }
.sim-no { background: var(--mm-green); border-color: var(--mm-green); color: #fff; }
.grad-card.pol-card { border-color: var(--gold-edge); }

/* — protocol-liquidity carve: Rust family, distinct from the YES pool — */
.grad-seg.pol {
  background: repeating-linear-gradient(135deg, var(--no-deep) 0 14px, var(--gold-bg) 14px 28px);
  color: var(--no);
}
.wf-tank.pol { background: var(--no-deep); color: var(--no); }
.grad-card .sm { color: var(--yes); }

/* — footer: Ink bookend with the white symbol watermark — */
.foot {
  border-top: none; background: var(--mm-ink); color: #8ea69d;
  position: relative; overflow: hidden;
}
.foot > * { position: relative; z-index: 1; }
.foot::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  right: -30px; bottom: -50px; width: 300px; height: 270px;
  background: url("../brand/mm-symbol-white.svg") center / contain no-repeat;
  opacity: 0.06;
}
.foot .mono { color: var(--mm-lime); }
.foot a { color: #b1c2ba; text-decoration-color: rgba(255, 255, 255, 0.3); }
.foot a:hover { color: var(--mm-white); }
.foot .fine { border-left-color: rgba(255, 255, 255, 0.25); color: #8ea69d; }

/* — simulator: legibility + hierarchy pass —
   Labels and controls move to Inter with real contrast; mono stays for
   figures, addresses, and the ledger. Primary actions become solid
   (Green = participate YES, Rust = participate NO, Ink = operator);
   ghost buttons stop looking disabled. */
.sim-section .btn, .cw-controls .btn {
  font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 10px 15px;
}
.sim-section .btn:hover, .cw-controls .btn:hover {
  border-color: var(--mm-green); color: var(--mm-green); filter: none;
}
.btn.yes { background: var(--mm-green); color: #fff; border-color: var(--mm-green); }
.btn.yes:hover { background: #006e00; border-color: #006e00; color: #fff; }
.btn.no { background: var(--mm-rust); color: #fff; border-color: var(--mm-rust); }
.btn.no:hover { background: #a53200; border-color: #a53200; color: #fff; }
.btn.amber { background: var(--mm-ink); color: #fff; border-color: var(--mm-ink); }
.btn.amber:hover { background: #16302a; border-color: #16302a; color: #fff; }
.btn.ghost { background: var(--surface); color: var(--ink-dim); border-style: dashed; }
.btn.ghost:hover { color: var(--mm-green); }
.btn:disabled { opacity: .38; }
.sim-no { background: var(--mm-green); border-color: var(--mm-green); color: #fff; }
[data-theme="dark"] .sim-section .btn:hover,
[data-theme="dark"] .cw-controls .btn:hover,
[data-theme="dark"] .btn.ghost:hover { color: var(--mm-lime); border-color: var(--mm-lime); }
[data-theme="dark"] .btn.yes,
[data-theme="dark"] .btn.yes:hover,
[data-theme="dark"] .sim-no,
[data-theme="dark"] .state-pill.now {
  background: var(--mm-lime); border-color: var(--mm-lime); color: var(--mm-ink);
}
[data-theme="dark"] .btn.no,
[data-theme="dark"] .btn.no:hover {
  background: var(--mm-orange); border-color: var(--mm-orange); color: var(--mm-ink);
}
[data-theme="dark"] .btn.amber {
  background: var(--mm-white); border-color: var(--mm-white); color: var(--mm-ink);
}
[data-theme="dark"] .btn.amber:hover { background: #dfe8e3; border-color: #dfe8e3; color: var(--mm-ink); }

/* panel headers: Inter caps with the brand tick, in Ink — not faint mono */
.panel-title, #sim-controls h4 {
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: .14em; color: var(--ink);
}
.panel-title::before, #sim-controls h4::before {
  content: ""; display: inline-block; width: 6px; height: 10px;
  margin-right: 8px; vertical-align: -1px;
  background: var(--mm-green); transform: skewX(-14deg);
}
.panel { border-color: var(--line); box-shadow: 0 6px 22px rgba(1, 16, 13, 0.06); }

/* lifecycle state pills: the machine's current state should be unmissable */
.state-pill {
  font-family: var(--sans); font-weight: 600; font-size: 12px;
  padding: 6px 13px; color: var(--ink-dim); border-color: var(--line);
}
.state-pill.now { background: var(--mm-green); border-color: var(--mm-green); color: #fff; }
.state-pill.past { background: var(--yes-deep); border-color: var(--mm-green); color: var(--mm-green); }

/* labels + inputs: Inter, visible borders, Ink values */
.preset-label, .ctrl-row label, .sim-params label, .pw-k {
  font-family: var(--sans); font-weight: 600; letter-spacing: .02em; color: var(--ink-dim);
}
.ctrl-row input[type=text], .ctrl-row input[type=number], .ctrl-row select,
.sim-params input { border-color: var(--line); color: var(--ink); }
.bchip { font-family: var(--sans); font-weight: 600; font-size: 12.5px; color: var(--ink-dim); border-color: var(--line); }
.bchip.sel { border-color: var(--yes); color: var(--yes); background: var(--yes-deep); }
.quote-preview {
  font-size: 12.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--gold-edge); border-left: 3px solid var(--mm-green); border-radius: 4px;
}
.quote-preview.empty { color: var(--ink-faint); border-left-color: var(--panel-edge); }

/* data readouts: bigger, darker; the price figure in Host Grotesk */
.st-v { font-family: var(--display); letter-spacing: -0.02em; }
.sim-vitals, .sim-proj, .sim-conserve { font-size: 13px; }
.sim-vitals b { font-weight: 600; }
.sim-log { font-size: 12.5px; }
.sim-log .le { padding: 4px 0; }
.sim-table { font-size: 12.5px; }
.sim-table th { color: var(--ink-dim); font-weight: 600; }
.sim-table td { color: var(--ink); }
.grad-check { font-size: 13px; }

/* mid widths: fade the hero bars where they'd underlap the sub text */
@media (max-width: 1060px) {
  .hero::after { opacity: 0.35; }
}
