@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url("../fonts/martian-mono-latin.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }

/* ---------- tokens: light on bare :root ---------- */
:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --ink: #1B1B1A;
  --muted: #6B6A66;
  --line: #E6E4DF;
  --accent: #27764A;
  --accent-fg: #FFFFFF;
  --good: #27764A;
  --close: #9A6410;
  --mistake: #C0392B;
  --suit-s: #1B1B1A;
  --suit-h: #C41E3A;
  --suit-c: #1D7A3E;
  --suit-d: #1A56C4;
  --card-face: #FCFBF7;
  --card-edge: #D9D6CE;

  /* the card back: the one committed surface */
  --back: #7E1B29;
  --back-ink: #F7F6F3;
  --back-muted: rgba(247, 246, 243, .80);
  --back-line: rgba(247, 246, 243, .18);
  --back-lattice: rgba(247, 246, 243, .05);

  --radius: 12px;
  --radius-card: 8px;
  --hit: 44px;
  --ease: 200ms ease-out;

  --words: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Martian Mono", ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111110;
    --surface: #1B1B1A;
    --ink: #F2F1EE;
    --muted: #A5A39D;
    --line: #2A2927;
    --accent: #5FBF8A;
    --accent-fg: #0E1A13;
    --good: #5FBF8A;
    --close: #E0B255;
    --mistake: #F08A80;
    --suit-s: #E6E4DF;
    --suit-h: #F07A8C;
    --suit-c: #63C08C;
    --suit-d: #7FA3F0;
    --card-face: #24231F;
    --card-edge: #3A3833;
    --back: #5E141F;
    --back-ink: #F2F1EE;
    --back-muted: rgba(242, 241, 238, .80);
    --back-line: rgba(242, 241, 238, .16);
    --back-lattice: rgba(242, 241, 238, .05);
  }
}

:root[data-theme="dark"] {
  --bg: #111110;
  --surface: #1B1B1A;
  --ink: #F2F1EE;
  --muted: #A5A39D;
  --line: #2A2927;
  --accent: #5FBF8A;
  --accent-fg: #0E1A13;
  --good: #5FBF8A;
  --close: #E0B255;
  --mistake: #F08A80;
  --suit-s: #E6E4DF;
  --suit-h: #F07A8C;
  --suit-c: #63C08C;
  --suit-d: #7FA3F0;
  --card-face: #24231F;
  --card-edge: #3A3833;
  --back: #5E141F;
  --back-ink: #F2F1EE;
  --back-muted: rgba(242, 241, 238, .80);
  --back-line: rgba(242, 241, 238, .16);
  --back-lattice: rgba(242, 241, 238, .05);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--words);
  font-variation-settings: "opsz" 12;
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-card);
}

h1, h2, h3 {
  font-family: var(--words);
  font-variation-settings: "opsz" 96;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
h3 {
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 48;
}

p { margin: 0; text-wrap: pretty; }

.num, .mono {
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: .88em;
  letter-spacing: -0.02em;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.measure { max-width: 62ch; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

section { padding: 80px 0; }
.ruled { border-top: 1px solid var(--line); }
.lede { color: var(--muted); margin-top: 12px; font-size: 17px; }

/* ---------- the card back: the committed surface ---------- */
.band {
  position: relative;
  isolation: isolate;
  background: var(--back);
  color: var(--back-ink);
}
.band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, var(--back-lattice) 0 1px, transparent 1px 19px),
    repeating-linear-gradient(-45deg, var(--back-lattice) 0 1px, transparent 1px 19px);
}
.band h1, .band h2 { color: var(--back-ink); }
.band .sub { color: var(--back-muted); }
.band .hosts { color: var(--back-ink); }
.band a:focus-visible, .band button:focus-visible { outline-color: var(--back-ink); }

/* ---------- nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  flex-wrap: wrap;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 19px;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.02em;
}
.wordmark:hover { text-decoration: none; }
.mark-tile {
  width: 18px; height: 25px;
  flex: none;
  border: 1px solid var(--card-edge);
  border-radius: 3px;
  background: var(--card-face);
  color: var(--suit-s);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  color: var(--ink);
  font-size: 15px;
  padding: 10px 12px;
  min-height: var(--hit);
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
}
.nav-links a:hover { text-decoration: none; background: var(--surface); }

/* ---------- the paper CTA: a card tile on the card back ---------- */
.cta-paper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--hit);
  padding: 13px 26px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-card);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
  font-family: var(--words);
  font-variation-settings: "opsz" 12;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
}
.cta-paper:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .2);
}
.hosts { font-size: 14px; margin-top: 14px; }

/* ---------- hero ---------- */
.hero { padding-top: 72px; padding-bottom: 72px; }
.hero h1 { margin-bottom: 20px; }
.hero .sub { margin-bottom: 30px; max-width: 54ch; }
/* The old hero put page copy beside a 340px drawn phone. The shared demo brings
   its own two columns, so the copy sits above it and the demo takes the width;
   a third column beside it would leave the chat too narrow to read. */
.hero .wrap { display: grid; gap: 40px; }
.hero .hero-copy { max-width: 54ch; }

/* ---------- card tile ---------- */
.card {
  background: var(--card-face);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-card);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.card .idx {
  position: absolute;
  top: 4px;
  left: 6px;
  font-family: var(--mono);
  font-weight: 500;
  line-height: 1;
}
.card .pip { line-height: 1; }
.card-sm { width: 34px; height: 48px; }
.card-sm .idx { font-size: 9px; top: 3px; left: 4px; }
.card-sm .pip { font-size: 17px; }
.s-s { color: var(--suit-s); }
.s-h { color: var(--suit-h); }
.s-c { color: var(--suit-c); }
.s-d { color: var(--suit-d); }

.spot-words { font-size: 15px; line-height: 1.4; }
.spot-num { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; font-size: 13px; letter-spacing: -0.02em; }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}
.act {
  min-height: var(--hit);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--words);
  font-variation-settings: "opsz" 12;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.act-locked { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }


/* ---------- verdict block: a full hairline, never a side stripe ---------- */
.verdict {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
}
.verdict .word {
  font-family: var(--words);
  font-variation-settings: "opsz" 96;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.verdict .cost { font-size: 16px; margin-top: 8px; }
.verdict .mix {
  font-family: var(--mono);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: -0.02em;
  line-height: 1.5;
  margin-top: 16px;
  color: var(--muted);
}
.verdict .src { font-style: italic; font-size: 14px; color: var(--muted); margin-top: 8px; }
.v-good .word { color: var(--good); }
.v-close .word { color: var(--close); }
.v-mistake .word { color: var(--mistake); }

.pill {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
}

/* ---------- the EV ruler: the signature element ---------- */
.ev {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 16px;
}
.ev-axis { stroke: var(--card-edge); stroke-width: 1; }
.ev-tick { stroke: var(--card-edge); stroke-width: 1; }
.ev-zero { stroke: var(--line); stroke-width: 1; }
.ev-lead { stroke: var(--card-edge); stroke-width: 1; }
.ev-best { fill: var(--ink); }
.ev-chosen { fill: none; stroke-width: 1.5; stroke: var(--muted); }
.ev-brk { fill: none; stroke-width: 1; stroke: var(--muted); }
.ev-lab {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  fill: var(--muted);
}
.ev-cost {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  fill: var(--ink);
}
.v-good .ev-chosen, .v-good .ev-brk { stroke: var(--good); }
.v-good .ev-cost { fill: var(--good); }
.v-close .ev-chosen, .v-close .ev-brk { stroke: var(--close); }
.v-close .ev-cost { fill: var(--close); }
.v-mistake .ev-chosen, .v-mistake .ev-brk { stroke: var(--mistake); }
.v-mistake .ev-cost { fill: var(--mistake); }

/* ---------- hero motion: default styles are the FINAL frame ---------- */
@media (prefers-reduced-motion: no-preference) {
}

/* ---------- proof strip ---------- */
.proof { font-size: 21px; line-height: 1.45; max-width: 52ch; }

/* ---------- how it works ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.step { padding: 36px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 28px; }
.step .note { color: var(--muted); font-size: 16px; margin-top: 8px; }

.chat {
  margin-top: 20px;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bubble { max-width: 90%; padding: 10px 14px; font-size: 15px; line-height: 1.45; }
.from-you { align-self: flex-end; background: var(--accent); color: var(--accent-fg); border-radius: 18px 18px 5px 18px; }
.from-agent { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 18px 18px 18px 5px; }
.linkish { font-family: var(--mono); font-weight: 400; font-size: .82em; letter-spacing: -0.03em; color: var(--accent); white-space: nowrap; }

.mini-drill { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); padding: 14px; }
.mini-drill .row { display: flex; gap: 6px; margin: 10px 0; }
.mini-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.mini-actions .act { min-height: 38px; font-size: 13px; }
.locked-note { font-family: var(--mono); font-weight: 400; font-variant-numeric: tabular-nums; font-size: 12px; letter-spacing: -0.02em; color: var(--muted); margin-top: 12px; }

/* ---------- verdict gallery ---------- */
.verdicts { display: grid; gap: 20px; margin-top: 36px; }
@media (min-width: 760px) { .verdicts { grid-template-columns: repeat(3, 1fr); } }

/* ---------- concepts ---------- */
.concepts { display: grid; margin-top: 32px; border-top: 1px solid var(--line); }
@media (min-width: 680px) { .concepts { grid-template-columns: 1fr 1fr; column-gap: 48px; } }
.concept {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 20px;
  min-width: 0;
}
.concept .fam { font-weight: 700; font-size: 16px; letter-spacing: -0.015em; }
.concept .ex { font-size: 14px; color: var(--muted); }
.concepts-line { margin-top: 32px; font-size: 19px; max-width: 54ch; }

/* ---------- pricing: one ruled ledger ---------- */
.ledger { margin-top: 32px; max-width: 620px; border-top: 1px solid var(--line); }
.ledger-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.ledger-row .offer { font-size: 17px; }
.ledger-row .fig {
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.term { margin-top: 20px; font-size: 15px; color: var(--muted); }

/* ---------- connect ---------- */
.connect { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 24px; margin-top: 32px; }
.endpoint { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.endpoint code {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: -0.03em;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  word-break: break-all;
}
.copy {
  min-height: var(--hit);
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--words);
  font-variation-settings: "opsz" 12;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--ease);
}
.copy:hover { border-color: var(--accent); }
.docs-link { display: inline-flex; align-items: center; min-height: var(--hit); font-size: 15px; }
.host-lines { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.host-lines div { font-size: 15px; color: var(--muted); }
.host-lines b { font-weight: 700; color: var(--ink); }
.host-lines .mono { font-size: 12px; letter-spacing: -0.03em; }

/* ---------- faq ---------- */
.faq { display: flex; flex-direction: column; gap: 0; margin-top: 24px; }
.faq > div { padding: 24px 0; border-bottom: 1px solid var(--line); }
.faq > div:first-child { border-top: 1px solid var(--line); }
.faq h3 { font-size: 19px; font-variation-settings: "opsz" 24; }
.faq p { color: var(--muted); margin-top: 8px; }

/* ---------- footer ---------- */
.footcta { text-align: center; padding: 88px 0; }
.footcta h2 { margin-bottom: 26px; }
.footer { border-top: 1px solid var(--line); padding: 32px 0 48px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 22px; }
.footer-links a { color: var(--muted); font-size: 15px; padding: 11px 0; }
.footer-mark { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- phone width ---------- */
@media (max-width: 560px) {
  section { padding: 56px 0; }
  .hero { padding-top: 48px; padding-bottom: 56px; }
  .footcta { padding: 64px 0; }
  .proof { font-size: 19px; }
  .concepts-line { font-size: 17px; }
}

/* Platform-owned surfaces keep ADR 0062 values; CR-1 supplies only the faces. */
:root { --rails-font-sans: var(--words); --rails-font-mono: var(--mono); --rails-ground: #FFFFFF; --rails-ink: #1D1D1F; --rails-muted: #636368; --rails-hairline: #E3E3E8; --rails-accent-ink: #0066CC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --rails-ground: #101012; --rails-ink: #F5F5F7; --rails-muted: #A1A1A8; --rails-hairline: #2C2C31; --rails-accent-ink: #4DA3FF; } }
:root[data-theme="dark"] { --rails-ground: #101012; --rails-ink: #F5F5F7; --rails-muted: #A1A1A8; --rails-hairline: #2C2C31; --rails-accent-ink: #4DA3FF; }
.rails-pricing { background: var(--rails-ground); color: var(--rails-ink); font-family: var(--rails-font-sans); padding: 32px 16px; }
.rails-pricing h2 { font-size: 22px; line-height: 28px; letter-spacing: -.005em; }
.rails-pricing .ledger-row { border-color: var(--rails-hairline); min-height: 52px; padding: 12px 0; }
.rails-pricing .offer { font-size: 17px; line-height: 22px; }
.rails-pricing .fig { font-family: var(--rails-font-mono); font-size: 15px; line-height: 20px; }
.rails-pricing .term { color: var(--rails-muted); font-size: 15px; line-height: 20px; }
.rails-pricing a, .rails-link { color: var(--rails-accent-ink); }
.rails-link { font-family: var(--rails-font-sans); }
.example-note { font-size: 15px; color: var(--muted); margin-top: 16px; }
@media (max-width: 560px) { .nav { align-items: flex-start; flex-wrap: wrap; } .nav-links { flex-wrap: wrap; } }

/* The hero's demo wears the page's palette; both are token-driven, so the
   dark theme above reaches the component without a second set of colours. */
.hero rails-hero-demo {
  --rpd-ground: var(--bg);
  --rpd-surface: var(--surface);
  --rpd-raised: var(--surface);
  --rpd-ink: var(--ink);
  --rpd-muted: var(--muted);
  --rpd-hairline: var(--line);
  --rpd-soft: var(--bg);
  --rpd-accent: var(--accent);
}
