/* ============================================================
   10-cta — closing call to action  (.closer)
   ============================================================ */

.closer {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  /* seam where dark meets the cream sections above and below (matches 04) */
  box-shadow: inset 0 1px 0 var(--border-on-dark), inset 0 -1px 0 var(--border-on-dark);
  /* dark-ground focus ring */
  --focus-ring: 0 0 0 2px var(--bg-deep), 0 0 0 4px var(--violet-300);
}

/* ---------- Background stack ---------- */
.closer__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  /* real backdrop so the grain has something to blend against */
  background: var(--bg-deep);
}

/* grain reads as film on a dark ground, not as dirt */
.closer__bg.grain::before {
  mix-blend-mode: screen;
  opacity: 0.14;
  z-index: 2;
}

/* Brand-tinted radial glow — the same single violet radial 04's aura uses,
   centred here because the closer's rings radiate from the middle. */
.closer__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
}

.closer__glow--violet {
  width: min(1080px, 128vw);
  aspect-ratio: 1.35;
  background: radial-gradient(
    closest-side,
    color-mix(in oklab, var(--violet-600) 66%, transparent),
    transparent 100%
  );
  opacity: 0.55;
  animation: closer-drift 34s var(--ease-in-out) infinite;
}

/* Tight core keeps the headline sitting on a lifted ground. Static on purpose:
   the type must not sit on a moving pool. */
.closer__glow--core {
  width: min(620px, 86vw);
  aspect-ratio: 1.6;
  background: radial-gradient(
    closest-side,
    color-mix(in oklab, var(--violet-400) 26%, transparent),
    transparent 100%
  );
  opacity: 0.45;
}

/* ---------- Concentric ring field ----------
   Same drawing as 04's aura (hairline rings radiating from one point, masked
   to nothing at the edges) — centred and a touch brighter, because this is the
   closing statement. Fills the section box and covers (slice) so the field is
   full-bleed at every viewport instead of a square clamped by the global
   svg max-width. */
.closer__field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  -webkit-mask-image: radial-gradient(
    farthest-side at 50% 50%,
    var(--text-on-dark) 0%,
    var(--text-on-dark) 38%,
    color-mix(in srgb, var(--text-on-dark) 55%, transparent) 62%,
    transparent 96%
  );
  mask-image: radial-gradient(
    farthest-side at 50% 50%,
    var(--text-on-dark) 0%,
    var(--text-on-dark) 38%,
    color-mix(in srgb, var(--text-on-dark) 55%, transparent) 62%,
    transparent 96%
  );
}

/* hairlines stay hairlines at every cover scale */
.closer__rings circle {
  fill: none;
  stroke: color-mix(in oklab, var(--violet-300) 26%, transparent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* ---------- Ripples spreading from a single point ---------- */
.closer__ripple {
  fill: none;
  stroke: var(--text-on-dark);
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: closer-ripple 24s linear infinite;
}
.closer__ripple--2 { animation-delay: -8s; }
.closer__ripple--3 { animation-delay: -16s; }

/* ---------- Content ---------- */
.closer__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* deliberate deviation: the closer is the last and largest statement on the
   page — one step under the hero's --fs-display, one step over every other h2 */
.closer .section-head h2 { font-size: var(--fs-h1); }

/* The break is structural, not a wrap accident: the statement holds its
   two-part shape from 320 to 1920. */
.closer__em {
  display: block;
  color: var(--violet-300);
}

/* on-dark emphasis, same weight and construction as 04's .builder__em; painted
   on the inline text so every wrapped line gets its own rule. */
.closer__em-ink {
  display: inline;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  background-image: linear-gradient(
    color-mix(in oklab, var(--violet-400) 78%, transparent),
    color-mix(in oklab, var(--violet-400) 78%, transparent)
  );
  background-repeat: no-repeat;
  background-size: 100% 0.08em;
  background-position: 0 100%;
  padding-bottom: 0.06em;
}

.closer__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-4);
  margin-top: var(--s-10);
}

/* the shared ghost hairline (12% white) resolves to ~1.4:1 on this glowing
   ground; 40% measures ~3.5:1, so the boundary is perceivable per 1.4.11 */
.closer__cta.btn--on-dark-ghost {
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--text-on-dark) 40%, transparent);
}
.closer__cta.btn--on-dark-ghost:hover {
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--text-on-dark) 55%, transparent);
}

/* .btn--on-dark* set their own box-shadow, so the global :focus-visible ring
   loses the cascade — re-apply it here (must outrank the :hover rule above). */
.closer .closer__cta:focus-visible {
  box-shadow: var(--focus-ring);
}

.closer__trust {
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: color-mix(in srgb, var(--text-on-dark) 55%, transparent);
  margin-top: var(--s-8);
  max-width: 40ch;
}

/* ---------- Motion ---------- */
@keyframes closer-drift {
  0%,
  100% { transform: translate3d(-51.5%, -50.8%, 0) scale(1); }
  50%  { transform: translate3d(-48.5%, -49.2%, 0) scale(1.06); }
}

/* Peaks around 30% — r ≈ 200 units, where the mask is fully open. */
@keyframes closer-ripple {
  0%   { transform: scale(0.18); opacity: 0; }
  30%  { opacity: 0.34; }
  100% { transform: scale(1); opacity: 0; }
}

/* Paused off-screen (shared observer toggles .is-paused) */
.closer__bg.is-paused .closer__glow--violet,
.closer__bg.is-paused .closer__ripple {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .closer__glow--violet,
  .closer__ripple {
    animation: none;
  }
  /* the six authored rings carry the still frame on their own */
  .closer__ripple { opacity: 0; }
}

/* ---------- Narrow widths ---------- */
@media (max-width: 30rem) {
  .closer__actions { width: 100%; flex-direction: column; align-items: stretch; }
  .closer__cta { width: 100%; }
}
