/* ============================================================================
   HYPECITY REVENUE DESIGN SYSTEM — "the analyst's memo, in daylight"
   Mobile-first (390px), self-sufficient (no dependency on legacy shared.css).
   Loaded by the rebuilt revenue pages; restyled legacy pages may load it after
   their own CSS and use the v- components without token collisions (all names
   are v- prefixed).
   Type: system stack for UI/body (iOS-native, zero font cost) + IBM Plex Mono
   for every number, label and eyebrow — the personality carrier.
   Color: paper + ink; emerald = action/BUY only; amber = WATCH; red = SKIP.
   RTL-safe: logical properties only. Reduced motion respected.
   ========================================================================== */

:root {
  /* palette */
  --v-paper: #FBFAF7;
  --v-sheet: #FFFFFF;
  --v-panel: #F3F1EA;
  --v-ink: #12181D;
  --v-slate: #59646E;
  --v-faint: #8A949D;
  --v-line: #E5E2D9;
  --v-line-strong: #C9C5B8;
  --v-emerald: #0B8F63;      /* actions, BUY, positive deltas */
  --v-emerald-ink: #086A4A;  /* pressed / text-on-paper accessible */
  --v-emerald-tint: #E7F5EF;
  --v-tick: #00D97E;         /* wordmark tick + chart accent ONLY */
  --v-amber: #9A6700;        /* WATCH */
  --v-amber-tint: #FBF3E0;
  --v-red: #B3261E;          /* SKIP */
  --v-red-tint: #FBEAE8;

  /* type */
  --v-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --v-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* scale (mobile-first) */
  --v-fs-h1: 1.875rem;   /* 30 */
  --v-fs-h2: 1.375rem;   /* 22 */
  --v-fs-h3: 1.0625rem;  /* 17 */
  --v-fs-body: 1rem;     /* 16 */
  --v-fs-small: .875rem; /* 14 */
  --v-fs-cap: .78125rem; /* 12.5 */
  --v-fs-eyebrow: .6875rem; /* 11 */

  /* rhythm */
  --v-gutter: 20px;
  --v-radius: 10px;
  --v-radius-lg: 14px;
  --v-maxcol: 640px;

  /* elevation: hairlines over shadows; one soft shadow for sheets/modals */
  --v-shadow-sheet: 0 1px 2px rgba(18, 24, 29, .05), 0 8px 28px rgba(18, 24, 29, .07);
}

@media (min-width: 768px) {
  :root {
    --v-fs-h1: 2.5rem;   /* 40 */
    --v-fs-h2: 1.625rem; /* 26 */
    --v-gutter: 24px;
  }
}

/* ---- base ---------------------------------------------------------------- */
.v-page, .v-page * { box-sizing: border-box; }
.v-page {
  margin: 0;
  background: var(--v-paper);
  color: var(--v-ink);
  font-family: var(--v-sans);
  font-size: var(--v-fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.v-page :focus-visible {
  outline: 2px solid var(--v-emerald);
  outline-offset: 2px;
  border-radius: 4px;
}
.v-page img { max-width: 100%; display: block; }
.v-page a { color: var(--v-emerald-ink); text-decoration: none; }
.v-page a:hover { text-decoration: underline; }

.v-col {
  max-width: var(--v-maxcol);
  margin-inline: auto;
  padding-inline: var(--v-gutter);
}

/* section rhythm: hairline-ruled blocks, not card soup */
.v-section { padding-block: 44px 48px; border-block-start: 1px solid var(--v-line); }
.v-section--flush { border-block-start: 0; }
@media (min-width: 768px) { .v-section { padding-block: 64px 72px; } }

/* ---- typography ----------------------------------------------------------- */
.v-eyebrow {
  font-family: var(--v-mono);
  font-size: var(--v-fs-eyebrow);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--v-slate);
  margin: 0 0 10px;
}
.v-h1 { font-size: var(--v-fs-h1); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 0 0 12px; }
.v-h2 { font-size: var(--v-fs-h2); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin: 0 0 10px; }
.v-h3 { font-size: var(--v-fs-h3); line-height: 1.3; font-weight: 600; margin: 0 0 6px; }
.v-sub { font-size: var(--v-fs-body); color: var(--v-slate); margin: 0 0 20px; max-width: 46ch; }
.v-small { font-size: var(--v-fs-small); color: var(--v-slate); }
.v-cap { font-size: var(--v-fs-cap); color: var(--v-faint); }

/* numbers are always mono + tabular */
.v-num { font-family: var(--v-mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.v-num--lg { font-size: 2.5rem; line-height: 1; letter-spacing: -.02em; }
.v-num--xl { font-size: 3.25rem; line-height: 1; letter-spacing: -.03em; }

.v-pos { color: var(--v-emerald-ink); }
.v-neg { color: var(--v-red); }
.v-warn { color: var(--v-amber); }

/* ---- buttons -------------------------------------------------------------- */
.v-btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 14px 22px;
  border-radius: var(--v-radius);
  font-family: var(--v-sans); font-size: 1.0625rem; font-weight: 600;
  line-height: 1.2; text-decoration: none;
  transition: transform .06s ease, background-color .15s ease, box-shadow .15s ease;
}
.v-btn:active { transform: translateY(1px); }
/* Primary CTA uses --v-emerald-ink (#086A4A), not --v-emerald (#0B8F63):
   white-on-#0B8F63 is 4.10:1 (FAILS WCAG AA 4.5:1 — the button label is 17px
   semibold = normal-size text, not large); white-on-#086A4A is 6.6:1 (PASSES).
   --v-emerald-ink is the design system's documented "text-on-paper accessible"
   emerald, so this stays on-token. --v-emerald remains for non-text accents. */
/* `a.v-btn--primary` (0,1,1) is needed to beat `.v-page a { color:--v-emerald-ink }`
   (0,1,1, defined earlier) — without it the anchor CTA rendered dark-green-on-green
   (~1.6:1), which is exactly the "text on the green is hard to read" 5-second-test
   finding. White on #086A4A = 6.6:1 (WCAG AA pass); white on #0B8F63 was 4.10:1 (fail). */
.v-btn--primary, a.v-btn--primary { background: var(--v-emerald-ink); color: #fff; }
.v-btn--primary:hover, a.v-btn--primary:hover { background: var(--v-emerald-ink); filter: brightness(.92); text-decoration: none; }
.v-btn--block { display: flex; inline-size: 100%; }
.v-btn--ghost {
  background: transparent; color: var(--v-ink);
  box-shadow: inset 0 0 0 1.5px var(--v-line-strong);
}
.v-btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--v-ink); text-decoration: none; }
.v-btn--quiet { background: var(--v-panel); color: var(--v-ink); }
.v-btn--sm { min-height: 44px; padding: 10px 16px; font-size: var(--v-fs-small); }
.v-btn .v-btn__price { font-family: var(--v-mono); font-weight: 600; }

/* text-link CTA (secondary path under a primary button) */
.v-linkcta {
  display: inline-block; margin-block-start: 14px;
  font-size: var(--v-fs-small); font-weight: 600; color: var(--v-slate);
  text-decoration: underline; text-underline-offset: 3px;
}
.v-linkcta:hover { color: var(--v-ink); }

/* ---- sticky bottom CTA bar (mobile) --------------------------------------- */
.v-stickybar {
  position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 60;
  background: color-mix(in srgb, var(--v-paper) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-block-start: 1px solid var(--v-line);
  padding: 10px var(--v-gutter) calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center;
  transform: translateY(110%);
  transition: transform .25s ease;
}
.v-stickybar.is-visible { transform: translateY(0); }
.v-stickybar .v-btn { flex: 1; }
@media (min-width: 768px) { .v-stickybar { display: none; } }

/* ---- header / footer ------------------------------------------------------- */
.v-header {
  position: sticky; inset-block-start: 0; z-index: 50;
  background: color-mix(in srgb, var(--v-paper) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--v-line);
}
.v-header__inner {
  max-width: var(--v-maxcol); margin-inline: auto; padding: 12px var(--v-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.v-wordmark {
  font-family: var(--v-mono); font-weight: 600; font-size: 1rem;
  letter-spacing: .04em; color: var(--v-ink); text-decoration: none;
}
.v-wordmark:hover { text-decoration: none; }
.v-wordmark .tick { color: var(--v-tick); }
.v-header__nav { display: flex; align-items: center; gap: 18px; }
.v-header__nav a { font-size: var(--v-fs-small); font-weight: 600; color: var(--v-slate); }
.v-header__nav a:hover { color: var(--v-ink); text-decoration: none; }

.v-footer { border-block-start: 1px solid var(--v-line); padding-block: 32px 40px; }
.v-footer .v-cap { max-width: 60ch; }
.v-footer__links { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-block: 14px; }
.v-footer__links a { font-size: var(--v-fs-cap); color: var(--v-slate); }

/* ---- the verdict memo (signature element) ---------------------------------- */
.v-memo {
  position: relative;
  background: var(--v-sheet);
  border: 1px solid var(--v-line);
  border-radius: var(--v-radius-lg);
  box-shadow: var(--v-shadow-sheet);
  overflow: hidden;
}
.v-memo__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px;
  border-block-end: 1px solid var(--v-line);
  font-family: var(--v-mono); font-size: var(--v-fs-eyebrow);
  letter-spacing: .1em; text-transform: uppercase; color: var(--v-slate);
}
.v-memo__head .dot { color: var(--v-tick); }
.v-memo__body { padding: 16px; }
@media (min-width: 768px) { .v-memo__body { padding: 22px; } }
/* Clickable demo card (5-second-test affordance fix): the whole card is a
   tap target that opens the full sample verdict. Desktop = hover lift +
   emerald border; touch = pressed state; keyboard = visible focus ring. */
.v-memo--clickable { cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease, transform .06s ease; }
.v-memo--clickable:hover { border-color: var(--v-emerald); box-shadow: 0 2px 4px rgba(18,24,29,.06), 0 14px 36px rgba(11,143,99,.14); }
.v-memo--clickable:focus-visible { outline: 2px solid var(--v-emerald); outline-offset: 3px; }
.v-memo--clickable:active { transform: translateY(1px) scale(.997); box-shadow: 0 1px 2px rgba(18,24,29,.08); }
@media (hover: none) { .v-memo--clickable:active { background: var(--v-emerald-tint); border-color: var(--v-emerald); } }
/* microcopy under the card — points at the now-tappable card */
.demo-tap-hint { text-align: center; margin-block-start: 10px; font-family: var(--v-mono); font-size: var(--v-fs-cap); font-weight: 600; letter-spacing: .01em; color: var(--v-emerald-ink); }

/* narrated analysis tape */
.v-tape { font-family: var(--v-mono); font-size: var(--v-fs-cap); color: var(--v-slate); min-height: 1.4em; }
.v-tape__line { display: flex; gap: 8px; align-items: baseline; opacity: 0; }
.v-tape__line.is-on { opacity: 1; transition: opacity .3s ease; }
.v-tape__line .ok { color: var(--v-emerald-ink); }

/* score + stamp row */
.v-scorerow { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-block: 14px 6px; }
.v-score__label { font-family: var(--v-mono); font-size: var(--v-fs-eyebrow); letter-spacing: .12em; text-transform: uppercase; color: var(--v-faint); }

/* rubber stamp badge — thunks in with slight rotation */
.v-stamp {
  font-family: var(--v-mono); font-weight: 600; font-size: 1.0625rem;
  letter-spacing: .18em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 6px;
  border: 2.5px solid currentColor;
  transform: rotate(-4deg) scale(2.2); opacity: 0;
}
.v-stamp.is-stamped {
  animation: v-stamp-in .38s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
.v-stamp--buy   { color: var(--v-emerald-ink); background: var(--v-emerald-tint); }
.v-stamp--watch { color: var(--v-amber); background: var(--v-amber-tint); }
.v-stamp--skip  { color: var(--v-red); background: var(--v-red-tint); }
@keyframes v-stamp-in {
  0%   { transform: rotate(-4deg) scale(2.2); opacity: 0; }
  60%  { transform: rotate(-4deg) scale(.96); opacity: 1; }
  100% { transform: rotate(-4deg) scale(1); opacity: 1; }
}

/* data rows: label ....... value (dotted leader like a rate sheet) */
.v-rows { margin: 0; padding: 0; list-style: none; }
.v-row {
  display: flex; align-items: baseline; gap: 10px;
  padding-block: 9px;
  border-block-end: 1px dashed var(--v-line);
  font-size: var(--v-fs-small);
}
.v-row:last-child { border-block-end: 0; }
.v-row__label { color: var(--v-slate); flex-shrink: 0; }
.v-row__leader { flex: 1; border-block-end: 1px dotted var(--v-line-strong); transform: translateY(-4px); }
.v-row__val { font-family: var(--v-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.v-row--total { font-weight: 600; }
.v-row--total .v-row__label { color: var(--v-ink); }
.v-row--total .v-row__val { font-weight: 600; font-size: 1rem; }

/* ---- source chip + confidence ---------------------------------------------- */
.v-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--v-mono); font-size: .6875rem; font-weight: 500;
  color: var(--v-slate); background: var(--v-panel);
  border: 1px solid var(--v-line); border-radius: 999px;
  padding: 2px 9px; white-space: nowrap;
}
.v-chip--conf-high::before, .v-chip--conf-med::before, .v-chip--conf-low::before {
  content: ""; inline-size: 6px; block-size: 6px; border-radius: 50%;
}
.v-chip--conf-high::before { background: var(--v-emerald); }
.v-chip--conf-med::before  { background: var(--v-amber); }
.v-chip--conf-low::before  { background: var(--v-faint); }

/* ---- cards (pricing etc.) --------------------------------------------------- */
.v-card {
  background: var(--v-sheet); border: 1px solid var(--v-line);
  border-radius: var(--v-radius-lg); padding: 20px;
}
.v-card--hero { border: 2px solid var(--v-emerald); box-shadow: var(--v-shadow-sheet); }
.v-card__flag {
  display: inline-block; font-family: var(--v-mono); font-size: var(--v-fs-eyebrow);
  letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  color: var(--v-emerald-ink); background: var(--v-emerald-tint);
  border-radius: 5px; padding: 3px 8px; margin-block-end: 10px;
}
.v-price { font-family: var(--v-mono); font-weight: 600; font-size: 2rem; letter-spacing: -.02em; }
.v-price .per { font-size: var(--v-fs-small); font-weight: 400; color: var(--v-slate); letter-spacing: 0; }

/* checklist rows inside cards */
.v-checks { margin: 14px 0 0; padding: 0; list-style: none; }
.v-checks li {
  position: relative; padding-inline-start: 24px; padding-block: 5px;
  font-size: var(--v-fs-small); color: var(--v-ink);
}
.v-checks li::before {
  content: "✓"; position: absolute; inset-inline-start: 0;
  color: var(--v-emerald); font-weight: 700;
}
.v-checks li.is-muted { color: var(--v-faint); }
.v-checks li.is-muted::before { content: "—"; color: var(--v-faint); }

/* ---- blurred report preview (the gap that sells) ----------------------------- */
.v-peek { position: relative; border-radius: var(--v-radius); overflow: hidden; border: 1px solid var(--v-line); background: var(--v-sheet); }
.v-peek__pages { filter: blur(0); }
.v-peek__pages .is-blurred { filter: blur(5px); user-select: none; pointer-events: none; }
.v-peek__veil {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(to bottom, transparent 30%, color-mix(in srgb, var(--v-sheet) 92%, transparent) 78%);
  padding: 16px;
}

/* ---- upgrade sheet (bottom sheet on mobile, dialog on desktop) ---------------- */
.v-sheetmodal { position: fixed; inset: 0; z-index: 90; display: none; }
.v-sheetmodal.is-open { display: block; }
.v-sheetmodal__backdrop { position: absolute; inset: 0; background: rgba(18, 24, 29, .45); }
.v-sheetmodal__panel {
  position: absolute; inset-inline: 0; inset-block-end: 0;
  background: var(--v-sheet); border-radius: 16px 16px 0 0;
  box-shadow: var(--v-shadow-sheet);
  padding: 10px var(--v-gutter) calc(20px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto;
  animation: v-sheet-up .28s ease;
}
.v-sheetmodal__grab { inline-size: 36px; block-size: 4px; border-radius: 2px; background: var(--v-line-strong); margin: 4px auto 14px; }
@keyframes v-sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 768px) {
  .v-sheetmodal__panel {
    inset: 50% auto auto 50%; transform: translate(-50%, -50%);
    inline-size: min(440px, 92vw); border-radius: var(--v-radius-lg);
    animation: none;
  }
  .v-sheetmodal__grab { display: none; }
}

/* ---- narrated loading state ---------------------------------------------------- */
.v-loading { padding: 22px 16px; }
.v-loading .v-tape__line { padding-block: 3px; }
.v-spinner {
  inline-size: 14px; block-size: 14px; border-radius: 50%;
  border: 2px solid var(--v-line-strong); border-block-start-color: var(--v-emerald);
  animation: v-spin .7s linear infinite; display: inline-block; vertical-align: -2px;
}
@keyframes v-spin { to { transform: rotate(360deg); } }

/* ---- utilities ------------------------------------------------------------------ */
.v-mt-0 { margin-block-start: 0; } .v-mt-8 { margin-block-start: 8px; }
.v-mt-16 { margin-block-start: 16px; } .v-mt-24 { margin-block-start: 24px; }
.v-mb-0 { margin-block-end: 0; }
.v-center { text-align: center; }
.v-grid { display: grid; gap: 14px; }
@media (min-width: 768px) { .v-grid--2 { grid-template-columns: 1fr 1fr; } .v-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.v-visually-hidden {
  position: absolute; inline-size: 1px; block-size: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.v-skip {
  position: absolute; inset-inline-start: -9999px; z-index: 100;
  background: var(--v-ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.v-skip:focus { inset-inline-start: 0; }

/* trust footer line — persistent on every page */
.v-trustline {
  font-size: var(--v-fs-cap); color: var(--v-faint);
  border-block-start: 1px solid var(--v-line);
  padding-block: 12px; text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .v-stamp.is-stamped { animation: none; transform: rotate(-4deg) scale(1); opacity: 1; }
  .v-sheetmodal__panel { animation: none; }
  .v-stickybar { transition: none; }
  .v-tape__line.is-on { transition: none; }
}
