/* ===========================================================================
   Crestbrick motion + secondary palette
   - Editorial restraint over flashy startup animations
   - Respects prefers-reduced-motion
   - Additive only — no existing layout broken
   =========================================================================== */

:root {
  --accent-2: #2d4f4a;        /* ink-teal — data/outcome accent */
  --accent-2-soft: #e8f0ee;   /* pale ink-teal wash */
  --accent-deep: #4a3820;     /* richer tan */
  --gradient-hero: linear-gradient(135deg, #faf8f4 0%, #f3ead9 50%, #e9e0d3 100%);
}

/* Scroll reveal — elements fade + rise on intersection */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Hero text reveal — character-level stagger */
.hero-text-reveal .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  animation: charReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-text-reveal .char.space { width: 0.32em; }
@keyframes charReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Card lift — hover transform for cards, articles, tiles */
.card-lift {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.2s ease;
  will-change: transform;
}
.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px -16px rgba(26, 26, 26, 0.16), 0 4px 12px -6px rgba(26, 26, 26, 0.08);
  border-color: var(--accent);
}

/* Gradient bar — slow-loop accent rule, place below section-labels */
.gradient-bar {
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 20%, var(--accent-2) 50%, var(--accent) 80%, transparent 100%);
  background-size: 200% 100%;
  animation: gradientShift 8s ease-in-out infinite;
  border: none;
  margin: 0.8rem 0 1.2rem;
  max-width: 180px;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Pulse accent — breath effect on CTAs */
.pulse-accent {
  animation: pulseAccent 3.2s ease-in-out infinite;
  will-change: box-shadow, transform;
}
@keyframes pulseAccent {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(139, 111, 71, 0.22), 0 2px 8px rgba(26, 26, 26, 0.08);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(139, 111, 71, 0), 0 2px 8px rgba(26, 26, 26, 0.08);
  }
}

/* Parallax — slight translate on scroll, JS driven */
[data-parallax] {
  will-change: transform;
  transition: transform 0.08s linear;
}

/* Secondary accent scoped — ONLY on data/outcome components */
.insight .val,
.value-total .amount,
.quickstat .value[data-outcome],
.result-total .amount {
  /* Use subtle teal-tinted tabular treatment on the big numbers */
  text-shadow: 0 0 0 transparent;
}

/* Alternating section bands — opt-in via .band-white (content-width) */
.band-white {
  background: #ffffff;
}

/* Full-bleed white band — wraps a max-width section without restructuring */
.section-band-white {
  position: relative;
  isolation: isolate;
}
.section-band-white::before {
  content: '';
  position: absolute;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background: #ffffff;
  z-index: -1;
}

/* Hero headshot rotator — stacked imgs, crossfade */
.hero-rotator {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 18px 36px -16px rgba(26,26,26,0.18), 0 4px 14px -6px rgba(26,26,26,0.08);
}
.hero-rotator img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  will-change: opacity;
}
.hero-rotator img.is-active {
  opacity: 1;
}

/* Launch card image overlay chips */
.launch-card-media {
  position: relative;
}
.launch-card-chips {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
  z-index: 2;
}
.launch-card-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.82);
  color: #faf8f4;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.launch-card-chip.chip-psf {
  background: rgba(250, 248, 244, 0.94);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.launch-card-chip .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Value stack receipt — stacked bar visualization */
.value-receipt {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0.5rem 0 1.5rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--rule, #e8e1d2);
  border-radius: 14px;
}
.value-receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted, #837a6d);
  margin-bottom: 0.5rem;
}
.value-receipt-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #f3ead9;
}
.value-receipt-bar span {
  height: 100%;
  transition: filter 0.2s ease;
}
.value-receipt-bar span:hover { filter: brightness(0.92); }
.value-receipt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--ink-soft, #4a4a4a);
}
.value-receipt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.value-receipt-legend em {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  font-style: normal;
}
.value-receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--rule, #e8e1d2);
  font-size: 0.9rem;
}
.value-receipt-total strong {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

/* Life-stage tile — accent hairline + number growth on hover */
.lifestage-tile {
  position: relative;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), border-color 0.2s ease, box-shadow 0.25s ease;
}
.lifestage-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lifestage-tile:hover::before { opacity: 1; }
.lifestage-tile .pillar-number,
.lifestage-tile > p:first-child {
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), color 0.2s ease;
}
.lifestage-tile:hover > p:first-child {
  transform: translateY(-2px);
  color: var(--accent-2, #2d4f4a);
}

/* WhatsApp float restyle — dark ink pill instead of agent green */
#wa-float {
  background: var(--ink) !important;
  color: var(--bg) !important;
  box-shadow: 0 10px 30px -8px rgba(26, 26, 26, 0.36) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#wa-float:hover {
  background: var(--accent-deep) !important;
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 14px 36px -10px rgba(74, 56, 32, 0.48) !important;
}
#wa-float svg { color: #faf8f4; }
@keyframes wa-pulse-refined {
  0%, 100% {
    box-shadow: 0 10px 30px -8px rgba(26, 26, 26, 0.36),
                0 0 0 0 rgba(139, 111, 71, 0.6);
  }
  60% {
    box-shadow: 0 10px 30px -8px rgba(26, 26, 26, 0.36),
                0 0 0 14px rgba(139, 111, 71, 0);
  }
}
#wa-float.wa-pulsing {
  animation: wa-pulse-refined 1.4s ease-out 2 !important;
}

/* Subtle hero gradient wash — applies via .hero-gradient class only */
.hero-gradient {
  background: var(--gradient-hero);
}

/* Accessibility — respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .card-lift,
  .pulse-accent,
  .gradient-bar,
  .hero-text-reveal .char,
  [data-parallax] {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .scroll-reveal { opacity: 1; transform: none; }
  .hero-text-reveal .char { opacity: 1; transform: none; }
}
