/* MeritForge landing: no build step, system fonts only. */
:root {
  --bg: #f7f1e8;
  --bg-alt: #efe6d8;
  --surface: #fffaf3;
  --ink: #1d1712;
  --muted: #5d5147;
  --line: #d9cbb7;
  --accent: #b4490f;        /* ember, AA on --bg */
  --accent-strong: #8f3708;
  --accent-soft: rgba(180, 73, 15, 0.10);
  --ok: #2f6b3a;
  --hold: #8a5a00;
  --flag: #a3261b;
  --code-bg: #1b1410;
  --code-ink: #f4e7d6;
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 40px -24px rgba(60, 30, 5, .35);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14100d;
    --bg-alt: #1b1611;
    --surface: #211a14;
    --ink: #f3e9dc;
    --muted: #b9a996;
    --line: #3a2f25;
    --accent: #f59e3b;
    --accent-strong: #ffb863;
    --accent-soft: rgba(245, 158, 59, 0.12);
    --ok: #7fcf8c;
    --hold: #f2c14e;
    --flag: #ff8a7a;
    --code-bg: #0d0a08;
    --shadow: 0 1px 0 rgba(255,255,255,.03), 0 24px 50px -28px rgba(0,0,0,.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  /* subtle forge grid */
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-attachment: fixed;
  background-position: -1px -1px;
}
body::before { /* fade the grid so it stays quiet */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, transparent 0%, var(--bg) 70%);
  opacity: .93;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
code { font-family: var(--mono); font-size: .9em; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .6em; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
h1 em { font-style: italic; color: var(--accent); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); max-width: 26ch; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(820px, 100% - 2.5rem); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: var(--bg); padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip:focus { left: .5rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.nav nav { margin-left: auto; }
.nav nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav nav a:hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .8rem 1.25rem; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff; font-weight: 650; text-decoration: none; font-size: 1rem;
  font-family: inherit; cursor: pointer; transition: transform .15s ease, background .15s ease;
}
@media (prefers-color-scheme: dark) { .btn { color: #1a0f05; } }
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; transform: translateY(-1px); }
@media (prefers-color-scheme: dark) { .btn:hover { color: #1a0f05; } }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
@media (prefers-color-scheme: dark) { .btn-ghost, .btn-ghost:hover { color: var(--ink); } }
.btn-small { padding: .5rem .95rem; font-size: .9rem; }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.kicker, .eyebrow {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.1rem;
}
.eyebrow::before { content: "// "; opacity: .6; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; }
.lede strong { color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 1.6rem; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--muted); font-size: .95rem; }
.hero-points li::before { content: "◆"; color: var(--accent); margin-right: .45rem; font-size: .7em; vertical-align: .15em; }

/* Ledger card */
.ledger-card {
  margin: 0; background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; border: 1px solid #3a2a1c;
  font-family: var(--mono); font-size: .88rem;
  transform: rotate(.6deg);
}
.ledger-head { display: flex; align-items: center; gap: .4rem; padding: .7rem 1rem; border-bottom: 1px solid #33261a; background: #20170f; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #4a3827; }
.dot:first-child { background: #f59e3b; }
.ledger-title { margin-left: .5rem; color: #c9b39a; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger { width: 100%; border-collapse: collapse; }
.ledger th, .ledger td { text-align: left; padding: .6rem 1rem; border-bottom: 1px dashed #33261a; }
.ledger th { color: #c9b39a; font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.ledger td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; }
.ledger th:nth-child(2) { text-align: right; }
.role { color: #9c8670; font-size: .8em; margin-left: .3rem; }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; border: 1px solid currentColor; }
.tag.ok { color: #86d993; }
.tag.hold { color: #f2c14e; }
.tag.flag { color: #ff8a7a; }
.ledger-note { padding: .9rem 1rem 0; margin: 0; color: var(--code-ink); font-family: var(--sans); font-size: .92rem; }
.ledger-note strong { color: #f59e3b; }
.ledger-card figcaption { padding: .6rem 1rem 1rem; color: #9c8670; font-family: var(--sans); font-size: .78rem; }

/* Sections */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; border-top: 1px solid var(--line); }
.section-alt { background: color-mix(in srgb, var(--bg-alt) 92%, transparent); }
.section-lede { color: var(--muted); font-size: 1.1rem; max-width: 46rem; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; counter-reset: s; }
.step { position: relative; padding: 1.6rem 1.5rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.step-n { font-family: var(--mono); font-size: 2.4rem; font-weight: 700; color: var(--accent); opacity: .9; line-height: 1; display: block; margin-bottom: .9rem; }
.step p { color: var(--muted); margin: 0; }
.steps .step:not(:last-child)::after {
  content: ""; position: absolute; top: 2.4rem; right: -1.25rem; width: 1.25rem; height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 10px);
}

/* Money flow */
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: 2.2rem 0 2.2rem; font-family: var(--mono); font-size: .9rem; }
.flow-node { padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.flow-hot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.flow-arrow { width: 28px; height: 2px; background: var(--accent); position: relative; flex: none; }
.flow-arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--accent); border-right: 0; }

.cards { display: grid; gap: 1.25rem; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.two { grid-template-columns: repeat(2, 1fr); margin-top: 2rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.card h3 { font-family: var(--serif); font-size: 1.35rem; }
.card p { color: var(--muted); }
.card p:last-child { margin-bottom: 0; }
.card strong, .card em { color: var(--ink); }
.formula { background: var(--code-bg); color: var(--code-ink) !important; padding: .8rem 1rem; border-radius: 10px; font-size: .85rem; line-height: 1.8; overflow-x: auto; }

/* Scoring */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); margin-top: 2rem; }
.list-h { font-family: var(--mono); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 1.5rem; }
.list-h:first-child { margin-top: 0; }
.checks, .crosses, .plain, .ledger-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.checks li, .crosses li, .ledger-list li { position: relative; padding: .55rem 0 .55rem 2rem; border-bottom: 1px solid var(--line); }
.checks li::before, .crosses li::before, .ledger-list li::before { position: absolute; left: 0; top: .55rem; font-family: var(--mono); font-weight: 700; }
.checks li::before { content: "+"; color: var(--ok); }
.crosses li::before { content: "−"; color: var(--flag); }
.crosses li { color: var(--muted); }
.ledger-list li::before { content: "#"; color: var(--accent); }
.rules { margin: 0; display: grid; gap: .8rem; }
.rules > div { padding: 1rem 1.1rem; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; }
.rules dt { font-weight: 700; margin-bottom: .2rem; }
.rules dd { margin: 0; color: var(--muted); font-size: .98rem; }
.plain li { padding: .5rem 0 .5rem 1.4rem; position: relative; color: var(--muted); }
.plain li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }


/* Ledger section */
.metric { display: grid; gap: .25rem; margin-top: 1.5rem; padding: 1.4rem 1.5rem; border: 1px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.metric-label { font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.metric-value { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; }
.metric-sub { color: var(--muted); font-size: .95rem; }
.privacy { margin-top: 2rem; color: var(--muted); font-size: .95rem; padding-top: 1.2rem; border-top: 1px solid var(--line); max-width: 60rem; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: .3rem 0; }
details:first-of-type { border-top: 1px solid var(--line); margin-top: 1.5rem; }
summary { cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; font-weight: 650; font-size: 1.08rem; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: .25rem; top: .85rem; font-family: var(--mono); font-size: 1.3rem; color: var(--accent); transition: transform .2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); padding-bottom: .8rem; margin: 0; max-width: 44rem; }

/* Join */
.join { background: var(--code-bg); color: var(--code-ink); border-top: 0; }
.join .eyebrow { color: #f59e3b; }
.join h2 { color: #fff4e6; }
.join .section-lede { color: #c9b39a; }
.join-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.waitlist { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; background: #20170f; border: 1px solid #3a2a1c; border-radius: var(--radius); padding: 1.6rem; }
.field { display: grid; gap: .35rem; }
.field.full, .btn.full, .form-note { grid-column: 1 / -1; }
.field label { font-size: .9rem; color: #e6d5c0; font-weight: 600; }
.opt { font-weight: 400; color: #9c8670; }
.field input, .field textarea {
  font: inherit; font-size: 1rem; color: #fff4e6; background: #14100d; border: 1px solid #4a3827;
  border-radius: 10px; padding: .7rem .8rem; width: 100%;
}
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid #f59e3b; outline-offset: 1px; border-color: #f59e3b; }
.join .btn { background: #f59e3b; border-color: #f59e3b; color: #1a0f05; }
.join .btn:hover { background: #ffb863; border-color: #ffb863; color: #1a0f05; }
.form-note { font-size: .85rem; color: #9c8670; margin: 0; }
.form-note a { color: #f59e3b; }

/* Footer */
.site-footer { padding: 3rem 0 2.5rem; border-top: 1px solid var(--line); background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; }
.footer-tag { color: var(--muted); margin-top: .8rem; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; columns: 2; }
.site-footer nav li { margin-bottom: .5rem; }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); text-decoration: underline; }
.fineprint { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); padding-top: 1.2rem; margin: 0; }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .split, .join-grid { grid-template-columns: 1fr; }
  .cards.three { grid-template-columns: 1fr; }
  .nav nav { display: none; }
  .nav .btn-small { margin-left: auto; }
  .ledger-card { transform: none; }
}
@media (max-width: 720px) {
  body { font-size: 1rem; }
  .steps { grid-template-columns: 1fr; }
  .steps .step:not(:last-child)::after { display: none; }
  .cards.two { grid-template-columns: 1fr; }
  .flow { flex-direction: column; align-items: stretch; }
  .flow-arrow { width: 2px; height: 18px; margin: 0 auto; }
  .flow-arrow::after { right: -4px; top: auto; bottom: -2px; border: 5px solid transparent; border-top: 7px solid var(--accent); border-bottom: 0; }
  .flow-node { text-align: center; }
  .waitlist { grid-template-columns: 1fr; padding: 1.2rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .lede { font-size: 1.08rem; }
  .ledger th, .ledger td { padding: .55rem .7rem; }
}
@media (max-width: 460px) {
  .nav .btn-small { display: none; }
  .cta-row .btn { width: 100%; }
}
@media print {
  .site-header, .join { position: static; }
  body { background: #fff; }
}

.soon { display: block; }
.soon-title { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; color: #fff4e6; margin: 0 0 .5rem; }
.soon-text { color: #c9b39a; margin: 0; }
