/* =============================================================================
 * gold.css — Conceptual Health® Gold Standard design system
 *
 * The single shared visual system for the gold site rewrite. The Standard
 * page uses it; Home, Verify, and Domains pages reuse it. Self-contained
 * (no external CDNs / fonts — CSP-safe), responsive, fast.
 *
 * Aesthetic of record: the calm holding-page family —
 *   deep green-black grounds (#0c1612 / #16201b), cream daylight sections
 *   (#faf9f6), emerald (#2ed5a0) as the single live/verify accent, forest
 *   green (#1f7a52) for quiet labels, warm gold (#b08d3c) for "pending".
 * Tokens are aligned 1:1 with ch-site.css so the two systems flow as one.
 * =========================================================================== */

:root {
  /* ── Ground + ink ─────────────────────────────────────────────────── */
  --g-deep:    #0c1612;   /* deepest ground (hero, footer)               */
  --g-deep-2:  #0f1613;   /* raised dark surface (cards on dark)         */
  --g-ink:     #16201b;   /* near-black green ink (body text on light)   */
  --g-cream:   #faf9f6;   /* daylight section ground                     */
  --g-surface: #ffffff;   /* card surface on light                       */
  --g-surface-2:#f3f1ea;  /* sunken surface on light                     */

  /* ── Text ────────────────────────────────────────────────────────── */
  --g-soft:    #46514b;   /* secondary ink on light                      */
  --g-soft-3:  #6b7770;   /* tertiary / captions on light                */
  --g-on-deep:    #eef6f1;/* primary text on dark                        */
  --g-on-deep-2:  #c7d8cf;/* secondary text on dark                      */
  --g-on-deep-3:  #9fb6ab;/* tertiary text on dark                       */

  /* ── Accents ─────────────────────────────────────────────────────── */
  --g-bright:  #2ed5a0;   /* emerald — the LIVE / verify accent          */
  --g-green:   #1f7a52;   /* forest — quiet labels, calm CTAs            */
  --g-gold:    #b08d3c;   /* warm gold — "patent-pending", halo          */
  --g-coral:   #b23a2e;   /* deficit / low band                          */

  /* ── Lines ───────────────────────────────────────────────────────── */
  --g-line:      #e7e4dc;            /* hairline on light                */
  --g-line-dark: #1c3329;            /* hairline on dark                 */
  --g-line-em:   rgba(46,213,160,.22);/* emerald hairline                */

  /* ── Type ────────────────────────────────────────────────────────── */
  --g-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --g-serif: "Fraunces", "Newsreader", Georgia, "Times New Roman", serif;
  --g-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* ── Rhythm ──────────────────────────────────────────────────────── */
  --g-maxw: 1120px;
  --g-pad: 24px;
  --g-radius: 18px;
  --g-radius-sm: 12px;
  --g-radius-pill: 999px;

  /* aliases so engine-page inline styles using --accent / --ink / --rule
     resolve to the gold system without touching the frozen calculator. */
  --accent: var(--g-green);
  --accent-halo: var(--g-gold);
  --ink: var(--g-ink);
  --ink-2: var(--g-soft);
  --ink-3: var(--g-soft-3);
  --rule: var(--g-line);
  --surface: var(--g-surface);
  --surface-2: var(--g-surface-2);
  --bg: var(--g-cream);
  --font-display: var(--g-serif);
  --font-sans: var(--g-sans);
  --font-mono: var(--g-mono);
  --font-equation: var(--g-serif);
}

* { box-sizing: border-box; }

.g-body {
  margin: 0;
  font-family: var(--g-sans);
  color: var(--g-ink);
  background: var(--g-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Layout primitives ──────────────────────────────────────────────── */
.g-wrap { max-width: var(--g-maxw); margin: 0 auto; padding: 0 var(--g-pad); }
.g-wrap--wide { max-width: 1280px; }

.g-section { padding: 96px 0; }
.g-section--tight { padding: 64px 0; }
.g-section--cream { background: var(--g-cream); }
.g-section--deep { background: var(--g-deep); color: var(--g-on-deep); }
@media (max-width: 720px) { .g-section, .g-section--tight { padding: 56px 0; } }

/* ── Nav ────────────────────────────────────────────────────────────── */
.g-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,249,246,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--g-line);
}
.g-nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 12px var(--g-pad);
  display: flex; align-items: center; gap: 22px;
}
.g-nav-brand {
  display: inline-flex; align-items: center; gap: 11px;
  font: 800 16px/1 var(--g-sans); letter-spacing: -.01em;
  color: var(--g-ink); text-decoration: none;
}
.g-nav-mark {
  width: 28px; height: 28px; flex: 0 0 auto;
  background: url('/assets/logo-mark.svg?v=20260520-a3b') no-repeat center / contain;
}
.g-nav-links { display: flex; gap: 4px; margin-left: 8px; }
.g-nav-links a {
  padding: 7px 12px; border-radius: 10px;
  font: 600 13.5px/1 var(--g-sans); letter-spacing: -.005em;
  color: var(--g-soft); text-decoration: none; white-space: nowrap;
  transition: color .12s, background .12s;
}
.g-nav-links a:hover { color: var(--g-green); background: rgba(31,122,82,.07); }
.g-nav-links a.is-active { color: var(--g-green); }
.g-nav-sp { margin-left: auto; }
.g-nav-cta {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px; border-radius: var(--g-radius-pill);
  background: var(--g-green); color: #fff; text-decoration: none;
  font: 700 13px/1 var(--g-sans); letter-spacing: -.005em; white-space: nowrap;
  transition: filter .12s, transform .12s;
}
.g-nav-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.g-nav-cta--ghost { background: transparent; color: var(--g-ink); border: 1px solid var(--g-line); }
.g-nav-cta--ghost:hover { border-color: var(--g-soft-3); background: var(--g-surface); }
@media (max-width: 860px) { .g-nav-links { display: none; } }
/* Phone header: below 600px tighten gaps, drop the wordmark text to the logo mark, and compact the
 * CTAs so brand-mark + Verify pill + Sign in + primary CTA fit without horizontal scroll. */
@media (max-width: 600px) {
  .g-nav-inner { gap: 9px; padding: 10px 14px; }
  .g-nav-brand span:not(.g-nav-mark) { display: none; } /* keep the logo mark, drop only the wordmark text */
  .g-nav-cta { padding: 8px 12px; font-size: 12px; gap: 5px; }
  .g-nav-cta--ghost { padding: 8px 11px; }
}
@media (max-width: 374px) { .g-nav-cta--ghost { display: none; } } /* tiniest phones: keep primary CTA + pill */

/* Skip-to-content link for keyboard / screen-reader users — visually hidden until focused. */
.g-skip { position: absolute; left: 8px; top: -64px; z-index: 10000; background: var(--g-green); color: #fff;
  padding: 10px 16px; border-radius: 10px; font: 700 14px var(--g-sans); text-decoration: none; transition: top .15s ease; }
.g-skip:focus { top: 8px; outline: 3px solid #fff; outline-offset: 2px; }

/* ── Type scale ─────────────────────────────────────────────────────── */
.g-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font: 700 12.5px/1 var(--g-sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--g-bright); margin: 0 0 18px;
}
.g-eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--g-bright); box-shadow: 0 0 0 4px rgba(46,213,160,.18);
}
.g-eyebrow--quiet { color: var(--g-green); }
.g-eyebrow--quiet::before { background: var(--g-green); box-shadow: 0 0 0 4px rgba(31,122,82,.16); }

.g-h1 {
  font: 800 clamp(36px,5.4vw,62px)/1.03 var(--g-sans);
  letter-spacing: -.022em; margin: 0 0 22px; max-width: 18ch; text-wrap: balance;
}
.g-h1 em { font-style: normal; color: var(--g-bright); }
.g-section--cream .g-h1 em, .g-body .g-h1 em { color: var(--g-green); }
.g-section--deep .g-h1 em { color: var(--g-bright); }

.g-h2 { font: 800 clamp(26px,3.5vw,40px)/1.08 var(--g-sans); letter-spacing: -.018em; margin: 0 0 16px; max-width: 24ch; text-wrap: balance; }
.g-h3 { font: 700 20px/1.25 var(--g-sans); letter-spacing: -.01em; margin: 0 0 8px; }
.g-kick { font: 700 12.5px/1 var(--g-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--g-green); margin: 0 0 16px; }
.g-section--deep .g-kick { color: var(--g-bright); }
.g-lede { font: 400 clamp(17px,2vw,20px)/1.55 var(--g-sans); color: var(--g-soft); max-width: 54ch; margin: 0 0 28px; text-wrap: pretty; }
.g-section--deep .g-lede { color: var(--g-on-deep-2); }
.g-lede b, .g-lede strong { color: var(--g-ink); font-weight: 700; }
.g-section--deep .g-lede b { color: var(--g-on-deep); }
.g-sub { font: 17px/1.6 var(--g-sans); color: var(--g-soft); max-width: 62ch; margin: 0 0 36px; }
.g-section--deep .g-sub { color: var(--g-on-deep-2); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.g-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.g-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 14px; padding: 14px 26px;
  font: 700 15px/1 var(--g-sans); text-decoration: none; border: 1px solid transparent;
  cursor: pointer;
  transition: transform .14s, box-shadow .14s, border-color .14s, background .14s, filter .14s;
}
.g-btn:hover { transform: translateY(-2px); }
.g-btn:active { transform: translateY(0); }
.g-btn--primary {
  background: var(--g-bright); color: #05140d;
  box-shadow: 0 14px 34px -12px rgba(46,213,160,.6);
}
.g-btn--primary:hover { box-shadow: 0 20px 44px -12px rgba(46,213,160,.72); }
.g-btn--solid { background: var(--g-ink); color: #fff; }
.g-btn--solid:hover { background: var(--g-green); }
.g-btn--ghost { background: transparent; color: var(--g-ink); border-color: var(--g-line); }
.g-btn--ghost:hover { border-color: var(--g-soft-3); background: var(--g-surface); }
/* Legible ghost button on ANY dark ground: deep sections, the on-dark hook, and every hero
 * ([class*="hero"] catches home-hero/dom-hero/vh-hero/std-hero/ax-hero/trust-hero/pat-hero/
 * how-hero/ab-hero/rw-hero/gs-hero + any future hero — all heroes are dark-ground by design).
 * Without this the base ghost uses --g-ink (near-black) → unreadable until hover. */
.g-section--deep .g-btn--ghost, .g-on-dark .g-btn--ghost, [class*="hero"] .g-btn--ghost { background: rgba(255,255,255,.08); color: #eef3f9; border-color: rgba(255,255,255,.5); }
.g-section--deep .g-btn--ghost:hover, .g-on-dark .g-btn--ghost:hover, [class*="hero"] .g-btn--ghost:hover { border-color: rgba(46,213,160,.7); background: rgba(255,255,255,.14); }

/* ── Verify chip (the recurring "don't trust us — verify" affordance) ── */
.g-vhint {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 12px/1.2 var(--g-sans); letter-spacing: .02em; color: var(--g-bright);
  background: rgba(46,213,160,.08); border: 1px solid rgba(46,213,160,.28);
  border-radius: var(--g-radius-pill); padding: 8px 16px;
}
.g-vhint::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--g-bright); box-shadow: 0 0 0 4px rgba(46,213,160,.18);
  animation: g-pulse 2.4s ease-in-out infinite;
}
@keyframes g-pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(46,213,160,.18); } 50% { box-shadow: 0 0 0 7px rgba(46,213,160,.06); } }
@media (prefers-reduced-motion: reduce) { .g-vhint::before { animation: none; } }

/* ── Pills ──────────────────────────────────────────────────────────── */
.g-pill {
  display: inline-block; font: 700 11.5px/1 var(--g-sans);
  border-radius: var(--g-radius-pill); padding: 7px 14px; border: 1px solid;
}
.g-pill--pending { background: rgba(176,141,60,.12); color: #8a6c1f; border-color: rgba(176,141,60,.35); }
.g-pill--live    { background: rgba(46,213,160,.10); color: #0f7a55; border-color: rgba(46,213,160,.34); }
.g-pill--green   { background: rgba(31,122,82,.10); color: var(--g-green); border-color: rgba(31,122,82,.3); }

/* ── Cards ──────────────────────────────────────────────────────────── */
.g-grid { display: grid; gap: 24px; }
.g-grid--2 { grid-template-columns: repeat(2, 1fr); }
.g-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .g-grid--2, .g-grid--3 { grid-template-columns: 1fr; } }

.g-card {
  position: relative; overflow: hidden;
  background: var(--g-surface); border: 1px solid var(--g-line-em);
  border-radius: var(--g-radius); padding: 30px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 24px 50px -36px rgba(12,22,18,.3);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.g-card:hover { transform: translateY(-3px); border-color: rgba(46,213,160,.5); box-shadow: 0 28px 56px -32px rgba(46,213,160,.38); }
.g-card--bar::before {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--g-bright), var(--g-green));
}
.g-card-label { font: 700 11px/1 var(--g-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--g-green); margin: 0 0 10px; }
.g-card h3 { margin: 0 0 8px; font-size: 19px; }
.g-card p { margin: 0; color: var(--g-soft); line-height: 1.55; font-size: 15px; }

/* Verify-card variant — dark tile on any ground, links to a live proof. */
.g-vcard {
  display: block; background: var(--g-deep-2); border: 1px solid var(--g-line-dark);
  border-radius: 16px; padding: 32px; text-decoration: none;
  transition: transform .14s, border-color .14s, box-shadow .14s;
}
.g-vcard:hover { transform: translateY(-4px); border-color: var(--g-bright); box-shadow: 0 24px 50px -32px rgba(46,213,160,.5); }
.g-vcard .n { font: 700 12px/1 var(--g-mono); color: var(--g-bright); letter-spacing: .06em; }
.g-vcard h3 { color: #fff; margin: 10px 0 6px; font-size: 18px; }
.g-vcard p { color: var(--g-on-deep-2); margin: 0; font-size: 14px; line-height: 1.5; }

/* ── Equation display ───────────────────────────────────────────────── */
.g-eq {
  font: 600 clamp(19px,2.7vw,28px)/1.3 var(--g-serif);
  letter-spacing: -.01em; color: var(--g-ink);
}
.g-section--deep .g-eq { color: var(--g-on-deep); }
.g-eq sup { font-size: .58em; }

/* ── Stat ───────────────────────────────────────────────────────────── */
.g-stat { padding: 24px; border: 1px solid var(--g-line); border-radius: var(--g-radius-sm); background: var(--g-surface); }
.g-stat-val { font: 800 36px/1 var(--g-sans); letter-spacing: -.02em; color: var(--g-ink); }
.g-stat-label { font: 700 11px/1 var(--g-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--g-green); margin-top: 10px; }
.g-stat-sub { color: var(--g-soft-3); font-size: 13px; margin-top: 6px; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.g-footer { background: var(--g-deep); color: var(--g-on-deep-2); padding: 56px 0; font-size: 13px; }
.g-footer a { color: var(--g-bright); text-decoration: none; }
.g-footer a:hover { text-decoration: underline; }
.g-footer-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.g-footer b { color: #eafff5; }

/* ── Skip link (a11y) ───────────────────────────────────────────────── */
.g-skip { position: absolute; left: -9999px; top: 0; background: var(--g-ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 300; }
.g-skip:focus { left: 0; }

/* ── Focus visibility ───────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--g-bright); outline-offset: 2px; border-radius: 4px; }

/* =============================================================================
 * GOLD VERIFIABILITY LAYER — design-system affordance (ch-page-verify.js).
 * Every gold page that loads /_shared/ch-verify-boot.js inherits this for free:
 * the header VERIFY pill, per-element/per-color recompute panel, live footer
 * verdict, and the "verify this page" paint. Honest states only — a green
 * VERIFIED is shown ONLY where the browser actually recomputed a matching hash.
 * Self-contained, CSP-safe, reduced-motion aware, AA contrast.
 * ========================================================================== */

/* ── Header pill + "verify this page" action ─────────────────────────────── */
.g-nav-verify-slot { display: inline-flex; align-items: center; gap: 8px; }
.chpv-toggle {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid rgba(46,213,160,.40); border-radius: var(--g-radius-pill);
  padding: 7px 13px; font: 700 12px/1 var(--g-sans); letter-spacing: .01em;
  color: var(--g-green); background: rgba(46,213,160,.08);
  transition: background .12s, border-color .12s, color .12s;
}
.chpv-toggle:hover { background: rgba(46,213,160,.14); border-color: var(--g-bright); }
.chpv-toggle .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--g-bright);
  box-shadow: 0 0 0 3px rgba(46,213,160,.20);
}
.chpv-toggle.off { color: var(--g-soft-3); border-color: var(--g-line); background: var(--g-surface-2); }
.chpv-toggle.off .dot { background: var(--g-soft-3); box-shadow: none; }
.chpv-all {
  display: inline-flex; align-items: center; cursor: pointer;
  border: 1px solid var(--g-green); border-radius: var(--g-radius-pill);
  padding: 7px 14px; font: 700 12px/1 var(--g-sans);
  color: #fff; background: var(--g-green); transition: filter .12s, transform .12s;
}
.chpv-all:hover { filter: brightness(1.08); transform: translateY(-1px); }
.chpv-all[disabled] { opacity: .6; cursor: progress; transform: none; }
@media (max-width: 720px) { .chpv-all { display: none; } } /* keep header tidy on small screens */

/* On dark grounds (some pages mount the pill over a deep nav) keep contrast. */
.g-section--deep .chpv-toggle, .home-hero .chpv-toggle { color: var(--g-bright); }

/* ── Hover-outline for verifiable nodes (when verification is ON) ────────── */
html:not(.chpv-off) [data-ch-id]:hover,
html:not(.chpv-off) [data-ch-asset]:hover,
html:not(.chpv-off) [data-ch-token]:hover {
  outline: 2px dashed rgba(46,213,160,.55); outline-offset: 3px;
  border-radius: 4px; cursor: pointer;
}

/* ── Verdict pills (used in panel, footer, hub) ──────────────────────────── */
.chpv-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 800 11px/1 var(--g-mono); letter-spacing: .06em; text-transform: uppercase;
  border-radius: var(--g-radius-pill); padding: 6px 11px; border: 1px solid;
}
.chpv-ok   { color: #0f7a55; background: rgba(46,213,160,.12); border-color: rgba(46,213,160,.42); }
.chpv-bad  { color: var(--g-coral); background: rgba(178,58,46,.10); border-color: rgba(178,58,46,.40); }
.chpv-pend { color: #8a6c1f; background: rgba(176,141,60,.12); border-color: rgba(176,141,60,.40); }

/* ── The recompute panel (per-element / per-color) ───────────────────────── */
.chpv-ov {
  position: fixed; inset: 0; z-index: 9500; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(6,16,12,.62);
}
.chpv-ov.open { display: flex; }
.chpv-card {
  background: var(--g-surface); border: 1px solid var(--g-line);
  border-radius: var(--g-radius); max-width: 560px; width: 100%;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.45); overflow: hidden;
  font-family: var(--g-sans);
}
.chpv-card header {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; background: var(--g-deep);
}
.chpv-card header h3 { margin: 0; font: 700 14px/1.2 var(--g-sans); color: var(--g-on-deep); }
.chpv-x { margin-left: auto; cursor: pointer; background: none; border: 0; color: var(--g-on-deep-3); font-size: 22px; line-height: 1; }
.chpv-x:hover { color: #fff; }
.chpv-body { padding: 16px 18px 18px; }
.chpv-verdict { margin: 0 0 12px; }
.chpv-run { color: var(--g-soft); font-size: 14px; }
.chpv-kv { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--g-line); font-size: 13px; }
.chpv-kv span { color: var(--g-soft-3); min-width: 150px; }
.chpv-kv b { color: var(--g-ink); word-break: break-word; }
.chpv-kv code { color: var(--g-green); font: 500 11.5px/1.5 var(--g-mono); word-break: break-all; }
.chpv-note { margin: 14px 0 0; font: 13.5px/1.6 var(--g-sans); color: var(--g-soft); }
.chpv-note b { color: var(--g-ink); }
.chpv-note a, .chpv-go { color: var(--g-green); font-weight: 700; }
.chpv-go { display: inline-block; margin-top: 14px; text-decoration: none; }
.chpv-go:hover { text-decoration: underline; }

/* ── Footer live verdict ─────────────────────────────────────────────────── */
.chpv-footline {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14);
  font: 500 12px/1.5 var(--g-mono); color: var(--g-on-deep-3);
}
.chpv-footline code { color: var(--g-bright); }
.chpv-footline b { color: #eafff5; }
.chpv-footline a { color: var(--g-bright); text-decoration: none; }
.chpv-footline a:hover { text-decoration: underline; }

/* ── "Verify this page" paint ────────────────────────────────────────────── */
.chpv-ok-box   { outline: 2px solid rgba(46,213,160,.65) !important; outline-offset: 3px; border-radius: 4px; transition: outline .2s; }
.chpv-bad-box  { outline: 2px solid var(--g-coral) !important; outline-offset: 3px; border-radius: 4px; }
.chpv-pend-box { outline: 2px dashed rgba(176,141,60,.6) !important; outline-offset: 3px; border-radius: 4px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.chpv-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(14px);
  z-index: 9600; max-width: 92vw;
  background: var(--g-deep); color: var(--g-on-deep); border: 1px solid var(--g-line-em);
  border-radius: var(--g-radius-pill); padding: 11px 20px;
  font: 600 13px/1.3 var(--g-sans); box-shadow: 0 20px 50px -20px rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.chpv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .chpv-toast, .chpv-all, .chpv-toggle, .chpv-ok-box { transition: none; }
}
