/* =====================================================================
   Seasonal effects: shared by vahecooper.com, consultantoralsurgeon.com
   and asktpd.com. Works with the data-season attribute each site sets.
   Nothing here needs editing; each site lists what to decorate in its
   window.SEASONAL_FX settings.
   ===================================================================== */

/* ---------- AUTUMN: warm accents and a campfire flicker on buttons ---------- */
@keyframes fx-flicker {
  0%   { box-shadow: 0 0 0 2px rgba(232, 140, 48, 0.35), 0 8px 26px rgba(214, 98, 32, 0.30); }
  22%  { box-shadow: 0 0 0 2px rgba(245, 170, 60, 0.45), 0 10px 32px rgba(232, 120, 40, 0.42); }
  41%  { box-shadow: 0 0 0 2px rgba(214, 98, 32, 0.32), 0 7px 22px rgba(190, 80, 30, 0.28); }
  63%  { box-shadow: 0 0 0 2px rgba(250, 186, 80, 0.50), 0 12px 36px rgba(236, 130, 46, 0.45); }
  81%  { box-shadow: 0 0 0 2px rgba(222, 110, 36, 0.36), 0 8px 26px rgba(200, 88, 30, 0.32); }
  100% { box-shadow: 0 0 0 2px rgba(232, 140, 48, 0.35), 0 8px 26px rgba(214, 98, 32, 0.30); }
}
@media (hover: hover) {
  [data-season="autumn"] .fx-cta:hover { animation: fx-flicker 1.7s ease-in-out infinite; border-color: #d9822b; }
}
[data-season="autumn"] .fx-cta:focus-visible { outline-color: #d9822b; }

/* ---------- WINTER & HOLIDAYS: frosted glass ---------- */
:where([data-season="winter"], [data-season="christmas"]) .fx-frost {
  background-color: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
          backdrop-filter: blur(14px) saturate(1.35);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 30px rgba(60, 90, 130, 0.12);
}

/* ---------- icicles hanging from the main headings ---------- */
.fx-icicles { position: absolute; pointer-events: none; z-index: 1; overflow: visible; }
.fx-icicles .fx-glint { animation: fx-glint 7s ease-in-out infinite; }
@keyframes fx-glint {
  0%   { transform: translateX(-30%); }
  18%  { transform: translateX(130%); }
  100% { transform: translateX(130%); }
}

/* ---------- fairy lights (Christmas) ---------- */
.fx-lights { position: absolute; left: 0; right: 0; height: 30px; pointer-events: none; z-index: 60; overflow: visible; }
.fx-lights.hang { top: 100%; margin-top: -6px; }
.fx-lights.top { top: -16px; }
.fx-lights svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fx-bulb { animation: fx-twinkle 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.fx-bulb ellipse { filter: drop-shadow(0 0 4px currentColor); }
@keyframes fx-twinkle {
  0%, 100% { opacity: 1; }
  45%      { opacity: 0.35; }
  55%      { opacity: 0.4; }
}

/* ---------- SPRING: butterfly on a looping flight path ---------- */
.fx-butterfly {
  position: fixed; left: 0; top: 0; width: 30px; height: 30px; z-index: 45; pointer-events: none;
  offset-rotate: auto 90deg; offset-anchor: center;
  animation: fx-fly 46s linear infinite;
}
@keyframes fx-fly { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.fx-butterfly .wing { transform-box: fill-box; animation: fx-flap 0.32s ease-in-out infinite alternate; }
.fx-butterfly .wing.l { transform-origin: right center; }
.fx-butterfly .wing.r { transform-origin: left center; }
@keyframes fx-flap { from { transform: scaleX(1); } to { transform: scaleX(0.25); } }

/* ---------- growing vine dividers ---------- */
.fx-vine { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); width: min(440px, 86%); height: 40px; pointer-events: none; z-index: 3; }
.fx-vine svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fx-vine .stem { fill: none; stroke: #6a9a5b; stroke-width: 2.2; stroke-linecap: round; transition: stroke-dashoffset 1.8s cubic-bezier(0.3, 0.7, 0.2, 1); }
.fx-vine .bud { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
.fx-vine.grow .stem { stroke-dashoffset: 0 !important; }
.fx-vine.grow .bud { transform: scale(1); }

/* ---------- SUMMER: sky follows the time of day ---------- */
html.fx-on[data-season="summer"] body::before {
  background:
    radial-gradient(circle at var(--fx-sun-x, 86%) var(--fx-sun-y, 6%), var(--fx-sun-core, rgba(255, 253, 240, 0.98)) 0, var(--fx-sun-glow, rgba(255, 246, 215, 0.55)) 6%, rgba(255, 246, 215, 0) 26%),
    linear-gradient(180deg, var(--fx-sky1, #a9d3f2) 0%, var(--fx-sky2, #d3e9f8) 55%, var(--fx-sky3, #f5ead3) 100%) !important;
}
html.fx-on[data-season="summer"] body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 120% 60% at 50% 105%, var(--fx-warm, rgba(255, 196, 120, 0.35)), transparent 70%);
  animation: fx-breathe 38s ease-in-out infinite alternate;
}
@keyframes fx-breathe { from { opacity: 0.35; } to { opacity: 1; } }

/* ---------- ocean waves along footers and section edges ---------- */
.fx-waves { position: absolute; left: 0; right: 0; height: 34px; top: -34px; pointer-events: none; z-index: 0; overflow: hidden; }
.fx-waves i { position: absolute; inset: 0; background-repeat: repeat-x; background-size: 600px 100%; background-position: 0 100%; }
.fx-waves i.back  { animation: fx-wave 19s linear infinite; }
.fx-waves i.front { animation: fx-wave 12s linear infinite reverse; }
@keyframes fx-wave { from { background-position-x: 0; } to { background-position-x: 600px; } }

/* ---------- sun shimmer sweeping across buttons ---------- */
[data-season="summer"] .fx-cta::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 250, 225, 0.7) 50%, transparent 68%);
  transform: translateX(-120%); animation: fx-shimmer 7.5s ease-in-out infinite;
  animation-delay: var(--fx-delay, 0s);
}
@keyframes fx-shimmer {
  0%, 62% { transform: translateX(-120%); }
  80%     { transform: translateX(120%); }
  100%    { transform: translateX(120%); }
}

/* ---------- respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-butterfly { display: none; }
  .fx-icicles .fx-glint, .fx-bulb, .fx-waves i, .fx-cta, .fx-cta::after,
  html.fx-on[data-season="summer"] body::after { animation: none !important; }
  .fx-vine .stem, .fx-vine .bud { transition: none !important; }
}
