/* ═══════════════════════════════════════════════════════
   candles.css — Birthday candle layout & animations
   ═══════════════════════════════════════════════════════ */

/* ── Outer 3-col layout ─────────────────────────────── */
.candle-layout {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(16px, 3vw, 48px);
  padding: 3rem 1rem 4rem;
  min-height: 80vh;
}

/* ── Candle wrapper ─────────────────────────────────── */
.candle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 0;
  position: sticky;
  top: 8vh;
}

/* ── Glow halo ──────────────────────────────────────── */
.candle-glow {
  position: absolute;
  width: 90px;
  height: 90px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in oklch, var(--accent, #f9a8d4) 55%, transparent) 0%,
    transparent 70%
  );
  filter: blur(14px);
  animation: glowPulse 2.4s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes glowPulse {
  from { opacity: 0.55; transform: translate(-50%,-45%) scale(0.9); }
  to   { opacity: 1;    transform: translate(-50%,-45%) scale(1.15); }
}

/* ── Flame wrap (positions flame + glow relative) ───── */
.candle-flame-wrap {
  position: relative;
  width: 48px;
  height: 80px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* ── Flame shape ─────────────────────────────────────── */
.candle-flame {
  position: relative;
  width: 38px;
  height: 68px;
  z-index: 2;
  /* Teardrop shape via border-radius */
  border-radius: 50% 50% 35% 35% / 60% 60% 40% 40%;
  background: linear-gradient(
    180deg,
    #fff4c2 0%,
    #ffd460 18%,
    #ff9d00 55%,
    #ff4500 85%,
    #c0392b 100%
  );
  overflow: hidden;
  box-shadow:
    0 0 12px 4px rgba(255,180,0,0.55),
    0 0 28px 10px rgba(255,100,0,0.30),
    0 0 55px 20px rgba(255,60,0,0.18);
  transform-origin: bottom center;
  animation: flicker 1.8s ease-in-out infinite;
}

@keyframes flicker {
   0%   { transform: scaleX(1)    scaleY(1)    rotate(0deg);   opacity:1;   }
   15%  { transform: scaleX(0.92) scaleY(1.04) rotate(-1.5deg); opacity:.97; }
   30%  { transform: scaleX(1.06) scaleY(0.96) rotate(1deg);   opacity:.99; }
   45%  { transform: scaleX(0.96) scaleY(1.06) rotate(-0.8deg); opacity:1;   }
   60%  { transform: scaleX(1.04) scaleY(0.98) rotate(1.2deg); opacity:.96; }
   75%  { transform: scaleX(0.94) scaleY(1.03) rotate(-1deg);  opacity:.98; }
   90%  { transform: scaleX(1.02) scaleY(1.01) rotate(0.5deg); opacity:1;   }
  100%  { transform: scaleX(1)    scaleY(1)    rotate(0deg);   opacity:1;   }
}

/* ── Photo layer inside flame ───────────────────────── */
.candle-flame-photos {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  /* Blend mode makes photos look warm/fiery */
  mix-blend-mode: luminosity;
  opacity: 0.65;
}

/* ── Sparks container ───────────────────────────────── */
.candle-sparks {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  pointer-events: none;
  z-index: 5;
}

.candle-spark {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

/* ── Wick ───────────────────────────────────────────── */
.candle-wick {
  width: 3px;
  height: 12px;
  background: linear-gradient(to bottom, #333 0%, #111 100%);
  border-radius: 2px 2px 0 0;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}

/* ── Candle body ────────────────────────────────────── */
.candle-body {
  width: 46px;
  min-height: clamp(160px, 22vh, 280px);
  background: linear-gradient(
    135deg,
    color-mix(in oklch, var(--candle-color, #f5d76e) 90%, white) 0%,
    var(--candle-color, #f5d76e) 40%,
    color-mix(in oklch, var(--candle-color, #f5d76e) 75%, #a07000) 100%
  );
  border-radius: 6px 6px 4px 4px;
  position: relative;
  overflow: visible;
  box-shadow:
    inset -6px 0 10px rgba(0,0,0,0.15),
    inset  3px 0  6px rgba(255,255,255,0.25),
    0 4px 16px rgba(0,0,0,0.35);
}

/* Candle highlight stripe */
.candle-body::before {
  content: '';
  position: absolute;
  top: 0; left: 22%;
  width: 6px; height: 100%;
  background: linear-gradient(to bottom,
    rgba(255,255,255,0.45) 0%,
    rgba(255,255,255,0.10) 60%,
    transparent 100%
  );
  border-radius: 3px;
}

/* Melted-top rim */
.candle-body::after {
  content: '';
  position: absolute;
  top: -3px; left: 50%;
  transform: translateX(-50%);
  width: 52px; height: 10px;
  background: color-mix(in oklch, var(--candle-color, #f5d76e) 85%, white);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ── Wax drips ──────────────────────────────────────── */
.candle-drip {
  position: absolute;
  top: 0;
  width: 7px;
  background: linear-gradient(to bottom,
    color-mix(in oklch, var(--drip-color, #f5d76e) 90%, white),
    var(--drip-color, #f5d76e)
  );
  border-radius: 0 0 4px 4px;
  animation: drip linear infinite;
  transform-origin: top center;
}

@keyframes drip {
    0% { height:  4px; opacity:0;   top: 0;  }
   10% { height:  4px; opacity:0.9; }
   80% { height: 28px; opacity:0.85; }
  100% { height: 36px; opacity:0;   }
}

/* ── Centre column ──────────────────────────────────── */
.candle-centre {
  flex: 1;
  min-width: 200px;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.candle-centre-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.candle-bday-label {
  font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-style: italic;
  letter-spacing: 0.06em;
  opacity: 0.9;
  animation: labelGlow 3s ease-in-out infinite alternate;
}

@keyframes labelGlow {
  from { text-shadow: 0 0 8px currentColor; opacity: 0.8; }
  to   { text-shadow: 0 0 20px currentColor, 0 0 40px currentColor; opacity: 1; }
}

.candle-note {
  font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
  font-style: italic;
  font-size: clamp(0.88rem, 1.3vw, 1.05rem);
  line-height: 1.9;
  color: rgba(255,255,255,0.82);
  padding: 1.25rem 1.25rem;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: 100%;
  position: relative;
}

.candle-note::before {
  content: '"';
  position: absolute;
  top: -0.5rem; left: 0.75rem;
  font-size: 3.5rem;
  color: var(--accent, #f9a8d4);
  opacity: 0.2;
  font-style: normal;
  line-height: 1;
}

.candle-quote {
  border: none;
  margin: 0;
  padding: 0.9rem 1.1rem;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--accent, #f9a8d4);
  border-radius: 0 10px 10px 0;
  max-width: 100%;
}

.candle-quote-text {
  font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
  font-style: italic;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  color: rgba(255,255,255,0.75);
  line-height: 1.75;
  margin: 0 0 0.4rem;
}

.candle-quote-author {
  font-size: 0.78rem;
  color: var(--accent, #f9a8d4);
  opacity: 0.7;
  font-style: normal;
  letter-spacing: 0.04em;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
  .candle-layout { flex-direction: column; align-items: center; padding: 2rem 1rem; }
  .candle-wrap   { flex-direction: row; position: static; }
  .candle-wrap .candle-body { min-height: 60px; width: 36px; }
  .candle-centre { max-width: 100%; }
}
