/* Public pages for factlore.io.
 *
 * The tokens are copied from apps/web/src/tokens.css, which Docs/28_Design_System.md §3 names as
 * the scale. These pages are static and share no build with apps/web, so the values are repeated
 * here. When a token changes there, change it here.
 *
 * One departure: --text-tertiary is --ink-500, not --ink-400. --ink-400 on white is about 3:1,
 * below WCAG AA for the small text these pages set in it (Docs/28 §3: contrast is a requirement).
 */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  color-scheme: light;

  --mint-50:#F0FAF8;--mint-100:#D9F2ED;--mint-200:#B4E4DC;--mint-300:#8AD3C7;--mint-400:#56BFAE;
  --mint-500:#2DB8A3;--mint-600:#1B9A8A;--mint-700:#157D71;--mint-800:#145F58;--mint-900:#0E3D37;

  --ink-900:#0A1614;--ink-800:#16211F;--ink-700:#2B3937;--ink-600:#46534F;
  --ink-500:#647069;--ink-400:#8B958F;--ink-300:#B4BCB7;--ink-200:#D6DBD8;

  --bg-canvas:#FAFBFB;--bg-surface:#FFFFFF;--bg-sunken:#F1F4F3;
  --border-subtle:#E4E8E9;--border-default:#CBD1D2;--border-strong:#A6ADAF;

  --blue-600:#3E63DD;--blue-100:#E3E9FD;
  --amber-600:#B8860E;--amber-100:#FBF0DA;
  --terracotta-600:#C1521B;--terracotta-100:#FBE7DA;
  --slate-600:#5B6663;--slate-100:#EEF0EF;

  --text-primary:var(--ink-900);--text-secondary:var(--ink-600);--text-tertiary:var(--ink-500);
  --text-link:var(--mint-700);--text-link-hover:var(--mint-800);

  --font-sans:'IBM Plex Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;

  --radius-sm:4px;--radius-md:8px;--radius-lg:12px;--radius-xl:16px;--radius-pill:999px;
  --shadow-xs:0 1px 2px rgba(10,22,20,0.06);
  --shadow-sm:0 2px 8px rgba(10,22,20,0.08);
  --shadow-md:0 8px 24px rgba(10,22,20,0.10);
  --shadow-focus:0 0 0 3px var(--mint-200);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-canvas); color: var(--text-primary); font: 400 16px/24px var(--font-sans); }
a { color: var(--text-link); text-underline-offset: 3px; }
a:hover { color: var(--text-link-hover); }
a:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }
svg.i { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 12px; height: 12px; stroke-width: 2; }
svg.i.lg { width: 22px; height: 22px; stroke-width: 1.55; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---- Top bar ---- */
.top { background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-primary); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; }
.brand::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--mint-500); }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; font-size: 14px; }
.top nav a:not(.btn) { color: var(--text-secondary); text-decoration: none; padding: 4px 0; }
.top nav a:not(.btn):hover { color: var(--text-primary); text-decoration: underline; }

/* ---- Buttons (designed/00) ---- */
.btn { font: 600 14px/20px var(--font-sans); padding: 9px 16px; border-radius: var(--radius-md); border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: background .12s ease, border-color .12s ease; }
.btn--primary { background: var(--mint-600); color: #fff; }
.btn--primary:hover { background: var(--mint-700); color: #fff; }
.btn--secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-default); }
.btn--secondary:hover { background: var(--bg-sunken); color: var(--text-primary); }
.btn--lg { font-size: 16px; line-height: 24px; padding: 11px 20px; }

/* ---- Section heading: D37, the only uppercase text with the bar ---- */
.sh { display: flex; align-items: center; gap: 9px; margin: 0 0 20px; font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mint-800); }
.sh::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--mint-500); flex: 0 0 auto; }
.eyebrow { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); }

/* ---- Hero ---- */
.hero { padding: 48px 0 56px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero { padding: 72px 0 80px; } .hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; } }
.hero h1 { margin: 12px 0 0; font-size: clamp(30px, 4.4vw, 42px); line-height: 1.16; font-weight: 600; letter-spacing: -0.02em; }
.hero .support { margin: 14px 0 0; font-size: 20px; line-height: 28px; font-weight: 500; color: var(--mint-700); }
.hero .lede { margin: 18px 0 0; max-width: 34rem; color: var(--text-secondary); }
.hero .actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 18px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--mint-100); color: var(--mint-800); border: 1px solid var(--mint-300); }

/* ---- Cards ---- */
.card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }

/* ---- The example: one leaver, two state columns (Docs/28 §4.4) ---- */
.example { box-shadow: var(--shadow-md); border-color: var(--border-default); overflow: hidden; }
.example .ch { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.av { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--mint-300), var(--mint-600)); color: #fff; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.example .who { font-weight: 600; font-size: 16px; line-height: 22px; }
.example .who small { display: block; font-weight: 400; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.example .ch .eyebrow { margin-left: auto; }
.rows { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.rows th { text-align: left; font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); padding: 10px 12px 8px; background: var(--bg-sunken); border-bottom: 1px solid var(--border-subtle); }
.rows td { padding: 11px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.rows th:first-child, .rows td:first-child { padding-left: 20px; }
.rows th:last-child, .rows td:last-child { padding-right: 20px; }
.rows tr:last-child td { border-bottom: 0; }
.rows .sys { font-weight: 500; }
.rows .sys small { display: block; font-weight: 400; font-size: 12.5px; line-height: 18px; color: var(--text-tertiary); }
.rows .when { display: block; font-size: 12.5px; line-height: 18px; color: var(--text-tertiary); margin-top: 2px; }
.example .foot { padding: 14px 20px; background: var(--amber-100); border-top: 1px solid #F0DDA8; font-size: 14px; line-height: 21px; color: var(--ink-800); display: flex; gap: 10px; align-items: flex-start; }
.example .foot svg { color: var(--amber-600); margin-top: 2px; }
@media (max-width: 480px) {
  .rows th:nth-child(2), .rows td:nth-child(2) { display: none; }
}

/* ---- Fact badges: colour marks the kind, with its word and icon (Docs/28 §9.3) ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius-pill); white-space: nowrap; line-height: 1.6; }
.badge--gone { background: var(--mint-100); color: var(--mint-700); border: 1px solid var(--mint-300); }
.badge--live { background: var(--amber-100); color: var(--amber-600); border: 1px solid #F0DDA8; }
.badge--attested { background: var(--blue-100); color: var(--blue-600); border: 1px solid #C2CEF6; }
.badge--unverifiable { background: var(--slate-100); color: var(--slate-600); border: 1px solid #D5DAD8; }
.badge--left { background: var(--terracotta-100); color: var(--terracotta-600); border: 1px solid #F0C8AC; }

/* ---- Bands ---- */
.band { padding: 56px 0; }
.band--surface { background: var(--bg-surface); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.grid3 { display: grid; gap: 16px; }
@media (min-width: 800px) { .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.grid2 { display: grid; gap: 16px; }
@media (min-width: 800px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.tile { padding: 22px 22px 24px; }
.tile .ic { width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--mint-100); color: var(--mint-700); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.tile.neutral .ic { background: var(--slate-100); color: var(--slate-600); }
.tile h3 { margin: 0 0 8px; font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.tile p { margin: 0; color: var(--text-secondary); font-size: 15px; line-height: 23px; }
.tile p + p { margin-top: 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--border-subtle); font-size: 15px; line-height: 23px; color: var(--text-secondary); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li svg { margin-top: 3px; color: var(--mint-700); }
.tile.neutral .list li svg { color: var(--slate-600); }
.note { margin: 20px 0 0; max-width: 46rem; color: var(--text-secondary); font-size: 15px; line-height: 23px; }
.systems { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.systems li { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 14px; font-size: 14px; font-weight: 500; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-pill); }
.systems li.csv { border-style: dashed; color: var(--text-secondary); font-weight: 400; }

.cta { text-align: left; }
.cta h2 { margin: 0; font-size: 26px; line-height: 34px; font-weight: 600; letter-spacing: -0.01em; }
.cta p { margin: 10px 0 24px; color: var(--text-secondary); max-width: 40rem; }

/* ---- Footer ---- */
.foot-bar { border-top: 1px solid var(--border-subtle); background: var(--bg-surface); }
.foot-bar .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; padding-top: 22px; padding-bottom: 28px; font-size: 13px; line-height: 18px; color: var(--text-tertiary); }
.foot-bar a { color: var(--text-secondary); text-decoration: none; }
.foot-bar a:hover { text-decoration: underline; }
.foot-bar .sp { margin-left: auto; }

/* ---- Document pages: privacy and terms ---- */
.doc { max-width: 760px; margin: 0 auto; padding: 40px 16px 64px; }
.doc h1 { margin: 0 0 6px; font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.doc h2 { margin: 36px 0 10px; font-size: 18px; line-height: 26px; font-weight: 600; }
.doc p, .doc li { color: var(--ink-700); }
.doc .muted { color: var(--text-tertiary); font-size: 14px; }
.doc code { font-size: 13px; background: var(--bg-sunken); padding: 1px 5px; border-radius: var(--radius-sm); word-break: break-word; }
.doc .scroll { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 21px; }
.doc th { text-align: left; font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); background: var(--bg-sunken); padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); }
.doc td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); min-width: 9rem; }
.doc tr:last-child td { border-bottom: 0; }
