/* =========================================================================
   QPN Catalyst — Universal Card (Ledger Row) + Compact Hero components.
   Mirrors WebShield's universal-card.css + compact-hero.css patterns,
   adapted for QPN's warm-paper canvas (no patent-footer beat needed).

   Load order: qpn-shared.css → THIS FILE → styles.css
   Tokens sourced from qpn-shared.css (--qpn-*).

   Variants:
     .qpn-uc           — base Ledger Row (rail-left, body-right; stacked).
     .qpn-uc--row      — row-collapsed (rail-on-top); used in N-up grids.
     .qpn-uc--here     — gold border + soft tint; for "default" highlights
                          (e.g. Silent Mode as the recommended default).

     .qpn-chero        — base portal hero (paper surface).
     .qpn-chero--feature — display-scale title for landing pages.

   Anchored to: docs/brief-website.md §5.1 (Universal cards), §6.1 (Home).
   ========================================================================= */

/* ── Base Ledger Row ─────────────────────────────────────────────────── */
.qpn-uc {
  background: var(--qpn-surface);
  border: var(--qpn-uc-border);
  border-radius: 6px;
  padding: var(--qpn-uc-pad-y) var(--qpn-uc-pad-x);
  font-family: var(--qpn-font-body);
  color: var(--qpn-ink);
  display: grid;
  grid-template-columns: var(--qpn-uc-rail-width) 1fr;
  gap: var(--qpn-uc-col-gap);
  align-items: start;
}

/* Rail — identity column. Icon + ordinal + name stacked. */
.qpn-uc__rail {
  display: flex;
  flex-direction: column;
}

.qpn-uc__rail-icon {
  display: block;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  /* Existing /icons/*.svg use a navy stroke; surface stays --qpn-surface. */
}

.qpn-uc__ordinal {
  font-family: var(--qpn-font-mono);
  font-size: var(--qpn-fs-micro);
  color: var(--qpn-accent);
  font-weight: 500;
  letter-spacing: var(--qpn-tracking-mono);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.qpn-uc__name {
  font-family: var(--qpn-font-display);
  font-size: 20px;
  font-weight: 500;
  line-height: var(--qpn-lh-tight);
  letter-spacing: -0.005em;
  color: var(--qpn-ink);
  margin: 0;
}

/* Body — argument column. */
.qpn-uc__col {
  display: flex;
  flex-direction: column;
}

.qpn-uc__eyebrow {
  font-family: var(--qpn-font-body);
  font-size: var(--qpn-fs-label);
  letter-spacing: var(--qpn-tracking-label);
  text-transform: uppercase;
  color: var(--qpn-accent);
  font-weight: 600;
  margin-bottom: 8px;
}

/* Definition — the lede. Serif, medium, full ink, looser leading. */
.qpn-uc__definition {
  font-family: var(--qpn-font-display);
  font-size: var(--qpn-fs-lede);
  line-height: var(--qpn-lh-lede);
  font-weight: 500;
  color: var(--qpn-ink);
  margin: 0 0 14px;
  letter-spacing: -0.005em;
}

/* Supporting body — sans, regular, muted. */
.qpn-uc__body {
  font-family: var(--qpn-font-body);
  font-size: var(--qpn-fs-body);
  line-height: var(--qpn-lh-body);
  font-weight: 400;
  color: var(--qpn-ink-muted);
  margin: 0;
}

.qpn-uc__body + .qpn-uc__body { margin-top: 10px; }

/* CTA — bottom-aligned, navy underlined. */
.qpn-uc__cta {
  align-self: flex-start;
  margin-top: 14px;
  font-family: var(--qpn-font-body);
  font-size: var(--qpn-fs-body-sm);
  font-weight: 500;
  color: var(--qpn-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--qpn-ink);
  padding-bottom: 2px;
}

/* Action-link row — one or more CTAs side by side inside a Ledger Row body.
   Used on /documents, where an entry can carry both a "read online" and a
   "download / open PDF" action; wraps to stack on narrow widths. */
.qpn-uc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--qpn-sp-5);
  margin-top: var(--qpn-sp-4);
}
.qpn-uc__actions .qpn-uc__cta {
  margin-top: 0;
}
.qpn-uc__cta-sep {
  color: var(--qpn-accent);
  opacity: 0.45;
}

/* ── Resource card · .qpn-uc--resource ───────────────────────────────
   Modifier for downloadable / link-out document cards placed in an N-up
   grid (see /documents). Collapses the canonical rail-left / body-right
   shape to a single column (rail-on-top, hairline-divided), stretches to
   fill the grid cell so CTAs align across a row, and pins the action row
   to the card foot behind a 2px gold rule (the load-bearing Ledger Row
   accent). Differs from .qpn-uc--row, whose rail goes horizontal — that
   suits short labels (home page), not long document titles. */
.qpn-uc--resource {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  align-items: stretch;
  gap: var(--qpn-sp-4);
  padding: var(--qpn-sp-6) var(--qpn-sp-6) var(--qpn-sp-5);
  height: 100%;
}
.qpn-uc--resource .qpn-uc__rail {
  border-bottom: var(--qpn-rule-hair) solid var(--qpn-rule-faint);
  padding-bottom: var(--qpn-sp-3);
}
.qpn-uc--resource .qpn-uc__name { font-size: 18px; }
.qpn-uc--resource .qpn-uc__definition {
  font-size: 16px;
  line-height: var(--qpn-lh-lede);
  margin: 0 0 var(--qpn-sp-4);
}
/* Action row pinned to the card foot, anchored by the gold proof rule. */
.qpn-uc--resource .qpn-uc__actions {
  margin-top: auto;
  gap: var(--qpn-sp-3);
  padding-top: var(--qpn-sp-3);
  border-top: var(--qpn-rule-anchor) solid var(--qpn-accent);
  align-items: baseline;
}
.qpn-uc--resource .qpn-uc__cta {
  margin-top: 0;
  padding-bottom: 0;
  border-bottom: none;
  color: var(--qpn-accent);
}
.qpn-uc--resource .qpn-uc__cta:hover { color: var(--qpn-accent-hover); }

/* ── Row-collapsed modifier — rail-on-top, used in N-up grids ────────── */
.qpn-uc--row {
  grid-template-columns: 1fr;
  gap: var(--qpn-sp-4);
  padding: var(--qpn-sp-6) var(--qpn-sp-6) var(--qpn-sp-5);
  height: 100%;
}

.qpn-uc--row .qpn-uc__rail {
  border-bottom: var(--qpn-rule-hair) solid var(--qpn-rule-faint);
  padding-bottom: var(--qpn-sp-3);
  flex-direction: row;
  align-items: center;
  gap: var(--qpn-sp-3);
}

.qpn-uc--row .qpn-uc__rail-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

.qpn-uc--row .qpn-uc__ordinal {
  margin-bottom: 0;
  margin-left: auto;  /* push ordinal to right edge of rail */
}

.qpn-uc--row .qpn-uc__name {
  font-size: 17px;
  flex: 0 1 auto;
}

.qpn-uc--row .qpn-uc__definition {
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.qpn-uc--row .qpn-uc__body {
  font-size: var(--qpn-fs-body-sm);
  line-height: 1.6;
}

.qpn-uc--row .qpn-uc__cta {
  margin-top: 14px;
  font-size: var(--qpn-fs-body-sm);
}

/* ── "Here" / default highlight — gold border + soft tint ────────────── */
.qpn-uc--here {
  border-color: var(--qpn-accent);
  background: rgba(138, 107, 46, 0.04);
}

.qpn-uc__here-tag {
  display: inline-block;
  background: var(--qpn-accent);
  color: var(--qpn-page);
  font-family: var(--qpn-font-body);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 9px 3px;
  border-radius: 2px;
  margin-bottom: var(--qpn-sp-2);
  white-space: nowrap;
}

/* ── Grid container — N-up row of .qpn-uc--row cards ─────────────────── */
.qpn-uc-grid {
  display: grid;
  gap: var(--qpn-sp-4);
  margin-top: var(--qpn-sp-5);
}

.qpn-uc-grid--3 { grid-template-columns: repeat(3, 1fr); }
.qpn-uc-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Axis labels above the modes grid */
.qpn-uc-axis {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--qpn-sp-5);
  margin-bottom: var(--qpn-sp-2);
  font-family: var(--qpn-font-body);
  font-size: var(--qpn-fs-label);
  letter-spacing: var(--qpn-tracking-label);
  text-transform: uppercase;
  color: var(--qpn-ink-faint);
  font-weight: 500;
}

.qpn-uc-grid--3.qpn-uc-grid--axis {
  margin-top: var(--qpn-sp-2);
}

/* =========================================================================
   Compact Hero — portal variant for QPN home + submit landing.
   ========================================================================= */

.qpn-chero {
  background: var(--qpn-page);
  color: var(--qpn-ink);
  border-bottom: var(--qpn-rule-hair) solid var(--qpn-rule);
  font-family: var(--qpn-font-body);
}

.qpn-chero__wrap {
  max-width: var(--qpn-w-marketing);
  margin: 0 auto;
  padding: 64px var(--qpn-sp-7) 56px;
  display: grid;
  grid-template-columns: var(--qpn-uc-rail-width) 1fr;
  gap: var(--qpn-uc-col-gap);
  align-items: end;
}

.qpn-chero__rail {
  border-left: 2px solid var(--qpn-accent);
  padding-left: 14px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 4px;
}

.qpn-chero__rail-ordinal {
  font-family: var(--qpn-font-mono);
  font-size: var(--qpn-fs-micro);
  letter-spacing: var(--qpn-tracking-mono);
  color: var(--qpn-accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.qpn-chero__rail-label {
  font-family: var(--qpn-font-display);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--qpn-ink-muted);
}

.qpn-chero__rail-tagline {
  margin-top: 18px;
  padding-top: 12px;
  border-top: var(--qpn-rule-hair) solid var(--qpn-rule-faint);
  font-family: var(--qpn-font-mono);
  font-size: var(--qpn-fs-micro);
  letter-spacing: var(--qpn-tracking-mono);
  line-height: 1.5;
  color: var(--qpn-ink-muted);
}

.qpn-chero__body {
  align-self: end;
}

.qpn-chero__eyebrow {
  font-family: var(--qpn-font-body);
  font-size: var(--qpn-fs-label);
  letter-spacing: var(--qpn-tracking-label);
  text-transform: uppercase;
  color: var(--qpn-accent);
  font-weight: 600;
  margin-bottom: 14px;
}

.qpn-chero__title {
  font-family: var(--qpn-font-display);
  font-size: var(--qpn-fs-display-lg);
  font-weight: 500;
  line-height: var(--qpn-lh-tight);
  letter-spacing: -0.015em;
  color: var(--qpn-ink);
  margin: 0 0 14px;
  max-width: 720px;
}

.qpn-chero__subtitle {
  font-family: var(--qpn-font-display);
  font-size: var(--qpn-fs-lede);
  font-weight: 400;
  line-height: var(--qpn-lh-lede);
  color: var(--qpn-ink-muted);
  margin: 0;
  max-width: 640px;
}

/* Hero legitimacy line — small factual statement sized between the
   lede subtitle and the CTAs. Treatment is intentionally legal-doc
   restrained (body sans, muted ink, left rule) rather than marketing
   prose, so a compliance reviewer scanning the first 8 seconds sees a
   trade-secret / entity / governing-law signal above the fold without
   it competing with the H1 or the primary CTA. Design review P3. */
.qpn-chero__legitimacy {
  font-family: var(--qpn-font-body);
  font-size: var(--qpn-fs-body-sm);
  line-height: 1.55;
  color: var(--qpn-ink-muted);
  margin: var(--qpn-sp-5) 0 0;
  padding-left: var(--qpn-sp-3);
  border-left: 2px solid var(--qpn-rule);
  max-width: 640px;
}

/* CTA group */
.qpn-chero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: var(--qpn-sp-7);
}

.qpn-chero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--qpn-sp-2);
  padding: 14px 22px;
  font-family: var(--qpn-font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.qpn-chero__cta--primary {
  background: var(--qpn-ink);
  color: var(--qpn-page);
  border-color: var(--qpn-ink);
}
.qpn-chero__cta--primary:hover,
.qpn-chero__cta--primary:focus-visible {
  background: var(--qpn-ink-deep);
  border-color: var(--qpn-ink-deep);
  outline: none;
}

/* Ghost = anchor-scroll secondary action ("Learn how it works"). A bordered
   button reads as a peer of the primary CTA and visually competes; this is
   actually a same-page anchor scroll, which should look like a text link, not
   a button. Strip the border + background, keep vertical alignment with the
   primary by preserving vertical padding only. Design review W3. */
.qpn-chero__cta--ghost {
  background: transparent;
  color: var(--qpn-ink);
  border-color: transparent;
  padding: 14px 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.qpn-chero__cta--ghost:hover,
.qpn-chero__cta--ghost:focus-visible {
  background: transparent;
  color: var(--qpn-link);
  outline: none;
}

.qpn-chero__cta:active { transform: translateY(1px); }

/* Feature modifier — bigger display title for landing pages. */
.qpn-chero--feature .qpn-chero__title {
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.018em;
  max-width: 960px;
  text-wrap: balance;
}

/* ── Entity URL line in Ledger Row rail (used on /ecosystem) ─────────── */
.qpn-uc__url {
  font-family: var(--qpn-font-mono);
  font-size: 10.5px;
  letter-spacing: var(--qpn-tracking-mono);
  color: var(--qpn-accent);
  text-decoration: none;
  display: block;
  margin-top: var(--qpn-sp-2);
  word-break: break-all;
}
.qpn-uc__url:hover { color: var(--qpn-accent-hover); }
.qpn-uc__url--forthcoming {
  color: var(--qpn-ink-faint);
  font-style: italic;
}

/* Vertical stack of Ledger Row cards (eco page) */
.qpn-uc-stack {
  display: flex;
  flex-direction: column;
  gap: var(--qpn-sp-4);
  margin-top: var(--qpn-sp-5);
}

/* ── Gate block — narrow centered CTA panel inside .qpn-section ──────── */
.qpn-gate {
  max-width: 640px;
  margin: var(--qpn-sp-5) auto 0;
}

/* ── Section title above a Ledger Row grid ───────────────────────────── */
.qpn-section {
  max-width: var(--qpn-w-marketing);
  margin: 0 auto;
  padding: var(--qpn-sp-7) var(--qpn-sp-7);
}

.qpn-section__eyebrow {
  font-family: var(--qpn-font-body);
  font-size: var(--qpn-fs-label);
  letter-spacing: var(--qpn-tracking-label);
  text-transform: uppercase;
  color: var(--qpn-accent);
  font-weight: 600;
  margin-bottom: var(--qpn-sp-2);
}

.qpn-section__title {
  font-family: var(--qpn-font-display);
  font-size: 28px;
  font-weight: 500;
  line-height: var(--qpn-lh-tight);
  letter-spacing: -0.01em;
  color: var(--qpn-ink);
  margin: 0 0 var(--qpn-sp-3);
}

.qpn-section__dek {
  font-family: var(--qpn-font-body);
  font-size: var(--qpn-fs-body);
  line-height: var(--qpn-lh-body);
  color: var(--qpn-ink-muted);
  max-width: 720px;
  margin: 0;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .qpn-uc-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .qpn-uc,
  .qpn-uc--row {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: var(--qpn-sp-5) var(--qpn-sp-5);
  }

  .qpn-uc-grid--3,
  .qpn-uc-grid--4 {
    grid-template-columns: 1fr;
  }

  .qpn-chero__wrap {
    grid-template-columns: 1fr;
    padding: 40px var(--qpn-sp-4) 36px;
    gap: 18px;
  }
  .qpn-chero__rail {
    border-left: none;
    padding-left: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 0;
  }
  .qpn-chero__rail-tagline {
    flex-basis: 100%;
    margin-top: 12px;
    padding-top: 8px;
  }
  .qpn-chero__title { font-size: 30px; }

  .qpn-section {
    padding: var(--qpn-sp-6) var(--qpn-sp-4);
  }

  .qpn-uc-axis {
    font-size: 9.5px;
  }
}

@media (max-width: 480px) {
  .qpn-uc-axis { display: none; }
}
