/* =============================================================================
   FILE: public/css/bloom.css
   PMD Bloom Reveal UX — Day 12
   Botanical particle rise + sequential tier reveal + gate bloom variants

   BRAND CONTRACT: All palette values from style.css variables only.
   CSS only — zero JS dependency for animations.
   ============================================================================= */


/* ---------------------------------------------------------------------------
   CORE BLOOM KEYFRAMES
   --------------------------------------------------------------------------- */

@keyframes botanical-bloom {
  0%   { opacity: 0; transform: translateY(12px) scale(0.96); }
  60%  { opacity: 1; transform: translateY(-2px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes botanical-bloom-soft {
  0%   { opacity: 0; transform: translateY(8px) scale(0.98); }
  70%  { opacity: 1; transform: translateY(-1px) scale(1.005); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes particle-rise {
  0%   { opacity: 0;    transform: translateY(0)     scale(0);    }
  20%  { opacity: 0.7;  transform: translateY(-20px) scale(1);    }
  80%  { opacity: 0.4;  transform: translateY(-80px) scale(0.8);  }
  100% { opacity: 0;    transform: translateY(-120px) scale(0.4); }
}

@keyframes bloom-overlay-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes bloom-overlay-out { from { opacity: 1; } to { opacity: 0; } }

@keyframes bloom-modal-in {
  0%   { opacity: 0; transform: translate(-50%, -48%) scale(0.94); }
  65%  { opacity: 1; transform: translate(-50%, -50%) scale(1.01); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes bloom-tile-up {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes bloom-line-draw {
  from { width: 0; opacity: 0; }
  to   { width: 48px; opacity: 1; }
}

@keyframes bloom-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.3); }
  50%       { box-shadow: 0 0 0 12px rgba(212, 175, 55, 0); }
}

@keyframes bloom-ring-expand {
  0%   { transform: scale(0.8);  opacity: 0.8; }
  100% { transform: scale(2.2);  opacity: 0; }
}

@keyframes bloom-letter-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ---------------------------------------------------------------------------
   BOTANICAL PARTICLE FIELD
   --------------------------------------------------------------------------- */
.bloom-particle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  overflow: hidden;
}

.bloom-particle {
  position: absolute;
  bottom: -10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-sage);
  opacity: 0;
  animation: particle-rise 3s ease-out forwards;
}

.bloom-particle:nth-child(1)  { left:  4%; width: 4px; height: 4px; animation-delay: 0.0s; animation-duration: 3.2s; background: var(--primary-sage); }
.bloom-particle:nth-child(2)  { left:  9%; width: 7px; height: 7px; animation-delay: 0.2s; animation-duration: 2.8s; background: var(--champagne-gold); }
.bloom-particle:nth-child(3)  { left: 15%; width: 5px; height: 5px; animation-delay: 0.4s; animation-duration: 3.5s; background: var(--primary-sage); }
.bloom-particle:nth-child(4)  { left: 22%; width: 3px; height: 3px; animation-delay: 0.1s; animation-duration: 3.0s; background: var(--sage-mist); }
.bloom-particle:nth-child(5)  { left: 30%; width: 6px; height: 6px; animation-delay: 0.6s; animation-duration: 2.6s; background: var(--champagne-gold); }
.bloom-particle:nth-child(6)  { left: 38%; width: 4px; height: 4px; animation-delay: 0.3s; animation-duration: 3.3s; background: var(--primary-sage); }
.bloom-particle:nth-child(7)  { left: 45%; width: 8px; height: 8px; animation-delay: 0.0s; animation-duration: 2.9s; background: var(--sage-mist); }
.bloom-particle:nth-child(8)  { left: 52%; width: 5px; height: 5px; animation-delay: 0.5s; animation-duration: 3.1s; background: var(--champagne-gold); }
.bloom-particle:nth-child(9)  { left: 59%; width: 4px; height: 4px; animation-delay: 0.2s; animation-duration: 3.4s; background: var(--primary-sage); }
.bloom-particle:nth-child(10) { left: 66%; width: 6px; height: 6px; animation-delay: 0.7s; animation-duration: 2.7s; background: var(--sage-mist); }
.bloom-particle:nth-child(11) { left: 73%; width: 3px; height: 3px; animation-delay: 0.4s; animation-duration: 3.0s; background: var(--champagne-gold); }
.bloom-particle:nth-child(12) { left: 80%; width: 7px; height: 7px; animation-delay: 0.1s; animation-duration: 3.6s; background: var(--primary-sage); }
.bloom-particle:nth-child(13) { left: 86%; width: 5px; height: 5px; animation-delay: 0.8s; animation-duration: 2.8s; background: var(--sage-mist); }
.bloom-particle:nth-child(14) { left: 91%; width: 4px; height: 4px; animation-delay: 0.3s; animation-duration: 3.2s; background: var(--champagne-gold); }
.bloom-particle:nth-child(15) { left: 95%; width: 6px; height: 6px; animation-delay: 0.6s; animation-duration: 2.9s; background: var(--primary-sage); }
.bloom-particle:nth-child(16) { left: 99%; width: 3px; height: 3px; animation-delay: 0.0s; animation-duration: 3.5s; background: var(--sage-mist); }

.bloom-particle-field.bloom-done {
  animation: bloom-overlay-out 600ms ease forwards;
  animation-delay: 3s;
}


/* ---------------------------------------------------------------------------
   BLOOM MODAL
   --------------------------------------------------------------------------- */
.bloom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 62, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9995;
  animation: bloom-overlay-in 500ms ease forwards;
}

.bloom-modal-overlay.bloom-closing {
  animation: bloom-overlay-out 400ms ease forwards;
}

.bloom-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--warm-ivory);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  max-width: 460px;
  width: calc(100% - 3rem);
  text-align: center;
  z-index: 9996;
  box-shadow: 0 32px 80px rgba(45, 62, 42, 0.28), 0 8px 24px rgba(45, 62, 42, 0.12);
  animation: bloom-modal-in 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bloom-modal-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary-sage), var(--deep-forest));
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: bloom-pulse 2s ease-in-out 1s infinite;
}

.bloom-modal-line {
  height: 2px;
  background: var(--champagne-gold);
  border-radius: 2px;
  margin: 1.25rem auto;
  animation: bloom-line-draw 600ms ease-out 400ms both;
}

.bloom-modal-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--deep-forest);
  line-height: 1.25;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.bloom-modal-message {
  font-size: 1rem;
  color: var(--warm-grey);
  line-height: 1.65;
  margin-bottom: 2rem;
}

.bloom-modal-cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-sage), var(--deep-forest));
  color: var(--warm-ivory);
  padding: 0.85rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: transform 220ms ease, box-shadow 220ms ease;
  text-decoration: none;
}

.bloom-modal-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 62, 42, 0.22);
}


/* ---------------------------------------------------------------------------
   SEQUENTIAL REVEAL TILES
   --------------------------------------------------------------------------- */
.bloom-reveal-sequence {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.bloom-reveal-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--soft-cream);
  border: 1px solid var(--sage-mist);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  opacity: 0;
  transform: translateY(10px);
  transition: none;
}

.bloom-reveal-tile.bloom-active {
  animation: bloom-tile-up 400ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bloom-tile-icon {
  width: 40px;
  height: 40px;
  background: rgba(156, 175, 136, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--deep-forest);
}

.bloom-tile-content { text-align: left; }

.bloom-tile-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-sage);
  margin-bottom: 0.2rem;
}

.bloom-tile-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--deep-forest);
}

.bloom-tile-value.bloom-gold { color: var(--champagne-gold); }


/* ---------------------------------------------------------------------------
   GATE BLOOM VARIANTS
   --------------------------------------------------------------------------- */
.bloom-gate-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 80px; height: 80px;
  margin: -40px 0 0 -40px;
  border-radius: 50%;
  border: 2px solid var(--champagne-gold);
  animation: bloom-ring-expand 800ms ease-out forwards;
  pointer-events: none;
}

.bloom-gcms-stack {
  position: relative;
  width: 100%;
  height: 80px;
  margin: 1rem 0;
}

.bloom-gcms-card {
  position: absolute;
  width: 100%;
  background: var(--soft-cream);
  border: 1px solid var(--sage-mist);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--deep-forest);
  opacity: 0;
  animation: botanical-bloom-soft 500ms ease-out forwards;
}

.bloom-gcms-card:nth-child(1) { top: 0;    animation-delay: 0.1s; z-index: 3; }
.bloom-gcms-card:nth-child(2) { top: 8px;  animation-delay: 0.2s; z-index: 2; transform-origin: top; }
.bloom-gcms-card:nth-child(3) { top: 16px; animation-delay: 0.3s; z-index: 1; transform-origin: top; }

.bloom-gate4-message {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--deep-forest);
  line-height: 1.6;
  text-align: center;
  padding: 1rem 0;
  opacity: 0;
  animation: botanical-bloom 700ms ease-out 300ms forwards;
}

.bloom-gate4-signature {
  font-size: 0.85rem;
  color: var(--warm-grey);
  margin-top: 0.5rem;
  opacity: 0;
  animation: botanical-bloom-soft 500ms ease-out 900ms forwards;
}

.bloom-stagger-letter {
  display: inline-block;
  opacity: 0;
  animation: bloom-letter-in 300ms ease-out forwards;
}


/* ---------------------------------------------------------------------------
   GENERIC BLOOM UTILITIES
   --------------------------------------------------------------------------- */
.bloom-reveal      { animation: botanical-bloom 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.bloom-reveal-soft { animation: botanical-bloom-soft 500ms ease-out forwards; }

.bloom-stagger-1 { animation-delay: 0ms; }
.bloom-stagger-2 { animation-delay: 100ms; }
.bloom-stagger-3 { animation-delay: 200ms; }
.bloom-stagger-4 { animation-delay: 300ms; }
.bloom-stagger-5 { animation-delay: 400ms; }
.bloom-stagger-6 { animation-delay: 500ms; }


/* ---------------------------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .bloom-particle          { animation: none; opacity: 0; }
  .bloom-particle-field    { display: none; }
  .bloom-modal             { animation: none; opacity: 1; transform: translate(-50%, -50%); }
  .bloom-reveal-tile       { opacity: 1; transform: none; }
  .bloom-reveal-tile.bloom-active { animation: none; opacity: 1; transform: none; }
  .bloom-reveal,
  .bloom-reveal-soft,
  .bloom-gcms-card,
  .bloom-gate4-message,
  .bloom-gate4-signature   { animation: none; opacity: 1; transform: none; }
  .bloom-modal-icon        { animation: none; }
  .bloom-modal-line        { animation: none; width: 48px; opacity: 1; }
}
