/* ============================================================================
   AumnI digital — stacked feature panels (cards.css)
   ----------------------------------------------------------------------------
   Companion layer to cards.js. Compact liquid-glass cards fly in from the
   right and pile up in a vertical peek stack while the engine holds the
   scene; the engine's copy card stays pinned on the left.

   GEOMETRY — mirrors the engine's .sw-copy exactly:
   the copy card is width:min(42vw,460px) at left:clamp(18px,5vw,64px), and
   during the hold band the engine pins its inline transform to translateY(0),
   so its TOP edge sits at exactly top:50%. The stack takes the same width on
   the right (right:6vw) with its top at 50% too — copy and stack share one
   horizon line. Card height is content-driven: the front (last) card is
   position:relative and sizes the group; the cards behind stretch to match.

   Engine z ladder: stage 10 · fx 12–15 · THIS LAYER 18 · copy 20.
   The animated layer is fixed + pointer-events:none; only each panel's
   "Explore →" link re-enables pointer events.

   Reduced motion: cards.js builds .cards-static instead — an in-flow,
   absolutely-positioned vertical list inside each section's scroll band.
   ========================================================================== */

.cards-layer {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  overflow: hidden;
}

/* one group per section — same width as .sw-copy, top edge on the copy card's
   horizon (top:50%). The motion layer owns transforms (y animates the
   release), so nothing here may set transform on the group. */
.cards-group {
  position: absolute;
  top: 50%;
  right: 6vw;
  width: min(42vw, 460px);
  will-change: transform, opacity;
}
/* cards behind stretch to the front card's height … */
.cards-group .card {
  position: absolute;
  inset: 0;
  height: 100%;
  will-change: transform;
}
/* … the front (last) card is content-sized and defines the group's height */
.cards-group .card:last-child {
  position: relative;
  height: auto;
}

/* ---- panel surface: Apple liquid glass + per-section pastel accent -------- */
.card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 2.2vw, 30px);
  border-radius: 24px;
  /* Liquid glass, smoked rather than clear. --card-plate is a deep-navy base
     under a low-alpha diagonal accent tint: the scene still moves through the
     card, but body copy on it clears 4.5:1 over the brightest frames (dawn
     harbour, golden-hour lane) instead of ghosting into them. Heavier blur and
     saturation carry the glass character that the extra opacity would cost. */
  --card-plate: rgba(4, 6, 48, 0.66);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--card-accent, #9BD8FF) 12%, transparent) 0%,
      color-mix(in srgb, var(--card-accent, #9BD8FF) 5%, transparent) 45%,
      transparent 72%
    ),
    var(--card-plate);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  backdrop-filter: blur(30px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #F4EFE6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  overflow: hidden;
}

/* ---- painted top edge (replaces the flat 3px accent strip) ----------------
   A rough brush stroke in the section accent: an accent-filled bar masked by
   a hand-drawn SVG silhouette (wavy top and bottom, tapered, with two flecks
   thrown off the end). preserveAspectRatio="none" lets it stretch to any card
   width without the hand-drawn waver turning into a regular ripple. */
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -2px;
  right: -2px;
  height: 9px;
  background: var(--card-accent, #9BD8FF);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 14' preserveAspectRatio='none'%3E%3Cpath fill='%23fff' d='M0 5C22 1 46 8 74 4C102 1 128 9 158 5C188 2 214 8 244 4C274 1 300 9 330 5C356 2 378 7 400 4L400 11C378 13 356 9 330 12C300 13 274 8 244 11C214 13 188 8 158 12C128 13 102 8 74 11C46 13 22 8 0 12Z'/%3E%3Ccircle fill='%23fff' cx='126' cy='2' r='1.3'/%3E%3Ccircle fill='%23fff' cx='308' cy='2.2' r='1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 14' preserveAspectRatio='none'%3E%3Cpath fill='%23fff' d='M0 5C22 1 46 8 74 4C102 1 128 9 158 5C188 2 214 8 244 4C274 1 300 9 330 5C356 2 378 7 400 4L400 11C378 13 356 9 330 12C300 13 274 8 244 11C214 13 188 8 158 12C128 13 102 8 74 11C46 13 22 8 0 12Z'/%3E%3Ccircle fill='%23fff' cx='126' cy='2' r='1.3'/%3E%3Ccircle fill='%23fff' cx='308' cy='2.2' r='1'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  pointer-events: none;
}
/* no masking support: fall back to the flat strip rather than a solid bar */
@supports not ((mask-image: url("#m")) or (-webkit-mask-image: url("#m"))) {
  .card { border-top: 3px solid var(--card-accent, #9BD8FF); }
  .card::after { display: none; }
}
/* subtle specular sweep — soft white radial falling from the top-left */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    120% 90% at 18% -4%,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.35) 32%,
    transparent 60%
  );
  opacity: 0.1;
  pointer-events: none;
}
/* depth tint for panels behind the front one — cards.js scrubs its opacity.
   z-index keeps it above ::after too, so a stepped-back panel's brush edge
   dims with the rest of the card instead of staying bright. */
.card__dim {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: rgba(2, 2, 26, 1);
  opacity: 0;
  pointer-events: none;
}

.card__title {
  position: relative;
  margin: 0;
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.18rem, 1.55vw, 1.45rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #F4EFE6;
  max-width: 22ch;
}
.card__body {
  position: relative;
  margin: 12px 0 0;
  font-size: clamp(0.9rem, 1vw, 0.97rem);
  line-height: 1.55;
  /* near-solid cream: still a step below the title, but no longer thinned
     enough for a bright frame to wash through it */
  color: rgba(244, 239, 230, 0.92);
  max-width: 52ch;
}
/* stat line in the logo face (brand.css .ad-fp), lifted off the accent so the
   darker accents still read against near-clear glass */
.card__stat {
  position: relative;
  display: block;
  margin-top: 14px;
  font-family: var(--ad-font-paint, ui-monospace, Menlo, monospace);
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--card-accent, #9BD8FF) 82%, #F4EFE6);
}
/* bottom-left text link — the only interactive part of the layer */
.card__link {
  position: relative;
  margin-top: 20px;
  align-self: flex-start;
  pointer-events: auto;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: #F4EFE6;
  border-bottom: 1.5px solid color-mix(in srgb, var(--card-accent, #9BD8FF) 65%, transparent);
  padding-bottom: 3px;
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.card__link:hover {
  color: var(--card-accent, #9BD8FF);
  border-color: var(--card-accent, #9BD8FF);
}

/* where backdrop-filter is unsupported there is no blur to soften the clip,
   so the plate goes nearly solid — raw video behind body copy never reads */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { --card-plate: rgba(2, 4, 46, 0.93); }
}

/* ---- mobile ≤860px: same pattern, centered, ~86vw, compact ---------------- */
@media (max-width: 860px) {
  .cards-group {
    top: 46%;
    left: 7vw;
    right: 7vw;
    width: auto;
  }
  /* the stack sits centred over the clip on phones, with no copy card beside
     it to darken the frame — take the plate up another notch */
  .card {
    padding: 20px 20px;
    border-radius: 20px;
    --card-plate: rgba(4, 6, 48, 0.74);
    -webkit-backdrop-filter: blur(26px) saturate(1.7);
    backdrop-filter: blur(26px) saturate(1.7);
  }
  .card__title { font-size: clamp(1.15rem, 5vw, 1.4rem); }
  .card__body { margin-top: 10px; font-size: 0.92rem; }
  .card__link { font-size: 0.88rem; margin-top: 16px; }
}

/* ---- reduced-motion static list (built instead of the fixed layer) -------- */
.cards-static {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 18;
  pointer-events: none;
}
.cards-static__group {
  position: absolute;
  right: 6vw;
  width: min(42vw, 460px);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* relative, not static, so ::before / ::after stay anchored to the card */
.cards-static .card { position: relative; height: auto; }
.cards-static .card__link { margin-top: 18px; }
.cards-static .card__dim { display: none; }
@media (max-width: 860px) {
  .cards-static__group { left: 7vw; right: 7vw; width: auto; }
}

/* the per-section "Explore →" ghost link the engine renders as a lone
   secondary CTA — keep it small (finale's primary+secondary pair untouched) */
.sw-copy__cta .sw-btn--ghost:only-child {
  font-size: 0.88rem;
  padding: 9px 18px;
}
