/*
  Sales and conversion layer for the public landing page.
  Loaded last so the copy and pricing changes stay visually stable.
*/

:root {
  --sales-ink: #101828;
  --sales-muted: #607086;
  --sales-line: #cbdcf0;
  --sales-blue: #2563eb;
  --sales-green: #12845f;
  --sales-amber: #d97706;
  --sales-red: #dc2626;
  --sales-soft: #f7fbff;
  --sales-card: #ffffff;
  --sales-shadow: 0 18px 54px rgba(39, 79, 126, .1);
}

.site-header .button-small {
  min-width: 132px;
}

@media (min-width: 1120px) {
  .hero {
    width: min(1240px, calc(100% - 48px));
    min-height: min(660px, calc(100vh - 72px));
    grid-template-columns: minmax(0, 1.12fr) minmax(460px, .88fr);
    align-items: center;
    justify-items: stretch;
    gap: 34px;
    padding: 82px 0 30px;
  }

  .hero-copy {
    justify-items: start;
    width: 100%;
  }

  .hero h1,
  .hero p {
    text-align: left;
  }

  .hero-copy h1 {
    max-width: 670px;
    font-size: clamp(36px, 3.6vw, 48px);
  }

  .hero-copy p {
    max-width: 570px;
    margin-top: 14px;
    font-size: 17px;
  }

  .hero-actions,
  .premium-proof,
  .hero-live-strip {
    justify-content: flex-start;
  }

  .hero-actions {
    margin-top: 24px;
  }

  .premium-proof {
    margin-top: 14px;
  }

  .product-panel {
    width: 100% !important;
    max-width: none !important;
    max-height: 450px;
    margin-top: 0 !important;
    padding-bottom: 18px !important;
    overflow: hidden;
    transform: none !important;
  }

  .hero-result-card {
    display: none;
  }
}

.hero-copy {
  gap: 18px;
}

.hero-copy h1 {
  max-width: 880px;
}

.hero-copy p {
  max-width: 760px;
}

.hero-actions .button.secondary {
  color: var(--sales-ink);
  background: #fff;
  border: 1px solid var(--sales-line);
  box-shadow: none;
}

.premium-proof {
  align-items: stretch;
}

.premium-proof span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  color: #344054;
  background: rgba(255, 255, 255, .84);
}

.hero-result-card {
  display: grid;
  max-width: 680px;
  grid-template-columns: minmax(190px, .8fr) minmax(240px, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(239, 248, 255, .92));
  box-shadow: 0 14px 38px rgba(37, 99, 235, .08);
}

.hero-result-card span,
.result-card span,
.audience-grid span,
.comparison-grid span,
.funnel-grid span,
.objection-grid span {
  color: var(--sales-blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-result-card strong {
  display: block;
  margin-top: 6px;
  color: var(--sales-ink);
  font-size: 22px;
  line-height: 1.15;
}

.hero-result-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #405168;
  font-size: 13px;
  font-weight: 750;
}

.hero-result-card li {
  position: relative;
  padding-left: 18px;
}

.hero-result-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--sales-amber);
}

.result-section,
.audience-section,
.comparison-section,
.trust-section,
.funnel-section,
.objection-section,
.runtime-section {
  width: min(1240px, calc(100% - 48px));
}

.result-grid,
.audience-grid,
.comparison-grid,
.trust-grid,
.pricing-aftercopy,
.funnel-grid,
.objection-grid,
.upgrade-matrix {
  display: grid;
  gap: 16px;
}

.result-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.audience-grid,
.trust-grid,
.funnel-grid,
.upgrade-matrix {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.comparison-grid,
.objection-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-card,
.audience-grid article,
.comparison-grid article,
.trust-grid article,
.pricing-aftercopy article,
.funnel-grid article,
.objection-grid article,
.upgrade-matrix article {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(129, 169, 220, .38);
  border-radius: 22px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--sales-shadow);
}

.result-card strong,
.trust-grid strong,
.pricing-aftercopy strong {
  display: block;
  margin-top: 8px;
  color: var(--sales-ink);
  font-size: 24px;
  line-height: 1.15;
}

.result-card p,
.audience-grid p,
.comparison-grid li,
.trust-grid span,
.pricing-aftercopy span,
.funnel-grid p,
.objection-grid p,
.upgrade-matrix span {
  color: var(--sales-muted);
  line-height: 1.52;
}

.result-card ul,
.comparison-grid ul {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding-left: 18px;
}

.result-paid {
  border-color: rgba(18, 132, 95, .28);
  background: linear-gradient(180deg, #fff, #f1fbf7);
}

.result-case {
  border-color: rgba(217, 119, 6, .28);
  background: linear-gradient(180deg, #fff, #fff8ed);
}

.case-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.case-stack b {
  padding: 7px 10px;
  border: 1px solid rgba(217, 119, 6, .24);
  border-radius: 999px;
  background: #fff;
  color: #92400e;
  font-size: 12px;
}

.audience-grid article h3 {
  margin: 10px 0 8px;
  color: var(--sales-ink);
  font-size: 20px;
}

.funnel-grid article {
  background: linear-gradient(180deg, #fff, #f4f8ff);
}

.funnel-grid h3 {
  margin: 10px 0 8px;
  color: var(--sales-ink);
  font-size: 20px;
  line-height: 1.2;
}

.funnel-grid b {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #184e9c;
  background: rgba(37, 99, 235, .08);
  font-size: 12px;
  font-weight: 900;
}

.comparison-win {
  border-color: rgba(18, 132, 95, .32) !important;
  background: linear-gradient(180deg, #fff, #f0fdf7) !important;
}

.trust-grid article {
  box-shadow: 0 12px 34px rgba(39, 79, 126, .06);
}

.objection-section {
  padding-top: 28px;
}

.objection-grid article {
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.objection-grid span {
  display: block;
  margin-bottom: 10px;
  color: var(--sales-ink);
  font-size: 18px;
  line-height: 1.25;
  text-transform: none;
}

.upgrade-matrix {
  margin-top: 16px;
}

.upgrade-matrix article {
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(39, 79, 126, .07);
}

.upgrade-matrix strong {
  display: block;
  margin-bottom: 6px;
  color: var(--sales-green);
  font-size: 16px;
}

.runtime-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .72fr);
  gap: 18px;
  align-items: stretch;
  padding-top: 24px;
}

.runtime-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(129, 169, 220, .34);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f7fbff);
  box-shadow: var(--sales-shadow);
}

.runtime-copy h2 {
  margin: 0;
  color: var(--sales-ink);
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.08;
}

.runtime-copy p {
  max-width: 650px;
  margin: 0;
  color: var(--sales-muted);
  line-height: 1.55;
}

.runtime-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(129, 169, 220, .46);
  border-top: 4px solid var(--sales-amber);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--sales-shadow);
}

.runtime-panel[data-state="ok"] {
  border-top-color: var(--sales-green);
  background: linear-gradient(180deg, #fff, #f1fbf7);
}

.runtime-panel[data-state="error"] {
  border-top-color: var(--sales-red);
  background: linear-gradient(180deg, #fff, #fff5f5);
}

.runtime-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(129, 169, 220, .22);
}

.runtime-row span {
  color: var(--sales-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.runtime-row strong {
  min-width: 0;
  color: var(--sales-ink);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.runtime-panel p {
  margin: 0;
  color: var(--sales-muted);
  line-height: 1.5;
}

.runtime-panel code {
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 10px;
  color: #184e9c;
  background: rgba(37, 99, 235, .07);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.runtime-panel .button {
  width: fit-content;
}

.billing-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: -12px 0 22px;
  padding: 6px;
  border: 1px solid var(--sales-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 26px rgba(39, 79, 126, .07);
}

.billing-note span,
.billing-note b {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--sales-muted);
  font-size: 12px;
  font-weight: 900;
}

.billing-note span.active {
  color: #fff;
  background: var(--sales-blue);
}

.billing-note b {
  color: var(--sales-green);
  background: rgba(18, 132, 95, .08);
}

.price-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0 !important;
}

.price-card.featured {
  position: relative;
}

.best-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--sales-green);
  font-size: 11px;
  font-weight: 900;
}

.price-card p {
  min-height: 0 !important;
}

.price-card p b {
  color: var(--sales-ink);
}

.plan-result {
  min-height: 58px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 14px;
  color: #24456f;
  background: rgba(37, 99, 235, .06);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.42;
}

.price-card ul {
  margin-top: 0 !important;
  margin-bottom: 16px !important;
}

.price-card .button {
  margin-top: auto;
}

.pricing-aftercopy {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.pricing-aftercopy article {
  padding: 18px;
}

.pricing-aftercopy strong {
  margin: 0 0 6px;
  font-size: 18px;
}

.cta-section {
  align-items: stretch;
}

.cta-section > div:first-child p {
  max-width: 640px;
  margin: 10px 0 0;
  color: #5f7188;
  line-height: 1.5;
}

.cta-form {
  grid-template-columns: minmax(220px, 1.1fr) minmax(220px, .9fr) auto;
  border-radius: 18px;
}

.cta-form.has-valid-url input[type="url"] {
  border-color: rgba(18, 132, 95, .45);
  box-shadow: 0 0 0 3px rgba(18, 132, 95, .1);
}

.cta-hint {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: #607086;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.cta-unlock {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  margin-top: 12px;
}

.cta-unlock span,
.cta-unlock a {
  padding: 7px 10px;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 999px;
  color: #31547d;
  background: rgba(255, 255, 255, .76);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.cta-unlock a {
  color: #fff;
  background: var(--sales-blue);
}

body.has-public-score .product-panel {
  border-color: rgba(18, 132, 95, .38);
  box-shadow: 0 24px 76px rgba(18, 132, 95, .16);
}

.canvas-wrap {
  position: relative;
}

.chart-fallback {
  display: grid;
  position: absolute;
  inset: 0;
  min-height: 100%;
  place-items: center;
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(37, 99, 235, .28);
  border-radius: 16px;
  color: #31547d;
  background: rgba(255, 255, 255, .78);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.5;
  text-align: center;
}

.chart-fallback[hidden] {
  display: none;
}

@media (min-width: 1120px) {
  .hero .hero-result-card,
  .hero .hero-live-strip {
    display: none !important;
  }

  .quality-strip {
    margin-top: 12px !important;
  }
}

@media (max-width: 1180px) {
  .result-grid,
  .pricing-aftercopy {
    grid-template-columns: 1fr;
  }

  .audience-grid,
  .trust-grid,
  .funnel-grid,
  .upgrade-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .objection-grid {
    grid-template-columns: 1fr;
  }

  .runtime-section {
    grid-template-columns: 1fr;
  }

  .cta-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .result-section,
  .audience-section,
  .comparison-section,
  .trust-section,
  .funnel-section,
  .objection-section,
  .runtime-section {
    width: min(100% - 22px, 1240px);
  }

  .hero-result-card,
  .comparison-grid,
  .audience-grid,
  .trust-grid,
  .funnel-grid,
  .upgrade-matrix {
    grid-template-columns: 1fr;
  }

  .billing-note {
    border-radius: 18px;
  }

  .best-badge {
    position: static;
    width: fit-content;
    margin-bottom: -4px;
  }
}

/* v2: fix public hero and free-check form overflow. */
@media (min-width: 1120px) {
  .hero {
    min-height: auto !important;
    align-items: start !important;
    padding-top: clamp(86px, 8vw, 112px) !important;
    padding-bottom: 42px !important;
  }

  .product-panel {
    max-height: none !important;
    overflow: visible !important;
  }

  .product-panel .live-engine-grid {
    display: none !important;
  }

  .product-panel .insight-grid {
    display: none !important;
  }
}

.cta-section {
  align-items: center !important;
}

.cta-form {
  align-self: center !important;
  grid-template-columns: 1fr !important;
  align-content: start !important;
  align-items: stretch !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 12px !important;
  border-radius: 20px !important;
}

.cta-form input {
  width: 100% !important;
  min-height: 46px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, .88) !important;
  border: 1px solid rgba(126, 176, 238, .58) !important;
}

.cta-form .button {
  width: 100% !important;
  min-height: 46px !important;
}

.cta-hint {
  margin: 0 !important;
}

@media (min-width: 1120px) {
  .cta-section {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px) !important;
  }
}

/* v3: rebuild hero product preview spacing. */
.hero .product-panel {
  box-sizing: border-box !important;
  padding: 0 22px 24px !important;
  border-radius: 18px !important;
  border-color: rgba(107, 157, 232, .64) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(242, 248, 255, .94)) !important;
  box-shadow: 0 26px 72px rgba(46, 98, 172, .16) !important;
}

.hero .product-panel .browser-bar {
  height: 48px !important;
  margin: 0 -22px 20px !important;
  padding: 0 22px !important;
  border-radius: 18px 18px 0 0 !important;
  background: rgba(246, 251, 255, .96) !important;
  border-bottom: 1px solid rgba(122, 171, 236, .36) !important;
}

.hero .product-panel .browser-bar b {
  padding: 6px 16px !important;
  background: #eaf2ff !important;
  color: #607086 !important;
}

.hero .product-panel .panel-top {
  align-items: flex-start !important;
  gap: 18px !important;
  padding: 0 0 2px !important;
}

.hero .product-panel .panel-actions {
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

.hero .product-panel .free-analysis-button {
  min-height: 36px !important;
  padding: 0 16px !important;
}

.hero .product-panel .period-switch {
  padding: 5px !important;
  background: rgba(239, 246, 255, .92) !important;
}

.hero .product-panel .kpi-grid {
  gap: 14px !important;
  margin-top: 18px !important;
}

.hero .product-panel .kpi-card {
  padding: 18px !important;
  border-radius: 12px !important;
}

.hero .product-panel .kpi-card strong {
  margin-top: 10px !important;
  font-size: 25px !important;
}

.hero .product-panel .premium-status {
  gap: 10px !important;
  margin-top: 14px !important;
}

.hero .product-panel .premium-status span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
  padding: 8px 12px !important;
  line-height: 1.2 !important;
}

.hero .product-panel .dashboard-grid {
  gap: 14px !important;
  margin-top: 14px !important;
}

.hero .product-panel .chart-card {
  padding: 22px !important;
  border-radius: 14px !important;
  border-color: rgba(120, 166, 232, .54) !important;
}

.hero .product-panel .module-head {
  align-items: flex-start !important;
  gap: 16px !important;
}

.hero .product-panel .module-head h2 {
  margin-top: 6px !important;
  line-height: 1.2 !important;
}

.hero .product-panel .canvas-wrap.large {
  height: 220px !important;
  margin-top: 18px !important;
  padding: 4px 6px 10px !important;
}

.hero .product-panel #trafficChart {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.hero .product-panel .chart-card-main {
  overflow: visible !important;
}

.hero .product-panel .chart-card-main::after {
  pointer-events: none !important;
}

@media (max-width: 760px) {
  .hero .product-panel {
    padding: 0 16px 18px !important;
  }

  .hero .product-panel .browser-bar {
    margin-inline: -16px !important;
    padding-inline: 16px !important;
  }

  .hero .product-panel .panel-top,
  .hero .product-panel .kpi-grid,
  .hero .product-panel .premium-status {
    grid-template-columns: 1fr !important;
  }
}

/* v4: replace loose grid background with framed hero workspace. */
body {
  background: linear-gradient(180deg, #f7f9fc 0%, #eef4f8 54%, #f8fafc 100%) !important;
  background-size: auto !important;
}

.hero {
  overflow: visible !important;
  border: 1px solid rgba(134, 157, 190, .34) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(247, 250, 254, .96)) !important;
  box-shadow: 0 24px 70px rgba(47, 75, 112, .10) !important;
}

.hero::before,
.hero::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}

.hero .hero-copy {
  box-sizing: border-box !important;
  align-self: start !important;
  max-width: 640px !important;
  padding: 30px !important;
  border: 1px solid rgba(134, 157, 190, .32) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .96)) !important;
  box-shadow: 0 18px 54px rgba(48, 78, 116, .08) !important;
}

.hero .hero-copy .eyebrow {
  margin-bottom: 16px !important;
  color: #2563eb !important;
}

.hero .hero-copy h1 {
  max-width: 100% !important;
}

.hero .hero-copy p {
  max-width: 100% !important;
}

.hero .premium-proof {
  width: 100% !important;
  gap: 10px !important;
  margin-top: 24px !important;
}

.hero .premium-proof span {
  border-color: rgba(129, 169, 220, .52) !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

@media (min-width: 1120px) {
  .hero {
    gap: 28px !important;
    padding: 96px 24px 32px !important;
  }

  .hero .hero-copy {
    margin-top: 18px !important;
  }
}

@media (max-width: 760px) {
  .hero {
    border-radius: 18px !important;
  }

  .hero .hero-copy {
    padding: 22px !important;
    border-radius: 16px !important;
  }
}
