/* ─────────────────────────────────────────
   Closing CTA — cinematic with scroll-expanding pill
   ───────────────────────────────────────── */

.cta-cinema {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  /* Tall enough that the wide oblong frame sits OUTSIDE all the text */
  min-height: min(90vw, 900px);
  display: grid;
  align-content: center;
  padding: clamp(5rem, 9vw, 7rem) 0;
  /* Organic colour patches centred ON the bottom edge — their upper halves
     show here, the matching lower halves are drawn by the footer, so the
     colour runs continuous across the seam (no straight stripe). */
  background:
    radial-gradient(40% 30% at 27% 100%, rgba(28,125,245,0.04), transparent 72%),
    radial-gradient(36% 26% at 71% 100%, rgba(28,125,245,0.04), transparent 72%),
    radial-gradient(30% 22% at 50% 100%, rgba(229,51,108,0.03), transparent 74%);
  color: var(--ink);
}

/* Organic, drifting dark mesh (not a flat stripe): transparent at the top
   to blend with the section above, deepest around the button, fading lighter
   toward the footer. */
.cta-cinema::after { display: none; }
.cta-cinema::before {
  content: '';
  position: absolute; inset: -14%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(82% 74% at 50% 58%, rgba(16,46,104,0.032), transparent 94%),
    radial-gradient(50% 46% at 54% 46%, rgba(20,70,160,0.058), transparent 78%),
    radial-gradient(46% 42% at 34% 52%, rgba(28,125,245,0.012), transparent 78%),
    radial-gradient(46% 42% at 68% 56%, rgba(28,125,245,0.04), transparent 78%),
    radial-gradient(48% 44% at 46% 60%, rgba(20,80,170,0.016), transparent 78%),
    radial-gradient(50% 46% at 60% 38%, rgba(16,52,120,0.04), transparent 80%);
  filter: blur(64px) saturate(104%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 26%, #000 47%, #000 56%, transparent 80%);
  mask-image: linear-gradient(180deg, transparent 0%, transparent 26%, #000 47%, #000 56%, transparent 80%);
  animation: ctaMeshDrift 26s ease-in-out infinite alternate;
}
@keyframes ctaMeshDrift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.04); }
  50%  { transform: translate3d(2%,  2%, 0) scale(1.10); }
  100% { transform: translate3d(0,  -1%, 0) scale(1.05); }
}

.cta-cinema__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.cta-cinema__mesh,
.cta-cinema__grid { display: none; }

.cta-cinema__ring {
  position: absolute;
  width: min(146vw, 1480px);
  aspect-ratio: 1400 / 740;   /* wide oblong frame, slightly flatter */
  height: auto;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.7;
  pointer-events: none;
}
.cta-cinema__ringtext {
  font-family: var(--font-mono);
  font-size: 18px; letter-spacing: 0.34em;
  fill: url(#cta-ring-grad); text-transform: uppercase;   /* deeper blue up top → bright blue-white at the bottom */
}

.cta-cinema__inner { position: relative; z-index: 3; text-align: center; }

.cta-cinema__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0; transform: translate3d(0, 10px, 0);
  transition: opacity .8s ease, transform .8s ease;
}
.is-in .cta-cinema__eyebrow { opacity: 1; transform: none; }

.cta-cinema__title {
  font-family: var(--font-display);
  font-weight: 500; letter-spacing: -0.025em;
  line-height: 0.98; font-size: clamp(2.6rem, 7vw, 6.2rem);
  margin: 1.25rem auto 0; max-width: 18ch;
}
.cta-cinema__title .line { display: block; }
/* Padding gives italic ascenders/descenders room inside the overflow clip;
   the matching negative margin cancels the layout shift (spacing unchanged). */
.cta-cinema__title .word {
  display: inline-block; overflow: hidden; vertical-align: bottom;
  padding: 0.55em 0.42em 0.44em;
  margin: -0.55em -0.42em -0.44em;
}
.cta-cinema__title .word__inner {
  display: inline-block;
  transform: translate3d(0, 185%, 0) rotate(4deg);
  transition: transform 1.05s cubic-bezier(.18,.7,.18,1);
  will-change: transform;
}
.cta-cinema__title .word--accent .word__inner em {
  font-style: italic; color: var(--accent);
  background: linear-gradient(100deg, var(--accent) 0%, #7adcf6 50%, var(--accent) 100%);
  background-size: 220% 100%;
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: ctaAccentSheen 6s ease-in-out infinite;
  /* Widen the background-clip:text box so the italic overhang is painted;
     the negative side margin cancels it — no extra space between words. */
  padding: 0.34em 0.32em; margin: 0 -0.32em;
}
@keyframes ctaAccentSheen { 0%,100%{background-position:0% 50%;} 50%{background-position:100% 50%;} }
.is-in .cta-cinema__title .word:nth-child(1) .word__inner { transition-delay: .10s; transform: none; }
.is-in .cta-cinema__title .word:nth-child(2) .word__inner { transition-delay: .18s; transform: none; }
.is-in .cta-cinema__title .word:nth-child(3) .word__inner { transition-delay: .26s; transform: none; }
.is-in .cta-cinema__title .line:nth-child(2) .word:nth-child(1) .word__inner { transition-delay: .36s; transform: none; }
.is-in .cta-cinema__title .line:nth-child(2) .word:nth-child(2) .word__inner { transition-delay: .44s; transform: none; }
.is-in .cta-cinema__title .line:nth-child(2) .word:nth-child(3) .word__inner { transition-delay: .56s; transform: none; }

.cta-cinema__lede {
  margin: 1.6rem auto 0; max-width: 36ch;
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.2vw, 1.125rem); line-height: 1.5;
  opacity: 0; transform: translate3d(0, 12px, 0);
  transition: opacity .9s ease .7s, transform .9s ease .7s;
}
.is-in .cta-cinema__lede { opacity: 1; transform: none; }

.cta-cinema__sub {
  margin-top: 1.6rem;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0; transform: translate3d(0, 10px, 0);
  transition: opacity .9s ease 1.05s, transform .9s ease 1.05s;
}
.cta-cinema__sub .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #18a957; margin-right: 0.5rem;
  box-shadow: 0 0 0 3px rgba(24,169,87,0.16);
  animation: ctaDotPulseGreen 2.4s ease-in-out infinite;
  vertical-align: 1px;
}
@keyframes ctaDotPulseGreen {
  0%,100% { box-shadow: 0 0 0 3px rgba(24,169,87,0.16); }
  50%     { box-shadow: 0 0 0 6px rgba(24,169,87,0); }
}
.cta-cinema__sub .sep { opacity: 0.45; }
.is-in .cta-cinema__sub { opacity: 1; transform: none; }

/* ─────────────────────────────────────────
   Scroll-driven expanding pill
   --p drives the expansion: 0 (compact) → 1 (full)
   ───────────────────────────────────────── */
.cta-expand {
  --p: 0;
  --w-min: 64px;
  --w-max: 380px;
  --h-min: 64px;
  --h-max: 76px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2.4rem auto 0;
  width: calc(var(--w-min) + (var(--w-max) - var(--w-min)) * var(--p));
  height: calc(var(--h-min) + (var(--h-max) - var(--h-min)) * var(--p));
  border-radius: 999px;
  cursor: pointer;
  isolation: isolate;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  will-change: width, height;
  transition: width .15s linear, height .15s linear, transform .25s ease;
}
.cta-expand:hover { transform: translateY(-2px); }

.cta-expand__bg {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, #1C7DF5 0%, #4FA0FF 50%, #1C7DF5 100%);
  background-size: 220% 100%;
  animation: ctaBtnSheen 5s ease-in-out infinite;
  box-shadow:
    0 12px 30px -12px rgba(28,125,245,0.55),
    0 6px 16px -8px rgba(28,125,245,0.45),
    inset 0 1px 0 rgba(255,255,255,0.25);
  transition: box-shadow .4s ease;
}
@keyframes ctaBtnSheen { 0%,100%{background-position:0% 50%;} 50%{background-position:100% 50%;} }
.cta-expand:hover .cta-expand__bg {
  box-shadow:
    0 22px 50px -16px rgba(28,125,245,0.7),
    0 10px 24px -10px rgba(28,125,245,0.55),
    inset 0 1px 0 rgba(255,255,255,0.35);
}

.cta-expand__core {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  padding: 0 calc(0.6rem + 0.9rem * var(--p));
  gap: calc(0.4rem + 0.4rem * var(--p));
}

/* Compact icon disc — visible at p=0, fades as label takes over */
.cta-expand__disc {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(calc(1 - var(--p) * 0.4));
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  opacity: calc(1 - var(--p) * 1.6);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.cta-expand__disc svg { transform: translateX(0); }

/* Label — fades in as p grows */
.cta-expand__label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: calc(0.92rem + 0.12rem * var(--p));
  letter-spacing: -0.005em;
  white-space: nowrap;
  opacity: clamp(0, calc((var(--p) - 0.35) / 0.55), 1);
  transform: translateX(calc((1 - var(--p)) * 12px));
  transition: opacity .2s ease, transform .25s ease;
  overflow: hidden;
}
.cta-expand__arrow { transition: transform .55s cubic-bezier(.18,.78,.18,1); flex-shrink: 0; }
.cta-expand:hover .cta-expand__arrow { transform: translateX(4px); }

/* Subtle hint pulse on the compact disc to invite scroll */
.cta-expand__pulse {
  display: none !important;
  position: absolute;
  left: 50%; top: 50%;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  transform: translate(-50%, -50%) scale(1);
  opacity: calc(1 - var(--p) * 1.6);
  animation: ctaCompactPulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes ctaCompactPulse {
  0%   { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
  80%  { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

.cta-expand__shine {
  position: absolute; inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}
.cta-expand__shine::before {
  content: '';
  position: absolute;
  top: -50%; bottom: -50%;
  left: -30%;
  width: 30%;
  background: linear-gradient(100deg,
    transparent 0%, rgba(255,255,255,0.0) 35%,
    rgba(255,255,255,0.55) 50%,
    rgba(255,255,255,0.0) 65%, transparent 100%);
  transform: translateX(0) skewX(-15deg);
}
.cta-expand:hover .cta-expand__shine::before {
  animation: ctaBtnShine 1.2s cubic-bezier(.2,.8,.2,1) .1s forwards;
}
@keyframes ctaBtnShine {
  0%   { transform: translateX(0) skewX(-15deg); }
  100% { transform: translateX(700%) skewX(-15deg); }
}

.cta-expand:active { transform: translateY(0); }
.cta-expand:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

@media (max-width: 640px) {
  .cta-expand { --w-max: 280px; --h-max: 64px; --w-min: 56px; --h-min: 56px; }
  .cta-expand__label { font-size: calc(0.85rem + 0.12rem * var(--p)); }
  .cta-cinema__title { font-size: clamp(2.2rem, 9vw, 3.4rem); }
}
/* On portrait/mobile the CTA content is tall — enlarge the ring so its
   scrolling text frames the content (a strip ABOVE and one BELOW), and
   shrink the SVG font so the rendered text size stays the same. */
@media (max-width: 768px) {
  .cta-cinema__ring { width: 260vw; }
  .cta-cinema__ringtext { font-size: 10px; letter-spacing: 0.3em; }
}

@media (prefers-reduced-motion: reduce) {
  .cta-cinema__mesh, .cta-cinema__ring, .cta-cinema__sub .dot,
  .cta-expand__bg, .cta-cinema__title .word--accent .word__inner em,
  .cta-expand__pulse { animation: none !important; }
  .cta-cinema__title .word__inner { transform: none !important; }
  .cta-cinema__eyebrow, .cta-cinema__lede, .cta-cinema__sub { opacity: 1 !important; transform: none !important; transition: none !important; }
  .cta-expand { --p: 1 !important; }
  .cta-expand__disc, .cta-expand__pulse { display: none; }
}
