/* ============================================================
   HOMEPAGE v4 — "Precision Instrument"
   Editorial, light-first landing inspired by block.xyz/ai:
   warm-paper canvas, big confident display type, generous
   whitespace, hairline separation, and monospaced technical
   marks (labels / metrics) as the diagnostics-brand signature.

   Scope: everything is gated on body[data-page="dashboard"] so
   this file cannot leak into other pages. Loads LAST in the
   cascade so it wins without !important wherever specificity
   allows. Theme model: dark is the site default; light via
   body.white-theme. Both palettes are tuned; light is the star.
   ============================================================ */

body[data-page="dashboard"] {
  /* Type system */
  --hp-font-display: 'Schibsted Grotesk', 'Hanken Grotesk', system-ui, sans-serif;
  --hp-font-sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hp-font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Menlo', monospace;

  /* Brand + status color tokens (homepage scope) */
  --hp-red: #dd3838;                 /* Site Mechanic brand red (logo-red.svg) */
  --hp-red-hover: #c22f2f;
  --hp-red-soft: rgba(221, 56, 56, 0.10);
  --hp-red-text: #f0625c;            /* red for text/links on dark bg (contrast) */
  --hp-green: #2bb35a;               /* positive indicators only */
  --hp-amber: #e8930c;               /* score visualizations only */

  /* Layout tokens — roomier than v3 to breathe like the reference */
  --hp-container: 1200px;
  --hp-copy-max: 640px;
  --hp-pad-x: clamp(22px, 5vw, 56px);
  --hp-band-y: clamp(72px, 10vw, 148px);

  /* Surfaces (dark default — warm near-black) */
  --hp-bg: #100f0d;
  --hp-band-raised: #16150f;
  --hp-surface: #1a1813;
  --hp-surface-2: #221f19;
  --hp-line: rgba(255, 248, 235, 0.10);
  --hp-line-strong: rgba(255, 248, 235, 0.18);

  /* Text */
  --hp-text: #f7f4ee;
  --hp-text-2: #c2bcb0;
  --hp-text-3: #8f887b;
  --hp-ink: #f7f4ee;                 /* high-contrast surface for solid marks */
  --hp-ink-on: #100f0d;

  /* Controls */
  --hp-control-h: 58px;
  --hp-radius: var(--radius-lg, 12px);
  --hp-radius-lg: var(--radius-xl, 16px);
  --hp-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 44px rgba(0, 0, 0, 0.4);
  --hp-shadow-pop: 0 30px 80px rgba(0, 0, 0, 0.55);
  --hp-focus-ring: 0 0 0 3px rgba(240, 98, 92, 0.4);

  /* Atmosphere accents */
  --hp-glow: radial-gradient(60% 55% at 78% 12%, rgba(221, 56, 56, 0.14), transparent 70%);

  background: var(--hp-bg);
  font-family: var(--hp-font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* -------- LIGHT — the block.xyz-inspired star -------- */
body.white-theme[data-page="dashboard"] {
  --hp-red-text: #c22f2f;
  --hp-red-soft: rgba(221, 56, 56, 0.08);

  --hp-bg: #fbfaf6;                  /* warm paper */
  --hp-band-raised: #f2efe7;         /* warm sand */
  --hp-surface: #ffffff;
  --hp-surface-2: #f5f2ea;
  --hp-line: rgba(26, 22, 15, 0.12);
  --hp-line-strong: rgba(26, 22, 15, 0.20);

  --hp-text: #1a160f;               /* warm near-black ink */
  --hp-text-2: #565048;
  --hp-text-3: #8b8579;
  --hp-ink: #1a160f;
  --hp-ink-on: #fbfaf6;

  --hp-shadow-card: 0 1px 2px rgba(26, 22, 15, 0.05), 0 16px 40px rgba(26, 22, 15, 0.08);
  --hp-shadow-pop: 0 30px 80px rgba(26, 22, 15, 0.14);
  --hp-focus-ring: 0 0 0 3px rgba(221, 56, 56, 0.28);
  --hp-glow: radial-gradient(60% 55% at 80% 8%, rgba(221, 56, 56, 0.10), transparent 68%);

  background: var(--hp-bg) !important; /* the legacy white-theme body rule uses !important */
}

/* ------------------------------------------------------------
   Page shell: full-bleed bands, each manages its own container.
   ------------------------------------------------------------ */
body[data-page="dashboard"] .page-shell {
  max-width: none;
  padding: 0;
}

body[data-page="dashboard"] .hp-container {
  max-width: var(--hp-container);
  margin: 0 auto;
  padding-left: var(--hp-pad-x);
  padding-right: var(--hp-pad-x);
}

/* ------------------------------------------------------------
   Technical grid (global body::after) — hold it faint and let it
   dissolve before the content bands begin.
   ------------------------------------------------------------ */
body[data-page="dashboard"]::after {
  opacity: 0.10;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0, rgba(0, 0, 0, 0.4) 460px, transparent 860px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0, rgba(0, 0, 0, 0.4) 460px, transparent 860px);
}

body.white-theme[data-page="dashboard"]::after {
  opacity: 0.22;
}

/* ============================================================
   SHARED TYPE
   ============================================================ */
/* Monospaced technical eyebrow with a red tick — the instrument mark */
body[data-page="dashboard"] .hp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-family: var(--hp-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hp-text-3);
}

body[data-page="dashboard"] .hp-eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--hp-red);
  flex-shrink: 0;
}

body[data-page="dashboard"] .hp-h2 {
  margin: 0 0 16px;
  font-family: var(--hp-font-display);
  font-size: clamp(1.9rem, 3vw, 2.85rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.028em;
  color: var(--hp-text);
}

body[data-page="dashboard"] .hp-lead {
  margin: 0 0 22px;
  max-width: var(--hp-copy-max);
  font-size: 1.09rem;
  line-height: 1.68;
  color: var(--hp-text-2);
}

/* Red text links.
   The :not() chain mirrors styles.css's global dark-theme anchor rule so
   these tie on specificity and win by source order (this file loads last). */
body[data-page="dashboard"] a.hp-textlink:not(.btn):not(.nav-link):not(.action-card-button),
body[data-page="dashboard"] .hp-signup-note a:not(.btn):not(.nav-link),
body[data-page="dashboard"] a.homepage-footer-bar__link:not(.btn):not(.nav-link) {
  color: var(--hp-red-text);
}

body[data-page="dashboard"] .hp-textlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  font-family: var(--hp-font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--hp-red-text);
  text-decoration: none;
  border-radius: 6px;
}

body[data-page="dashboard"] .hp-textlink:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

body[data-page="dashboard"] .hp-textlink:focus-visible {
  outline: none;
  box-shadow: var(--hp-focus-ring);
}

/* ============================================================
   HERO
   ============================================================ */
body[data-page="dashboard"] .hp-hero {
  position: relative;
  padding: clamp(52px, 8vw, 116px) 0 clamp(56px, 8vw, 120px);
  overflow: clip;
}

/* Warm accent glow — atmosphere without clutter */
body[data-page="dashboard"] .hp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hp-glow);
  pointer-events: none;
  z-index: 0;
}

body[data-page="dashboard"] .hp-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(36px, 5vw, 84px);
  align-items: center;
}

body[data-page="dashboard"] .hp-hero__copy {
  text-align: left;
  min-width: 0;
}

/* Big, tight, confident display headline — the block.xyz signature */
body[data-page="dashboard"] .hp-hero__headline {
  margin: 0 0 22px;
  max-width: 15ch;
  text-align: left;
  font-family: var(--hp-font-display);
  font-size: clamp(2.5rem, 5.2vw, 4.5rem);
  font-weight: 800;
  line-height: 1.015;
  letter-spacing: -0.038em;
  color: var(--hp-text);
  white-space: pre-line;
}

body[data-page="dashboard"] .hp-hero__subhead {
  margin: 0 0 34px;
  max-width: var(--hp-copy-max);
  font-size: clamp(1.09rem, 1.4vw, 1.24rem);
  line-height: 1.62;
  color: var(--hp-text-2);
}

/* --- Scan form: the strongest interaction on the page --- */
body[data-page="dashboard"] .hp-form {
  max-width: 640px;
  margin: 0 0 14px;
}

body[data-page="dashboard"] .hp-form__row {
  display: flex;
  gap: 8px;
  padding: 7px;
  background: var(--hp-surface);
  border: 1px solid var(--hp-line-strong);
  border-radius: var(--hp-radius-lg);
  box-shadow: var(--hp-shadow-card);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body[data-page="dashboard"] .hp-form__row:focus-within {
  border-color: var(--hp-red);
  box-shadow: var(--hp-shadow-card), var(--hp-focus-ring);
}

body[data-page="dashboard"] .hp-form__input {
  flex: 1;
  min-width: 0;
  height: var(--hp-control-h);
  padding: 0 20px;
  border: none;
  border-radius: calc(var(--hp-radius-lg) - 6px);
  background: transparent;
  font-family: var(--hp-font-mono);
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--hp-text);
}

body[data-page="dashboard"] .hp-form__input::placeholder {
  color: var(--hp-text-3);
  font-family: var(--hp-font-mono);
}

body[data-page="dashboard"] .hp-form__input:focus {
  outline: none;
}

body[data-page="dashboard"] .hp-form__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--hp-control-h);
  min-width: 150px;
  padding: 0 34px;
  border: none;
  border-radius: calc(var(--hp-radius-lg) - 6px);
  background: var(--hp-red);
  color: #ffffff;
  font-family: var(--hp-font-sans);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.1s ease;
}

body[data-page="dashboard"] .hp-form__button:hover {
  background: var(--hp-red-hover);
}

body[data-page="dashboard"] .hp-form__button:active {
  transform: scale(0.985);
}

body[data-page="dashboard"] .hp-form__button:focus-visible {
  outline: 2px solid var(--hp-text);
  outline-offset: 2px;
}

body[data-page="dashboard"] .hp-form__button:disabled {
  background: var(--hp-surface-2);
  color: var(--hp-text-3);
  cursor: wait;
}

/* Legacy styles.css paints #dashboardAnalyzeButton cyan with !important —
   counter it, scoped, in brand red. */
body[data-page="dashboard"] #dashboardAnalyzeButton {
  background: var(--hp-red) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}

body[data-page="dashboard"] #dashboardAnalyzeButton:hover {
  background: var(--hp-red-hover) !important;
}

body[data-page="dashboard"] #dashboardAnalyzeButton:disabled {
  background: var(--hp-surface-2) !important;
  color: var(--hp-text-3) !important;
}

body[data-page="dashboard"] #dashboardAnalyzeButton:focus {
  outline: 2px solid var(--hp-text) !important;
  outline-offset: 2px !important;
}

/* Usage pill + helper text row directly under the form */
body[data-page="dashboard"] .hp-form__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin: 0 0 22px;
  min-height: 28px;
}

body[data-page="dashboard"] .hp-form__meta .page-shell-usage-pill {
  margin: 0;
  justify-content: flex-start;
}

body[data-page="dashboard"] .hp-form__helper {
  margin: 0;
  font-family: var(--hp-font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--hp-text-3);
}

/* Example chips — right next to the scanner */
body[data-page="dashboard"] .hp-hero .example-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 26px;
  max-width: 640px;
}

body[data-page="dashboard"] .hp-hero .example-chips__label {
  font-family: var(--hp-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--hp-text-3);
  margin-right: 2px;
}

body[data-page="dashboard"] .hp-hero .example-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  font-family: var(--hp-font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--hp-text-2);
  background: transparent;
  border: 1px solid var(--hp-line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

body[data-page="dashboard"] .hp-hero .example-chip:hover {
  border-color: var(--hp-red);
  color: var(--hp-red-text);
  background: var(--hp-red-soft);
}

body[data-page="dashboard"] .hp-hero .example-chip:focus-visible {
  outline: none;
  box-shadow: var(--hp-focus-ring);
}

/* Secondary actions under the form */
body[data-page="dashboard"] .hp-hero .sample-report-link {
  margin: 0;
}

body[data-page="dashboard"] .hp-signup-note {
  margin: 16px 0 0;
  max-width: var(--hp-copy-max);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--hp-text-3);
}

body[data-page="dashboard"] .hp-signup-note a {
  color: var(--hp-red-text);
  font-weight: 600;
  text-decoration: none;
  /* a runtime script strips inter-element whitespace; keep the gap explicit */
  margin-left: 5px;
}

body[data-page="dashboard"] .hp-signup-note a:hover {
  text-decoration: underline;
}

body[data-page="dashboard"] .hp-signup-note a:focus-visible {
  outline: none;
  box-shadow: var(--hp-focus-ring);
  border-radius: 4px;
}

/* --- Hero right: framed product preview --- */
body[data-page="dashboard"] .hp-hero__visual {
  min-width: 0;
}

body[data-page="dashboard"] .hp-browser {
  background: var(--hp-surface);
  border: 1px solid var(--hp-line-strong);
  border-radius: var(--hp-radius-lg);
  box-shadow: var(--hp-shadow-pop);
  overflow: hidden;
}

body[data-page="dashboard"] .hp-browser__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: var(--hp-surface-2);
  border-bottom: 1px solid var(--hp-line);
}

body[data-page="dashboard"] .hp-browser__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hp-line-strong);
}

body[data-page="dashboard"] .hp-browser__url {
  margin-left: 10px;
  padding: 5px 14px;
  font-family: var(--hp-font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  color: var(--hp-text-3);
  background: var(--hp-bg);
  border: 1px solid var(--hp-line);
  border-radius: 999px;
}

body[data-page="dashboard"] .hp-browser__body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(22px, 2.6vw, 32px);
}

/* Overall score ring (SVG) — header row above the category bars */
body[data-page="dashboard"] .hp-score {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hp-line);
}

body[data-page="dashboard"] .hp-score__ring {
  width: 96px;
  flex-shrink: 0;
  height: auto;
}

body[data-page="dashboard"] .hp-score__ring .hp-ring-track {
  stroke: var(--hp-line);
}

body[data-page="dashboard"] .hp-score__ring .hp-ring-value {
  stroke: var(--hp-green);
}

body[data-page="dashboard"] .hp-score__ring text {
  fill: var(--hp-text);
  font-family: var(--hp-font-mono);
  font-size: 25px;
  font-weight: 600;
}

body[data-page="dashboard"] .hp-score__label {
  font-family: var(--hp-font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hp-text-3);
}

/* Category score rows */
body[data-page="dashboard"] .hp-cats {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

body[data-page="dashboard"] .hp-cat {
  display: grid;
  grid-template-columns: 108px 1fr 34px;
  align-items: center;
  gap: 12px;
}

body[data-page="dashboard"] .hp-cat__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hp-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="dashboard"] .hp-cat__track {
  height: 7px;
  background: var(--hp-line);
  border-radius: 999px;
  overflow: hidden;
}

body[data-page="dashboard"] .hp-cat__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--hp-green);
}

body[data-page="dashboard"] .hp-cat__fill--warn {
  background: var(--hp-amber);
}

body[data-page="dashboard"] .hp-cat__score {
  font-family: var(--hp-font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hp-text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   BANDS — full-bleed, hairline separation (block.xyz calm)
   ============================================================ */
body[data-page="dashboard"] .hp-band {
  position: relative;
  padding: var(--hp-band-y) 0;
}

body[data-page="dashboard"] .hp-band--raised {
  background: var(--hp-band-raised);
  border-top: 1px solid var(--hp-line);
  border-bottom: 1px solid var(--hp-line);
}

/* ------------------------------------------------------------
   PRODUCT VALUE band
   ------------------------------------------------------------ */
body[data-page="dashboard"] .hp-value .hero-right {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

body[data-page="dashboard"] .hp-value__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(36px, 5.5vw, 88px);
  align-items: center;
}

/* Report document card (links to the sample PDF) */
body[data-page="dashboard"] .hp-doc {
  display: block;
  max-width: 460px;
  margin: 0 auto;
  padding: clamp(24px, 2.8vw, 36px);
  background: var(--hp-surface);
  border: 1px solid var(--hp-line-strong);
  border-radius: var(--hp-radius-lg);
  box-shadow: var(--hp-shadow-pop);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body[data-page="dashboard"] .hp-doc:hover {
  transform: translateY(-4px);
}

body[data-page="dashboard"] .hp-doc:focus-visible {
  outline: none;
  box-shadow: var(--hp-shadow-pop), var(--hp-focus-ring);
}

body[data-page="dashboard"] .hp-doc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hp-line);
  margin-bottom: 18px;
}

body[data-page="dashboard"] .hp-doc__logo {
  height: 26px;
  width: auto;
}

body[data-page="dashboard"] .hp-doc__badge {
  font-family: var(--hp-font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hp-red-text);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 10px;
}

body[data-page="dashboard"] .hp-doc__rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

body[data-page="dashboard"] .hp-doc__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--hp-surface-2);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--hp-text-2);
}

body[data-page="dashboard"] .hp-doc__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--hp-font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--hp-red-text);
}

/* Value copy + benefits */
body[data-page="dashboard"] .hp-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 26px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

body[data-page="dashboard"] .hp-benefit {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

body[data-page="dashboard"] .hp-benefit__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--hp-red-soft);
  color: var(--hp-red-text);
}

body[data-page="dashboard"] .hp-benefit__icon svg {
  width: 20px;
  height: 20px;
}

body[data-page="dashboard"] .hp-benefit__text {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--hp-text);
  padding-top: 9px;
}

body[data-page="dashboard"] .hp-value__note {
  margin: 26px 0 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--hp-text-3);
  max-width: var(--hp-copy-max);
}

/* ------------------------------------------------------------
   FEATURE COVERAGE — 5 linked cards, editorial hairline style
   ------------------------------------------------------------ */
body[data-page="dashboard"] .hp-features.feature-strip {
  max-width: none;
  margin: 0;
  border-top: none;
  padding: var(--hp-band-y) 0;
}

body[data-page="dashboard"] .hp-features__head {
  max-width: var(--hp-copy-max);
  margin-bottom: clamp(30px, 3.5vw, 52px);
}

body[data-page="dashboard"] .hp-features__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--hp-line-strong);
}

/* Cards share hairlines like an index/table — a block.xyz-ish register.
   A colored top accent draws in on hover. */
body[data-page="dashboard"] .hp-feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px 24px 26px;
  background: transparent;
  border-right: 1px solid var(--hp-line);
  border-radius: 0;
  text-decoration: none;
  transition: background 0.2s ease;
}

body[data-page="dashboard"] .hp-features__grid > .hp-feature-card:last-child {
  border-right: none;
}

body[data-page="dashboard"] .hp-feature-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--hp-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s ease;
}

body[data-page="dashboard"] .hp-feature-card:hover {
  background: var(--hp-surface-2);
}

body[data-page="dashboard"] .hp-feature-card:hover::before {
  transform: scaleX(1);
}

body[data-page="dashboard"] .hp-feature-card:focus-visible {
  outline: none;
  box-shadow: inset var(--hp-focus-ring);
}

body[data-page="dashboard"] .hp-feature-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--hp-red-soft);
  color: var(--hp-red-text);
}

body[data-page="dashboard"] .hp-feature-card__icon svg {
  width: 22px;
  height: 22px;
}

body[data-page="dashboard"] .hp-feature-card .feature-strip__item-title {
  margin: 0;
  font-family: var(--hp-font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--hp-text);
}

body[data-page="dashboard"] .hp-feature-card .feature-strip__item-desc {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--hp-text-2);
}

body[data-page="dashboard"] .hp-feature-card__go {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--hp-font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  font-weight: 500;
  color: var(--hp-red-text);
}

/* ------------------------------------------------------------
   PRO CTA band
   ------------------------------------------------------------ */
body[data-page="dashboard"] .hp-cta.pro-upsell {
  max-width: none;
  margin: 0;
  padding: 0;
}

body[data-page="dashboard"] .hp-cta__band {
  background: var(--hp-band-raised);
  border-top: 1px solid var(--hp-line);
  padding: var(--hp-band-y) 0;
}

body[data-page="dashboard"] .hp-cta__inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: center;
}

body[data-page="dashboard"] .hp-cta__bullets {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

body[data-page="dashboard"] .hp-cta__bullet {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--hp-text-2);
}

body[data-page="dashboard"] .hp-cta__bullet svg {
  width: 18px;
  height: 18px;
  color: var(--hp-green);
  flex-shrink: 0;
}

body[data-page="dashboard"] .hp-cta__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  justify-self: end;
}

/* !important counters the white-theme mega button rule in styles.css
   (its :not() chain contains an ID, so it can't be beaten on specificity) */
body[data-page="dashboard"] .hp-cta__actions .pro-upsell__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--hp-control-h);
  padding: 0 44px;
  border: none !important;
  border-radius: var(--hp-radius);
  background: var(--hp-red) !important;
  color: #ffffff !important;
  font-family: var(--hp-font-sans);
  font-size: 1.06rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.1s ease;
}

body[data-page="dashboard"] .hp-cta__actions .pro-upsell__cta:hover {
  background: var(--hp-red-hover) !important;
}

body[data-page="dashboard"] .hp-cta__actions .pro-upsell__cta:active {
  transform: scale(0.985);
}

body[data-page="dashboard"] .hp-cta__actions .pro-upsell__cta:focus-visible {
  outline: 2px solid var(--hp-text);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   FOOTER bar (homepage-scoped)
   ------------------------------------------------------------ */
body[data-page="dashboard"] .homepage-footer-bar {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--hp-line);
}

body[data-page="dashboard"] .homepage-footer-bar__text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--hp-text-2);
}

body[data-page="dashboard"] .homepage-footer-bar__link {
  color: var(--hp-red-text);
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
}

body[data-page="dashboard"] .homepage-footer-bar__link:hover {
  text-decoration: underline;
}

body[data-page="dashboard"] .homepage-footer-bar__link:focus-visible {
  outline: none;
  box-shadow: var(--hp-focus-ring);
  border-radius: 4px;
}

body[data-page="dashboard"] .sm-version-badge {
  font-family: var(--hp-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--hp-text-3);
}

/* Shared UsagePill component renders 10-12px type; lift it to readable
   sizes on the homepage without touching the component itself */
body[data-page="dashboard"] .usage-pill__plan {
  font-size: 0.75rem !important;
}

body[data-page="dashboard"] .usage-pill__login-link {
  font-size: 0.8125rem !important;
}

/* ------------------------------------------------------------
   Report document card skeleton (wireframe, no fake copy)
   ------------------------------------------------------------ */
body[data-page="dashboard"] .hp-doc__body {
  display: block;
}

body[data-page="dashboard"] .hp-doc__line {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--hp-line-strong);
}

body[data-page="dashboard"] .hp-doc__line--title {
  width: 62%;
  height: 14px;
  margin-bottom: 10px;
}

body[data-page="dashboard"] .hp-doc__line--sub {
  width: 40%;
  background: var(--hp-line);
  margin-bottom: 20px;
}

body[data-page="dashboard"] .hp-doc__rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

body[data-page="dashboard"] .hp-doc__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--hp-surface-2);
  border-radius: 8px;
}

body[data-page="dashboard"] .hp-doc__line--row {
  flex: 1;
  background: var(--hp-line);
}

body[data-page="dashboard"] .hp-doc__dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

body[data-page="dashboard"] .hp-doc__dot--high { background: var(--hp-red); }
body[data-page="dashboard"] .hp-doc__dot--med  { background: var(--hp-amber); }
body[data-page="dashboard"] .hp-doc__dot--ok   { background: var(--hp-green); }

/* ============================================================
   ENTRANCE — one orchestrated staggered reveal on load
   ============================================================ */
@keyframes hpRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

body[data-page="dashboard"] .hp-hero__copy > *,
body[data-page="dashboard"] .hp-hero__visual {
  animation: hpRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body[data-page="dashboard"] .hp-hero__copy > .hp-eyebrow      { animation-delay: 0.02s; }
body[data-page="dashboard"] .hp-hero__copy > .hp-hero__headline { animation-delay: 0.09s; }
body[data-page="dashboard"] .hp-hero__copy > .hp-hero__subhead  { animation-delay: 0.17s; }
body[data-page="dashboard"] .hp-hero__copy > .hp-form           { animation-delay: 0.24s; }
body[data-page="dashboard"] .hp-hero__copy > .hp-form__meta     { animation-delay: 0.30s; }
body[data-page="dashboard"] .hp-hero__copy > .example-chips     { animation-delay: 0.35s; }
body[data-page="dashboard"] .hp-hero__copy > .sample-report-link,
body[data-page="dashboard"] .hp-hero__copy > .hp-signup-note    { animation-delay: 0.40s; }
body[data-page="dashboard"] .hp-hero__visual                    { animation-delay: 0.30s; }

/* ------------------------------------------------------------
   Post-scan state: hide marketing sections (behavior contract
   with dashboard-script.js's body.scan-complete toggle)
   ------------------------------------------------------------ */
body.scan-complete .hero-right,
body.scan-complete .feature-strip,
body.scan-complete .pro-upsell,
body.scan-complete .homepage-footer-bar,
body.scan-complete .sample-report-link,
body.scan-complete .example-chips,
body.scan-complete .hp-value,
body.scan-complete .hp-signup-note,
body.scan-complete .hp-eyebrow {
  display: none !important;
}

/* ------------------------------------------------------------
   Scan results container inherits the wider stage
   ------------------------------------------------------------ */
body[data-page="dashboard"] #dashboardResults {
  max-width: var(--hp-container) !important;
  padding-left: var(--hp-pad-x) !important;
  padding-right: var(--hp-pad-x) !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1279px) {
  body[data-page="dashboard"] .hp-hero__grid {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  }
}

/* 1024-1140: five feature cards get cramped — drop to 3 columns and
   restore full hairline borders around the now-wrapping cells */
@media (max-width: 1140px) and (min-width: 1024px) {
  body[data-page="dashboard"] .hp-features__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  body[data-page="dashboard"] .hp-hero__grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  body[data-page="dashboard"] .hp-hero__copy {
    text-align: center;
    max-width: 660px;
    margin: 0 auto;
  }

  body[data-page="dashboard"] .hp-hero__copy > .hp-eyebrow {
    justify-content: center;
  }

  body[data-page="dashboard"] .hp-hero__headline {
    text-align: center;
    max-width: none;
  }

  body[data-page="dashboard"] .hp-hero__headline,
  body[data-page="dashboard"] .hp-hero__subhead,
  body[data-page="dashboard"] .hp-form,
  body[data-page="dashboard"] .hp-signup-note {
    margin-left: auto;
    margin-right: auto;
  }

  body[data-page="dashboard"] .hp-form__meta,
  body[data-page="dashboard"] .hp-hero .example-chips {
    justify-content: center;
  }

  body[data-page="dashboard"] .hp-hero__visual {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
  }

  body[data-page="dashboard"] .hp-value__grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  body[data-page="dashboard"] .hp-features__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* wrapping grid: every cell keeps its right hairline; add row rhythm */
  body[data-page="dashboard"] .hp-feature-card {
    border-bottom: 1px solid var(--hp-line);
  }

  body[data-page="dashboard"] .hp-cta__inner {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .hp-cta__actions {
    justify-self: start;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
  }
}

@media (max-width: 767px) {
  body[data-page="dashboard"] .hp-form__row {
    flex-direction: column;
    padding: 8px;
  }

  body[data-page="dashboard"] .hp-form__input {
    height: 52px;
    text-align: center;
  }

  body[data-page="dashboard"] .hp-form__button {
    width: 100%;
    height: 52px;
  }

  body[data-page="dashboard"] .hp-cta__actions .pro-upsell__cta {
    height: 52px;
    width: 100%;
    max-width: 420px;
  }

  body[data-page="dashboard"] .hp-browser__body {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  body[data-page="dashboard"] .hp-cat {
    width: 100%;
  }

  body[data-page="dashboard"] .hp-benefits {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .hp-features__grid {
    grid-template-columns: 1fr;
    border-top: none;
  }

  body[data-page="dashboard"] .hp-feature-card {
    border-right: none;
    border-top: 1px solid var(--hp-line);
    border-bottom: none;
  }

  body[data-page="dashboard"] .hp-doc {
    max-width: 100%;
  }
}

/* Reduced motion: no transforms, no entrance animation */
@media (prefers-reduced-motion: reduce) {
  body[data-page="dashboard"] .hp-form__button,
  body[data-page="dashboard"] .hp-doc,
  body[data-page="dashboard"] .hp-feature-card,
  body[data-page="dashboard"] .hp-feature-card::before,
  body[data-page="dashboard"] .hp-cta__actions .pro-upsell__cta,
  body[data-page="dashboard"] .hp-form__row,
  body[data-page="dashboard"] .hp-hero .example-chip {
    transition: none;
  }

  body[data-page="dashboard"] .hp-hero__copy > *,
  body[data-page="dashboard"] .hp-hero__visual {
    animation: none;
  }

  body[data-page="dashboard"] .hp-doc:hover,
  body[data-page="dashboard"] .hp-feature-card:hover,
  body[data-page="dashboard"] .hp-form__button:active,
  body[data-page="dashboard"] .hp-cta__actions .pro-upsell__cta:active {
    transform: none;
  }
}

/* ------------------------------------------------------------
   Box harmony (post-scan / light theme): one clean card for
   results; the hero stays frameless on the page surface.
   ------------------------------------------------------------ */
body[data-page="dashboard"] .homepage-hero {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body[data-page="dashboard"] #dashboardResults {
  background: var(--hp-surface) !important;
  border: 1px solid var(--hp-line) !important;
  border-radius: var(--hp-radius-lg) !important;
  box-shadow: var(--hp-shadow-card) !important;
  padding-top: 28px !important;
  padding-bottom: 28px !important;
}

body[data-page="dashboard"] #dashboardResults .dashboard-animate-in,
body[data-page="dashboard"] #dashboardResults > .section {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
