/* ============================================================
   Section 04 — Pricing. Two cards. Honest, no games.
   ============================================================ */

.section-pricing {
  padding-block: var(--section-py);
}

.section-pricing__head {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-pricing__head .headline {
  max-width: 14ch;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 2vw, 2rem);
  /* preserve-3d so the recessed Trial card reads as actually behind */
  perspective: 1200px;
  perspective-origin: 50% 60%;
  transform-style: preserve-3d;
}

@media (min-width: 900px) {
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.tier {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--color-blue-steel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-panel);
  position: relative;
  transform-style: preserve-3d;
  will-change: transform, opacity, border-color;
  transition: transform 720ms var(--ease-out),
    opacity 600ms var(--ease-out),
    border-color 600ms var(--ease-out),
    box-shadow 600ms var(--ease-out);
}

.tier--paid {
  border-color: rgba(233, 69, 96, 0.32);
  background: linear-gradient(
    180deg,
    rgba(233, 69, 96, 0.04) 0%,
    var(--color-blue-steel) 60%
  );
}

/* ---------- The stand-off ----------
   1. Armed state: both cards offscreen at opposite edges.
   2. Entered: travel toward center via deceleration.
   3. Settled: Completo forward, Trial recessed in 3D space.
*/

/* Armed — only takes effect after JS adds .is-armed so initial paint
   (before JS) doesn't flash empty cards. */
.pricing-grid.is-armed .tier {
  opacity: 0;
}
.pricing-grid.is-armed .tier--trial {
  transform: translate3d(-110%, 0, 0);
}
.pricing-grid.is-armed .tier--paid {
  transform: translate3d(110%, 0, 0);
}

/* Entered — both travel toward center */
.pricing-grid.is-armed.is-entered .tier {
  opacity: 1;
}
.pricing-grid.is-armed.is-entered .tier--trial,
.pricing-grid.is-armed.is-entered .tier--paid {
  transform: translate3d(0, 0, 0);
}

/* Settled — Completo forward, Trial recessed.
   The 3D depth is real CSS, not a fake. ~12px Z + 2% scale-down. */
@media (min-width: 900px) {
  .pricing-grid.is-armed.is-settled .tier--trial {
    transform: translate3d(0, 0, -12px) scale(0.985);
    opacity: 0.92;
  }
  .pricing-grid.is-armed.is-settled .tier--paid {
    transform: translate3d(0, 0, 0) scale(1);
    border-color: rgba(233, 69, 96, 0.42);
    box-shadow: var(--shadow-panel),
      0 0 0 1px rgba(233, 69, 96, 0.12),
      0 30px 60px -30px rgba(233, 69, 96, 0.25);
  }
}

/* Static mode (reduced motion): no travel, just final positions */
.pricing-grid.is-static .tier { opacity: 1; transform: none; }
@media (min-width: 900px) {
  .pricing-grid.is-static .tier--trial {
    transform: translate3d(0, 0, -12px) scale(0.985);
    opacity: 0.94;
  }
}

/* Hover: paid card lifts toward viewer; trial card stays where it is */
@media (hover: hover) and (min-width: 900px) {
  .pricing-grid.is-armed.is-settled .tier--paid:hover {
    transform: translate3d(0, -4px, 6px) scale(1.01);
  }
}

/* tier label now uses .ap-tier class on the element directly — Apoc Bold 28px */
.tier__label {
  display: inline-block;
}
.tier--trial .tier__label {
  color: var(--color-muted-soft);
}
.tier--paid .tier__label {
  color: var(--color-red);
}

.tier__price {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  line-height: 1;
  flex-wrap: wrap;
}

.tier__price-amount {
  font-family: var(--font-display);
  font-size: var(--fs-pricing-num);
  font-weight: 700;
  color: var(--color-red);
  letter-spacing: -0.02em;
  line-height: 1;
}

.tier__price-period {
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 500;
}

.tier__messages {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding-block: 0.5rem;
  border-top: 1px solid var(--color-border);
  margin-top: 0.5rem;
}

.tier__messages-count {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw + 0.5rem, 3rem);
  font-weight: 700;
  color: var(--color-red);
  letter-spacing: -0.02em;
  line-height: 1;
}

.tier__messages-label {
  font-size: 0.8125rem;
  color: var(--color-muted);
  letter-spacing: 0.02em;
}

.tier__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tier__features li {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.5;
  padding-left: 1.25rem;
  position: relative;
}

.tier__features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(165, 165, 194, 0.5);
}

.tier--paid .tier__features li::before {
  background: var(--color-red);
}

.tier__cta {
  margin-top: auto;
  width: 100%;
  text-align: center;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .pricing-grid.is-armed .tier {
    opacity: 1 !important;
    transform: none !important;
  }
  .tier { transition: none !important; }
}
