/* PredictMeNot — site styles. One family (IBM Plex Sans), tabular figures for the ledger,
   a light slate ground so the two semantic colors (settled win / settled loss) carry the meaning. */
:root {
  --paper: #eef1f5;
  --paper-2: #f7f8fa;
  --ink: #14181f;
  --ink-2: #4b5563;
  --rule: #cfd5de;
  --win: #17744a;
  --loss: #b8371f;
  --brand: #2448c9;
  --brand-ink: #ffffff;
  --max: 1100px;
  --text: 70ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1318; --paper-2: #161b22; --ink: #e8ebef; --ink-2: #9aa3af; --rule: #2a313b;
    --win: #3ccf8e; --loss: #ff6b5a; --brand: #7a9bff; --brand-ink: #0f1318;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1318; --paper-2: #161b22; --ink: #e8ebef; --ink-2: #9aa3af; --rule: #2a313b;
  --win: #3ccf8e; --loss: #ff6b5a; --brand: #7a9bff; --brand-ink: #0f1318;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px; line-height: 1.55;
}
a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover, a:focus-visible { text-decoration-thickness: 2px; }
header.top a, .cta, .btn, .posts h3 a, nav a { text-decoration: none; }
header.top a:hover, .posts h3 a:hover, nav a:hover { text-decoration: underline; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }
caption, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.text { max-width: var(--text); }

header.top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 22px 0 8px; }
header.top .brand { font-weight: 600; font-size: 19px; letter-spacing: -0.01em; color: var(--ink); }
header.top nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 15px; }
header.top nav a { color: var(--ink-2); display: inline-block; padding: 6px 0; }
.theme { display: inline-flex; gap: 2px; margin: 0; padding: 2px; border: 1px solid var(--rule); border-radius: 6px; font-size: 13px; }
.theme legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.theme label { padding: 4px 8px; border-radius: 4px; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.theme label:has(input:checked) { background: var(--ink); color: var(--paper); }
.theme input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

.hero { padding: 56px 0 28px; }
.hero h1 { font-size: clamp(34px, 5.6vw, 60px); line-height: 1.04; letter-spacing: -0.025em; font-weight: 600; margin: 0 0 20px; max-width: 18ch; }
.hero p.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); margin: 0 0 26px; max-width: 54ch; }
.cta { display: inline-block; background: var(--brand); color: var(--brand-ink); padding: 12px 18px; border-radius: 6px; font-weight: 600; font-size: 16px; }
.cta:hover { text-decoration: none; filter: brightness(1.08); }

section { padding: 40px 0; border-top: 1px solid var(--rule); }
section h2 { font-size: 26px; letter-spacing: -0.015em; margin: 0 0 8px; font-weight: 600; }
section p.sub { color: var(--ink-2); margin: 0 0 22px; max-width: 64ch; }
h3 { font-size: 19px; margin: 26px 0 6px; font-weight: 600; }

/* the ledger */
.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.ledger th, .ledger td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.ledger th { color: var(--ink-2); font-weight: 500; font-size: 13px; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger td.num { text-align: right; }
.ledger th.num { text-align: right; }
.ledger .win { color: var(--win); font-weight: 600; }
.ledger .loss { color: var(--loss); font-weight: 600; }
.ledger-wrap { overflow-x: auto; }
.ledger-note { color: var(--ink-2); font-size: 14px; margin-top: 10px; }
.ledger-sum { display: flex; gap: 28px; flex-wrap: wrap; margin: 0 0 14px; font-size: 15px; color: var(--ink-2); }
.ledger-sum b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* scanners: three plain blocks, each with a real example line */
.scan { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px 40px; }
.scan p { margin: 0 0 10px; color: var(--ink-2); }
.scan .ex { font-size: 14px; color: var(--ink); background: var(--paper-2); border-left: 3px solid var(--rule); padding: 8px 12px; }

/* research list */
.posts { list-style: none; padding: 0; margin: 0; }
.posts li { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.posts li:last-child { border-bottom: 0; }
.posts .when { color: var(--ink-2); font-size: 14px; }
.posts h3 { margin: 4px 0 6px; }
.posts p { margin: 0; color: var(--ink-2); max-width: 70ch; }

/* hero extras */
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.cta.ghost { background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); }
.marks { list-style: none; padding: 0; margin: 22px 0 0; display: flex; gap: 10px 28px; flex-wrap: wrap; font-size: 15px; color: var(--ink-2); }
.marks li::before { content: "✓"; color: var(--win); font-weight: 600; margin-right: 8px; }
.fine { color: var(--ink-2); font-size: 14px; margin: 14px 0 0; max-width: 84ch; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper-2); color: var(--ink); cursor: pointer; }
.btn.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn:hover { text-decoration: none; filter: brightness(1.05); }

.elsewhere { margin-top: 22px; border-top: 1px solid var(--rule); padding-top: 6px; }
.elsewhere h3 { margin: 22px 0 8px; }
.elsewhere p, .elsewhere li { color: var(--ink); }
.elsewhere ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; }
.elsewhere .ledger td.win { color: var(--win); font-weight: 600; }

/* True Cost calculator */
.calc { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.4fr); gap: 28px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; padding: 24px; }
.calc-in { display: flex; flex-direction: column; gap: 12px; }
.calc-in label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
.calc-in label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; }
.calc-in input, .calc-in select { font: inherit; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); width: 100%; }
.calc-in input[type=checkbox] { width: auto; }
.calc-out { display: flex; flex-direction: column; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 14px; }
.kpi .k { font-size: 13px; color: var(--ink-2); }
.kpi .v { font-size: 26px; font-weight: 600; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; margin: 2px 0; }
.kpi .v.loss { color: var(--loss); }
.kpi .s { font-size: 13px; color: var(--ink-2); }
.calc-note { margin: 0; font-size: 15px; color: var(--ink-2); }
.calc-note b { color: var(--ink); }
.calc-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* the deal */
.deals { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.deal { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.deal-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.deal-h h3 { margin: 0; }
.deal-h span { font-size: 13px; color: var(--ink-2); }
.deal ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.deal .btn { align-self: flex-start; }

/* the Floor */
.floor-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.floor { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.floor-post { background: var(--paper-2); border: 1px solid var(--rule); border-left: 3px solid var(--rule); border-radius: 8px; padding: 12px 14px; margin: 0 0 12px; font-size: 15px; }
.floor-post p { margin: 6px 0 0; }
.badge { background: var(--rule); border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--rule); }
.bar i { display: block; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.floor-form { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.floor-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
.floor-form textarea, .floor-form input { font: inherit; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper-2); color: var(--ink); width: 100%; }
[data-floor] { margin-top: 36px; border-top: 1px solid var(--rule); padding-top: 24px; }

/* two-column prose blocks */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px 40px; }
.two h3 { margin: 0 0 6px; }
.two ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.two.faq p { margin: 0; color: var(--ink-2); }
.ledger td.loss { color: var(--loss); font-weight: 600; }
.ledger.cells td { white-space: normal; min-width: 9ch; }

/* waitlist */
form.wait { display: flex; gap: 10px; flex-wrap: wrap; max-width: 560px; }
form.wait input[type=email] { flex: 1 1 260px; font: inherit; padding: 11px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper-2); color: var(--ink); }
form.wait button { font: inherit; font-weight: 600; padding: 11px 16px; border: 0; border-radius: 6px; background: var(--brand); color: var(--brand-ink); cursor: pointer; }
form.wait button:disabled { opacity: 0.6; cursor: default; }
.wait-msg { margin-top: 10px; font-size: 15px; color: var(--ink-2); min-height: 1.4em; }
.wait-msg.ok { color: var(--win); }
.wait-msg.err { color: var(--loss); }

footer { padding: 36px 0 48px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 14px; }
footer p { margin: 6px 0; max-width: 80ch; }

/* post pages */
article.post { padding: 40px 0 20px; }
article.post h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.08; letter-spacing: -0.022em; margin: 0 0 12px; max-width: 24ch; }
article.post .meta { color: var(--ink-2); margin-bottom: 28px; }
article.post .body { max-width: var(--text); }
article.post .body h2 { font-size: 24px; margin: 36px 0 10px; letter-spacing: -0.012em; }
article.post .body p, article.post .body li { font-size: 17.5px; line-height: 1.6; }
article.post .body img { max-width: 100%; height: auto; display: block; margin: 22px 0; border: 1px solid var(--rule); border-radius: 6px; }
article.post .body blockquote { margin: 18px 0; padding: 4px 16px; border-left: 3px solid var(--rule); color: var(--ink-2); }
article.post .body code { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }
article.post .wide { max-width: var(--max); }
article.post .body table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 15px; font-variant-numeric: tabular-nums; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
article.post .body th, article.post .body td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
article.post .body th { color: var(--ink-2); font-weight: 500; font-size: 13px; }
article.post .body tr:last-child td { border-bottom: 0; }
.q-where { color: var(--ink-2); font-size: 13px; }
article.post .body.wide-body { max-width: var(--max); }
article.post .body.wide-body p.text { max-width: var(--text); }
article.post .body.wide-body td, article.post .body.wide-body th { font-size: 14px; }
article.post .body .ledger.cells th[scope=row] { font-weight: 600; color: var(--ink); font-size: 15px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (prefers-reduced-motion: no-preference) {
  .ledger tbody tr { animation: rowin 320ms ease-out both; }
  @keyframes rowin { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 760px) {
  .calc { grid-template-columns: 1fr; padding: 18px; }
}
@media (max-width: 640px) {
  .hero { padding-top: 36px; }
  section { padding: 32px 0; }
  header.top nav { gap: 14px; }
}
