/* The Birthday Candles — living moments (candles-fx.js), scoped to html.cfx-on. Opacity / transform only; loops only while on screen. */
html.cfx-on .cfx-stage { position: relative; display: block; -webkit-tap-highlight-color: transparent; }
html.cfx-on .cfx-stage > img:first-child { display: block; width: 100%; height: auto; }
html.cfx-on .cfx-stage i { position: absolute; display: block; pointer-events: none; }
/* the soft drop shadow sits on the still picture itself, not on the box the moving pieces live in (a filter over animated children made
   WebKit re-blur the whole picture every frame) */
html.cfx-on .decor.big:has(> .cfx-stage) { filter: none; }
html.cfx-on .cfx-stage > img:first-child { filter: drop-shadow(0 10px 14px rgba(70, 45, 40, .13)); }
/* the engine's decorations ignore taps: the cupcake, the gifts and the cue take them */
html.cfx-on .decor .cfx-cupcake, html.cfx-on .decor .cfx-gifts { pointer-events: auto; cursor: pointer; position: relative; z-index: 2; }

/* ── the candle flame ── */
html.cfx-on .cfx-flame { left: 50%; top: 6.4%; width: 7%; height: 9.6%; margin-left: -3.5%; transform: translateY(-50%); }
html.cfx-on .cfx-flame::before { content: ''; position: absolute; inset: 0; border-radius: 50% 50% 45% 45% / 64% 64% 36% 36%;
  background: radial-gradient(ellipse 46% 56% at 50% 68%, rgba(255, 252, 242, .92) 0, rgba(255, 236, 196, .55) 34%, rgba(var(--tint), .26) 60%, rgba(var(--tint), 0) 78%);
  transform-origin: 50% 94%; will-change: transform, opacity; }
html.cfx-on .cfx-live .cfx-flame::before { animation: cfxFlick 1.7s ease-in-out infinite alternate; }
@keyframes cfxFlick { 0% { transform: scale(1, 1) rotate(0); opacity: .9; } 22% { transform: scale(.95, 1.08) rotate(-2deg); opacity: 1; } 43% { transform: scale(1.03, .95) rotate(1.5deg); opacity: .84; }
  68% { transform: scale(.97, 1.05) rotate(-.8deg); opacity: .97; } 100% { transform: scale(1.02, .98) rotate(1deg); opacity: .9; } }
/* its warm halo on the paper: breathes slowly */
html.cfx-on .cfx-halo { left: 50%; top: 6.4%; width: 46%; height: 0; padding-bottom: 46%; margin-left: -23%; border-radius: 50%; transform: translateY(-50%);
  background: radial-gradient(circle, rgba(var(--tint), .30) 0, rgba(var(--tint), .12) 34%, rgba(var(--tint), 0) 68%); will-change: opacity, transform; }
html.cfx-on .cfx-live .cfx-halo { animation: cfxBreathe 3.4s ease-in-out infinite alternate; }
@keyframes cfxBreathe { from { opacity: .7; transform: translateY(-50%) scale(.95); } to { opacity: 1; transform: translateY(-50%) scale(1.05); } }
/* a wish: the flame flares, the halo blooms, a few golden sparks rise and fade */
html.cfx-on .cfx-cupcake.wish .cfx-flame { animation: cfxFlare 1.5s cubic-bezier(.3, .1, .3, 1) both; }
@keyframes cfxFlare { 0% { transform: translateY(-50%); } 18% { transform: translateY(-58%) scale(1.25, 1.45); } 45% { transform: translateY(-52%) scale(1.08, 1.12); } 100% { transform: translateY(-50%); } }
html.cfx-on .cfx-cupcake.wish .cfx-halo { animation: cfxBloom 1.9s cubic-bezier(.3, .1, .3, 1) both; }
@keyframes cfxBloom { 0% { opacity: .8; transform: translateY(-50%) scale(1); } 20% { opacity: 1; transform: translateY(-50%) scale(1.5); } 100% { opacity: .85; transform: translateY(-50%) scale(1); } }
html.cfx-on .cfx-sparks { left: 50%; top: 4%; width: 0; height: 0; }
html.cfx-on .cfx-sparks b { position: absolute; left: 0; top: 0; width: var(--sz); height: var(--sz); margin: calc(var(--sz) / -2) 0 0 calc(var(--sz) / -2); border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(255, 246, 214, 1) 0, rgba(236, 184, 92, .95) 45%, rgba(214, 150, 60, 0) 74%); box-shadow: 0 0 7px 1px rgba(226, 164, 70, .75); /* gold, not white: white specks vanished on the cream paper */ will-change: transform, opacity; }
html.cfx-on .cfx-cupcake.wish .cfx-sparks b { animation: cfxSpark 1.8s cubic-bezier(.2, .6, .3, 1) var(--dl) both; }
@keyframes cfxSpark { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; } 70% { opacity: .8; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.3); } }
/* the cue under the cupcake: one quiet italic line in the page's accent (no pill — it wrapped into two lines at 320 px in Italian) */
html.cfx-on .cfx-cue { display: block; margin: -6px auto 14px; padding: 6px 8px; border: 0; background: transparent; position: relative; z-index: 2; white-space: nowrap;
  color: var(--accent, #a08040); font: italic 400 min(15px, 4.25vw)/1.3 'Cormorant Garamond', var(--serif), serif; letter-spacing: .02em;
  cursor: pointer; -webkit-tap-highlight-color: transparent; transition: opacity .6s ease, transform .6s ease; }
html.cfx-on .cfx-cue::before, html.cfx-on .cfx-cue::after { content: '\2726'; font-style: normal; font-size: .62em; opacity: .7; vertical-align: .18em; margin: 0 .55em; }
html.cfx-on .cfx-cue.gone { opacity: 0; transform: translateY(-4px); pointer-events: none; }

/* ── the hot-air balloon: rises in, then floats ── */
html.cfx-on .cfx-balloon { will-change: transform; }
html.cfx-on .cfx-balloon.pre { transform: translateY(16%); }
html.cfx-on .cfx-balloon.rise { animation: cfxRise 2.8s cubic-bezier(.25, .1, .25, 1) both; }
html.cfx-on .cfx-balloon.rise.cfx-live { animation: cfxRise 2.8s cubic-bezier(.25, .1, .25, 1) both, cfxBob 8.5s ease-in-out 2.8s infinite; }
@keyframes cfxRise { from { transform: translateY(16%); } to { transform: translateY(0); } }
@keyframes cfxBob { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translate(1.2%, -3.2%) rotate(.6deg); } 65% { transform: translate(-.8%, -1.4%) rotate(-.4deg); } }

/* ── the corner balloons: a slow float ── */
html.cfx-on .cfx-float { will-change: transform; }
html.cfx-on .cfx-live > .cfx-float { animation: cfxCorner var(--fd, 9s) ease-in-out var(--fdl, 0s) infinite; }
@keyframes cfxCorner { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-1.2deg); } }

/* ── the pompom garland: one soft swing, then still ── */
html.cfx-on .cfx-swing { transform-origin: 50% 12%; animation: cfxSwing 3s cubic-bezier(.35, .1, .3, 1) both; }
@keyframes cfxSwing { 0% { transform: rotate(0); } 18% { transform: rotate(2.6deg); } 42% { transform: rotate(-1.6deg); } 64% { transform: rotate(.8deg); } 84% { transform: rotate(-.3deg); } 100% { transform: rotate(0); } }

/* ── the gift stack: a sheen; a gentle lift on a tap ── */
html.cfx-on .cfx-sheen { inset: 0; overflow: hidden; -webkit-mask: var(--m) center / 100% 100% no-repeat; mask: var(--m) center / 100% 100% no-repeat; }
html.cfx-on .cfx-sheen b { position: absolute; top: -10%; bottom: -10%; left: -60%; width: 42%; transform: translateX(-30%) skewX(-18deg); opacity: 0;
  background: linear-gradient(90deg, rgba(255, 248, 230, 0), rgba(255, 248, 230, .5) 50%, rgba(255, 248, 230, 0)); will-change: transform, opacity; }
html.cfx-on .cfx-gifts.sheen .cfx-sheen b { animation: cfxSheen 1.9s cubic-bezier(.4, .1, .3, 1) both; }
@keyframes cfxSheen { 0% { transform: translateX(-30%) skewX(-18deg); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(420%) skewX(-18deg); opacity: 0; } }
html.cfx-on .cfx-gifts.lift { animation: cfxLift 1.1s cubic-bezier(.3, .1, .25, 1) both; }
@keyframes cfxLift { 0% { transform: none; } 40% { transform: translateY(-6%) rotate(-1.4deg); } 70% { transform: translateY(-1%) rotate(.4deg); } 100% { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html.cfx-on .cfx-stage, html.cfx-on .cfx-stage *, html.cfx-on .cfx-stage *::before, html.cfx-on .cfx-float, html.cfx-on .cfx-swing { animation: none !important; }
  html.cfx-on .cfx-balloon.pre { transform: none; }
}

/* ── the top tier's date + city: one line each (candles-fx.js sets data-cfx1l + --cfx-k where the engine would wrap) ── */
html.cfx-on .hero .hn-sm .hn-date.wrap[data-cfx1l], html.cfx-on .hero .hn-sm .hn-city.wrap[data-cfx1l] { white-space: nowrap; max-width: none; line-height: 1.3;
  letter-spacing: .1em; padding-left: .1em; transform: scale(var(--cfx-k, 1)); transform-origin: 50% 50%; flex: none; width: max-content; align-self: center; margin-left: 0; margin-right: 0; }
