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

.cta-cinema {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(7rem, 14vw, 12rem) 0 clamp(7rem, 14vw, 12rem);
  background:
    radial-gradient(120% 80% at 50% 100%, var(--accent-soft) 0%, #F0EFE6 40%, var(--bg) 80%),
    var(--bg);
  color: var(--ink);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Tinted overlay layer — softens the white, adds depth + subtle grain */
.cta-cinema::before {
  content: '';
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(107,138,31,0.06) 0%, rgba(107,138,31,0.02) 60%, rgba(10,15,20,0.04) 100%),
    radial-gradient(120% 70% at 50% 0%, rgba(255,255,255,0.0) 60%, rgba(10,15,20,0.05) 100%);
  mix-blend-mode: multiply;
}
.cta-cinema::after {
  content: '';
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
  mix-blend-mode: multiply;
}

.cta-cinema__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.cta-cinema__mesh {
  position: absolute; inset: -10%;
  background:
    radial-gradient(38% 30% at 50% 25%, rgba(107,138,31,0.28), transparent 65%),
    radial-gradient(34% 28% at 18% 70%, rgba(210,100,26,0.22), transparent 65%),
    radial-gradient(34% 28% at 82% 70%, rgba(196,255,31,0.20), transparent 65%),
    radial-gradient(50% 35% at 50% 95%, rgba(107,138,31,0.20), transparent 70%);
  filter: blur(20px) saturate(115%);
  animation: ctaMeshDrift 22s ease-in-out infinite alternate;
}
@keyframes ctaMeshDrift {
  0%   { transform: translate3d(0, -1%, 0) scale(1.02); }
  50%  { transform: translate3d(0, 1.5%, 0) scale(1.06); }
  100% { transform: translate3d(0, 0, 0) scale(1.03); }
}
.cta-cinema__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(10,15,20,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10,15,20,0.045) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(70% 60% at 50% 50%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 50%, #000 30%, transparent 80%);
}

.cta-cinema__ring {
  position: absolute;
  width: min(120vw, 1100px);
  height: min(120vw, 1100px);
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.18;
  animation: ctaRingSpin 60s linear infinite;
  pointer-events: none;
}
.cta-cinema__ringtext {
  font-family: var(--font-mono);
  font-size: 18px; letter-spacing: 0.34em;
  fill: var(--ink); text-transform: uppercase;
}
@keyframes ctaRingSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.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; }
.cta-cinema__title .word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.06em; }
.cta-cinema__title .word__inner {
  display: inline-block;
  transform: translate3d(0, 110%, 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%, var(--accent-2) 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;
}
@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, var(--accent-3) 0%, var(--accent) 50%, var(--accent-2) 100%);
  background-size: 220% 100%;
  animation: ctaBtnSheen 5s ease-in-out infinite;
  box-shadow:
    0 12px 30px -12px rgba(107,138,31,0.55),
    0 6px 16px -8px rgba(107,138,31,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(107,138,31,0.7),
    0 10px 24px -10px rgba(107,138,31,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 {
  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); }
}

@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; }
}
