/* ==========================================================================
   PULSE V2 — pricing.css
   Conversion page layer for /pricing: hero + trace echo, the prominent
   annual/monthly toggle (sliding thumb + savings chip), the two instrument
   panels (Free / Pro — Pro gets the hero treatment: glass face, outside
   registration brackets, a quiet live trace in its title bar, one hot
   seam), trust band (Paddle MoR · refunds · reversibility), Early
   Supporter explainer, grouped Free-vs-Pro matrix with row glow, billing
   FAQ, final CTA. Requires tokens.css + base.css first. Tokens only —
   zero hardcoded colors. No inline styles (CSP style-src 'self').
   PERF: no filter:blur() on any layer added here (see base.css .aurora
   guard comment) — every texture is a flat gradient at token alphas.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero — editorial copy over the aurora, calm trace underline
   -------------------------------------------------------------------------- */
.hero h1 { margin-top: var(--sp-4); }
.hero .trust-strip {
  display: block;
  margin-top: var(--sp-6);
}
/* 1b. Seam divider — a dual-channel equalizer rides the exact hero/plans
   boundary (motifs.js · equalize): one channel in each colored zone,
   bars breathing toward level — the two tiers meeting at one line.
   Zero flow height keeps the seam exactly where the zones meet; the svg
   centers itself on it. z-index lifts it above both sections' fields. */
.seam-trace {
  position: relative;
  z-index: 1;
  height: 0;
  pointer-events: none;
}
.seam-trace .motif-svg {
  width: 100%;
  height: clamp(48px, 7vw, 80px);
  transform: translateY(-50%);
}

/* --------------------------------------------------------------------------
   2. Plans section — the page's own zone identity: the sparse mint
   constellation (the index journey's pricing layer), static and cheap.
   -------------------------------------------------------------------------- */
.plans::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: var(--z-viz);
  pointer-events: none;
  background-image:
    radial-gradient(circle, var(--accent-tint-1) 1.2px, transparent 2px),
    radial-gradient(circle, var(--line-1) 1px, transparent 1.8px);
  background-size: 132px 132px, 88px 88px;
  background-position: 18px 40px, 0 0;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
}

/* --------------------------------------------------------------------------
   3. Billing toggle — prominent, delightful. pricing.js reveals it and
   drives aria-pressed + data-billing; the thumb glide is pure CSS (:has),
   with the pressed-pill style standing in on browsers without :has.
   Hidden = no-JS fallback (both price blocks render).
   -------------------------------------------------------------------------- */
.billing-row {
  display: flex;
  margin-bottom: var(--sp-7);
}
.billing-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
}
.billing-toggle[hidden] { display: none; }
.billing-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 1.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  cursor: pointer;
  font: 700 var(--fs-body-sm) / 1 var(--font-mono);
  letter-spacing: 0.03em;
  color: var(--text-3);
  transition: color var(--dur-1) ease, background-color var(--dur-1) ease;
}
.billing-btn:hover { color: var(--text-1); }
/* Fallback pressed state (no :has) */
.billing-btn[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--text-1);
}
.toggle-save {
  padding: 3px 8px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  background: var(--accent-tint-2);
  font: 700 var(--fs-micro) / 1 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--accent-bright);
  white-space: nowrap;
}
.toggle-thumb { display: none; }
@supports selector(:has(*)) {
  .billing-btn[aria-pressed="true"] { background: none; color: var(--text-1); }
  .toggle-thumb {
    display: block;
    position: absolute;
    z-index: 0;
    top: 4px;
    bottom: 4px;
    inset-inline-start: 4px;
    width: calc(50% - 6px);
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-3);
    background: var(--surface-3);
    box-shadow: var(--shadow-1), 0 0 18px -6px var(--accent-line);
    transition: transform var(--dur-2) var(--ease-glide);
  }
  .billing-toggle:has(.billing-btn[data-billing="monthly"][aria-pressed="true"]) .toggle-thumb {
    transform: translateX(calc(100% + 4px));
  }
  [dir="rtl"] .billing-toggle:has(.billing-btn[data-billing="monthly"][aria-pressed="true"]) .toggle-thumb {
    transform: translateX(calc(-100% - 4px));
  }
}

/* --------------------------------------------------------------------------
   4. Instrument panels — Free (5 cols, calm) / Pro (7 cols, the hero)
   -------------------------------------------------------------------------- */
.panels {
  display: grid;
  gap: var(--sp-6);
  align-items: stretch;
}
@media (min-width: 56em) {
  .panels { grid-template-columns: 5fr 7fr; }
}

.panel {
  display: flex;
  flex-direction: column;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--line-1);
}
.panel-name { margin-bottom: var(--sp-2); }
.panel-desc {
  color: var(--text-3);
  font-size: var(--fs-body-sm);
}

/* PRO — the hero instrument. Wrapper (no overflow) hosts the OUTSIDE
   registration brackets + hot seam; the glass face clips the title-bar
   trace and the top-edge light sweep. */
.panel-pro { position: relative; }
.panel-pro-glass {
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  /* background-image carries the face; background-color the base — never
     the shorthand (the .card class-combination trap in base.css). */
  background-color: var(--surface-1);
  background-image:
    radial-gradient(120% 90% at 50% -20%, var(--slab-glow), transparent 55%),
    linear-gradient(180deg, var(--panel-tint-1), var(--panel-tint-2));
  box-shadow: var(--glow-accent-lg), var(--shadow-2);
  transition: box-shadow var(--dur-2) ease;
}
.panel-pro:hover .panel-pro-glass {
  box-shadow: var(--glow-accent), var(--glow-accent-lg), var(--shadow-2);
}
/* Top-edge light: static accent hairline; under html.anim a sweep glides
   across it forever (reduced motion / no JS keeps the static line). */
.panel-pro-glass::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.8;
  pointer-events: none;
}
html.anim .panel-pro-glass::before {
  animation: pro-sweep 7s var(--ease-glide) infinite;
}
@keyframes pro-sweep {
  0%   { transform: translateX(-65%); }
  55%  { transform: translateX(65%); }
  100% { transform: translateX(-65%); }
}

/* Outside registration brackets — the monolith framing language */
.panel-corners {
  position: absolute;
  inset: -7px;
  pointer-events: none;
  opacity: 0.85;
  background-image:
    linear-gradient(var(--accent-line), var(--accent-line)),
    linear-gradient(var(--accent-line), var(--accent-line)),
    linear-gradient(var(--accent-line), var(--accent-line)),
    linear-gradient(var(--accent-line), var(--accent-line)),
    linear-gradient(var(--accent-line), var(--accent-line)),
    linear-gradient(var(--accent-line), var(--accent-line)),
    linear-gradient(var(--accent-line), var(--accent-line)),
    linear-gradient(var(--accent-line), var(--accent-line));
  background-repeat: no-repeat;
  background-size:
    16px 1px, 1px 16px,
    16px 1px, 1px 16px,
    16px 1px, 1px 16px,
    16px 1px, 1px 16px;
  background-position:
    0 0, 0 0,
    100% 0, 100% 0,
    0 100%, 0 100%,
    100% 100%, 100% 100%;
}
/* The one hot seam beneath the panel */
.panel-seam {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  filter: drop-shadow(var(--glow-trace));
}

/* Pro title bar — slab bar spanning edge to edge, quiet trace behind it */
.panel-pro .panel-head {
  position: relative;
  overflow: hidden;
  margin: calc(-1 * var(--sp-6)) calc(-1 * var(--sp-6)) var(--sp-5);
  padding: 13px var(--sp-6);
  background: var(--slab-bar);
  border-bottom: 1px solid var(--line-1);
}
.panel-pro .panel-head > .mono-label,
.panel-pro .panel-head > .es-chip {
  position: relative;
  z-index: 1;
}
.es-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  background: var(--accent-tint-2);
  font: 700 var(--fs-micro) / 1 var(--font-mono);
  letter-spacing: 0.05em;
  color: var(--accent-bright);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   5. Price blocks
   No-JS: annual + "or" + monthly all render. With JS (.js-billing on the
   scope) exactly one Pro block shows, driven by data-billing — and the
   incoming block rises in (html.anim only).
   -------------------------------------------------------------------------- */
.price-area { margin-block: var(--sp-4) var(--sp-3); }
.price {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--text-1);
}
.price-value {
  font-size: var(--fs-num-lg);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.panel-pro .price-value { color: var(--accent-bright); }
.price-per {
  font: 400 var(--fs-micro) / 1 var(--font-mono);
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.price-note {
  margin-top: var(--sp-2);
  color: var(--text-3);
  font-size: var(--fs-body-sm);
}
.price-or {
  margin-block: var(--sp-3);
  font: 700 var(--fs-micro) / 1 var(--font-mono);
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.price-standard {
  margin-top: var(--sp-4);
  color: var(--text-3);
  font-size: var(--fs-body-sm);
}

.js-billing .price-or { display: none; }
.js-billing .panel-pro .price-block { display: none; }
.js-billing[data-billing="annual"] .panel-pro .price-annual { display: block; }
.js-billing[data-billing="monthly"] .panel-pro .price-monthly { display: block; }
/* The switched-in block rises gently (display toggle restarts the
   keyframe; static under reduced motion via the global kill switch). */
html.anim .js-billing[data-billing="annual"] .panel-pro .price-annual,
html.anim .js-billing[data-billing="monthly"] .panel-pro .price-monthly {
  animation: price-in 360ms var(--ease-glide);
}
@keyframes price-in {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   6. Feature lists — neutral hairline ticks, never cyan checkmarks
   -------------------------------------------------------------------------- */
.panel-list {
  list-style: none;
  padding: 0;
  margin-block: var(--sp-5);
  display: grid;
  gap: 0.65rem;
}
.panel-list li {
  position: relative;
  padding-inline-start: 1.3rem;
  font-size: var(--fs-body-sm);
  color: var(--text-2);
}
.panel-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.65em;
  width: 11px;
  height: 1px;
  background: var(--line-3);
}
.panel-pro .panel-list li::before { background: var(--accent-line); }
.li-pro { color: var(--text-3); }
.pro-tag {
  display: inline-block;
  margin-inline-start: 0.45rem;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  background: var(--accent-tint-2);
  font: 700 var(--fs-micro) / 1.2 var(--font-mono);
  letter-spacing: 0.05em;
  color: var(--accent-bright);
}

.panel-cta {
  margin-top: auto;
  padding-top: var(--sp-4);
}
.panel-cta .btn { width: 100%; }
.panel-note {
  margin-top: var(--sp-3);
  text-align: center;
  font: 400 var(--fs-micro) / 1.5 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   7. Trust band — Paddle MoR · refund promise · reversibility
   -------------------------------------------------------------------------- */
.trust-band {
  display: grid;
  gap: var(--sp-6);
  margin-top: var(--sp-7);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line-1);
}
@media (min-width: 56em) {
  .trust-band { grid-template-columns: repeat(3, 1fr); }
}
.trust-cell > p:last-child {
  margin-top: var(--sp-2);
  color: var(--text-3);
  font-size: var(--fs-body-sm);
  max-width: 38ch;
}
.trust-cell strong {
  color: var(--text-2);
  font-weight: 600;
}
.trust-cell a { color: var(--text-2); }

/* --------------------------------------------------------------------------
   8. Early Supporter explainer
   -------------------------------------------------------------------------- */
.es-body {
  display: grid;
  gap: var(--sp-5);
  align-content: center;
  padding-inline-start: clamp(1.25rem, 3vw, 2rem);
  border-inline-start: 2px solid var(--accent-line);
}
.es-body strong {
  color: var(--text-1);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   9. Feature matrix — the page's one full-bleed telemetry band.
   Grouped row sections + status chips + row glow on hover.
   -------------------------------------------------------------------------- */
.band {
  background: var(--surface-1);
  border-block: 1px solid var(--line-1);
}
.table-scroll { overflow-x: auto; }
.matrix-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: var(--fs-body-sm);
}
.matrix-table th,
.matrix-table td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line-0);
  text-align: start;
  vertical-align: middle;
}
.matrix-table thead th {
  /* caps diet (§13): sentence case — the mono micro size carries the label feel */
  font: 700 var(--fs-micro) / 1 var(--font-mono);
  letter-spacing: var(--track-micro);
  color: var(--text-3);
  border-bottom: 1px solid var(--line-2);
  vertical-align: bottom;
}
/* Group header rows — quiet mono dividers between feature families */
.matrix-table .matrix-group th {
  padding: var(--sp-5) 0.9rem 0.55rem;
  font: 700 var(--fs-micro) / 1 var(--font-mono);
  letter-spacing: 0.05em;
  color: var(--text-3);
  border-bottom: 1px solid var(--line-2);
}
.matrix-table tbody:first-of-type .matrix-group th { padding-top: var(--sp-4); }
.matrix-table tbody th {
  font-weight: 500;
  color: var(--text-2);
}
.matrix-table tbody tr {
  transition: background-color var(--dur-1) ease;
}
.matrix-table tbody tr:not(.matrix-group):hover { background: var(--wash-1); }
/* Row glow — an accent register tick lights the hovered row's edge */
.matrix-table tbody tr:not(.matrix-group) th {
  transition: box-shadow var(--dur-1) ease;
}
.matrix-table tbody tr:not(.matrix-group):hover th {
  box-shadow: inset 2px 0 0 var(--accent-line);
}
.matrix-table tbody tr:not(.matrix-group):hover td.col-pro {
  background: var(--accent-tint-1);
}
.matrix-table .col-free {
  width: 7.5rem;
  text-align: center;
}
.matrix-table .col-pro {
  width: 11rem;
  text-align: center;
}
.matrix-table td.col-pro {
  background: var(--accent-tint-2);
  transition: background-color var(--dur-1) ease;
}

/* Tier-coverage bars under the column heads — share of listed features
   each tier includes (honest category fill, not performance data). */
.tier-bar {
  display: block;
  width: min(100%, 4.5rem);
  margin: 0.55rem auto 0;
  height: 4px;
}

/* Compact state chips inside cells */
.cell-chip { padding: 3px 10px; }
.cell-yes .cell-chip { border-color: var(--accent-line); }
.cell-text { color: var(--text-1); }
.cell-note {
  color: var(--text-3);
  font-size: var(--fs-body-sm);
}

/* --------------------------------------------------------------------------
   10. Billing FAQ
   -------------------------------------------------------------------------- */
.faq-list { align-self: start; }

/* --------------------------------------------------------------------------
   11. Final CTA
   -------------------------------------------------------------------------- */
.cta-final .container { text-align: center; }
.cta-final h2 { margin-top: var(--sp-4); }
.cta-final .trust-strip {
  display: block;
  margin-top: var(--sp-4);
}
.cta-final p { margin-inline: auto; }
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}
.cta-note {
  margin-top: var(--sp-4);
  font: 400 var(--fs-micro) / 1.5 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.cta-meta {
  margin-top: var(--sp-2);
  font: 400 var(--fs-micro) / 1.5 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.cta-meta { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   12. Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 55.99em) {
  .billing-row { justify-content: center; }
  .billing-toggle { width: 100%; max-width: 24rem; }
  .es-body {
    padding-inline-start: var(--sp-4);
  }
}
