/* ==========================================================================
   Kilnwork — section: cta (the finale band before the footer)
   Every selector scoped under .s-cta. Tokens only.

   The band runs on .is-inverse, so it is deep kiln green in the light theme
   and warm cream in the dark theme. Two consequences drive the colour choices
   below: (1) --ink-subtle fails 4.5:1 on the inverse band in the dark theme,
   so secondary copy here uses --ink-muted only; (2) --ink-on-brand does not
   flip with .is-inverse, so the primary button is repainted with the
   --highlight / --surface pair, which stays legible in both themes.
   ========================================================================== */

.s-cta {
  isolation: isolate;
  text-align: center;
  background-image:
    radial-gradient(120% 78% at 50% -18%,
      color-mix(in oklab, var(--highlight) 15%, transparent), transparent 64%),
    radial-gradient(90% 62% at 50% 118%,
      color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%);
}

/* Hairline of light along the band's rounded top edge. */
.s-cta::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 1px;
  z-index: var(--z-raised);
  pointer-events: none;
  background-image: linear-gradient(
    to right,
    transparent,
    color-mix(in oklab, var(--highlight) 55%, transparent) 22%,
    color-mix(in oklab, var(--highlight) 55%, transparent) 78%,
    transparent
  );
}

/* ---- Decorative art ------------------------------------------------------ */

.s-cta__bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-below);
  overflow: clip;
  pointer-events: none;
}

/* Concentric rings — a wheel head seen from above, sitting behind the type. */
.s-cta__rings {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  translate: -50% -50%;
  width: min(68rem, 165%);
  height: auto;
  aspect-ratio: 1;
  color: var(--ink);
  /* Elliptical cut-out, not a plain fade: a ring's horizontal tangent runs
     straight through centred small print and reads as a strikethrough. The
     copy column sits inside the transparent core, so the arcs only ever show
     outside it. #000 here is mask alpha, not a colour. */
  -webkit-mask-image: radial-gradient(48% 44% at 50% 50%, transparent 58%, #000 100%);
  mask-image: radial-gradient(48% 44% at 50% 50%, transparent 58%, #000 100%);
}

.s-cta__ring {
  stroke: color-mix(in oklab, var(--ink) 16%, transparent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.s-cta__ring--hot  { stroke: color-mix(in oklab, var(--accent) 55%, transparent); }
.s-cta__ring--mint { stroke: color-mix(in oklab, var(--highlight) 40%, transparent); }
/* Concentric circles are rotationally symmetric, so spinning the whole set
   would repaint everything to animate nothing. Only the dashed ring moves.
   pathLength="960" divides evenly by the 16-unit dash period, so it loops
   with no visible seam. */
.s-cta__ring--dash {
  stroke: color-mix(in oklab, var(--ink) 22%, transparent);
  stroke-dasharray: 3 13;
}

@media (prefers-reduced-motion: no-preference) {
  .s-cta__ring--dash { animation: kw-cta-dash 48s linear infinite; }
}

@keyframes kw-cta-dash {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: 16; }
}

/* Centred with auto margins, not translate: .gradient-orb--drift animates
   the translate property and would otherwise knock the orb off centre. */
.s-cta__orb--brand {
  --orb-size: min(52rem, 128vw);
  --orb-opacity: 0.34;
  inset-block-start: -34%;
  inset-inline: 0;
  margin-inline: auto;
}

.s-cta__orb--ember {
  --orb-size: min(38rem, 104vw);
  --orb-opacity: 0.26;
  --orb-blur: 76px;
  inset-block-end: -26%;
  inset-inline-start: -14%;
}

.s-cta__orb--cobalt {
  --orb-size: min(32rem, 92vw);
  --orb-opacity: 0.16;
  --orb-blur: 88px;
  inset-block-end: -22%;
  inset-inline-end: -12%;
}

/* Film grain over the whole band — the layer that stops the gradients from
   looking like flat CSS. Direct child of the section (not of .s-cta__bg) so
   the band's gradient is in its blend backdrop; z-index keeps it under the
   copy, which sits at the same level but later in the DOM. */
.s-cta__grain {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  width: 100%;
  height: 100%;
  opacity: 0.28;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ---- Content ------------------------------------------------------------- */

.s-cta__inner {
  position: relative;
  z-index: var(--z-base);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.s-cta__title {
  margin-block-start: var(--space-5);
  /* Stepped down twice below the display size: at 360px the longest line
     ("Open the shop.") needs ~270px of the 328px available. */
  font-size: var(--step-7);
}

@media (width >= 30rem) { .s-cta__title { font-size: var(--step-8); } }
@media (width >= 48rem) { .s-cta__title { font-size: var(--step-9); } }

.s-cta__line { display: block; }

/* Solid, not a gradient fill: 11.4:1 on the green band, 7.9:1 on the cream one. */
.s-cta__accent { color: var(--highlight); }

.s-cta__lede {
  margin-block-start: var(--space-6);
  margin-inline: auto;
  max-width: 44ch;
  color: var(--ink-muted);
  text-wrap: pretty;
}

/* ---- Actions ------------------------------------------------------------- */

.s-cta__actions {
  --cluster-gap: var(--space-5);
  flex-direction: column;
  justify-content: center;
  width: 100%;
  margin-block-start: clamp(var(--space-8), 4vw, var(--space-10));
}

@media (width >= 30rem) {
  .s-cta__actions {
    flex-direction: row;
    --cluster-gap: var(--space-7);
  }
}

.s-cta__primary {
  width: 100%;
  max-width: 22rem;
}

@media (width >= 30rem) {
  .s-cta__primary {
    width: auto;
    max-width: none;
    padding-inline: var(--space-9);
  }
}

/* Repaint of the shared button: --highlight on the band's own surface colour
   clears 9.7:1 in the light theme and 7.9:1 in the dark theme. */
.s-cta .btn--primary {
  --btn-bg: var(--highlight);
  --btn-fg: var(--surface);
  --btn-shadow: var(--shadow-md), var(--glow-brand);
}

.s-cta .btn--primary:hover {
  --btn-bg: color-mix(in oklab, var(--highlight) 88%, var(--ink));
  --btn-shadow: var(--shadow-lift), var(--glow-brand);
}

.s-cta .btn--primary:active {
  --btn-bg: color-mix(in oklab, var(--highlight) 80%, var(--ink));
  --btn-shadow: var(--shadow-xs);
}

.s-cta__secondary {
  /* 44px tall target without looking like a second button */
  display: inline-flex;
  padding: var(--space-3) var(--space-2);
  font-size: var(--step-1);
}

.s-cta__secondary:hover,
.s-cta__secondary:focus-visible {
  color: var(--highlight);
}

.s-cta__secondary:active { opacity: 0.75; }

/* ---- Trust line ---------------------------------------------------------- */

.s-cta__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3) var(--space-6);
  margin-block-start: var(--space-8);
}

.s-cta__trust-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: none;
  color: var(--ink-muted);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-wide);
}

.s-cta__check {
  width: 0.9em;
  height: 0.9em;
  flex: none;
  color: var(--highlight);
}

/* No opacity fade here: --ink-muted at 0.8 drops to 4.3:1 on the cream band
   in the dark theme. Size carries the hierarchy instead. */
.s-cta__proof {
  margin-block-start: var(--space-6);
  max-width: 48ch;
  color: var(--ink-muted);
  font-size: var(--step--2);
  letter-spacing: var(--tracking-wide);
}

/* ---- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .s-cta__ring--dash { animation: none; }
}
