/* ==========================================================================
   Noir & Ember — FX Layer v2 (atmosphere, hero cinema, counters, marquee)
   Loaded after anim.css. JS-gated, reduced-motion safe.
   ========================================================================== */

/* ---- Fixed atmosphere stack (behind everything) ---- */
.fx-atmos { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#fx-particles { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .85; }
.fx-grain {
  position: fixed; inset: -50%; z-index: 2; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 1.1s steps(4) infinite;
  will-change: transform;
}
@keyframes grainShift {
  0%{transform:translate(0,0)} 25%{transform:translate(-4%,2%)}
  50%{transform:translate(3%,-3%)} 75%{transform:translate(-2%,4%)} 100%{transform:translate(2%,-2%)}
}
/* keep real content above atmosphere */
body > header, body > main, body > footer { position: relative; z-index: 5; }

/* a soft vignette to deepen the mood */
.fx-vignette {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(140% 130% at 50% 45%, transparent 62%, rgba(0,0,0,.32) 100%);
}

/* ---- Hero scroll-zoom cinema ---- */
html.js-anim .fx-hero-bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
}
html.js-anim [data-hero-zoom] { will-change: transform, opacity; }

/* ---- Animated counters ---- */
.count[data-count] { font-variant-numeric: tabular-nums; }

/* ---- Marquee ribbon ---- */
.fx-marquee { overflow: hidden; width: 100%; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.fx-marquee-track { display: inline-flex; gap: 56px; white-space: nowrap; will-change: transform; animation: marqueeMove 26s linear infinite; }
.fx-marquee:hover .fx-marquee-track { animation-play-state: paused; }
.fx-marquee-track span { font-family: var(--serif, Georgia, serif); font-size: 22px; color: var(--text-soft, #a39a8b); letter-spacing: .06em; }
@keyframes marqueeMove { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  #fx-particles, .fx-grain, .fx-vignette { display: none !important; }
  .fx-marquee-track { animation: none !important; }
  html.js-anim [data-hero-zoom] { transform: none !important; opacity: 1 !important; }
}

/* ---- Custom gold cursor — comet trail (desktop only) ---- */
@media (pointer:fine) {
  html.js-cursor, html.js-cursor * { cursor: none !important; }
  .fx-dot {
    position: fixed; top:0; left:0; z-index:9999; pointer-events:none;
    width:12px; height:12px; border-radius:50%;
    background: var(--gold-bright, #e7be6e);
    box-shadow: 0 0 12px 3px rgba(231,190,110,.65);
    transition: width .25s ease, height .25s ease, background .25s ease;
    will-change: transform;
  }
  .fx-dot.grow { width:22px; height:22px; background:#f0d089; box-shadow:0 0 22px 6px rgba(231,190,110,.8); }
  .fx-trail {
    position: fixed; top:0; left:0; z-index:9998; pointer-events:none;
    width:10px; height:10px; border-radius:50%;
    background: radial-gradient(circle, rgba(231,190,110,.9), rgba(199,154,75,0) 70%);
    will-change: transform;
  }
}
@media (prefers-reduced-motion: reduce), (pointer:coarse) {
  .fx-dot, .fx-trail { display:none !important; }
  html.js-cursor, html.js-cursor * { cursor: auto !important; }
}

/* ---- Scroll progress line ---- */
.fx-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 10001; pointer-events: none;
  background: linear-gradient(90deg, rgba(199,154,75,.2), var(--gold, #c79a4b) 40%, #f0d089);
  transform: scaleX(0); transform-origin: left center; }
