/* =============================================================================
   PRODUCTS SECTION — three doors, one coach
   The diagram is the layout: each product card is wired through converging
   lines into a single "AI coach" core that forks into the two outputs.
   Signal stays violet/blue on the way in, value turns mint on the way out.
   Loaded via page-registry deferredStyles.
   ============================================================================= */

.home-products__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.home-product-card {
  --home-product-accent: 196, 181, 253;

  position: relative;
  display: flex;
  min-height: 31rem;
  flex-direction: column;
  padding: 1.6rem;
  overflow: hidden;
  border: 1px solid var(--home-line);
  border-radius: 1.65rem;
  background: rgba(15, 16, 38, 0.74);
}

.home-product-card[data-product='plugin'] {
  --home-product-accent: 103, 232, 249;
}

.home-product-card[data-product='meeting'] {
  --home-product-accent: 110, 231, 183;
}

.home-product-card::after {
  position: absolute;
  top: -7rem;
  right: -7rem;
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  pointer-events: none;
  content: '';
  background: radial-gradient(circle, rgba(90, 116, 255, 0.12), transparent 66%);
}

.home-product-card--active {
  border-color: rgba(154, 86, 255, 0.48);
  background:
    linear-gradient(150deg, rgba(101, 44, 255, 0.16), transparent 44%), rgba(17, 18, 43, 0.92);
  box-shadow: 0 24px 78px rgba(52, 25, 130, 0.2);
}

.home-product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

.home-product-card__status {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.4rem 0.52rem;
  border: 1px solid var(--home-line);
  border-radius: 999px;
  color: #9693ad;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--home-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-product-card__status--available {
  border-color: rgba(25, 206, 136, 0.25);
  color: #75e3b8;
  background: rgba(25, 206, 136, 0.08);
}

.home-product-card__status--available i {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--home-mint);
  box-shadow: 0 0 12px rgba(25, 206, 136, 0.7);
}

.home-product-card__type {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  color: #9693ad;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* The product logo sits in a framed emblem tile tinted with the card's accent
   (same language as the homepage plan emblems) — gives the mark structure and a
   premium feel without a heavy halo. */
.home-product-card__icon {
  display: inline-flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 2.1rem 0 1.4rem;
  border-radius: 1.1rem;
  color: rgb(var(--home-product-accent));
  background: linear-gradient(
    155deg,
    rgba(var(--home-product-accent), 0.2),
    rgba(var(--home-product-accent), 0.05)
  );
  border: 1px solid rgba(var(--home-product-accent), 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 26px -16px rgba(var(--home-product-accent), 0.55);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.home-product-card:hover .home-product-card__icon {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 14px 30px -14px rgba(var(--home-product-accent), 0.6);
}

.home-product-card__icon svg {
  width: 1.7rem;
  height: 1.7rem;
  fill: currentcolor;
}

/* Card header (emblem, product name, promise) reads as one centered stack;
   the feature list and CTA below stay left-aligned / full-width. */
.home-product-card h3 {
  margin: 0;
  color: var(--home-text);
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  text-align: center;
}

.home-product-card__title-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.home-product-card__title-stack small {
  color: #8f8a9f;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.home-product-card__body {
  margin: 1rem 0 0;
  color: var(--home-muted);
  font-size: 0.96rem;
  line-height: 1.65;
  text-align: center;
}

.home-product-card__list {
  display: grid;
  gap: 0.55rem;
  padding: 1.2rem 0 0;
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--home-line);
  color: #d1cee0;
  font-size: 0.84rem;
  line-height: 1.45;
  list-style: none;
}

.home-product-card__list li::before {
  margin-right: 0.55rem;
  color: #8c70ed;
  content: '—';
}

/* The active product mirrors the published Standard plan feature block. The
   nested pricing namespace keeps both lists in sync without duplicating copy. */
.home-product-card__features {
  padding: 1.2rem 0 0;
  margin: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--home-line);
}

.home-product-card__features-label {
  margin: 0 0 0.9rem;
  color: #dedbea;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.4;
}

.home-product-card__feature-list {
  display: grid;
  gap: 0.72rem;
  padding: 0;
  margin: 0;
  color: #d1cee0;
  font-size: 0.84rem;
  line-height: 1.45;
  list-style: none;
}

.home-product-card__feature-list li {
  display: flex;
  align-items: flex-start;
}

.home-product-card__feature-list i {
  flex: 0 0 auto;
  margin: 0.24rem 0.75rem 0 0;
  color: #22c55e;
  font-size: 0.7rem;
}

.home-product-card > .btn {
  margin-top: auto;
}

/* --- Convergence wiring ----------------------------------------------------
   Three lines leave the card columns and meet at the core below. A light
   pulse travels each wire while the section is on screen. */

.home-products__wiring {
  height: clamp(5.5rem, 9vw, 7.5rem);
  margin-top: -0.25rem;
}

.home-products__wiring svg {
  display: block;
  width: 100%;
  height: 100%;
}

.home-products__wire {
  fill: none;
  stroke: rgba(154, 86, 255, 0.26);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.home-products__pulse {
  fill: none;
  stroke: url('#home-wire-grad');
  stroke-dasharray: 26 400;
  stroke-dashoffset: 426;
  stroke-linecap: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  animation: home-products-pulse 2.6s linear infinite;
}

.home-products__pulse--mid {
  animation-delay: 0.45s;
}

.home-products__pulse--late {
  animation-delay: 0.9s;
}

@keyframes home-products-pulse {
  to {
    stroke-dashoffset: 0;
  }
}

/* --- The core rail: one coach, two outputs --------------------------------- */

.home-products__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-products__core {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 1.3rem 0.7rem 0.85rem;
  border: 1px solid rgba(154, 86, 255, 0.46);
  border-radius: 1.25rem;
  background: rgba(101, 44, 255, 0.12);
  box-shadow: 0 0 45px rgba(101, 44, 255, 0.22);
}

.home-products__core img {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 24%;
}

.home-products__core strong {
  color: #e5dfff;
  font-family: var(--home-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Fork: the single stream splits toward the two value outputs. */
.home-products__fork {
  display: flex;
  gap: 4.2rem;
  height: 2.1rem;
  margin: 0.3rem 0;
}

.home-products__fork i {
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, rgba(154, 86, 255, 0.55), rgba(25, 206, 136, 0.65));
}

.home-products__fork i:first-child {
  transform: rotate(24deg);
}

.home-products__fork i:last-child {
  transform: rotate(-24deg);
}

.home-products__outputs {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
}

.home-products__outputs span {
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(25, 206, 136, 0.28);
  border-radius: 999px;
  color: #86e7c0;
  background: rgba(25, 206, 136, 0.07);
  font-family: var(--home-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- Responsive ------------------------------------------------------------ */

/* Below this width, three columns no longer leave enough room for the two
   metadata labels to remain legible on one line. */
@media (max-width: 1180px) {
  .home-products__grid {
    grid-template-columns: 1fr 1fr;
  }

  .home-product-card--active {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .home-product-card--active .home-product-card__body {
    max-width: 60ch;
  }

  /* Column centers no longer match the wiring geometry: fall back to a
     single vertical wire into the core. */
  .home-products__wiring {
    display: flex;
    height: 3.4rem;
    justify-content: center;
  }

  .home-products__wiring svg {
    display: none;
  }

  .home-products__wiring::after {
    width: 1px;
    height: 100%;
    content: '';
    background: linear-gradient(180deg, rgba(90, 116, 255, 0.15), rgba(124, 60, 255, 0.6));
  }
}

@media (max-width: 760px) {
  .home-products__grid {
    grid-template-columns: 1fr;
  }

  .home-product-card--active {
    grid-column: auto;
  }

  .home-product-card {
    min-height: auto;
    border-radius: 1.4rem;
  }

  /* Cards shrink to their content here, so the footer CTA needs a fixed gap. */
  .home-product-card > .btn {
    margin-top: 1.5rem;
  }

  .home-products__fork {
    gap: 2.6rem;
  }
}

@media (max-width: 430px) {
  .home-product-card {
    padding: 1.25rem;
  }

  .home-product-card__icon {
    margin-top: 1.6rem;
  }

  .home-product-card__meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-products__pulse {
    display: none;
  }
}
