/**!
 * @file    blog/css/hero-fx.css
 * @desc    Styles for the blog home hero effects (js/heroFx.js). Everything is scoped under
 *          .sw-hero.hfx--<name>, which the script adds only when an effect actually plays, so the
 *          plain hero (phones, reduced motion, "off") is untouched. Shared states: .hfx-has-tag
 *          (tagline starts hidden), .hfx-tag-in / .hfx-tag-out, .hfx-collapsing.
 * @version v7 2026-10-22 - Initial version. Batch 1: sizzle (moved here from blog.css), typewriter, neon,
 *          decoder, stamp.
 * @version v7 2026-10-22 - Batch 2: sunrise, starry, sakura, flight, ocean, snow, fireworks + the shared .hfx-scene window.
 * @version v7 2026-10-22 - Title in the site green (var(--sw-green)) wherever it rested in near-black ink
 *          (sizzle wave, decoder lock, sunrise, sakura); the neon panel and the decoder tiles use the site
 *          green instead of near-black.
 * @author  Charlie Samra <charles@samraworld.net>
 * @see     js/heroFx.js
 */

/* ---------- shared ---------- */
.sw-hero.hfx h1, .sw-hero.hfx p { position: relative; z-index: 1; }
.sw-hero.hfx-has-tag p { opacity: 0; transform: translateY(8px); transition: none; }   /* hidden at once, no fade-out first */
.sw-hero.hfx-tag-in p { opacity: 1; transform: none; transition: opacity .7s ease-out, transform .7s ease-out; }
.sw-hero.hfx-tag-out p { opacity: 0; transform: translateY(-6px); transition: opacity .8s ease-in, transform .8s ease-in; }
.sw-hero.hfx-collapsing { overflow: hidden; transition: height .5s ease, padding .5s ease, opacity .3s ease; }
.hfx-ch { display: inline-block; white-space: pre; }

/* ---------- 1. sizzle ---------- */
.hfx--sizzle.hfx-sz-drop .hfx-ch { opacity: 0; animation: hfxDropIn .6s cubic-bezier(.2,.9,.3,1.25) forwards; animation-delay: calc(var(--i) * 55ms); }
.hfx--sizzle.hfx-sz-in .hfx-ch { opacity: 1; }
.hfx--sizzle.hfx-sz-wave .hfx-ch { animation: hfxWave .9s ease-in-out both; animation-delay: calc(var(--i) * 70ms); }
.hfx-spark { position: absolute; z-index: 2; width: 22px; height: 22px; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fffbe0 0 22%, #f4c430 40%, #e0a800 58%, transparent 72%);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 4px rgba(244,196,48,.8));
  animation: hfxTwinkle 1.4s ease-in-out infinite; }
.hfx--sizzle.hfx-sz-sizzle .hfx-ch { animation: hfxSizzle .09s steps(2) infinite alternate; text-shadow: 0 0 10px rgba(244,196,48,.9), 0 0 2px #f4c430; }
.hfx--sizzle.hfx-sz-fizzle .hfx-ch { animation: hfxFizzle .55s ease-in forwards; animation-delay: calc(var(--i) * 40ms); text-shadow: 0 0 12px rgba(244,196,48,.9); }
.hfx--sizzle.hfx-sz-fizzle .hfx-spark { display: none; }
@keyframes hfxDropIn { 0% { opacity: 0; transform: translateY(-22px) scale(.9); filter: blur(6px); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes hfxWave { 0%, 100% { color: var(--sw-green); text-shadow: none; transform: none; } 35% { color: #2fbf5f; } 55% { color: #e0a800; text-shadow: 0 0 14px rgba(244,196,48,.85); transform: translateY(-5px); } 75% { color: #2fbf5f; } }
@keyframes hfxTwinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes hfxSizzle { from { transform: translate(-1px, .5px) rotate(-1.5deg); opacity: 1; } to { transform: translate(1px, -1px) rotate(1.5deg); opacity: .75; } }
@keyframes hfxFizzle { 0% { opacity: 1; transform: none; filter: none; } 100% { opacity: 0; transform: translateY(-26px) scale(.6) rotate(12deg); filter: blur(5px); } }

/* ---------- 2. typewriter ---------- */
.hfx--typewriter h1 { font-family: "Courier Prime", "Courier New", ui-monospace, monospace; letter-spacing: .02em; }
.hfx-caret { display: inline-block; width: .08em; height: .95em; margin-left: .06em; vertical-align: -0.08em;
  background: #18a34a; animation: hfxBlink 1s steps(1) infinite; }
.hfx-caret--off { opacity: 0; transition: opacity .4s; animation: none; }
@keyframes hfxBlink { 50% { opacity: 0; } }

/* ---------- 3. neon ---------- */
.hfx--neon::before { content: ""; position: absolute; z-index: 0; top: -14px; bottom: 12px;
  left: max(0px, calc(50% - 330px)); right: max(0px, calc(50% - 330px));
  border-radius: 22px; background: radial-gradient(ellipse at 50% 40%, #138a40 0%, #0b5528 58%, #084a22 100%);   /* site green (masthead) */
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 10px 30px rgba(7,20,13,.25);
  opacity: 0; animation: hfxFadeIn .45s ease-out forwards; }
.hfx--neon h1 { color: rgba(255,255,255,.16); text-shadow: none; }   /* unlit tube */
.hfx--neon p { color: #6b7c72; }
.hfx--neon.hfx-neon-on h1 { animation: hfxNeonOn 1.2s linear forwards, hfxHum 3.2s 1.3s ease-in-out infinite; }
.hfx--neon.hfx-tag-in p { color: #ffd6f1; text-shadow: 0 0 4px #fff, 0 0 10px #ff5fc8, 0 0 22px #ff2fb2; animation: hfxNeonOnPink .8s linear; }
.hfx--neon.hfx-neon-off h1 { animation: hfxNeonOff 1.3s linear forwards; }
.hfx--neon.hfx-neon-off p { opacity: 0; transition: opacity .2s steps(2); }
.hfx--neon.hfx-neon-dark::before { animation: hfxFadeOut .5s ease-in forwards; }
@keyframes hfxFadeIn { to { opacity: 1; } }
@keyframes hfxFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes hfxNeonOn {
  0%, 9%, 13%, 30%, 36% { color: rgba(255,255,255,.16); text-shadow: none; }
  10%, 12%, 31%, 35%, 40%, 100% { color: #eafff2; text-shadow: 0 0 4px #fff, 0 0 12px #39ff8f, 0 0 26px #18c463, 0 0 48px #18a34a; }
}
@keyframes hfxHum { 0%, 100% { color: #eafff2; text-shadow: 0 0 4px #fff, 0 0 12px #39ff8f, 0 0 26px #18c463, 0 0 48px #18a34a; }
  48% { text-shadow: 0 0 3px #fff, 0 0 9px #39ff8f, 0 0 20px #18c463, 0 0 36px #18a34a; } 50% { color: #d9fbe7; } }
@keyframes hfxNeonOnPink { 0%, 20%, 40% { opacity: .2; } 10%, 30%, 60%, 100% { opacity: 1; } }
@keyframes hfxNeonOff {
  0%, 12%, 24%, 52% { color: #eafff2; text-shadow: 0 0 4px #fff, 0 0 12px #39ff8f, 0 0 26px #18c463, 0 0 48px #18a34a; }
  8%, 20%, 30%, 60%, 100% { color: rgba(255,255,255,.12); text-shadow: none; }
}

/* ---------- 4. decoder (departure board) ---------- */
.hfx--decoder h1 { perspective: 400px; }
.hfx--decoder .hfx-ch { text-align: center; margin: 0 1px; padding: 0 1px; border-radius: 5px;
  background: linear-gradient(#138a40 0 49%, #0b5528 51% 100%); color: #ffd23f;   /* site-green tiles */
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.06), 0 2px 4px rgba(0,0,0,.25);
  transition: background .35s ease, color .35s ease, box-shadow .35s ease; }
.hfx--decoder .hfx-ch.hfx-dec-locked { background: transparent; color: var(--sw-green); box-shadow: none; }
.hfx--decoder .hfx-ch.hfx-flip { animation: hfxFlip .09s ease-out; }
.hfx--decoder .hfx-ch.hfx-dec-gone { opacity: 0; transform: translateY(14px); transition: opacity .35s, transform .35s; }
@keyframes hfxFlip { from { transform: rotateX(70deg); } to { transform: rotateX(0); } }

/* ---------- 5. passport stamp ---------- */
.hfx--stamp h1 { opacity: 0; color: #1f4aa8; }
.hfx--stamp.hfx-stamp-down h1 { animation: hfxSlam .33s cubic-bezier(.5,0,.75,0) forwards; }
.hfx--stamp.hfx-stamp-down h1, .hfx-postmark {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.2 1.75'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.2 1.75'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
.hfx-postmark { position: absolute; z-index: 2; color: #1f4aa8; opacity: 0; pointer-events: none; transform-origin: center;
  animation: hfxPostmark .3s .12s cubic-bezier(.5,0,.75,0) forwards; }
.hfx-postmark svg { display: block; font-family: "Source Sans 3", system-ui, sans-serif; }
.sw-hero.hfx-thump { animation: hfxThump .3s ease-out; }
.hfx--stamp.hfx-stamp-fade h1, .hfx--stamp.hfx-stamp-fade .hfx-postmark {
  transition: opacity 1.4s ease-in, filter 1.4s ease-in; opacity: 0 !important; filter: blur(1.5px) sepia(.8); }
@keyframes hfxSlam { 0% { opacity: 0; transform: scale(2.3) rotate(-10deg); } 100% { opacity: .92; transform: scale(1) rotate(-3deg); } }
@keyframes hfxPostmark { 0% { opacity: 0; transform: scale(2) rotate(30deg); } 100% { opacity: .8; transform: scale(1) rotate(14deg); } }
@keyframes hfxThump { 0% { transform: none; } 30% { transform: translate(2px, 3px); } 60% { transform: translate(-2px, -1px); } 100% { transform: none; } }

/* ================= batch 2 — scenic / seasonal ================= */
/* shared: a rounded window behind the title (scene()), and a generic title fade-out */
.hfx-scene { position: absolute; z-index: 0; top: -14px; bottom: 12px; pointer-events: none;
  left: max(0px, calc(50% - 330px)); right: max(0px, calc(50% - 330px));
  border-radius: 22px; overflow: hidden; opacity: 0; animation: hfxFadeIn .5s ease-out forwards; }
.hfx-scene--clear { background: none; }
.hfx-scene.hfx-scene-out { animation: hfxFadeOut .9s ease-in forwards; }
.sw-hero.hfx-title-out h1 { opacity: 0 !important; filter: blur(2px); transition: opacity 1s ease-in, filter 1s ease-in; }
@keyframes hfxFadeUpT { from { opacity: 0; filter: blur(5px); transform: translateY(6px); } to { opacity: 1; filter: none; transform: none; } }

/* ---------- 6. sunrise ---------- */
.hfx-scene--sky { background: linear-gradient(to bottom, #bfe3ff 0%, #dff0ff 18%, #ffe3b8 34%, #ffb27a 46%, #ff8a7a 54%, #6b4f99 70%, #262a63 86%, #151838 100%);
  background-size: 100% 400%; background-position: 0 100%; transition: background-position 3.2s ease-in-out; }
.hfx-sunrise-go .hfx-scene--sky { background-position: 0 0; }
.hfx-sun { position: absolute; left: 80%; bottom: -72px; width: 62px; height: 62px; margin-left: -31px; border-radius: 50%;
  background: radial-gradient(circle, #fff7c2 0 30%, #ffd23f 58%, #ff9f1c 100%);
  box-shadow: 0 0 28px 10px rgba(255,190,60,.55); transition: transform 3.1s cubic-bezier(.3,.6,.3,1); }
.hfx-sunrise-go .hfx-sun { transform: translateY(-112px); }
.hfx-rays { position: absolute; inset: -46px; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(rgba(255,214,90,.42) 0 7deg, transparent 7deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 35%, transparent 70%); mask-image: radial-gradient(circle, #000 35%, transparent 70%);
  transition: opacity 1.4s ease 1.6s; animation: hfxSpin 16s linear infinite; }
.hfx-sunrise-go .hfx-rays { opacity: 1; }
.hfx--sunrise h1 { color: #fff3e4; text-shadow: 0 1px 10px rgba(30,20,60,.55); transition: color 3s ease-in-out .4s, text-shadow 3s ease-in-out .4s; }
.hfx-sunrise-go h1 { color: var(--sw-green); text-shadow: 0 1px 0 rgba(255,255,255,.7); }
@keyframes hfxSpin { to { transform: rotate(360deg); } }

/* ---------- 7. starry night ---------- */
.hfx-scene--night { background: radial-gradient(ellipse at 30% 0%, #1d2b5c 0%, #0e1533 55%, #070b1f 100%); }
.hfx-star { position: absolute; border-radius: 50%; background: #fff; box-shadow: 0 0 4px #fff; opacity: .2;
  animation: hfxStar ease-in-out infinite; }
.hfx-moon { position: absolute; top: 14px; left: 8%; width: 34px; height: 34px; border-radius: 50%;
  box-shadow: 9px 5px 0 0 #f6f1c7; filter: drop-shadow(0 0 6px rgba(246,241,199,.6)); transform: rotate(-20deg); }
.hfx-shoot { position: absolute; width: 110px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff); animation: hfxShoot 1.2s ease-out forwards; }
.hfx--starry h1 { color: #e8eeff; text-shadow: 0 0 6px rgba(190,210,255,.9), 0 0 22px rgba(120,150,255,.55); animation: hfxFadeUpT 1.2s ease-out .3s both; }
.hfx--starry p, .hfx--fireworks p, .hfx--snow p { color: #c9d3ef; }
@keyframes hfxStar { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes hfxShoot { 0% { opacity: 0; transform: rotate(20deg) translateX(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: rotate(20deg) translateX(280px); } }

/* ---------- 8. cherry blossoms ---------- */
.hfx-scene--wide { left: 0; right: 0; top: -30px; bottom: 0; border-radius: 0; }
.hfx-petal-wrap { position: absolute; top: 0; transition: transform 1.1s cubic-bezier(.4,0,1,1), opacity 1.1s ease-in; }
.hfx-gust .hfx-petal-wrap { transform: translate(900px, -50px); opacity: 0; }
.hfx-petal { display: block; border-radius: 150% 0 150% 0; background: linear-gradient(135deg, #ffe6ee, #ffa3c2);
  box-shadow: 0 0 2px rgba(255,150,190,.45);
  animation-name: hfxPetalFall, hfxPetalSway; animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite; animation-direction: normal, alternate; }
.hfx--sakura h1 { animation: hfxBloom 1.5s ease-out both; }
.hfx-blow .hfx-ch { animation: hfxBlow .9s ease-in forwards; animation-delay: calc(var(--i) * 45ms); }
@keyframes hfxPetalFall { from { translate: 0 -20px; } to { translate: 90px 200px; } }
@keyframes hfxPetalSway { from { rotate: -40deg; } to { rotate: 70deg; } }
@keyframes hfxBloom { 0% { opacity: 0; filter: blur(8px); color: #ff9fbf; } 60% { opacity: 1; filter: none; color: #d9578a; } 100% { opacity: 1; filter: none; color: var(--sw-green); } }
@keyframes hfxBlow { to { opacity: 0; transform: translate(170px, -34px) rotate(40deg); filter: blur(3px); } }

/* ---------- 9. flight path ---------- */
.hfx-scene--route { top: -22px; bottom: 0; left: max(0px, calc(50% - 390px)); right: max(0px, calc(50% - 390px)); overflow: visible; }
.hfx-scene--route svg { position: absolute; inset: 0; overflow: visible; }
.hfx-route { fill: none; stroke: #18a34a; stroke-width: 2.4; stroke-dasharray: 2 8; stroke-linecap: round; }
.hfx-pin { fill: #e0a800; stroke: #fff; stroke-width: 2; }
.hfx-pin--end { animation: hfxPop .35s cubic-bezier(.3,1.6,.5,1) both; transform-box: fill-box; transform-origin: center; }
.hfx-plane { fill: #0b5528; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.hfx--flight h1 { opacity: 0; transform: translateY(-10px); }
.hfx-landed h1 { opacity: 1; transform: none; transition: opacity .6s ease-out, transform .6s cubic-bezier(.3,1.5,.5,1); }
@keyframes hfxPop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------- 10. ocean wave ---------- */
.hfx-scene--sea { top: -14px; bottom: 0; }
.hfx-water { position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='18'><path d='M0 9 Q30 0 60 9 T120 9 V18 H0 Z' fill='%234fb3d9'/></svg>") repeat-x 0 0 / 120px 18px,
              linear-gradient(#4fb3d9, #1f7fa8) no-repeat 0 17px / 100% 100%;
  animation: hfxSwell 1.2s ease-out forwards, hfxDrift 3.2s linear infinite; }
.hfx-water--back { opacity: .55; bottom: 5px; filter: hue-rotate(-12deg) brightness(1.15);
  animation: hfxSwellBack 1.4s ease-out forwards, hfxDrift 5s linear infinite reverse; }
.hfx--ocean h1 { animation: hfxFadeIn .9s ease-out both; }
.hfx--ocean .hfx-ch { color: #0e6e8c; animation: hfxBob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.2s); }
.hfx-tide .hfx-scene--sea { z-index: 2; }
.hfx-tide .hfx-water { height: 150% !important; transition: height 1.5s ease-in; }
.hfx-tide .hfx-ch { animation: hfxSink 1.1s ease-in forwards; animation-delay: calc(var(--i) * 40ms); }
@keyframes hfxSwell { from { height: 0; } to { height: 24px; } }
@keyframes hfxSwellBack { from { height: 0; } to { height: 30px; } }
@keyframes hfxDrift { from { background-position: 0 0, 0 17px; } to { background-position: 120px 0, 0 17px; } }
@keyframes hfxBob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes hfxSink { to { transform: translateY(48px) rotate(10deg); opacity: 0; } }

/* ---------- 11. snowfall ---------- */
.hfx-scene--winter { background: linear-gradient(#1c3557 0%, #2c5282 60%, #4a6fa5 100%); }
.hfx-flake-wrap { position: absolute; top: 0; }
.hfx-flake { display: block; border-radius: 50%; background: #fff; box-shadow: 0 0 3px rgba(255,255,255,.85);
  animation-name: hfxFlakeFall, hfxFlakeSway; animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite; animation-direction: normal, alternate; }
.hfx-whiteout::after { content: ""; position: absolute; inset: 0; background: #f7fbff; opacity: 0; animation: hfxFadeIn 1.4s ease-in forwards; }
.hfx--snow h1 { color: #fff; text-shadow: 0 0 8px rgba(190,230,255,.95), 0 2px 0 rgba(20,40,70,.45); animation: hfxFadeUpT 1.4s ease-out .2s both; }
@keyframes hfxFlakeFall { from { translate: 0 -10px; } to { translate: 0 175px; } }
@keyframes hfxFlakeSway { from { margin-left: -7px; } to { margin-left: 7px; } }

/* ---------- 12. fireworks ---------- */
.hfx-scene--fw canvas { position: absolute; inset: 0; }
.hfx--fireworks h1 { color: #4a4566; transition: color .5s ease-out, text-shadow .5s ease-out; }
.hfx-fw-lit h1 { color: #fff3c4; text-shadow: 0 0 8px rgba(255,210,63,.9), 0 0 26px rgba(255,140,60,.55); }

/* ---------- motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  .sw-hero.hfx-has-tag p { opacity: 1; transform: none; }
}
