:root {
  /* "Truth & Justice" palette — antique gold on deep ink-teal, warm parchment text */
  --bg: #0e1614;
  --surface: #17211e;
  --border: #2c3b36;
  --text: #f3e9d2;
  --text-muted: #b6a892;
  --accent: #d4af37;
  --accent-2: #e8c766;
  --green: #4fb477;
  --red: #d8624b;
  --grey: #7d8a83;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
.container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }
header { text-align: center; margin-bottom: 2rem; }
header h1 { font-size: 1.8rem; margin-bottom: 0.25rem; }
header h1 span { color: var(--accent); }
header p { color: var(--text-muted); font-size: 0.9rem; }

#self-test-banner {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  display: none;
}
#self-test-banner.pass { display: block; background: #0d2818; border: 1px solid var(--green); color: var(--green); }
#self-test-banner.fail { display: block; background: #2d1013; border: 1px solid var(--red); color: var(--red); }

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab {
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: transparent;
}
.tab.active { background: var(--surface); border-color: var(--border); color: var(--text); }

.panel { display: none; }
.panel.active { display: block; }

.input-group { margin-bottom: 1rem; }
.input-group label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
textarea {
  width: 100%;
  min-height: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.75rem;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.8rem;
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }

button.verify-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.5rem;
}
button.verify-btn:hover { opacity: 0.9; }
button.verify-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* "Paste a whole bundle" fast path + the divider from the per-field inputs */
.bundle-group {
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.9rem 1rem 1rem;
  background: rgba(212, 175, 55, 0.05);
  margin-bottom: 0.75rem;
}
.or-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 0 0 1.1rem;
}
.or-divider::before, .or-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
.or-divider span { padding: 0 0.75rem; }

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.demo-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 0.85rem;
}
.demo-btn:hover { border-color: var(--accent); }
.demo-btn .label { font-weight: 500; }
.demo-btn .desc { color: var(--text-muted); font-size: 0.75rem; margin-top: 0.2rem; }

#results {
  margin-top: 1.5rem;
  display: none;
}
#results.visible { display: block; }

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.result-table th, .result-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.result-table th { color: var(--text-muted); font-weight: 500; }
.pass-icon { color: var(--green); }
.fail-icon { color: var(--red); }
.skip-icon { color: var(--grey); }

.details-toggle {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
}
.details-content {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-family: monospace;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}
.details-content.open { display: block; }

.notes { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.5rem; }
.notes li { margin-left: 1rem; }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Product-page polish (hero, how-it-works, sections, buttons) ── */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 380px at 50% -120px, rgba(212,175,55,0.22), transparent 70%),
    linear-gradient(180deg, #13201c 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1.5rem 2.5rem;
  text-align: center;
}
/* Faint goddess watermark (user's own art) with a readability overlay */
.hero-art {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(14,22,20,0.62) 0%, rgba(14,22,20,0.78) 60%, rgba(14,22,20,0.92) 100%),
    url('assets/veritas-hero.jpg') center 18% / cover no-repeat;
  opacity: 0.9;
}
/* Sunburst halo drawn in CSS */
.hero-rays {
  position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 760px; height: 760px; z-index: 1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(212,175,55,0.13) 0deg 1.1deg, transparent 1.1deg 7deg);
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 8%, transparent 60%);
          mask: radial-gradient(circle at 50% 50%, #000 8%, transparent 60%);
  opacity: 0.7;
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }
.hero-fact {
  font-size: 0.82rem; font-style: italic; color: var(--text-muted);
  max-width: 540px; margin: 0 auto 1.5rem; line-height: 1.5;
}
.hero-fact strong { color: var(--accent); font-style: normal; }
.brand { font-weight: 700; letter-spacing: 0.18em; font-size: 0.95rem; color: var(--accent); margin-bottom: 1.25rem; }
.hero-title { font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.12; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 1rem; }
.hero-title span { color: var(--accent); display: block; }
.hero-sub { font-size: 1.02rem; color: var(--text-muted); max-width: 620px; margin: 0 auto 1.75rem; }
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.btn { display: inline-block; padding: 0.7rem 1.4rem; border-radius: 8px; font-weight: 600; font-size: 0.92rem; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: transform .05s ease, opacity .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { opacity: 0.92; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-trust { max-width: 620px; margin: 0 auto; }

/* ── Page intro (muted autoplay overview that crossfades to the page) ───────
   Shown only when intro.js adds .intro-pending to <html>; with JS off, the
   intro already seen this session, or reduced-motion, the page renders as
   normal and the overlay stays hidden. Every state is a class toggle — no
   inline styles — so the strict, no-'unsafe-inline' CSP needs no changes. */
.intro {
  position: fixed; inset: 0; z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  padding: 1rem;
  background: radial-gradient(1000px 560px at 50% 42%, #16231f 0%, var(--bg) 78%);
  opacity: 1;
  transition: opacity 0.7s ease;
}
html.intro-pending { overflow: hidden; }
html.intro-pending body { overflow: hidden; }
html.intro-pending .intro { display: flex; }
.intro.is-closing { opacity: 0; pointer-events: none; }

.intro-video {
  width: min(100%, 177.78vh, 1120px);
  aspect-ratio: 16 / 9;
  height: auto;
  display: block;
  background: #000;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(212,175,55,0.18), 0 24px 80px -24px rgba(0,0,0,0.9), 0 0 90px -28px rgba(212,175,55,0.35);
}
.intro-controls {
  position: absolute;
  left: 50%; bottom: clamp(1rem, 5vh, 2.75rem);
  transform: translateX(-50%);
  display: flex; gap: 0.6rem; align-items: center;
}
.intro-btn {
  font: inherit; font-size: 0.84rem; font-weight: 600;
  color: var(--text);
  background: rgba(14,22,20,0.66);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  cursor: pointer;
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  transition: border-color .15s ease, color .15s ease;
}
.intro-btn:hover { border-color: var(--accent); color: var(--accent); }
.intro-skip { color: var(--text-muted); }

/* Hero + content crossfade in as the intro fades out */
html.intro-pending .hero,
html.intro-pending main,
html.intro-pending .site-footer { opacity: 0; }
html.intro-revealing .hero,
html.intro-revealing main,
html.intro-revealing .site-footer { opacity: 1; transition: opacity 0.7s ease; }

/* "Replay the intro" — only works with JS, so hidden until intro.js marks the page ready */
.intro-replay { display: none; background: none; border: none; padding: 0; font: inherit; font-size: 0.72rem; color: var(--accent); cursor: pointer; text-decoration: underline; }
html.intro-js .intro-replay { display: inline; }

/* Reduced motion: intro.js won't auto-open it, and we drop the fades entirely */
@media (prefers-reduced-motion: reduce) {
  .intro,
  html.intro-revealing .hero,
  html.intro-revealing main,
  html.intro-revealing .site-footer { transition: none; }
}

.section { padding: 2.5rem 0; border-bottom: 1px solid var(--border); }
.section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.4rem; }
.section-lead { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.5rem; max-width: 660px; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 0.85rem; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem 1rem; }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(212,175,55,0.16); color: var(--accent); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.6rem; }
.step-n svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.demo-intro { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.layer-guide { margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem 1.25rem; }
.layer-guide h3 { font-size: 0.95rem; margin-bottom: 0.7rem; color: var(--accent); }
.layer-guide ul { list-style: none; display: grid; gap: 0.55rem; }
.layer-guide li { font-size: 0.84rem; color: var(--text-muted); line-height: 1.45; padding-left: 1.1rem; position: relative; }
.layer-guide li::before { content: "\2726"; position: absolute; left: 0; color: var(--accent); }
.layer-guide li strong { color: var(--text); }
.steps h3 { font-size: 0.98rem; margin-bottom: 0.3rem; }
.steps p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; }

/* "Where you've already seen this" — real-world example clips */
.clips { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 1rem; }
.clip { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.clip-frame { aspect-ratio: 16 / 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; text-align: center; text-decoration: none; padding: 1rem; border-bottom: 1px solid var(--border); background: radial-gradient(circle at 50% 35%, rgba(212,175,55,0.10), rgba(212,175,55,0.02) 70%); color: var(--accent); }
a.clip-frame:hover { background: radial-gradient(circle at 50% 35%, rgba(212,175,55,0.18), rgba(212,175,55,0.04) 70%); }
.clip-frame .play { font-size: 1.7rem; line-height: 1; }
.clip-frame .frame-site { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.clip-frame .frame-label { font-size: 0.74rem; color: var(--text-muted); }
.clip-frame.as-note { cursor: default; }
video.clip-frame { display: block; width: 100%; height: auto; padding: 0; aspect-ratio: auto; background: #000; }
.clip-cap { padding: 0.85rem 1rem 1.05rem; font-size: 0.84rem; color: var(--text-muted); line-height: 1.5; }
.clip-cap strong { color: var(--text); }

.try-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.result-legend { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.85rem; }
.result-legend strong { color: var(--text); }

.site-footer { padding: 2.5rem 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.8rem; border-top: 1px solid var(--border); }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-note { margin-top: 0.5rem; font-size: 0.72rem; opacity: 0.8; }
.footer-seal { margin-bottom: 1.1rem; }
.footer-seal img { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; object-position: center 20%; border: 2px solid var(--accent); box-shadow: 0 0 0 5px rgba(212,175,55,0.10); }
.footer-seal figcaption { margin-top: 0.5rem; font-size: 0.72rem; font-style: italic; color: var(--text-muted); }

@media (max-width: 600px) { .hero { padding: 2.75rem 1.25rem 2rem; } }

/* Moved off inline style attributes so the CSP needs no 'unsafe-inline' */
.ta-sm { min-height: 80px; }
.ta-xs { min-height: 60px; }
.row-total { border-top: 2px solid var(--border); }

/* Live Bitcoin-anchor callout */
.real-anchor {
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(212,175,55,0.10), rgba(212,175,55,0.03));
}
.real-anchor > p { font-size: 0.9rem; color: var(--text); margin: 0 0 0.8rem; }
.real-anchor-links { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.real-anchor-links a {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: #1a1208;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}
.real-anchor-links a:hover { background: var(--accent-2); }
.real-anchor-tx {
  font-size: 0.72rem !important;
  color: var(--text-muted) !important;
  margin: 0.85rem 0 0 !important;
  word-break: break-all;
}
.real-anchor-tx code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ── Reveal & verify the original record ── */
.reveal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.2rem 1.4rem;
}
.reveal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 620px) { .reveal-row { grid-template-columns: 1fr; } }
.input-group input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.6rem 0.7rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
}
.input-group input[type="text"]:focus { outline: none; border-color: var(--accent); }
.input-group label .opt { color: var(--grey); font-weight: 400; font-size: 0.72rem; }
.reveal-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.4rem; }
.reveal-result {
  margin-top: 1.1rem;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  background: var(--bg);
}
.reveal-result.match { border-left-color: var(--green); }
.reveal-result.mismatch { border-left-color: var(--red); }
.reveal-result .reveal-headline { margin: 0 0 0.5rem; font-weight: 600; }
.reveal-result.match .reveal-headline { color: var(--green); }
.reveal-result.mismatch .reveal-headline { color: var(--red); }
.reveal-result p { margin: 0.3rem 0; font-size: 0.86rem; color: var(--text); }
.reveal-result a { color: var(--accent); }
.reveal-hash { color: var(--text-muted); }
.reveal-hash span { color: var(--text-muted); }
.reveal-hash code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  color: var(--text);
  word-break: break-all;
}
.reveal-receipt-btn { margin-top: 0.85rem; }

/* ── Do-it-yourself walkthrough (signet anchor) ── */
.walkthrough-steps { list-style: none; counter-reset: wstep; display: grid; gap: 0.7rem; margin-top: 1.5rem; }
.walkthrough-steps li {
  counter-increment: wstep;
  position: relative;
  padding: 0.85rem 1rem 0.9rem 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}
.walkthrough-steps li::before {
  content: counter(wstep);
  position: absolute;
  left: 0.8rem; top: 0.8rem;
  width: 1.55rem; height: 1.55rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(212,175,55,0.16);
  color: var(--accent);
  font-weight: 700; font-size: 0.8rem;
}
.walkthrough-steps code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1rem 0.38rem;
  color: var(--accent-2);
  word-break: break-all;
}
.walkthrough-steps code.cmd { display: block; margin-top: 0.45rem; padding: 0.55rem 0.7rem; white-space: pre-wrap; }
.walkthrough-steps a { color: var(--accent); }
.walkthrough-note { font-size: 0.83rem; color: var(--text-muted); margin-top: 1.1rem; }
.walkthrough-note a { color: var(--accent); }

/* ── Top-level section tabs (declutter: one pane at a time) ──────────────────
   Progressive enhancement: the nav and pane-hiding only switch on once JS has
   set html.intro-js (done in intro.js, before first paint). With JS off, the
   nav is hidden and every pane renders stacked — exactly the old long page. */
.page-tabs { display: none; }
html.intro-js .page-tabs {
  display: flex;
  gap: 0.4rem;
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -1.5rem 1.75rem;          /* bleed to container edges so the bar's bg spans full width when stuck */
  padding: 0.6rem 1.5rem;
  background: rgba(14, 22, 20, 0.92);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;                    /* 5 pills scroll sideways on narrow screens instead of wrapping */
  scrollbar-width: none;
}
html.intro-js .page-tabs::-webkit-scrollbar { display: none; }
.page-tab {
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.page-tab:hover { color: var(--text); border-color: var(--border); }
.page-tab.active { color: #1a1208; background: var(--accent); border-color: var(--accent); }
.page-tab:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Panes: shown all-at-once without JS; one-at-a-time once JS is on. */
html.intro-js .tabpane { display: none; }
html.intro-js .tabpane.active { display: block; }
.tabpane > .section:first-child { padding-top: 1rem; border-top: none; }
.tabpane > .section:last-child { border-bottom: none; }
/* keep section anchors clear of the sticky bar when jumped to */
.section { scroll-margin-top: 4.5rem; }

@media (prefers-reduced-motion: reduce) {
  .page-tab { transition: none; }
}

/* ── "Go deeper" tab: free guide + the book ── */
.deeper-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  align-items: stretch;
}
.deeper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.deeper-card h3 { color: var(--accent-2); font-size: 1.05rem; }
.deeper-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.deeper-card > p, .deeper-book-row p { color: var(--text); font-size: 0.95rem; }
.deeper-card .btn { align-self: flex-start; }
.deeper-book-row { display: flex; gap: 1.1rem; align-items: flex-start; }
.deeper-cover {
  width: 118px;
  flex: 0 0 auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.deeper-note { font-size: 0.8rem; color: var(--text-muted); }
.deeper-note a { color: var(--accent-2); }
@media (max-width: 760px) {
  .deeper-grid { grid-template-columns: 1fr; }
  .deeper-cover { width: 96px; }
}
