/* RecheBot public site. One stylesheet, no external requests. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --surface: #f2f4f7;
  --surface-2: #e7ebf0;
  --border: #d5dbe3;
  --text: #111821;
  --text-muted: #46505e;
  --link: #a8430b;
  --accent: #f26b1d;
  --accent-hover: #ff7f36;
  --accent-ink: #140a03;
  --ok: #117a43;
  --focus: #f26b1d;

  /* The top band (header + hero) is dark in both schemes. */
  --band-bg: #10161f;
  --band-surface: #18212d;
  --band-border: #2a3646;
  --band-text: #eef2f7;
  --band-muted: #a6b2c2;
  --band-link: #ffa167;
  --band-ok: #4fd58c;

  --radius: 6px;
  --radius-lg: 10px;
  --maxw: 1120px;
  --readw: 74ch;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-code: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1118;
    --surface: #141b25;
    --surface-2: #1b2430;
    --border: #283444;
    --text: #e8edf3;
    --text-muted: #a3aebd;
    --link: #ff9d5c;
    --accent: #f26b1d;
    --accent-hover: #ff7f36;
    --accent-ink: #140a03;
    --ok: #4fd58c;
    --band-bg: #080c12;
    --band-surface: #121a24;
    --band-border: #243040;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

code {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 1rem; font-weight: 800; }
h2 { font-size: clamp(1.45rem, 3vw, 1.95rem); margin: 0 0 0.75rem; font-weight: 750; }
h3 { font-size: 1.15rem; margin: 0 0 0.4rem; font-weight: 700; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 700px) { .wrap { padding: 0 28px; } }

/* ---------- Header ---------- */

.site-header {
  background: var(--band-bg);
  color: var(--band-text);
  border-bottom: 1px solid var(--band-border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--band-text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  margin-right: auto;
}
.brand svg { width: 30px; height: 30px; flex: none; }
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a:not(.btn) {
  color: var(--band-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}
.site-nav a:not(.btn):hover { color: var(--band-text); }
.site-nav .nav-optional { display: none; }
@media (min-width: 820px) { .site-nav .nav-optional { display: list-item; } }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--band-border);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  color: var(--band-text) !important;
}
.lang-switch svg { width: 16px; height: 16px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--band-border); color: var(--band-text); background: transparent; }
.btn-ghost:hover { border-color: var(--band-muted); }
.btn-small { min-height: 38px; padding: 0.4rem 0.85rem; font-size: 0.92rem; }

/* ---------- Hero ---------- */

.hero {
  background: var(--band-bg);
  color: var(--band-text);
  padding: 3rem 0 3.5rem;
  border-bottom: 3px solid var(--accent);
}
.hero .wrap {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 940px) {
  .hero { padding: 4.5rem 0 5rem; }
  .hero .wrap { grid-template-columns: 1.08fr 0.92fr; gap: 3.5rem; }
}
.hero h1 { max-width: 17ch; }
.hero-lead { font-size: 1.15rem; color: var(--band-muted); max-width: 56ch; margin: 0 0 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem; }
.hero-legal { font-size: 0.9rem; color: var(--band-muted); max-width: 60ch; margin: 0; }
.hero a:not(.btn) { color: var(--band-link); }
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  color: var(--band-text);
  font-weight: 600;
  font-size: 0.97rem;
}
.hero-facts li { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-facts svg { width: 18px; height: 18px; color: var(--band-ok); flex: none; }

/* Proof card: illustrates commit and reveal. */
.proof {
  background: var(--band-surface);
  border: 1px solid var(--band-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  min-width: 0;
}
.proof-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.proof-title { font-weight: 700; margin: 0; }
.proof-note { color: var(--band-muted); font-size: 0.85rem; margin: 0; }
.proof-step {
  border-left: 3px solid var(--band-border);
  padding: 0.2rem 0 0.2rem 0.9rem;
  margin: 0 0 1rem;
}
.proof-step.is-done { border-left-color: var(--accent); }
.proof-label { display: block; font-size: 0.88rem; color: var(--band-muted); margin-bottom: 0.25rem; }
.proof code {
  display: block;
  background: var(--band-bg);
  color: var(--band-text);
  border: 1px solid var(--band-border);
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
}
.proof-result {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-weight: 700;
  color: var(--band-ok);
}
.proof-result svg { width: 22px; height: 22px; flex: none; }

/* ---------- Sections ---------- */

.section { padding: 4rem 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-alt { background: var(--surface); }
.section-intro { max-width: 64ch; margin: 0 0 2.25rem; color: var(--text-muted); font-size: 1.08rem; }
.section-intro p { margin: 0; }

.timeline {
  display: grid;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
}
@media (min-width: 820px) { .timeline { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }
.timeline li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.timeline .when { color: var(--link); font-weight: 700; margin: 0 0 0.3rem; }
.timeline p { margin: 0; color: var(--text-muted); }


.grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--bg);
}
.card p { margin: 0; color: var(--text-muted); }

/* Flat lists: features and legal documents, no boxed tiles. */
.grid.flat { gap: 0 2rem; }
.feature, .doc-item {
  border-top: 1px solid var(--border);
  padding: 1.1rem 0 1.4rem;
}
.feature h3 { display: flex; align-items: center; gap: 0.6rem; }
.feature h3 svg { width: 22px; height: 22px; color: var(--link); flex: none; }
.feature p, .doc-item p { margin: 0; color: var(--text-muted); }
.doc-item h3 a { text-decoration: none; }
.doc-item h3 a:hover { text-decoration: underline; }

.split {
  display: grid;
  gap: 1rem;
}
@media (min-width: 820px) { .split { grid-template-columns: 1fr 1fr; gap: 1.25rem; } }
.split .card h3 { display: flex; align-items: center; gap: 0.5rem; }
.split .card h3 svg { width: 22px; height: 22px; color: var(--link); }
.checklist { list-style: none; padding: 0; margin: 0.75rem 0 0; }
.checklist li {
  position: relative;
  padding-left: 1.6rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.55em;
  width: 0.7rem;
  height: 0.38rem;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}
.callout {
  margin: 1.5rem 0 0;
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 600;
}

.faq { max-width: 820px; }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.7rem 0;
  list-style-position: outside;
}
.faq details p { margin: 0 0 1rem; color: var(--text-muted); }

.cta-band {
  background: var(--band-bg);
  color: var(--band-text);
  padding: 3.5rem 0;
}
.cta-band .wrap { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 820px) { .cta-band .wrap { grid-template-columns: 1fr auto; } }
.cta-band h2 { margin-bottom: 0.4rem; }
.cta-band p { margin: 0; color: var(--band-muted); }
.cta-band a:not(.btn) { color: var(--band-link); }

/* ---------- Legal pages ---------- */

.doc-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
}
.doc-header h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 0.6rem; }
.doc-meta { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.doc-layout { display: grid; gap: 2rem; padding: 2.5rem 0 4rem; }
@media (min-width: 1000px) {
  .doc-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 3rem; }
  .toc { position: sticky; top: 1.5rem; align-self: start; max-height: calc(100vh - 3rem); overflow-y: auto; }
}
.toc {
  font-size: 0.93rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: var(--surface);
}
.toc h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin: 0.25rem 0; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--link); text-decoration: underline; }

.prose { max-width: var(--readw); min-width: 0; }
.prose h2 {
  font-size: 1.4rem;
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.25rem;
  scroll-margin-top: 1rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.6rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin: 0.3rem 0; }
.prose .lead { font-size: 1.1rem; color: var(--text-muted); }
.prose .note {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 0.9rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
th { background: var(--surface); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.table-wrap table { min-width: 560px; }
dl.facts { display: grid; gap: 0.35rem 1.25rem; margin: 0 0 1.25rem; }
@media (min-width: 640px) { dl.facts { grid-template-columns: max-content 1fr; } }
dl.facts dt { font-weight: 700; }
dl.facts dd { margin: 0 0 0.5rem; }
@media (min-width: 640px) { dl.facts dd { margin: 0; } }

.placeholder {
  background: #fff1c2;
  color: #3d2c00;
  padding: 0 0.3em;
  border-radius: 3px;
  font-weight: 700;
}
.fill {
  background: var(--surface-2);
  border: 1px dashed var(--text-muted);
  padding: 0 0.3em;
  border-radius: 3px;
}

/* ---------- 404 ---------- */

.notfound { padding: 5rem 0; }
.notfound .big { font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 800; line-height: 1; margin: 0 0 1rem; color: var(--link); }
.notfound .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.notfound .btn-ghost { color: var(--text); border-color: var(--border); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.footer-grid { display: grid; gap: 1.75rem; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer h2 { font-size: 1rem; color: var(--text); margin: 0 0 0.6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.35rem 0; }
.site-footer a { color: var(--text); }
.site-footer p { margin: 0 0 0.6rem; }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header, .site-footer, .toc, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}
