/* EXTRA SAFE Chat — landing page. Static CSS, light + dark via prefers-color-scheme.
   One accent (#0b5fff), neutral greys, system fonts, thin rules. Motion only where
   it explains, and only when the visitor has not asked to reduce it. */

:root {
  --accent: #0b5fff;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0ff;
  --bg: #ffffff;
  --bg-2: #f6f7f9;
  --bg-3: #eef1f5;
  --card: #ffffff;
  --ink: #0f1419;
  --ink-2: #3b434d;
  --mut: #697482;
  --line: #e2e6ec;
  --line-2: #d4dae2;
  --ok: #0a7d33;
  --ok-soft: #e4f4ea;
  --code-bg: #0f1623;
  --code-ink: #e7ecf5;
  --code-com: #8aa0bd;
  --code-str: #9ad59a;
  --radius: 12px;
  --maxw: 1120px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #4d8bff;
    --accent-ink: #06142e;
    --accent-soft: #15233d;
    --bg: #0c0f14;
    --bg-2: #11151c;
    --bg-3: #171c25;
    --card: #141922;
    --ink: #eef2f7;
    --ink-2: #c3ccd7;
    --mut: #8893a2;
    --line: #232a35;
    --line-2: #2c3542;
    --ok: #4ec177;
    --ok-soft: #10281a;
    --code-bg: #090d14;
    --code-ink: #e7ecf5;
    --code-com: #6f84a0;
    --code-str: #8fce8f;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font: 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

a { color: var(--accent); }

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-3); padding: 1px 5px; border-radius: 5px; }

/* ── Header ───────────────────────────────────────────── */
.site-head { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); z-index: 20; }
.head-row { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.logo-sub { font-weight: 500; color: var(--mut); }
.logo-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); position: relative; flex: none; }
.logo-mark::after { content: ""; position: absolute; inset: 6px 5px; border-radius: 2px; background: repeating-linear-gradient(var(--accent-ink) 0 2px, transparent 2px 4px); opacity: 0.9; }
.site-nav { display: flex; gap: 20px; font-size: 14.5px; }
.site-nav a { color: var(--ink-2); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
@media (max-width: 720px) { .site-nav { display: none; } }

/* ── Hero ─────────────────────────────────────────────── */
.hero { padding: 68px 20px 40px; max-width: 920px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 18px; }
.lede { font-size: clamp(17px, 2.3vw, 20px); color: var(--ink-2); max-width: 44ch; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; font: inherit; font-weight: 600; font-size: 15px; padding: 11px 20px; border-radius: 9px; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-note { margin: 22px 0 0; font-size: 14.5px; color: var(--mut); }
.hero-note b { color: var(--ink); }

section { padding: 56px 20px; }
section h2 { font-size: clamp(23px, 3.4vw, 31px); margin: 0 0 12px; }
.section-lede, .hero + section .section-lede { color: var(--ink-2); max-width: 70ch; margin: 0 0 28px; }

/* ── Section 2 · figure ───────────────────────────────── */
.embed { border-top: 1px solid var(--line); }
.figure { }
.figwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .figwrap { grid-template-columns: 1fr; } }

.pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.pane-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mut); font-weight: 600; }

/* segmented switch */
.switch { display: inline-flex; background: var(--bg-3); border-radius: 8px; padding: 3px; gap: 2px; }
.switch label { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 5px 13px; border-radius: 6px; cursor: pointer; user-select: none; }
#ba-before:checked ~ .figwrap .switch label[for="ba-before"],
#ba-after:checked ~ .figwrap .switch label[for="ba-after"] { background: var(--card); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,0.12); }

/* the mock */
.mock { padding: 12px; position: relative; font-size: 13px; min-height: 360px; }
.mock-top { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; border-bottom: 1px solid var(--line); }
.mock-brand { font-weight: 700; }
.mock-brand span { color: var(--accent); }
.mock-tabs { display: flex; gap: 12px; color: var(--mut); font-size: 12px; }
.mock-tabs b { color: var(--ink); }
.mock-msgs { margin-left: auto; position: relative; font: inherit; font-size: 12px; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 7px; padding: 6px 11px; }
.mock-msgs .badge { position: absolute; top: -7px; right: -7px; background: #e0353b; color: #fff; font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; border-radius: 9px; padding: 0 4px; }

.mock-body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; padding: 14px 8px 8px; }
@media (max-width: 460px) { .mock-body { grid-template-columns: 1fr; } }
.mock-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mut); font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mock-me { font-size: 10px; text-transform: none; letter-spacing: 0; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 20px; font-weight: 600; }

.mock-cp { padding: 8px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; }
.cp-id { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cp-name { font-weight: 600; }
.cp-chip { font-size: 10px; color: var(--ok); background: var(--ok-soft); padding: 1px 6px; border-radius: 5px; font-weight: 600; }
.cp-on { font-size: 10px; color: var(--accent); font-weight: 600; }
.cp-acts { display: flex; gap: 6px; margin-top: 8px; }
.cp-acts button { font: inherit; font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); cursor: default; }
.cp-acts button.pay { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.mock-ledger { width: 100%; border-collapse: collapse; font-size: 12px; }
.mock-ledger th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mut); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.mock-ledger td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
.src-chat { font-size: 10px; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; font-weight: 600; }

/* chat panel drawn over the mock */
.mock-panel { position: absolute; right: 12px; bottom: 12px; width: 220px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 34px rgba(5,20,50,0.22); overflow: hidden; }
.mp-head { background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; padding: 9px 12px; }
.mp-body { padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.mp-msg { font-size: 11.5px; padding: 6px 9px; border-radius: 9px; max-width: 80%; }
.mp-msg.them { background: var(--bg-3); align-self: flex-start; border-bottom-left-radius: 3px; }
.mp-msg.me { background: var(--accent); color: var(--accent-ink); align-self: flex-end; border-bottom-right-radius: 3px; }
.mp-card { border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; background: var(--bg-2); }
.mp-card-h { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mut); }
.mp-card-amt { font-size: 18px; font-weight: 700; font-family: var(--mono); }
.mp-card-sub { font-size: 10px; color: var(--mut); }
@media (max-width: 460px) { .mock-panel { position: static; width: auto; margin: 12px 0 0; box-shadow: none; } }

/* After-only elements: hidden in the Before state */
#ba-before:checked ~ .figwrap .es-added { display: none; }

/* numbered annotation outline (After) */
.es-added[data-anno], .cp-chip[data-anno] { position: relative; }
#ba-after:checked ~ .figwrap .es-added[data-anno] { outline: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; border-radius: 6px; }
.es-added[data-anno]::after {
  content: attr(data-anno);
  position: absolute; top: -10px; left: -10px; z-index: 3;
  width: 18px; height: 18px; line-height: 18px; text-align: center;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; border-radius: 50%;
  font-family: var(--sans);
}
#ba-before:checked ~ .figwrap .es-added[data-anno]::after { display: none; }

/* cross-highlight (JS adds .hl) */
.hl { outline: 2px solid var(--accent) !important; outline-offset: 3px; }
.code-block .anno.hl { background: color-mix(in srgb, var(--accent) 26%, transparent); outline: none !important; border-radius: 3px; }

/* ── code tabs ────────────────────────────────────────── */
.code { background: var(--code-bg); }
.tabbar { display: flex; align-items: center; gap: 2px; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.tabbar label { font-size: 13px; font-weight: 600; color: #9fb0c9; padding: 6px 13px; border-radius: 7px; cursor: pointer; }
.tabbar label:hover { color: #dfe8f5; }
#tab-html:checked ~ .tabbar label[for="tab-html"],
#tab-react:checked ~ .tabbar label[for="tab-react"],
#tab-next:checked ~ .tabbar label[for="tab-next"] { background: rgba(255,255,255,0.1); color: #fff; }
.copy { margin-left: auto; font: inherit; font-size: 12px; font-weight: 600; color: #cdd8e8; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 7px; padding: 5px 11px; cursor: pointer; }
.copy:hover { background: rgba(255,255,255,0.14); }
.copy.done { color: var(--code-str); }

.panel { display: none; }
#tab-html:checked ~ .panel-html,
#tab-react:checked ~ .panel-react,
#tab-next:checked ~ .panel-next { display: block; }

.file-name { font-family: var(--mono); font-size: 11px; color: var(--code-com); padding: 10px 14px 2px; }
.code-block { margin: 0; padding: 6px 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--code-ink); tab-size: 2; }
.code-block code { background: none; padding: 0; font-size: inherit; color: inherit; }
.tok-com { color: var(--code-com); font-style: italic; }
.tok-str { color: var(--code-str); }
.anno { display: inline; }
.code-block .anno { position: relative; border-left: 2px solid transparent; }
.code-foot { margin: 14px 2px 0; font-size: 14px; color: var(--mut); }
.panel-react .code-block:first-of-type, .panel-next .code-block:first-of-type { border-bottom: 1px solid rgba(255,255,255,0.08); }

/* legend */
.legend { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 22px; }
.legend li { font-size: 14px; color: var(--ink-2); padding: 8px 10px; border-radius: 8px; }
.legend li b { color: var(--accent); margin-right: 4px; font-size: 15px; }
.legend li.hl { background: var(--accent-soft); }

/* ── Section 3 · flow ─────────────────────────────────── */
.flow { border-top: 1px solid var(--line); }
.steps { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .steps { grid-template-columns: 1fr; } }
.steps li { position: relative; }
.step-n { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; align-items: center; justify-content: center; margin-bottom: 10px; }
.frame { height: 110px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden; }
.steps p { font-size: 14px; color: var(--ink-2); margin: 10px 0 0; }
.f-chat { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.f-chat .b { height: 13px; border-radius: 7px; background: var(--bg-3); }
.f-chat .them { width: 70%; }
.f-chat .me { width: 55%; align-self: flex-end; background: color-mix(in srgb, var(--accent) 30%, var(--bg-3)); }
.f-chat .short { width: 40%; }
.f-pay { text-align: center; }
.f-amt { display: block; font-family: var(--mono); font-size: 26px; font-weight: 700; }
.f-tok { display: block; font-size: 12px; color: var(--mut); }
.f-ref { display: inline-block; margin-top: 6px; font-size: 10px; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 10px; }
.f-card { border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 14px; text-align: center; background: var(--card); }
.f-card-h { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mut); }
.f-card-a { display: block; font-family: var(--mono); font-size: 17px; font-weight: 700; margin: 2px 0; }
.f-card-s { font-size: 10px; color: var(--ok); }
.f-led { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.f-led span { height: 14px; border-radius: 4px; background: var(--bg-3); }
.f-led .hot { background: color-mix(in srgb, var(--accent) 30%, var(--bg-3)); outline: 2px solid var(--accent); outline-offset: 1px; }

.event-json { background: var(--code-bg); border-radius: var(--radius); overflow: hidden; max-width: 560px; }
.event-json .code-block { color: var(--code-ink); }
.verify-note { margin: 20px 0 0; font-size: 15px; color: var(--ink-2); max-width: 70ch; }
.verify-note b { color: var(--ink); }

/* ── Section 4 · sees ─────────────────────────────────── */
.sees { border-top: 1px solid var(--line); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 680px) { .cols { grid-template-columns: 1fr; } }
.col { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; background: var(--card); }
.col h3 { margin: 0 0 12px; font-size: 16px; }
.col ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.col li { margin: 7px 0; }
.col-sees { border-top: 3px solid var(--accent); }
.col-not { border-top: 3px solid var(--ok); }
.sees-why { margin: 20px 0 0; color: var(--mut); max-width: 72ch; font-size: 15px; }

/* ── Section 5 · checklist ────────────────────────────── */
.check { border-top: 1px solid var(--line); }
.check-list { margin: 0; padding: 0; list-style: none; counter-reset: c; max-width: 760px; }
.check-list li { counter-increment: c; position: relative; padding: 14px 14px 14px 52px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--card); font-size: 15px; }
.check-list li::before { content: counter(c); position: absolute; left: 14px; top: 13px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.eff { display: inline-block; font-size: 11px; font-weight: 600; color: var(--mut); background: var(--bg-3); border-radius: 6px; padding: 2px 8px; margin-right: 8px; }
.check-foot { margin: 18px 0 0; }

/* ── Section 6 · status ───────────────────────────────── */
.status { border-top: 1px solid var(--line); }
.col-now { border-top: 3px solid var(--accent); }
.col-later { border-top: 3px solid var(--mut); }
.status-note { margin: 14px 0 0; font-size: 13px; color: var(--mut); font-style: italic; }

/* ── Section 7 · full system ──────────────────────────── */
.full { border-top: 1px solid var(--line); }
.full-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; align-items: center; }
@media (max-width: 760px) { .full-grid { grid-template-columns: 1fr; } }
.full-shot { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.shot-top { display: flex; gap: 6px; padding: 10px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.shot-top .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.shot-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.shot-row { height: 46px; border-radius: 8px; background: var(--bg-3); position: relative; }
.shot-dir { background: linear-gradient(90deg, var(--accent-soft) 32%, var(--bg-3) 32%); }
.shot-deal { background: linear-gradient(90deg, var(--bg-3) 60%, color-mix(in srgb, var(--accent) 24%, var(--bg-3)) 60%); }
.shot-admin { height: 70px; background: repeating-linear-gradient(90deg, var(--bg-3) 0 22px, var(--card) 22px 26px); }
.full-caps { margin: 0; padding-left: 20px; color: var(--ink-2); }
.full-caps li { margin: 10px 0; }
.full-cta { margin: 26px 0 0; }

/* ── Footer ───────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-2); padding: 30px 0 40px; margin-top: 10px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.foot-ver { font-weight: 500; color: var(--mut); font-size: 13px; font-family: var(--mono); }
.foot-nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.foot-nav a { color: var(--ink-2); text-decoration: none; }
.foot-nav a:hover { color: var(--accent); }
.foot-fine { margin-top: 16px; font-size: 12.5px; color: var(--mut); }

/* ── Your ledger strip (live widget callback) ─────────── */
.your-ledger { position: fixed; left: 16px; bottom: 16px; width: 290px; max-width: calc(100vw - 32px); background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 14px 40px rgba(5,20,50,0.24); z-index: 30; overflow: hidden; }
.yl-head { display: flex; align-items: center; justify-content: space-between; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; padding: 9px 12px; }
.yl-close { background: none; border: 0; color: var(--accent-ink); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.yl-rows { max-height: 220px; overflow: auto; }
.yl-row { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.yl-row:last-child { border-bottom: 0; }
.yl-row .yl-amt { font-family: var(--mono); font-weight: 700; }
.yl-row .yl-sub { color: var(--mut); font-size: 11px; }
@media (max-width: 520px) { .your-ledger { left: 8px; right: 8px; width: auto; } }

@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; } }
