/* paperbot.trade — the public landing page. No libraries. Fonts are the system's; the ledger is monospace. */

:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #eef1ee;
  --ink: #131a17;
  --muted: #5a6660;
  --line: #dbe1dd;
  --line-soft: #e9ede9;
  --accent: #1f6f5c;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ec;
  --paper-bg: #fff4d6;
  --paper-ink: #6b4b00;
  --paper-line: #e6c977;
  --green: #1d8a4e;
  --green-bg: #e3f4ea;
  --yellow: #9a7400;
  --yellow-bg: #fbf1cf;
  --orange: #b85300;
  --orange-bg: #fde6d2;
  --red: #c02b2b;
  --red-bg: #fbe1e1;
  --black: #1b1b1b;
  --black-bg: #e4e4e4;
  --chart-line: #1f6f5c;
  --chart-fill: rgba(31, 111, 92, .10);
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 8px 24px rgba(16, 24, 20, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412;
    --surface: #161c19;
    --surface-2: #1d2521;
    --ink: #e6eae7;
    --muted: #9ba6a0;
    --line: #2a332e;
    --line-soft: #222a26;
    --accent: #4fbf9f;
    --accent-ink: #0f1412;
    --accent-soft: #17302a;
    --paper-bg: #3a2e0c;
    --paper-ink: #f6d77f;
    --paper-line: #5a4812;
    --green: #4cc38a;
    --green-bg: #13301f;
    --yellow: #e2c14b;
    --yellow-bg: #332a0b;
    --orange: #f3994c;
    --orange-bg: #3a2210;
    --red: #f07171;
    --red-bg: #3c1616;
    --black: #f2f2f2;
    --black-bg: #2e2e2e;
    --chart-line: #4fbf9f;
    --chart-fill: rgba(79, 191, 159, .14);
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(38px, 6.2vw, 68px); }
h2 { font-size: clamp(28px, 3.6vw, 40px); }
h3 { font-size: 21px; }
p { margin: 0; max-width: 62ch; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--surface); padding: 8px 12px; border: 1px solid var(--line); z-index: 20; }
.skip:focus { top: 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 20px; color: var(--muted); max-width: 56ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num, table { font-variant-numeric: tabular-nums; }

/* -- the top bar -------------------------------------------------------------------------------------------------- */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar-inner { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 17px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 16px; height: 16px; }
.bar nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.bar nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.bar nav a:hover { color: var(--ink); }
.bar nav a.cta { color: var(--accent-ink); background: var(--accent); padding: 8px 14px; border-radius: 999px; }
.tag-paper {
  display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 8px; border-radius: 4px;
  background: var(--paper-bg); color: var(--paper-ink); border: 1px solid var(--paper-line);
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
@media (max-width: 720px) { .bar nav a:not(.cta) { display: none; } }

/* -- buttons ------------------------------------------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 16px;
  text-decoration: none; border: 1px solid var(--accent); cursor: pointer; font-family: inherit; line-height: 1.2;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }

/* -- sections ----------------------------------------------------------------------------------------------------- */
section { padding-block: 72px; border-top: 1px solid var(--line-soft); }
section.hero { border-top: 0; padding-block: 64px 56px; }
.section-head { display: grid; gap: 12px; margin-bottom: 36px; max-width: 70ch; }
@media (max-width: 720px) { section { padding-block: 52px; } }

/* -- hero --------------------------------------------------------------------------------------------------------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .9fr); gap: 48px; align-items: start; }
.hero-copy { display: grid; gap: 22px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { font-size: 14px; color: var(--muted); max-width: 52ch; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } }

/* the state card: what the bot is, right now */
.state-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: 22px 22px 18px; display: grid; gap: 16px; overflow: hidden;
}
.stamp {
  position: absolute; right: 18px; top: 14px; transform: rotate(-8deg);
  font-family: var(--mono); font-weight: 700; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-ink);
  border: 2px solid var(--paper-ink); border-radius: 4px; padding: 3px 8px; opacity: .85; pointer-events: none;
}
.state-head { display: grid; gap: 4px; }
.state-head .eyebrow { color: var(--muted); }
.state-title { font-family: var(--serif); font-size: 22px; }
.state-rows { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.state-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.state-row .k { color: var(--muted); }
.state-row .v { font-family: var(--mono); font-size: 14px; text-align: right; }
.state-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.GREEN { background: var(--green-bg); color: var(--green); }
.pill.YELLOW { background: var(--yellow-bg); color: var(--yellow); }
.pill.ORANGE { background: var(--orange-bg); color: var(--orange); }
.pill.RED { background: var(--red-bg); color: var(--red); }
.pill.BLACK { background: var(--black-bg); color: var(--black); }
.pill.none { background: var(--surface-2); color: var(--muted); }
.pill.none::before { background: var(--muted); }

/* -- the live record ---------------------------------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 4px; }
.tile .label { font-size: 13px; color: var(--muted); }
.tile .value { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12.5px; color: var(--muted); }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .tiles { grid-template-columns: 1fr; } }

.record-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 900px) { .record-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-head h3 { font-family: var(--sans); font-size: 16px; font-weight: 600; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 200px; overflow: visible; }
.chart .grid line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.chart .line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--chart-fill); }
.chart .end { fill: var(--chart-line); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .cross-dot { fill: var(--chart-line); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 12px;
  padding: 6px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -10px;
}
.tip[hidden] { display: none; }
.chart-empty { display: grid; place-items: center; height: 200px; color: var(--muted); font-size: 14px; text-align: center; padding: 16px; }
details.table { font-size: 13px; }
details.table summary { cursor: pointer; color: var(--muted); }
details.table table { width: 100%; border-collapse: collapse; margin-top: 8px; }
details.table th, details.table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); font-size: 12px; }

.ledger { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.entry { display: grid; grid-template-columns: 92px 64px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.entry .when { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 3px; }
.entry .sym { font-family: var(--mono); font-size: 13px; font-weight: 600; padding-top: 2px; }
.entry .what { display: grid; gap: 2px; font-size: 14.5px; }
.entry .what .why { color: var(--muted); font-size: 13.5px; }
.entry .tag { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; margin-right: 6px; }
.tag.refused, .tag.no_trade { background: var(--yellow-bg); color: var(--yellow); }
.tag.signal, .tag.order_sent, .tag.filled { background: var(--accent-soft); color: var(--accent); }
.tag.evaluated, .tag.reviewed_position { background: var(--surface-2); color: var(--muted); }
.tag.closed { background: var(--green-bg); color: var(--green); }
.ledger-empty { padding: 24px 0; color: var(--muted); font-size: 14px; }
@media (max-width: 520px) { .entry { grid-template-columns: 1fr; gap: 4px; } }

/* -- how a decision happens --------------------------------------------------------------------------------------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.step { counter-increment: step; display: grid; gap: 8px; padding-top: 14px; border-top: 2px solid var(--line); }
.step::before { content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.step h3 { font-family: var(--sans); font-size: 16px; font-weight: 600; }
.step p { font-size: 14.5px; color: var(--muted); }
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* -- nine things it will never do --------------------------------------------------------------------------------- */
.never { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 0; }
.never li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 6px; }
.never .rule { font-weight: 600; font-size: 16px; }
.never .rule s { text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.never .why { font-size: 14px; color: var(--muted); }
.never code { font-size: 11.5px; color: var(--muted); }
@media (max-width: 900px) { .never { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .never { grid-template-columns: 1fr; } }

/* -- six layers --------------------------------------------------------------------------------------------------- */
.layers { display: grid; gap: 0; border-top: 1px solid var(--line); }
.layer { display: grid; grid-template-columns: 56px minmax(0, 260px) 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.layer .n { font-family: var(--serif); font-size: 30px; color: var(--accent); line-height: 1; }
.layer .name { font-weight: 600; }
.layer .name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.layer p { font-size: 15px; color: var(--muted); max-width: none; }
@media (max-width: 720px) { .layer { grid-template-columns: 44px 1fr; } .layer p { grid-column: 2; } }

/* -- what it is not ----------------------------------------------------------------------------------------------- */
.honest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.honest > div { display: grid; gap: 8px; }
.honest p { font-size: 15px; color: var(--muted); }
@media (max-width: 800px) { .honest { grid-template-columns: 1fr; } }

/* -- plans -------------------------------------------------------------------------------------------------------- */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: grid; gap: 10px; align-content: start; }
.plan.soon { border-style: dashed; }
.plan h3 { font-family: var(--sans); font-size: 18px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.plan .when { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.plan ul { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--muted); display: grid; gap: 4px; }
.plan .foot { font-size: 13px; color: var(--muted); margin-top: auto; }
@media (max-width: 900px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .plans { grid-template-columns: 1fr; } }

/* -- the road ----------------------------------------------------------------------------------------------------- */
.road { display: grid; gap: 0; border-left: 2px solid var(--line); margin-left: 8px; }
.stage { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 0 0 26px 22px; position: relative; }
.stage::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.stage.now::before { background: var(--accent); border-color: var(--accent); }
.stage.done::before { background: var(--line); }
.stage .when { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding-top: 3px; }
.stage .what { display: grid; gap: 4px; }
.stage .what strong { font-size: 16px; }
.stage .what p { font-size: 14.5px; color: var(--muted); }
.stage .gate { font-size: 13px; color: var(--muted); }
.stage .gate::before { content: "Gate: "; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }
@media (max-width: 600px) { .stage { grid-template-columns: 1fr; gap: 4px; } }

/* -- join --------------------------------------------------------------------------------------------------------- */
.join-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.join-head { margin-bottom: 0; }
@media (max-width: 800px) { .join-grid { grid-template-columns: 1fr; } }
form.join { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); }
form.join label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
form.join input, form.join select {
  font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); width: 100%;
}
form.join .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { form.join .row { grid-template-columns: 1fr; } }
form.join .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.join-msg { font-size: 14.5px; padding: 10px 12px; border-radius: 8px; }
.join-msg.ok { background: var(--green-bg); color: var(--green); }
.join-msg.error { background: var(--red-bg); color: var(--red); }
.join-msg[hidden] { display: none; }
.fine { font-size: 12.5px; color: var(--muted); }

/* -- footer ------------------------------------------------------------------------------------------------------- */
footer { border-top: 1px solid var(--line); padding-block: 32px 48px; font-size: 14px; color: var(--muted); }
.foot-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-grid nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-grid a { color: var(--muted); }

/* -- the legal pages ---------------------------------------------------------------------------------------------- */
.doc { max-width: 72ch; padding-block: 48px 72px; display: grid; gap: 18px; }
.doc h1 { font-size: clamp(32px, 4.5vw, 44px); }
.doc h2 { font-size: 24px; margin-top: 18px; }
.doc p, .doc li { color: var(--ink); font-size: 16px; }
.doc ul { padding-left: 22px; display: grid; gap: 6px; margin: 0; }
.draft { background: var(--paper-bg); color: var(--paper-ink); border: 1px solid var(--paper-line); border-radius: 10px; padding: 12px 16px; font-size: 14.5px; }
