/* Mastbound Trader site: one stylesheet, no build step, no external fonts.
   Colours are tokens on :root; dark mode redefines them. */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #eeece6;
  --ink: #15181d;
  --muted: #4f5763;
  --line: #d9d6cc;
  --link: #1d4fc4;
  --link-visited: #5b3cb0;
  --accent: #8a5200;          /* amber text on light: 6.1:1 on white */
  --rail: #f2b705;            /* safety amber: buttons and the strip */
  --rail-ink: #15181d;        /* text on --rail: 11:1 */
  --ok: #1b6b3a;
  --no: #a1271c;
  --note-bg: #eef3fb;
  --note-line: #9db4e0;
  --warn-bg: #fff6dc;
  --warn-line: #e2b44c;
  --ph-bg: #fff09a;
  --ph-ink: #3d3200;
  --focus: #1d4fc4;
  --shadow: 0 1px 2px rgba(20, 24, 29, .06), 0 4px 16px rgba(20, 24, 29, .05);
  --radius: 10px;
  --wrap: 72rem;
  --prose: 44rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216;
    --surface: #161a20;
    --surface-2: #1d222a;
    --ink: #e8e6e0;
    --muted: #a9b0ba;
    --line: #2c323b;
    --link: #93b6ff;
    --link-visited: #c3a8ff;
    --accent: #f2b705;
    --rail: #f2b705;
    --rail-ink: #15181d;
    --ok: #6fd08f;
    --no: #ff8f82;
    --note-bg: #16202f;
    --note-line: #35507d;
    --warn-bg: #272010;
    --warn-line: #7a6124;
    --ph-bg: #4d4300;
    --ph-ink: #fff3b0;
    --focus: #93b6ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
  }
}

:root[data-theme="dark"] {
  --bg: #0f1216;
  --surface: #161a20;
  --surface-2: #1d222a;
  --ink: #e8e6e0;
  --muted: #a9b0ba;
  --line: #2c323b;
  --link: #93b6ff;
  --link-visited: #c3a8ff;
  --accent: #f2b705;
  --rail: #f2b705;
  --rail-ink: #15181d;
  --ok: #6fd08f;
  --no: #ff8f82;
  --note-bg: #16202f;
  --note-line: #35507d;
  --warn-bg: #272010;
  --warn-line: #7a6124;
  --ph-bg: #4d4300;
  --ph-ink: #fff3b0;
  --focus: #93b6ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3, h4 { line-height: 1.2; margin: 1.6em 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); margin-top: .4em; letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p, ul, ol, dl, table, figure, blockquote { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: .3em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
small, .small { font-size: .9rem; }
strong { font-weight: 650; }

code, kbd, .mono {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;
  font-size: .92em;
}
code { background: var(--surface-2); padding: .08em .35em; border-radius: 4px; overflow-wrap: anywhere; }
kbd {
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  padding: .05em .4em; background: var(--surface); white-space: nowrap;
}
pre { background: var(--surface-2); padding: .9rem 1rem; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
pre code { background: none; padding: 0; }

/* ---------- layout ---------- */

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 48rem) { .wrap { padding: 0 28px; } }

.prose { max-width: var(--prose); }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 10;
  background: var(--surface); color: var(--ink); padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* beta strip: on every page */
.beta-strip {
  background: var(--rail); color: var(--rail-ink);
  font-size: .9rem; line-height: 1.4;
}
.beta-strip .wrap { padding-top: .45rem; padding-bottom: .45rem; }
.beta-strip strong { font-weight: 750; }
.beta-strip a, .beta-strip a:visited { color: var(--rail-ink); }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .4rem 1.2rem; padding-top: .7rem; padding-bottom: .7rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 750; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em;
}
.brand:visited { color: var(--ink); }
.brand svg { width: 34px; height: 22px; flex: none; }
.brand .tag {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: .05rem .45rem;
}
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem .15rem; }
.nav li + li { margin: 0; }
.nav a {
  display: inline-block; padding: .35rem .55rem; border-radius: 6px;
  color: var(--ink); text-decoration: none; font-size: .98rem;
}
.nav a:visited { color: var(--ink); }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--surface-2); font-weight: 650; box-shadow: inset 0 -2px 0 var(--rail); }
@media (max-width: 40rem) {
  .nav { width: 100%; }
  .nav .nav-home { display: none; }   /* the logo already links home */
  .nav a { padding: .3rem .42rem; font-size: .95rem; }
  .site-header .wrap { padding-bottom: .45rem; }
}

main { display: block; padding-bottom: 3rem; }

.page-head { padding: 2rem 0 .5rem; }
.page-head p.lede { font-size: 1.15rem; color: var(--muted); max-width: var(--prose); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0; }

section { scroll-margin-top: 1rem; }
[id] { scroll-margin-top: 1rem; }

/* ---------- hero ---------- */

.hero { padding: 2.2rem 0 1rem; }
.hero h1 { max-width: 20ch; }
.hero .lede { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); max-width: 40rem; color: var(--ink); }
.hero .meta { color: var(--muted); font-size: .95rem; margin-top: .75rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.4rem 0 .5rem; }

/* the flow: your rules -> Mastbound Trader -> NinjaTrader */
.flow {
  display: grid; gap: .6rem; margin: 2rem 0 1rem; padding: 0; list-style: none;
  grid-template-columns: 1fr;
}
.flow li { margin: 0; }
.flow .node {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem; box-shadow: var(--shadow); height: 100%;
}
.flow .node h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.flow .node p { margin: 0; color: var(--muted); font-size: .95rem; }
.flow .node.core { border-color: var(--rail); border-width: 2px; }
.flow .arrow { text-align: center; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.flow .arrow span { display: inline-block; transform: rotate(90deg); }
@media (min-width: 52rem) {
  .flow { grid-template-columns: 1fr auto 1.2fr auto 1fr; align-items: stretch; }
  .flow .arrow { display: flex; align-items: center; }
  .flow .arrow span { transform: none; }
}

/* ---------- buttons ---------- */

.btn, .btn:visited {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 .4rem;
  min-height: 44px; padding: .6rem 1.15rem; border-radius: 8px;
  font: inherit; font-weight: 650; line-height: 1.25; text-align: center; text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
  background: var(--rail); color: var(--rail-ink);
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.secondary, .btn.secondary:visited { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.secondary:hover { background: var(--surface-2); }
.btn[aria-disabled="true"], .btn:disabled {
  background: var(--surface-2); color: var(--muted); border-color: var(--line); cursor: not-allowed; filter: none;
}
.btn .sub { font-weight: 400; font-size: .88em; opacity: .85; }

/* ---------- cards and grids ---------- */

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid.four { grid-template-columns: 1fr; }
@media (min-width: 40rem) { .grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .grid.four { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h3 { margin: 0 0 .4rem; }

.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0 2rem; margin: 2.5rem 0; }

/* numbered steps */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.steps > li { counter-increment: step; margin: 0; position: relative; padding-top: 2.8rem; }
.steps > li::before {
  content: counter(step); position: absolute; top: 1rem; left: 1.2rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--rail); color: var(--rail-ink); font-weight: 750;
  display: grid; place-items: center;
}
.steps.card-steps > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 3.2rem 1.2rem 1.1rem; box-shadow: var(--shadow); }
.steps.card-steps > li::before { top: 1rem; }
.steps h3 { margin: 0 0 .4rem; }
.steps p:last-child, .steps ul:last-child { margin-bottom: 0; }

/* long numbered instructions */
ol.howto > li { margin-bottom: .6rem; }
ol.howto > li::marker { font-weight: 700; color: var(--accent); }

/* yes / no lists */
ul.yes, ul.no { list-style: none; padding-left: 0; }
ul.yes > li, ul.no > li { position: relative; padding-left: 1.7rem; }
ul.yes > li::before, ul.no > li::before {
  position: absolute; left: 0; top: .05em; font-weight: 800; width: 1.2rem; text-align: center;
}
ul.yes > li::before { content: "\2713"; color: var(--ok); }
ul.no > li::before { content: "\2715"; color: var(--no); }

/* callouts */
.callout {
  border: 1px solid var(--note-line); border-left-width: 5px; background: var(--note-bg);
  border-radius: 8px; padding: .9rem 1.1rem; margin: 1.2rem 0;
}
.callout.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout .title { font-weight: 750; display: block; margin-bottom: .25rem; }

/* the checkout line: quoted word for word */
.checkout-line {
  border: 2px solid var(--ink); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.2rem 0;
  background: var(--surface); font-size: 1.05rem;
}
.checkout-line p { margin: 0; }
.checkout-line .label { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: .3rem; }

/* CFTC statement */
.cftc {
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
  padding: .8rem 1rem; font-size: .92rem; margin: 1rem 0;
}
.cftc .label { display: block; font-weight: 700; font-size: .82rem; margin-bottom: .25rem; }
.cftc p { margin: 0; }

/* placeholders the owner still has to fill: visible on purpose */
.ph {
  background: var(--ph-bg); color: var(--ph-ink);
  outline: 1px dashed currentColor; outline-offset: 1px; border-radius: 3px; padding: 0 .2em;
  font-weight: 600;
}

/* screenshot placeholders */
.shot {
  margin: 0; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface);
  aspect-ratio: 16 / 10; display: grid; place-items: center; text-align: center; padding: 1rem;
  color: var(--muted);
}
.shot .inner { max-width: 22rem; }
.shot strong { display: block; color: var(--ink); margin-bottom: .3rem; }
.shot-grid figure figcaption { font-size: .9rem; color: var(--muted); margin-top: .45rem; }
.shot-grid figure { margin: 0; }

/* ---------- tables ---------- */

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1.2rem; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: .97rem; }
th, td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface-2); font-size: .9rem; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
caption { text-align: left; font-weight: 650; padding: 0 0 .4rem; caption-side: top; }

/* on phones, a stacked table: each row becomes a card, labels from data-label */
@media (max-width: 40rem) {
  table.stack, table.stack tbody, table.stack tr, table.stack td, table.stack th { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.stack { border: 0; background: none; }
  table.stack caption { display: block; width: 100%; }
  table.stack tr { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: .75rem; padding: .3rem 0; }
  table.stack td, table.stack th { border: 0; padding: .35rem .8rem; }
  table.stack td[data-label]::before, table.stack th[data-label]::before {
    content: attr(data-label); display: block; font-size: .78rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  }
}

/* ---------- pricing ---------- */

.plans { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: start; margin: 1.5rem 0; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.3rem 1.2rem; box-shadow: var(--shadow); }
.plan.featured { border: 2px solid var(--rail); }
.plan h3 { margin: 0; font-size: 1.25rem; }
.plan .price { font-size: 2.1rem; font-weight: 780; letter-spacing: -.02em; margin: .4rem 0 0; line-height: 1.1; }
.plan .price small { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
/* [int1019 fixB] the founding-price note under a plan's price (build.py FOUNDING_OPEN) */
.plan .founding { font-size: .92rem; margin: .35rem 0 0; line-height: 1.35; }
.plan .terms { color: var(--muted); font-size: .95rem; margin: .3rem 0 1rem; }
.plan ul { padding-left: 0; }
.plan .badge {
  display: inline-block; font-size: .75rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase;
  background: var(--rail); color: var(--rail-ink); border-radius: 999px; padding: .15rem .55rem; margin-bottom: .6rem;
}
.plan .badge.quiet { background: var(--surface-2); color: var(--muted); }

.agree-box {
  background: var(--surface); border: 2px solid var(--ink); border-radius: 14px;
  padding: 1.2rem 1.3rem; margin: 1.5rem 0; max-width: 46rem;
}
.agree-box h3 { margin-top: 0; }
.agree-box ul { padding-left: 1.2em; }
.consent {
  display: flex; gap: .7rem; align-items: flex-start; margin: 1.2rem 0 1rem;
  padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
}
.consent input[type="checkbox"] { width: 1.35rem; height: 1.35rem; margin: .15rem 0 0; flex: none; accent-color: var(--ink); }
.consent label { font-weight: 650; }
.buy-status { font-size: .92rem; color: var(--muted); margin: .6rem 0 0; min-height: 1.4em; }
.buy-status.bad { color: var(--no); font-weight: 600; }
.mode-note { font-size: .92rem; }

/* ---------- checklist (will it run) ---------- */

.checklist { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.checklist > li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem; margin: 0 0 .7rem; display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem;
}
.checklist input[type="checkbox"] { width: 1.3rem; height: 1.3rem; margin: .2rem 0 0; accent-color: var(--ok); grid-row: span 2; }
.checklist label { font-weight: 650; }
.checklist .how { grid-column: 2; color: var(--muted); font-size: .95rem; }
.checklist .how p { margin: .2rem 0; }

/* ---------- FAQ / legal ---------- */

.toc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin: 1rem 0 2rem; max-width: var(--prose);
}
.toc h2 { font-size: 1rem; margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toc ol, .toc ul { margin: 0; padding-left: 1.2em; }
.toc li + li { margin-top: .15rem; }
.toc.cols ol { columns: 2 18rem; column-gap: 2rem; }
.toc.cols li { break-inside: avoid; }

.faq h3 { margin-top: 2rem; }
.faq h2 { margin-top: 2.6rem; padding-top: .6rem; border-top: 1px solid var(--line); }

.legal { max-width: var(--prose); }
.legal h2 { font-size: 1.3rem; margin-top: 2.2rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.legal h3 { font-size: 1.08rem; margin-top: 1.5rem; }
.legal p, .legal li { font-size: 1rem; }
.legal .caps { font-size: .95rem; }
.legal .docmeta { color: var(--muted); font-size: .95rem; }
.legal .short { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.legal .short h2 { border: 0; margin-top: 0; padding-top: 0; }
.legal blockquote, blockquote.quote {
  margin: 1rem 0; padding: .7rem 1rem; border-left: 4px solid var(--line); background: var(--surface); border-radius: 0 8px 8px 0;
}

.hash { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; word-break: break-all; font-size: .92rem; }

dl.facts { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: .45rem 1rem; margin: 0; }
dl.facts dt { font-weight: 650; color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; }
@media (max-width: 30rem) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { margin-bottom: .5rem; } }

.pill { display: inline-block; border-radius: 999px; padding: .1rem .55rem; font-size: .82rem; font-weight: 700; border: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: currentColor; background: transparent; }
.pill.warn { color: var(--accent); border-color: currentColor; background: transparent; }
.pill.no { color: var(--no); border-color: currentColor; background: transparent; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 2rem 0 2.5rem; color: var(--muted); font-size: .93rem; }
.site-footer p { max-width: 52rem; }
.site-footer nav ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.site-footer nav li + li { margin: 0; }
.site-footer a, .site-footer a:visited { color: var(--ink); }

/* ---------- 404 ---------- */
.big-code { font-size: clamp(4rem, 3rem + 6vw, 7rem); font-weight: 800; letter-spacing: -.04em; margin: 1rem 0 0; line-height: 1; color: var(--accent); }

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

@media print {
  .beta-strip, .nav, .cta-row, .site-footer nav { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  .card, .plan, .agree-box, .callout, .checkout-line { box-shadow: none; }
}
