/* Closing run of the homepage: picture divider and the 3D "better decision" card */

/* Divider: starts as an inset, rounded frame and opens to full bleed as it rises up the screen */
.divider {
  --expand: 0;
  background: var(--surface);
}

.divider__frame {
  position: relative;
  height: min(88svh, 880px);
  overflow: hidden;
  clip-path: inset(
    calc((1 - var(--expand)) * 10%) calc((1 - var(--expand)) * 16%)
    round calc((1 - var(--expand)) * 40px)
  );
}

.divider__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(calc(1.22 - var(--expand) * 0.22));
  transform-origin: 50% 40%;
}

/* CTA: a 3D card that tilts toward the pointer. Layers sit at different depths,
   a conic ring spins around the edge and a soft glare follows the cursor. */
@property --ring-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.cta {
  padding: clamp(104px, 12vw, 180px) var(--gutter);
}

.cta__stage {
  max-width: 1120px;
  margin: 0 auto;
  perspective: 1400px;
}

.cta__card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 30%;
  position: relative;
  padding: clamp(56px, 7vw, 104px) clamp(24px, 6vw, 96px);
  border-radius: 2rem;
  text-align: center;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
}

.cta__surface {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(640px circle at var(--mx) var(--my), rgba(56, 206, 187, 0.16), transparent 62%),
    var(--surface-deep);
}

/* Dot grid fading out from the top edge */
.cta__surface::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1.5px);
  background-size: 16px 16px;
  -webkit-mask: radial-gradient(ellipse 80% 70% at 50% 0%, #000, transparent 75%);
  mask: radial-gradient(ellipse 80% 70% at 50% 0%, #000, transparent 75%);
}

/* Glare that tracks the pointer */
.cta__surface::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.09), transparent 55%);
}

.cta__ring,
.cta__halo {
  background: conic-gradient(
    from var(--ring-angle),
    var(--turquoise),
    var(--yellow),
    var(--blue),
    var(--turquoise)
  );
  animation: ring-spin 6s linear infinite;
}

.cta__ring {
  position: absolute;
  inset: -2px;
  padding: 2px;
  border-radius: calc(2rem + 2px);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
}

/* Coloured light spilling out behind the card */
.cta__halo {
  position: absolute;
  inset: 10% 6%;
  border-radius: 3rem;
  opacity: 0.32;
  filter: blur(64px);
  transform: translateZ(-90px);
}

@keyframes ring-spin {
  to {
    --ring-angle: 360deg;
  }
}

.cta__content {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 28px;
  transform-style: preserve-3d;
}

/* Depth: the mark floats highest, then the button, title and copy */
.cta__mark {
  width: 54px;
  height: auto;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.55));
  animation: mark-float 5s ease-in-out infinite;
}

@keyframes mark-float {
  0%,
  100% {
    transform: translateZ(100px) translateY(0) rotate(-5deg);
  }
  50% {
    transform: translateZ(100px) translateY(-12px) rotate(5deg);
  }
}

.cta__title {
  max-width: 13ch;
  font-size: clamp(42px, 1rem + 4vw, 88px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.045em;
  transform: translateZ(64px);
}

.cta__title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--turquoise) 30%, var(--yellow));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cta__text {
  max-width: 50ch;
  font-size: clamp(17px, 1.2vw, 20px);
  line-height: 1.55;
  color: var(--on-dark-muted);
  transform: translateZ(36px);
}

.cta__btn {
  margin-top: 8px;
  transform: translateZ(80px);
}

@media (max-width: 420px) {
  .cta__card {
    padding-inline: 16px;
  }

  .cta__btn {
    --btn-h: 46px;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta__ring,
  .cta__halo,
  .cta__mark {
    animation: none;
  }
}
