/* ============================================================
 * CleverAlpha — Kinetic-typography intro
 * Right-angled, jade-first, Poppins+Lato. Zero corner radius.
 * Plays before Step 1. Dismissed on Skip / CTA / auto-timeout.
 * Respects prefers-reduced-motion by skipping most animation.
 * ============================================================ */

.ca-intro {
  position: fixed;
  inset: 0;
  z-index: 2147483000;         /* above header + wizard */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #0A0F0E;         /* deep ink for punch, jade-adjacent */
  color: #FFFFFF;
  overflow: hidden;
  isolation: isolate;
  opacity: 1;
  transition: opacity 320ms cubic-bezier(.2, .8, .2, 1), visibility 0s linear 320ms;
}

/* Dismissed state */
.ca-intro[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Body scroll lock while intro is visible */
body.ca-intro-open,
html.ca-intro-open {
  overflow: hidden !important;
}

/* Ambient background layers removed per direction — clean solid backdrop */
.ca-intro__grid,
.ca-intro__scan { display: none !important; }

/* --- Stage layout ------------------------------------------- */

.ca-intro__stage {
  position: relative;
  max-width: 880px;
  width: 100%;
  text-align: left;
  padding: 32px 8px;
  font-family: var(--ca-font-primary, 'Poppins', sans-serif);
  z-index: 1;
}

/* Skip control */
.ca-intro__skip {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  padding: 10px 16px;
  font: 500 13px/1 var(--ca-font-primary, 'Poppins', sans-serif);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.ca-intro__skip:hover,
.ca-intro__skip:focus-visible {
  color: #FFFFFF;
  border-color: var(--ca-jade, #40C1AC);
  background: rgba(64, 193, 172, 0.08);
  outline: none;
}

/* --- Typography sequence ------------------------------------ */

/* Base kinetic reveal: mask-driven wipe with slight upward drift.
   Each element sets its own delay via `animation-delay`. */
.ca-intro__stage [data-anim] {
  opacity: 0;
  transform: translateY(14px);
  animation: caIntroReveal 875ms cubic-bezier(.2, .8, .2, 1) forwards;
}
@keyframes caIntroReveal {
  0%   { opacity: 0; transform: translateY(14px); clip-path: inset(0 100% 0 0); }
  60%  { opacity: 1; clip-path: inset(0 0 0 0); }
  100% { opacity: 1; transform: translateY(0); clip-path: inset(0 0 0 0); }
}

/* Eyebrow */
.ca-intro__eyebrow {
  font-family: var(--ca-font-primary, 'Poppins', sans-serif);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ca-jade, #40C1AC);
  margin: 0 0 20px 0;
  animation-delay: 125ms;
}
.ca-intro__eyebrow::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--ca-jade, #40C1AC);
  vertical-align: middle;
  margin-right: 12px;
  transform-origin: left;
  animation: caIntroBar 625ms cubic-bezier(.2, .8, .2, 1) 125ms both;
}
@keyframes caIntroBar {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Hello — the punchy hero word */
.ca-intro__hello {
  font-family: var(--ca-font-primary, 'Poppins', sans-serif);
  font-weight: 800;
  font-size: clamp(52px, 10vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 24px 0;
  color: #FFFFFF;
  animation-delay: 325ms;
}
.ca-intro__hello .ca-intro__word {
  display: inline-block;
  position: relative;
}
.ca-intro__hello .ca-intro__word::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 4px;
  background: var(--ca-jade, #40C1AC);
  transform: scaleX(0);
  transform-origin: left;
  animation: caIntroUnderline 775ms cubic-bezier(.2, .8, .2, 1) 800ms forwards;
}
@keyframes caIntroUnderline {
  to { transform: scaleX(1); }
}

/* Lede line */
.ca-intro__lede {
  font-family: var(--ca-font-primary, 'Poppins', sans-serif);
  font-weight: 500;
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0 0 20px 0;
  color: #FFFFFF;
  animation-delay: 875ms;
}

/* Setup line — the coffee/quiet corner */
.ca-intro__setup {
  font-family: var(--ca-font-support, 'Lato', sans-serif);
  font-weight: 400;
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 28px 0;
  max-width: 640px;
  animation-delay: 1250ms;
}

/* Highlight — inline jade block behind key words */
.ca-intro__hilite {
  position: relative;
  display: inline-block;
  color: #0A0F0E;
  padding: 0 6px;
  font-weight: 700;
  z-index: 0;
  white-space: nowrap;
}
.ca-intro__hilite::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ca-jade, #40C1AC);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  animation: caIntroHilite 700ms cubic-bezier(.2, .8, .2, 1) 1125ms forwards;
}
@keyframes caIntroHilite {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.ca-intro__lede .ca-intro__hilite:nth-of-type(2)::before {
  animation-delay: 1400ms;
}
.ca-intro__setup .ca-intro__hilite::before {
  background: rgba(64, 193, 172, 0.22);
  animation-delay: 1750ms;
}
.ca-intro__hilite--soft {
  color: var(--ca-jade, #40C1AC);
  font-weight: 700;
}

/* Legacy "3–4 minutes" bracket treatment removed per direction */

/* Ampersand — subtle jade accent (no italics) */
.ca-intro__amp {
  font-family: var(--ca-font-primary, 'Poppins', sans-serif);
  font-weight: 400;
  color: var(--ca-jade, #40C1AC);
  padding: 0 2px;
}

/* Pills — quick trust callouts */
.ca-intro__pills {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  animation-delay: 1400ms;
}
.ca-intro__pill {
  position: relative;
  font-family: var(--ca-font-primary, 'Poppins', sans-serif);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  padding: 8px 14px;
  opacity: 0;
  transform: translateY(10px);
  animation: caIntroPillIn 625ms cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: calc(1875ms + var(--i, 0) * 175ms);
}
/* Chevron glyph removed per direction — tiles are plain outlined pills */
@keyframes caIntroPillIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Promise line — the payoff */
.ca-intro__promise {
  font-family: var(--ca-font-primary, 'Poppins', sans-serif);
  font-weight: 500;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.35;
  color: #FFFFFF;
  margin: 0 0 32px 0;
  animation-delay: 2375ms;
}
/* Plain "Financial Scorecard" — no jade block, no italic slant */
.ca-intro__plain {
  font-weight: 700;
  color: #FFFFFF;
}
.ca-intro__flash {
  font-weight: 800;
  color: var(--ca-jade, #40C1AC);
  position: relative;
  display: inline-block;
  animation: caIntroFlash 1125ms cubic-bezier(.2, .8, .2, 1) 2875ms both;
}
@keyframes caIntroFlash {
  0%   { opacity: 0.2; transform: translateX(-4px); }
  40%  { opacity: 1;   transform: translateX(0);    }
  60%  { opacity: 0.6; }
  100% { opacity: 1;   }
}

/* CTA */
.ca-intro__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ca-font-primary, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0A0F0E;
  background: var(--ca-jade, #40C1AC);
  border: none;
  border-radius: 0;
  padding: 0 24px;
  height: 52px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  animation-delay: 3000ms;
  box-shadow: 6px 6px 0 rgba(64, 193, 172, 0.28);
}
.ca-intro__cta:hover {
  background: var(--ca-jade-dark, #2FA592);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(64, 193, 172, 0.42);
}
.ca-intro__cta:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(64, 193, 172, 0.28);
}
.ca-intro__cta:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 3px;
}
.ca-intro__cta svg {
  transition: transform 200ms cubic-bezier(.2, .8, .2, 1);
}
.ca-intro__cta:hover svg {
  transform: translateX(4px);
}

/* Foot line */
.ca-intro__foot {
  font-family: var(--ca-font-support, 'Lato', sans-serif);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin: 24px 0 0 0;
  letter-spacing: 0.02em;
  animation-delay: 3375ms;
}
.ca-intro__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--ca-jade, #40C1AC);
  margin-right: 10px;
  vertical-align: 1px;
  animation: caIntroDot 1400ms ease-in-out infinite;
}
@keyframes caIntroDot {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%      { opacity: 0.3; transform: scale(0.7); }
}

/* --- Dismiss animation (adds .is-leaving before removal) ---- */
.ca-intro.is-leaving .ca-intro__stage {
  animation: caIntroLeave 320ms cubic-bezier(.6, 0, .4, 1) forwards;
}
@keyframes caIntroLeave {
  to { opacity: 0; transform: translateY(-16px); filter: blur(2px); }
}

/* --- Reduced motion ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .ca-intro__grid,
  .ca-intro__scan,
  .ca-intro__stage [data-anim],
  .ca-intro__pill,
  .ca-intro__hello .ca-intro__word::after,
  .ca-intro__hilite::before,
  .ca-intro__num::before,
  .ca-intro__num::after,
  .ca-intro__flash,
  .ca-intro__dot,
  .ca-intro__eyebrow::before {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  .ca-intro__hilite::before { transform: scaleX(1); }
  .ca-intro__hello .ca-intro__word::after { transform: scaleX(1); }
  .ca-intro__num::before,
  .ca-intro__num::after { opacity: 1; }
}

/* --- Mobile ------------------------------------------------- */
@media (max-width: 640px) {
  .ca-intro { padding: 20px 16px; }
  .ca-intro__stage { padding: 24px 0; }
  .ca-intro__skip { top: 14px; right: 14px; padding: 8px 12px; font-size: 12px; }
  .ca-intro__eyebrow { font-size: 11px; letter-spacing: 0.22em; margin-bottom: 14px; }
  .ca-intro__hello { margin-bottom: 18px; }
  .ca-intro__lede { margin-bottom: 16px; }
  .ca-intro__setup { margin-bottom: 22px; }
  .ca-intro__pills { margin-bottom: 24px; gap: 8px; }
  .ca-intro__pill { font-size: 12px; padding: 7px 12px; }
  .ca-intro__promise { margin-bottom: 24px; }
  .ca-intro__cta { width: 100%; justify-content: center; }
  .ca-intro__foot { text-align: center; }
}

/* --- Light theme override (rare) ---------------------------- */
html[data-theme="light"] .ca-intro,
html:not([data-theme]) .ca-intro {
  /* Intro is intentionally always dark for punch — no light variant. */
}
