/* ==========================================================================
   CLARITY PRODUCTS — page-family layer for the dark product pages
   (/clarity-secure/, /clarity-conserve/). Loads after zaon-nav.css.
   Requires <html class="zn-dark-product"> (token scope in zaon-tokens.css).
   All color via tokens: purple = interaction, green/amber/red = status.
   ========================================================================== */

/* ---- fixed-dark chrome: white logo, no theme toggle (page is dark by design) */
html.zn-dark-product .zn-logo-light { display: none; }
html.zn-dark-product .zn-logo-dark  { display: block; }
html.zn-dark-product #zn-theme      { display: none; }
html.zn-dark-product body { background: var(--bg); }

/* ---- hero ------------------------------------------------------------- */
.cp-hero {
  position: relative;
  padding: calc(var(--nav-height) + 72px) 0 56px;
  background:
    radial-gradient(1100px 480px at 78% -10%, rgba(139,92,246,.16) 0%, transparent 65%),
    var(--bg);
  overflow: hidden;
}
.cp-hero .container { position: relative; z-index: 1; }
.cp-hero-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); gap: 56px; align-items: center; }
.cp-eyebrow {
  display: inline-block; font-family: var(--mono); font-size: .8rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--link); margin-bottom: 18px;
}
.cp-h1 {
  font-family: var(--display); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(2.1rem, 4.4vw, 3.4rem); line-height: 1.08; color: var(--ink); margin: 0 0 22px;
}
.cp-sub { font-size: 1.16rem; line-height: 1.65; color: var(--ink-soft); max-width: 34em; margin: 0 0 30px; }
.cp-sub strong { color: var(--ink); font-weight: 640; }
.cp-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* trust strip */
.cp-trust {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 34px;
  padding-top: 22px; border-top: 1px solid var(--line);
}
.cp-trust span { font-size: .84rem; color: var(--ink-faint); display: inline-flex; align-items: center; gap: 8px; }
.cp-trust span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---- sections --------------------------------------------------------- */
.cp-section { padding: 84px 0; }
.cp-section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cp-kicker { font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--link); margin-bottom: 14px; }
.cp-h2 {
  font-family: var(--display); font-weight: 680; letter-spacing: -.015em;
  font-size: clamp(1.5rem, 2.6vw, 2.15rem); line-height: 1.2; color: var(--ink); margin: 0 0 18px; max-width: 26em;
}
.cp-body { color: var(--ink-soft); line-height: 1.7; max-width: 46em; }
.cp-body strong { color: var(--ink); font-weight: 640; }
.cp-body a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

/* pull quote */
.cp-pull {
  margin: 40px 0 0; padding: 22px 26px; border-left: 3px solid var(--accent);
  background: var(--accent-wash); border-radius: 0 var(--r) var(--r) 0;
  font-family: var(--display); font-size: 1.14rem; line-height: 1.55; color: var(--ink); max-width: 42em;
}

/* card grid */
.cp-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; margin-top: 40px; }
.cp-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 24px; box-shadow: var(--shadow);
}
.cp-card h3 { font-family: var(--display); font-size: 1.06rem; font-weight: 660; color: var(--ink); margin: 0 0 12px; line-height: 1.35; }
.cp-card p { font-size: .95rem; line-height: 1.65; color: var(--ink-soft); margin: 0; }
.cp-card p em { font-style: italic; color: var(--ink); }

/* two-column example (sent vs happened) */
.cp-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 24px; margin-top: 40px; align-items: start; }
.cp-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.cp-panel-label { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; }
.cp-panel blockquote { margin: 0; font-size: 1.02rem; line-height: 1.65; color: var(--ink); border-left: 3px solid var(--conflict); padding-left: 16px; }

/* monospace machine-response block */
.cp-mono {
  font-family: var(--mono); font-size: .84rem; line-height: 1.66; color: var(--ink);
  background: var(--bg-deep); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 20px 22px; margin: 0; overflow-x: auto; white-space: pre;
}
.cp-mono .ok  { color: var(--verified); }
.cp-mono .ref { color: var(--conflict); }
.cp-mono .dim { color: var(--ink-faint); }

/* tables */
.cp-scroll { overflow-x: auto; margin-top: 36px; }
.cp-table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 560px; }
.cp-table th, .cp-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.6; }
.cp-table th { font-family: var(--display); font-weight: 640; color: var(--ink); white-space: nowrap; }
.cp-table td { color: var(--ink-soft); }
.cp-table td strong { color: var(--ink); }
.cp-table .num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.3rem; color: var(--ink); font-weight: 640; }
.cp-chip {
  display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 9999px; white-space: nowrap;
}
.cp-chip.now  { color: var(--verified); background: var(--verified-wash); border: 1px solid var(--verified-line); }

/* full-width stat band */
.cp-band {
  margin-top: 56px; padding: 52px 32px; text-align: center;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-deep) 100%);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cp-band .figure {
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700;
  font-size: clamp(1.7rem, 5.4vw, 3.6rem); letter-spacing: -.01em; color: var(--ink); line-height: 1.15;
}
.cp-band .figure .arrow { color: var(--accent); padding: 0 .25em; }
.cp-band .figure .out { color: var(--attention); }
.cp-band .caption { margin-top: 14px; color: var(--ink-soft); font-size: 1rem; }

/* fact list (fails-safe bullets) */
.cp-facts { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 18px; max-width: 52em; }
.cp-facts li { padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink-soft); line-height: 1.65; }
.cp-facts li strong { color: var(--ink); }

/* not-yet-available */
.cp-notyet { border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 36px; background: var(--bg-2); }
.cp-notyet ul { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; }
.cp-notyet li { display: flex; gap: 14px; color: var(--ink-soft); line-height: 1.65; }
.cp-notyet li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: .55em; border-radius: 50%; border: 1.5px solid var(--attention); }
.cp-notyet li strong { color: var(--ink); }

/* ordered steps */
.cp-steps { counter-reset: cp; list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; max-width: 46em; }
.cp-steps li { counter-increment: cp; display: flex; gap: 16px; color: var(--ink-soft); line-height: 1.65; }
.cp-steps li::before {
  content: counter(cp); flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-wash); border: 1px solid var(--accent-line); color: var(--link);
  font-family: var(--mono); font-size: .82rem; display: grid; place-items: center; margin-top: .1em;
}
.cp-steps strong { color: var(--ink); }

/* CTA closer */
.cp-closer { text-align: center; padding: 96px 0; background: radial-gradient(700px 340px at 50% 0%, rgba(139,92,246,.14) 0%, transparent 70%), var(--bg-deep); border-top: 1px solid var(--line); }
.cp-closer .cp-h2 { max-width: none; }
.cp-closer .cp-body { margin: 0 auto 32px; }
.cp-closer .cp-cta { justify-content: center; }

/* ==========================================================================
   VIGNETTES — HTML/CSS interpretations of the spec's image prompts.
   Abstract, token-driven, no rasters. role="img" + aria-label on the root.
   ========================================================================== */
.cpv { position: relative; border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(160deg, var(--bg-2) 0%, var(--bg-deep) 100%); box-shadow: var(--shadow-lift); overflow: hidden; }

/* -- Secure hero: message panel stopped at a light gate on a rail -------- */
.cpv-gate { height: 320px; }
.cpv-gate .rail { position: absolute; left: 6%; right: 6%; top: 58%; height: 2px; background: linear-gradient(90deg, transparent, var(--line-2) 12%, var(--line-2) 88%, transparent); }
.cpv-gate .rail::after { content: ""; position: absolute; left: 0; right: 34%; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent-line)); }
.cpv-gate .gatebar { position: absolute; left: 62%; top: 16%; bottom: 16%; width: 3px; border-radius: 2px; background: linear-gradient(180deg, transparent, var(--accent) 24%, var(--accent) 76%, transparent); box-shadow: 0 0 26px 5px var(--accent-wash); }
.cpv-gate .msg {
  position: absolute; left: 22%; top: 34%; width: 34%; padding: 14px;
  background: var(--bg-glass); border: 1px solid var(--line-2); border-radius: 10px;
  backdrop-filter: blur(3px); transform: rotate(-1.4deg);
  box-shadow: var(--shadow);
}
.cpv-gate .msg i { display: block; height: 5px; border-radius: 3px; background: var(--fill); margin: 6px 0; }
.cpv-gate .msg i:nth-child(1) { width: 62%; }
.cpv-gate .msg i:nth-child(2) { width: 88%; }
.cpv-gate .msg i:nth-child(3) { width: 74%; }
.cpv-gate .seal {
  position: absolute; left: 57.4%; top: 44%; width: 16px; height: 16px; border-radius: 50%;
  background: var(--attention-wash); border: 1.6px solid var(--attention);
  box-shadow: 0 0 14px 2px var(--attention-wash);
}
.cpv-gate .past { position: absolute; left: 68%; right: 8%; top: 58%; height: 2px; }

/* -- Secure triptych internals ------------------------------------------ */
.cpv-sq { aspect-ratio: 1; margin-bottom: 20px; }
.cpv-seam .pane { position: absolute; inset: 18% 22% 26% 16%; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-glass); }
.cpv-seam .pane.b { inset: 26% 14% 18% 24%; }
.cpv-seam .seamline { position: absolute; left: 30%; right: 26%; top: 52%; height: 2px; background: var(--attention); box-shadow: 0 0 12px 2px var(--attention-wash); border-radius: 2px; }
.cpv-glyphs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 9%; padding: 16%; align-content: center; }
.cpv-glyphs i { aspect-ratio: 1; border-radius: 2px; background: var(--fill); opacity: .8; }
.cpv-glyphs i.key { background: var(--attention); border-radius: 50% 50% 2px 2px; box-shadow: 0 0 12px 2px var(--attention-wash); opacity: 1; }
.cpv-raking { padding: 18% 16%; display: grid; gap: 9%; align-content: center; }
.cpv-raking i { display: block; height: 5px; border-radius: 3px; background: var(--fill); }
.cpv-raking i.hid { height: 3px; width: 58%; background: var(--accent-line); box-shadow: 0 0 10px 1px var(--accent-wash); justify-self: end; }

/* -- Secure: closed gate + orderly queue -------------------------------- */
.cpv-queue { height: 240px; }
.cpv-queue .door { position: absolute; left: 58%; top: 12%; bottom: 12%; width: 12px; border-radius: 4px; background: linear-gradient(180deg, var(--card-hover), var(--card)); border: 1px solid var(--line-2); }
.cpv-queue .door::after { content: ""; position: absolute; left: -3px; top: 6%; bottom: 6%; width: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 16px 3px var(--accent-wash); }
.cpv-queue .q { position: absolute; top: 38%; height: 26%; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-glass); }
.cpv-queue .q1 { left: 36%; width: 16%; opacity: .95; }
.cpv-queue .q2 { left: 22%; width: 14%; opacity: .65; }
.cpv-queue .q3 { left: 10%; width: 12%; opacity: .4; }

/* -- Secure: verified lattice → gate ------------------------------------ */
.cpv-lattice { height: 260px; }
.cpv-lattice .node { position: absolute; width: 15%; aspect-ratio: 4/3; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-glass); }
.cpv-lattice .node::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--verified); box-shadow: 0 0 10px 1px var(--verified-wash); }
.cpv-lattice .thread { position: absolute; left: 34%; right: 12%; top: 38%; height: 2px; background: linear-gradient(90deg, var(--verified-line), var(--accent)); transform: rotate(-6deg); }
.cpv-lattice .gateend { position: absolute; right: 9%; top: 22%; height: 34%; width: 3px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 20px 4px var(--accent-wash); }

/* -- Conserve hero: eight receding panels, seven dissolving ------------- */
.cpv-eight { height: 320px; }
.cpv-eight .p {
  position: absolute; top: 20%; height: 52%; width: 22%; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--bg-glass);
}
.cpv-eight .p i { display: block; height: 4px; border-radius: 2px; background: var(--fill); margin: 12% 14% 0; }
.cpv-eight .p i + i { width: 68%; }
.cpv-eight .measure { position: absolute; left: 6%; right: 6%; bottom: 14%; height: 2px; background: var(--accent-line); }
.cpv-eight .measure i { position: absolute; top: -3px; width: 1.5px; height: 8px; background: var(--accent-line); }
.cpv-eight .measure i:nth-child(1){left:12%} .cpv-eight .measure i:nth-child(2){left:24%}
.cpv-eight .measure i:nth-child(3){left:36%} .cpv-eight .measure i:nth-child(4){left:48%}
.cpv-eight .measure i:nth-child(5){left:60%} .cpv-eight .measure i:nth-child(6){left:72%}
.cpv-eight .measure i:nth-child(7){left:84%}

/* -- Conserve: shared floor, not a growth curve ------------------------- */
.cpv-floor { height: 300px; }
.cpv-floor .col { position: absolute; bottom: 16%; width: 8.4%; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--card-hover), var(--card)); border: 1px solid var(--line-2); border-bottom: none; }
.cpv-floor .col i { position: absolute; left: -1px; right: -1px; top: -1px; border-radius: 4px 4px 0 0; background: var(--accent-wash); border: 1px solid var(--accent-line); }
.cpv-floor .plane { position: absolute; left: 4%; right: 4%; bottom: calc(16% + 118px); height: 2px; background: var(--accent); box-shadow: 0 0 16px 3px var(--accent-wash); }
.cpv-floor .base { position: absolute; left: 0; right: 0; bottom: 16%; height: 1px; background: var(--line-2); }

/* -- Conserve: stack → aperture → slivers ------------------------------- */
.cpv-extract { height: 240px; }
.cpv-extract .stack { position: absolute; left: 8%; top: 22%; width: 30%; height: 56%; }
.cpv-extract .stack i { position: absolute; inset: 0; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-glass); }
.cpv-extract .stack i:nth-child(2) { transform: translate(7px,-7px); opacity: .7; }
.cpv-extract .stack i:nth-child(3) { transform: translate(14px,-14px); opacity: .45; }
.cpv-extract .aperture { position: absolute; left: 50%; top: 26%; bottom: 26%; width: 2px; background: var(--accent); box-shadow: 0 0 18px 4px var(--accent-wash); border-radius: 2px; }
.cpv-extract .sliver { position: absolute; height: 12%; width: 26%; border: 1px solid var(--line-2); border-radius: 5px; background: var(--card-2); }
.cpv-extract .sliver::after { content: ""; position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--verified); }
.cpv-extract .s1 { left: 62%; top: 24%; } .cpv-extract .s2 { left: 66%; top: 44%; } .cpv-extract .s3 { left: 62%; top: 64%; }

/* -- Conserve: instrument gauge ----------------------------------------- */
.cpv-gauge { height: 240px; }
.cpv-gauge .dial { position: absolute; left: 50%; top: 58%; transform: translate(-50%,-50%); width: 170px; height: 170px; border-radius: 50%; border: 1px solid var(--line-2); background: radial-gradient(circle at 38% 30%, var(--card-hover), var(--bg-deep) 72%); box-shadow: var(--shadow-lift); }
.cpv-gauge .dial::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 1px solid var(--line); }
.cpv-gauge .needle { position: absolute; left: 50%; top: 58%; width: 74px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px 2px var(--accent-wash); transform-origin: 0 50%; transform: rotate(-64deg); }
.cpv-gauge .pivot { position: absolute; left: 50%; top: 58%; transform: translate(-50%,-50%); width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 960px) {
  .cp-hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .cp-cards { grid-template-columns: 1fr; }
  .cp-split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cp-section { padding: 60px 0; }
  .cp-band { padding: 40px 18px; }
  .cp-notyet { padding: 24px 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .cpv-gate .gatebar, .cpv-queue .door::after { animation: cpv-breathe 3.6s ease-in-out infinite; }
  @keyframes cpv-breathe { 50% { opacity: .72; } }
}
