/* Home: CTA banner (T14, Figma 340:6669)
   Section-only colours that aren't Figma variables are scoped below. */
.s-cta {
  --cta-bg: #f2e9d5;                         /* card fill, not a Figma variable */
  --cta-ink: var(--text-strong);
  --cta-mock-bg: var(--stone-100);
  --cta-mock-line: var(--border-thin);
  --cta-mock-text: rgb(0 0 0 / 0.85);
  --cta-accent: #42bc00;
  padding-block: var(--space-16);
}

.s-cta__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* keep the wide mockup from stretching the title column */
  gap: var(--space-10);
  padding: var(--space-10) var(--space-6) 0;
  border-radius: var(--radius-lg);
  background: var(--cta-bg);
}

/* Soft orange/yellow/green arcs behind the card (Figma group 340:6927, 20% opacity) */
.s-cta__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 0% 30%, rgb(253 199 0 / 0.25) 0, transparent 40%),
    radial-gradient(circle at 42% 115%, rgb(255 105 0 / 0.14) 0 38%, transparent 38.2%),
    radial-gradient(circle at 42% 115%, rgb(255 137 4 / 0.08) 0 58%, transparent 58.2%),
    radial-gradient(circle at 72% -10%, rgb(154 230 0 / 0.12) 0 22%, transparent 22.2%);
}

.s-cta__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-8);
}

.s-cta__title {
  font-family: var(--font-heading);
  font-weight: var(--fw-heading);
  font-size: var(--h2-size);
  line-height: 1.1;
  letter-spacing: var(--h2-ls);
  color: var(--cta-ink);
}

/* "Start Free" uses .btn.btn--cta */

/* ---------- App mockup ---------- */
.s-cta__mock {
  display: flex;
  width: 760px;               /* fixed, cropped by the card */
  height: 220px;
  margin-right: calc(var(--space-6) * -1);
  border: 1px solid var(--cta-mock-line);
  border-bottom: 0;
  border-radius: 14px 0 0 0;
  background: var(--cta-mock-bg);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 16px;
  color: var(--cta-mock-text);
  overflow: hidden;
  user-select: none;
}

.s-cta__mock-side { flex: none; width: 218px; padding-bottom: var(--space-2); }
.s-cta__mock-bar { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); }
.s-cta__dots { display: flex; gap: 8px; }
.s-cta__dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.s-cta__dots i:nth-child(2) { background: #febc2e; }
.s-cta__dots i:nth-child(3) { background: #28c840; }
.s-cta__mock-tools { display: flex; }
.s-cta__mock-tools svg { box-sizing: content-box; padding: 8px; opacity: 0.5; }
.s-cta__mock-tools + .s-cta__mock-tools { margin-left: auto; }

.s-cta__mock-nav { padding: 0 var(--space-2); }
.s-cta__mock-nav li { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 var(--space-3); font-weight: var(--fw-medium); }
.s-cta__mock-nav svg { opacity: 0.7; }
.s-cta__mock-label { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) 18px 0; font-size: 10px; font-weight: var(--fw-medium); }
.s-cta__mock-label svg { opacity: 0.4; }

.s-cta__mock-main { flex: 1; min-width: 0; padding: var(--space-4) var(--space-4) 0; background: var(--base-high); }
.s-cta__mock-title { font-size: 14px; font-weight: var(--fw-semibold); letter-spacing: -0.02em; }
.s-cta__mock-tabs { display: flex; height: 44px; border-bottom: 1px solid var(--cta-mock-line); }
.s-cta__mock-tabs span { display: flex; align-items: center; gap: 5px; padding: 0 var(--space-2); }
.s-cta__mock-tabs .is-active { border-bottom: 1px solid var(--cta-accent); font-weight: var(--fw-medium); }
.s-cta__mock-tabs .is-muted { color: #8e8e93; }
.s-cta__mock-chat { display: grid; gap: 10px; padding: var(--space-6) var(--space-4); line-height: 1.4; white-space: nowrap; }
.s-cta__mock-bubble { justify-self: end; padding: 7px 12px; border-radius: 28px; background: var(--cta-mock-bg); font-weight: var(--fw-medium); margin-bottom: 14px; }
.s-cta__mock-step::before { content: ""; display: inline-block; width: 8px; height: 10px; margin-right: 10px; border: 1px solid currentColor; border-radius: 1px; opacity: 0.5; vertical-align: -1px; }

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
  .s-cta { padding-block: var(--space-20); }
  .s-cta__card { padding: var(--space-12) var(--space-12) 0; }
  .s-cta__mock { margin-right: calc(var(--space-12) * -1); height: 240px; }
}

/* ---------- Desktop: text left, mockup bleeding off the right ---------- */
@media (min-width: 1024px) {
  .s-cta { padding-block: 115px; }
  .s-cta__card {
    display: flex;
    align-items: center;
    min-height: 286px;
    padding: 74px 88px;
  }
  .s-cta__content { position: relative; z-index: 1; max-width: 48%; }
  .s-cta__mock {
    position: absolute;
    top: 34px;
    left: 55%;
    width: 1200px;
    height: 709px;
    margin: 0;
    border-bottom: 1px solid var(--cta-mock-line);
    border-radius: 14px;
  }
}

@media (min-width: 1280px) {
  .s-cta__content { max-width: 573px; }
  .s-cta__title { white-space: nowrap; }
  .s-cta__mock { left: 661px; }
}

/* ---------- Interactions ----------
   Entrances come from data-reveal in partials/cta.html. Ambient motion below uses `translate`/`scale`
   (not `transform`) so it never fights motion.css on the revealed mockup. */
.s-cta__glow { animation: cta-glow 14s var(--ease-in-out) infinite alternate; }
@keyframes cta-glow {
  from { scale: 1; translate: 0 0; }
  to   { scale: 1.08; translate: 2% -3%; }
}

/* Mockup drifts toward the copy and the chat's active tab glows while the card is hovered */
.s-cta__mock { transition: translate var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) var(--ease-out); }
.s-cta__mock-tabs .is-active { transition: box-shadow var(--dur-slow) var(--ease-out); }
@media (hover: hover) {
  .s-cta__card:hover .s-cta__mock { translate: -12px -6px; box-shadow: var(--shadow-md); }
  .s-cta__card:hover .s-cta__mock-tabs .is-active { box-shadow: inset 0 -2px 0 var(--cta-accent); }
}

/* Blinking caret after the last agent step, like it is still working */
.s-cta__mock-step:last-child::after {
  content: "";
  display: inline-block;
  width: 6px; height: 12px;
  margin-left: 6px;
  vertical-align: -2px;
  background: currentColor;
  opacity: 0.5;
  animation: cta-caret 1.1s steps(1) infinite;
}
@keyframes cta-caret { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .s-cta__glow, .s-cta__mock-step:last-child::after { animation: none; }
  .s-cta__mock { transition-property: filter, box-shadow; }
  .s-cta__card:hover .s-cta__mock { translate: none; }
}
