/* =========================================================
   PGS 3D - Conversion layer
   Additive styles for the rebuilt homepage: hero composition,
   proof bar, outcomes, comparison, guarantee, sticky CTA.
   Loaded LAST so it can refine the base system.
   ========================================================= */

:root {
  /* Alias for a token referenced in sections.css but never defined.
     Keeps pricing/add-on copy rendering in the intended muted tone. */
  --pgs-text-soft: var(--pgs-text-light);
}

/* ============================================================
   HERO refinements
   ============================================================ */
.pgs3d-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem 0.4rem 0.45rem;
  margin-bottom: var(--pgs-space-lg);
  background: var(--pgs-glass-bg-strong);
  border: 1px solid var(--pgs-glass-border);
  border-radius: var(--pgs-radius-pill);
  box-shadow: var(--pgs-shadow-1);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pgs-text-light);
}
.pgs3d-hero__badge b { color: var(--pgs-text); font-weight: 700; }
.pgs3d-hero__badge-text { line-height: 1.3; }
.pgs3d-hero__badge-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.2rem 0.6rem;
  border-radius: var(--pgs-radius-pill);
  background: var(--pgs-primary-bg);
  color: var(--pgs-primary-dark);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}
.pgs3d-hero__stars { color: #F59E0B; letter-spacing: 0.05em; font-size: 0.85rem; }

/* Hero CTA helper line under the buttons */
.pgs3d-hero__reassure {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--pgs-text-light);
  margin: 0.85rem 0 0;
}
.pgs3d-hero__reassure svg { width: 16px; height: 16px; color: var(--pgs-primary); flex-shrink: 0; }

/* Above-the-fold quantified proof (truthful, already-stated figures) */
.pgs3d-hero__proof {
  font-size: 0.875rem;
  color: var(--pgs-text-light);
  margin: 0.5rem 0 0;
}
.pgs3d-hero__proof strong { color: var(--pgs-primary-dark); font-weight: 700; }

/* Screen-reader-only utility (table caption, etc.) */
.pgs3d-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Hero "demand kit" composition (replaces flat SVG) ---- */
.pgs3d-kit {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 540px;
  margin-left: auto;
}
.pgs3d-kit__core {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 42%;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--pgs-radius-xl);
  background: linear-gradient(160deg, #ffffff 0%, #ecfdfa 100%);
  border: 1px solid var(--pgs-glass-border);
  box-shadow: var(--pgs-shadow-3);
  z-index: 3;
}
.pgs3d-kit__core-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #14B8A6 0%, #0F766E 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), var(--pgs-shadow-glow);
}
.pgs3d-kit__core-icon svg { width: 26px; height: 26px; }
.pgs3d-kit__core b { font-size: 1.05rem; color: var(--pgs-text); line-height: 1.1; }
/* Label span only, NOT the icon span (which must stay white on the teal disc). */
.pgs3d-kit__core > span:not(.pgs3d-kit__core-icon) { font-size: 0.72rem; color: var(--pgs-text-light); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }

.pgs3d-kit__node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--pgs-radius-md);
  background: var(--pgs-glass-bg-strong);
  border: 1px solid var(--pgs-glass-border);
  box-shadow: var(--pgs-shadow-2);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pgs-text);
  white-space: nowrap;
  z-index: 4;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: pgs3d-float 7s var(--pgs-ease-in-out) infinite;
}
.pgs3d-kit__node svg { width: 18px; height: 18px; color: var(--pgs-primary-dark); flex-shrink: 0; }
.pgs3d-kit__node small {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--pgs-primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pgs3d-kit__node b { font-size: 0.84rem; color: var(--pgs-text); }

.pgs3d-kit__node--a { top: 6%;  left: -2%;  animation-delay: 0s; }
.pgs3d-kit__node--b { top: 2%;  right: 2%;  animation-delay: -1.2s; }
.pgs3d-kit__node--c { top: 44%; right: -6%; animation-delay: -2.4s; }
.pgs3d-kit__node--d { bottom: 6%; right: 4%; animation-delay: -3.6s; }
.pgs3d-kit__node--e { bottom: 2%; left: 0%;  animation-delay: -4.8s; }
.pgs3d-kit__node--f { top: 40%; left: -8%;  animation-delay: -6s; }

@keyframes pgs3d-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Faint connecting rings behind the nodes */
.pgs3d-kit__ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px dashed rgba(13, 148, 136, 0.22);
  z-index: 1;
}
.pgs3d-kit__ring--1 { width: 64%; aspect-ratio: 1/1; }
.pgs3d-kit__ring--2 { width: 92%; aspect-ratio: 1/1; border-color: rgba(13,148,136,0.12); }

@media (prefers-reduced-motion: reduce) {
  .pgs3d-kit__node { animation: none; }
}

/* ============================================================
   PROOF BAR (stats strip under hero)
   ============================================================ */
.pgs3d-proofbar {
  padding: var(--pgs-space-2xl) 0;
  background: var(--pgs-bg);
  border-top: 1px solid var(--pgs-border);
  border-bottom: 1px solid var(--pgs-border);
}
.pgs3d-proofbar__intro {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--pgs-text-light);
  margin: 0 0 var(--pgs-space-xl);
}
.pgs3d-proofbar__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--pgs-space-lg);
}
.pgs3d-stat { text-align: center; }
.pgs3d-stat__num {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--pgs-primary) 0%, var(--pgs-primary-dark) 70%, #0E3A36 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.pgs3d-stat__label {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--pgs-text-light);
  line-height: 1.35;
}
/* Keep the gradient-clipped numbers visible in Windows High Contrast mode. */
@media (forced-colors: active) {
  .pgs3d-stat__num {
    -webkit-text-fill-color: currentColor;
    color: CanvasText;
    background: none;
  }
}

/* Hide collapsed FAQ answers from the accessibility tree, not just visually.
   Keeps the existing max-height animation intact. */
.pgs3d-faq__answer {
  visibility: hidden;
  transition: max-height 0.4s var(--pgs-ease-out-expo), visibility 0s linear 0.42s;
}
.pgs3d-faq__item.is-open .pgs3d-faq__answer {
  visibility: visible;
  transition: max-height 0.4s var(--pgs-ease-out-expo), visibility 0s linear 0s;
}

/* ============================================================
   OUTCOMES
   ============================================================ */
.pgs3d-outcomes { background: var(--pgs-mesh-warm); }
.pgs3d-outcomes__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--pgs-space-lg);
  margin-top: var(--pgs-space-2xl);
  text-align: left;
}
.pgs3d-outcome__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: var(--pgs-radius-md);
  background: linear-gradient(135deg, rgba(204,251,241,0.85) 0%, rgba(20,184,166,0.18) 100%);
  border: 1px solid rgba(255,255,255,0.6);
  color: var(--pgs-primary-dark);
  margin-bottom: var(--pgs-space-md);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 6px 14px rgba(13,148,136,0.16);
}
.pgs3d-outcome__icon svg { width: 24px; height: 24px; }
.pgs3d-outcomes__grid h3 { font-size: 1.125rem; margin-bottom: 0.4rem; }
.pgs3d-outcomes__grid p { color: var(--pgs-text-light); font-size: 0.9375rem; margin: 0; }

/* ============================================================
   COMPARISON
   ============================================================ */
.pgs3d-compare { background: var(--pgs-bg); }
.pgs3d-compare__wrap {
  margin-top: var(--pgs-space-2xl);
  overflow-x: auto;
  border-radius: var(--pgs-radius-lg);
  border: 1px solid var(--pgs-border);
  box-shadow: var(--pgs-shadow-2);
  background: var(--pgs-bg);
}
.pgs3d-compare__table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
}
.pgs3d-compare__table th,
.pgs3d-compare__table td {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--pgs-border);
  font-size: 0.9375rem;
  vertical-align: middle;
}
.pgs3d-compare__table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pgs-text-light);
  font-weight: 700;
  background: var(--pgs-bg-alt);
}
.pgs3d-compare__table thead th:first-child { background: transparent; }
.pgs3d-compare__rowlabel { font-weight: 600; color: var(--pgs-text); }
.pgs3d-compare__col-pgs {
  position: relative;
  background: linear-gradient(180deg, rgba(204,251,241,0.45) 0%, rgba(204,251,241,0.18) 100%);
}
.pgs3d-compare__table thead th.pgs3d-compare__col-pgs {
  color: var(--pgs-primary-dark);
  background: var(--pgs-primary-bg);
}
.pgs3d-compare__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.pgs3d-compare__yes { color: var(--pgs-primary-dark); font-weight: 700; }
.pgs3d-compare__no  { color: var(--pgs-text-light); }
.pgs3d-compare__table tbody tr:last-child td,
.pgs3d-compare__table tbody tr:last-child th { border-bottom: none; }
.pgs3d-compare__ico { display: inline-flex; vertical-align: -3px; margin-right: 0.35rem; }
.pgs3d-compare__ico svg { width: 16px; height: 16px; }

/* ============================================================
   GUARANTEE band
   ============================================================ */
.pgs3d-guarantee {
  background: var(--pgs-mesh-alt);
}
.pgs3d-guarantee__card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--pgs-space-xl);
  padding: var(--pgs-space-2xl);
  text-align: left;
}
.pgs3d-guarantee__seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #14B8A6 0%, #0F766E 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), var(--pgs-shadow-glow);
  flex-shrink: 0;
}
.pgs3d-guarantee__seal svg { width: 38px; height: 38px; }
.pgs3d-guarantee__card h3 { margin: 0 0 0.35rem; font-size: 1.375rem; }
.pgs3d-guarantee__card p { margin: 0; color: var(--pgs-text-light); max-width: 560px; }
.pgs3d-guarantee__card .pgs3d-btn { white-space: nowrap; }

/* ============================================================
   STICKY MOBILE CTA
   ============================================================ */
.pgs3d-stickycta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--pgs-glass-border-dark);
  box-shadow: 0 -6px 24px rgba(15,23,42,0.10);
  transform: translateY(110%);
  transition: transform 0.4s var(--pgs-ease-out-expo);
}
.pgs3d-stickycta.is-visible { transform: translateY(0); }
.pgs3d-stickycta__text { line-height: 1.2; }
.pgs3d-stickycta__text b { display: block; font-size: 0.9rem; color: var(--pgs-text); }
.pgs3d-stickycta__text span { font-size: 0.75rem; color: var(--pgs-text-light); }
.pgs3d-stickycta .pgs3d-btn { padding: 0.75rem 1.15rem; font-size: 0.9rem; }

/* Show the sticky CTA only on smaller screens where the header CTA scrolls away. */
@media (min-width: 901px) {
  .pgs3d-stickycta { display: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .pgs3d-outcomes__grid { grid-template-columns: 1fr; }
  .pgs3d-proofbar__grid { grid-template-columns: repeat(2, 1fr); gap: var(--pgs-space-xl); }
}

/* Sticky CTA shows up to 900px: drop the backdrop blur here (not just at 720)
   so mid-size phones/tablets avoid the blur repaint cost. */
@media (max-width: 900px) {
  .pgs3d-stickycta {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .pgs3d-stickycta .pgs3d-btn { min-height: 48px; flex: 0 0 auto; }
}

@media (max-width: 720px) {
  /* Badge reads as one wrapping sentence next to the chip, in a tidy
     rounded box rather than a stretched stadium pill. */
  .pgs3d-hero__badge {
    align-items: center;
    border-radius: var(--pgs-radius-lg);
    padding: 0.5rem 0.8rem;
    gap: 0.6rem;
  }

  .pgs3d-kit { max-width: 340px; margin: 0 auto; }
  .pgs3d-kit__node { font-size: 0.72rem; padding: 0.45rem 0.6rem; }
  .pgs3d-kit__node small { font-size: 0.6rem; }

  /* Perf: the 6 floating hero nodes each ran a backdrop blur that repaints
     every animation frame. Swap to a solid surface on phones. */
  .pgs3d-kit__node {
    background: var(--pgs-glass-bg-strong);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Mobile-friendly buttons: primary CTAs go full width with a comfortable
     tap height so they are easy to hit and look intentional. */
  .pgs3d-hero__ctas {
    flex-direction: column;
    align-items: stretch;
  }
  .pgs3d-hero__ctas .pgs3d-btn,
  .pgs3d-deliverables__cta .pgs3d-btn,
  .pgs3d-pricing__bottom .pgs3d-btn,
  .pgs3d-guarantee__card .pgs3d-btn,
  .pgs3d-final-cta .pgs3d-btn {
    display: flex;
    width: 100%;
    white-space: normal;
    min-height: 52px;
  }
  /* The hero "See how it works" text link needs a real tap target. */
  .pgs3d-hero__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }

  .pgs3d-guarantee__card {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    gap: var(--pgs-space-md);
    padding: var(--pgs-space-lg);
  }
  .pgs3d-guarantee__card p { margin-left: auto; margin-right: auto; }

  /* Comparison: pin the metric column so each row's PGS answer stays
     paired with its label while the alternatives scroll into view. */
  .pgs3d-compare__table { min-width: 560px; }
  .pgs3d-compare__table th,
  .pgs3d-compare__table td { padding: 0.85rem 0.9rem; }
  .pgs3d-compare__table thead th:first-child,
  .pgs3d-compare__rowlabel {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--pgs-bg);
    box-shadow: 8px 0 12px -10px rgba(15, 23, 42, 0.25);
  }
}
