/* mpriors marketing site — same token vocabulary as the app
   (packages/app/src/styles.css) and the product docs.

   Light is the base, so a browser that cannot report a preference gets it.
   Dark then applies two ways, exactly as the app does it: by system preference
   (unless the reader has explicitly forced light) or by explicit choice. The
   :not() guard is what makes "light" win over a dark system setting — without
   it the media query would override the reader's own decision. */
:root {
  --desk: #faf9f5;
  --card: #ffffff;
  --ink: #0b0b0b;
  --muted: #898781;
  --blue: #2a78d6;
  --up: #17805a;
  --down: #c2483f;
  --band: #e4e3dc;
  --bandline: #c9c8bf;
  --hair: #e1e0d9;
  --hair2: #d7d6cf;
  --shade: rgba(11, 11, 11, 0.045);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --desk: #181817;
    --card: #201f1e;
    --ink: #ffffff;
    --muted: #93918a;
    --blue: #3987e5;
    --up: #27a075;
    --down: #dd5d54;
    --band: #302f2c;
    --bandline: #48473f;
    --hair: #363530;
    --hair2: #383835;
    --shade: rgba(255, 255, 255, 0.05);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --desk: #181817;
  --card: #201f1e;
  --ink: #ffffff;
  --muted: #93918a;
  --blue: #3987e5;
  --up: #27a075;
  --down: #dd5d54;
  --band: #302f2c;
  --bandline: #48473f;
  --hair: #363530;
  --hair2: #383835;
  --shade: rgba(255, 255, 255, 0.05);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--blue) 25%, transparent); }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

/* ---- top bar ---------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--desk) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 18px;
  min-height: 54px;
}
.wordmark {
  display: flex; align-items: center; gap: 9px;
  font-weight: 750; font-size: 17px; letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark svg { display: block; }
.wordmark .wm-accent { color: var(--blue); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px;
  padding: 6px 10px; border-radius: 6px;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); }
.nav a.cta {
  color: var(--card); background: var(--ink); margin-left: 8px;
  padding: 7px 14px; white-space: nowrap;
}
.nav a.cta:hover { color: var(--card); opacity: 0.85; }
@media (max-width: 620px) {
  .nav a:not(.cta) { padding: 6px 7px; }
  .topbar .wrap { gap: 8px; }
}
/* On phones the hero carries its own CTA; the topbar one would wrap or overflow. */
@media (max-width: 480px) {
  .nav a.cta { display: none; }
}

/* ---- theme control ----------------------------------------------------
   Built by theme.js, so it never appears without the script that makes it
   work. Same segmented-control vocabulary as the app's .rangectl. */
.themectl { display: flex; gap: 2px; }
.nav .themectl { margin-left: 8px; }
.themectl button {
  appearance: none; background: none; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 4px 9px; border-radius: 5px; touch-action: manipulation;
}
.themectl button:hover { color: var(--ink); }
.themectl button.active { color: var(--ink); border-color: var(--hair2); background: var(--card); }

/* The topbar runs out of room before the footer does, so the control moves
   down there rather than disappearing on phones. */
footer .themectl { margin-top: 2px; }
@media (max-width: 800px) { .nav .themectl { display: none; } }
@media (min-width: 801px) { footer .themectl { display: none; } }

/* ---- type ------------------------------------------------------------- */
.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 16px;
}
h1 {
  font-size: clamp(38px, 7vw, 66px); letter-spacing: -0.035em; line-height: 1.02;
  margin: 0 0 20px; font-weight: 750; text-wrap: balance;
}
h2 {
  font-size: clamp(27px, 4.5vw, 40px); letter-spacing: -0.028em; line-height: 1.1;
  margin: 0 0 14px; font-weight: 730; text-wrap: balance;
}
h3 { font-size: 17px; letter-spacing: -0.012em; margin: 0 0 6px; font-weight: 700; }
p { max-width: 64ch; margin: 0 0 14px; }
.lede { font-size: clamp(16px, 2.4vw, 19px); line-height: 1.55; color: var(--ink); }
.dim { color: var(--muted); }
.solo { color: var(--blue); }
.up { color: var(--up); }
.down { color: var(--down); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.center p { margin-left: auto; margin-right: auto; }

/* ---- layout ----------------------------------------------------------- */
.section { padding: 88px 0; border-bottom: 1px solid var(--hair); }
.section.tight { padding: 64px 0; }
.section:last-of-type { border-bottom: none; }
.hero { padding: 96px 0 72px; }
@media (max-width: 720px) { .section { padding: 64px 0; } .hero { padding: 64px 0 48px; } }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0 0; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 26px 0 0; }
@media (max-width: 860px) { .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; margin-top: 8px; }
.split.rev { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
@media (max-width: 860px) {
  .split, .split.rev { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .split.rev .copy { order: -1; }
}

/* ---- cards ------------------------------------------------------------ */
.card {
  background: var(--card); border: 1px solid var(--hair); border-radius: 12px;
  padding: 18px 20px;
}
.card .k {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px;
}
.card p { font-size: 13.5px; color: var(--muted); margin: 0; max-width: none; }
.card p strong { color: var(--ink); }
.card .quote { font-size: 14px; font-style: italic; color: var(--ink); margin: 0 0 8px; }

.figure {
  background: var(--card); border: 1px solid var(--hair); border-radius: 12px;
  padding: 14px 14px 10px; overflow: hidden;
}
.figure svg { display: block; width: 100%; height: auto; }
.figure .cap {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  padding: 8px 4px 2px; letter-spacing: 0.02em;
}
.figure .legend {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 2px 4px 10px;
  font-size: 11.5px; color: var(--muted); font-weight: 600;
}
.figure .legend .item { display: inline-flex; align-items: center; gap: 6px; }
.figure .legend .swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.figure .legend .swatch.dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---- buttons ---------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 650; font-size: 14.5px;
  background: var(--ink); color: var(--card); border: 1px solid transparent;
  border-radius: 8px; padding: 11px 20px; letter-spacing: -0.01em;
}
.btn:hover { opacity: 0.85; }
.btn.quiet { background: none; color: var(--ink); border-color: var(--hair2); }
.btn.quiet:hover { opacity: 1; background: var(--shade); }

.arrowlink { font-weight: 650; font-size: 14px; text-decoration: none; color: var(--blue); }
.arrowlink:hover { text-decoration: underline; }

/* ---- the equation band ------------------------------------------------ */
.equation {
  font-family: var(--mono); font-size: clamp(20px, 4.2vw, 34px);
  letter-spacing: -0.01em; font-weight: 500; margin: 0 0 18px;
}
.equation .g { color: var(--muted); }
.equation .s { color: var(--blue); font-weight: 700; }

.splitbar { margin: 8px auto 18px; }
.splitbar rect, .splitbar line { transform-origin: 0 50%; }
@media (prefers-reduced-motion: no-preference) {
  .splitbar .anim-band { animation: growx 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .splitbar .anim-solo { animation: growx 0.7s 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .splitbar .anim-tick { animation: fadein 0.4s 1.2s both; }
}
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---- kicker rows ------------------------------------------------------ */
.kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 14px;
}
.kicker .n { color: var(--blue); }

/* ---- never / instead list --------------------------------------------- */
.nevers { margin: 26px 0 0; border-top: 1px solid var(--hair); }
.never-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 28px;
  padding: 16px 2px; border-bottom: 1px solid var(--hair); align-items: baseline;
}
@media (max-width: 640px) { .never-row { grid-template-columns: minmax(0, 1fr); padding: 14px 2px; } }
.never-row .no { color: var(--muted); font-size: 14.5px; }
.never-row .no .tag, .never-row .yes .tag {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; margin-right: 10px;
}
.never-row .no .tag { color: var(--down); }
.never-row .yes .tag { color: var(--up); }
.never-row .no s { text-decoration-color: color-mix(in srgb, var(--down) 55%, transparent); text-decoration-thickness: 1.5px; }
.never-row .yes { font-size: 14.5px; font-weight: 550; }

/* ---- tables ----------------------------------------------------------- */
.table-scroll { overflow-x: auto; margin: 26px 0 0; }
table.compare { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 640px; }
table.compare th {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; text-align: left; padding: 8px 12px;
  border-bottom: 1px solid var(--hair2); white-space: nowrap;
}
table.compare td { padding: 9px 12px; border-bottom: 1px solid var(--hair); vertical-align: top; }
table.compare td.yes { color: var(--up); font-weight: 650; }
table.compare td.no { color: var(--muted); }
table.compare td.only { color: var(--blue); font-weight: 700; }
table.compare th.us, table.compare td.us { background: var(--shade); }

/* ---- pricing ---------------------------------------------------------- */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 32px 0 0; align-items: stretch; }
@media (max-width: 860px) { .tiers { grid-template-columns: 1fr; } }
.tier { display: flex; flex-direction: column; padding: 24px 22px; }
.tier.featured { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.tier .name { font-weight: 750; font-size: 18px; letter-spacing: -0.015em; }
.tier .for { color: var(--muted); font-size: 12.5px; margin: 2px 0 14px; }
.tier .price { font-size: 34px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tier .per { color: var(--muted); font-size: 13px; font-weight: 500; }
.tier ul { list-style: none; margin: 16px 0 22px; padding: 0; font-size: 13.5px; }
.tier li { padding: 6px 0 6px 22px; position: relative; border-bottom: 1px solid var(--hair); }
.tier li:last-child { border-bottom: none; }
.tier li::before { content: '—'; position: absolute; left: 2px; color: var(--bandline); }
.tier li.hl::before { content: '+'; color: var(--blue); font-weight: 700; }
.tier .btn { margin-top: auto; text-align: center; }
.tier .k { margin-bottom: 10px; }

/* ---- ledger / feed mocks (HTML) --------------------------------------- */
.ledger { font-variant-numeric: tabular-nums; padding: 0; overflow: hidden; }
.ledger .head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--hair);
}
.ledger .head .t { font-weight: 700; font-size: 13.5px; }
.ledger .head .sum { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ledger .row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--hair); font-size: 13px;
}
.ledger .row:last-child { border-bottom: none; }
.ledger .row .pair { font-weight: 650; }
.ledger .row .meta { color: var(--muted); font-size: 12px; }
.badge {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 9px; white-space: nowrap;
}
.badge.ok { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.badge.watch { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.badge.broke { color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); }

/* ---- feature rows (product page) -------------------------------------- */
.featlist { margin: 26px 0 0; border-top: 1px solid var(--hair); }
.feat {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 8px 32px;
  padding: 18px 2px; border-bottom: 1px solid var(--hair);
}
@media (max-width: 640px) { .feat { grid-template-columns: minmax(0, 1fr); } }
.feat .name { font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; }
.feat .name .mono { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.feat p { font-size: 13.5px; color: var(--muted); margin: 0; max-width: 60ch; }
.feat p strong { color: var(--ink); font-weight: 650; }

/* ---- refusal panel ----------------------------------------------------- */
.refusal {
  border: 1px dashed var(--bandline); border-radius: 12px; padding: 26px 28px;
  margin: 30px 0 0;
}
.refusal .big { font-size: clamp(19px, 3vw, 25px); font-weight: 730; letter-spacing: -0.02em; margin: 0 0 8px; }
.refusal p { color: var(--muted); font-size: 14px; margin: 0; }
.refusal p strong { color: var(--ink); }

/* ---- footer ------------------------------------------------------------ */
footer { padding: 48px 0 64px; color: var(--muted); font-size: 13px; }
footer .cols { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-start; }
footer .fnav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: none; font-weight: 600; }
footer a:hover { color: var(--ink); }
footer .disclaimer {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--hair);
  font-size: 12px; max-width: none;
}
