/* ==========================================================================
   TreckerTreck Motion Layer — trecker-motion.css
   Scroll-reveal, ambient hero motion (amber glow column + ember particles),
   marquee, hover-lift, glass chips, floating bob. Scoped under `.tt-public`;
   reuses trecker-public-v7.css's tokens only (no new colors beyond alpha
   variants of the existing accents). Pairs with js/trecker-motion.js.

   SAFETY: every "hidden, pre-animation" state below is gated behind
   `html.tt-motion-ready`, a class ONLY added by trecker-motion.js once it has
   actually decided to run (reduced-motion users and no-JS/slow-JS visitors
   never get it). Without that class .tt-reveal elements get none of these
   rules and render at their normal, fully-visible layout — content is never
   permanently invisible if JS is disabled, fails, or hasn't run yet.
   ========================================================================== */

/* 1. SCROLL REVEAL ----------------------------------------------------------
   Transform+opacity only; transition delay honours an inline --tt-delay
   custom property (set per-element by markup/JS for staggering), default 0ms.
   -------------------------------------------------------------------------- */
html.tt-motion-ready .tt-public .tt-reveal {
  opacity: 0;
  transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--tt-delay, 0ms);
}
html.tt-motion-ready .tt-public .tt-reveal--up    { transform: translateY(28px); }
html.tt-motion-ready .tt-public .tt-reveal--fade  { transform: none; }
html.tt-motion-ready .tt-public .tt-reveal--scale { transform: scale(.94); }
html.tt-motion-ready .tt-public .tt-reveal--left  { transform: translateX(-28px); }
html.tt-motion-ready .tt-public .tt-reveal--right { transform: translateX(28px); }

html.tt-motion-ready .tt-public .tt-reveal.is-in {
  opacity: 1;
  transform: none;
}
.tt-public .tt-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* 2. HERO — cinematic modifier, amber glow column, ember particle canvas --- */
.tt-public .tt-hero--cinematic {
  min-height: clamp(560px, 86vh, 820px);
}
.tt-public .tt-hero--cinematic .tt-hero__scrim {
  background: linear-gradient(180deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.32) 38%, rgba(0,0,0,.62) 68%, rgba(0,0,0,.92) 100%);
}
/* Stacking: photo (0) < glow + embers (1) < content (2) */
.tt-public .tt-hero--cinematic .tt-hero__img { z-index: 0; }
.tt-public .tt-hero--cinematic .tt-hero__scrim { z-index: 0; }
.tt-public .tt-hero--cinematic .tt-hero__content { position: relative; z-index: 2; }

.tt-public .tt-hero__glow {
  position: absolute;
  left: 50%;
  top: -10%;
  width: min(70vw, 820px);
  height: 130%;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse 50% 55% at 50% 28%, var(--tt-accent-2-tint) 0%, transparent 65%),
    radial-gradient(ellipse 40% 70% at 50% 55%, var(--tt-accent-tint) 0%, transparent 70%);
  filter: blur(70px);
  pointer-events: none;
  will-change: opacity, transform;
  animation: tt-glow-breathe 8s ease-in-out infinite alternate;
  z-index: 1;
}
@keyframes tt-glow-breathe {
  from { opacity: .7;  transform: translateX(-50%) scale(.96); }
  to   { opacity: 1;   transform: translateX(-50%) scale(1.05); }
}

.tt-public .tt-hero__embers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: opacity;
  z-index: 1;
}

/* 3. MARQUEE -----------------------------------------------------------------
   .tt-marquee__track's content is expected to be duplicated once by markup
   (two copies back to back) so translateX(-50%) loops seamlessly.
   -------------------------------------------------------------------------- */
.tt-public .tt-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.tt-public .tt-marquee__track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: var(--tt-gap-lg);
  animation: tt-marquee-scroll 32s linear infinite;
}
.tt-public .tt-marquee:hover .tt-marquee__track {
  animation-play-state: paused;
}
@keyframes tt-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* 4. LIFT (card hover affordance) -------------------------------------------- */
.tt-public .tt-lift {
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), box-shadow .2s cubic-bezier(.16, 1, .3, 1);
}
.tt-public .tt-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px -14px var(--tt-accent-tint), 0 4px 10px -4px var(--tt-accent-tint);
}

/* 5. GLASS (frosted floating chips) ------------------------------------------ */
.tt-public .tt-glass {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

/* 6. FLOAT (subtle infinite bob for glass chips) ----------------------------- */
.tt-public .tt-float {
  animation: tt-float-bob 6s ease-in-out infinite alternate;
  animation-delay: var(--tt-delay, 0ms);
}
@keyframes tt-float-bob {
  from { transform: translateY(0); }
  to   { transform: translateY(-6px); }
}

/* 7. REDUCED MOTION — non-negotiable: disables every continuous/infinite
   animation AND the reveal transition, forcing the fully-visible end state.
   trecker-motion.js already never adds html.tt-motion-ready when
   prefers-reduced-motion matches, so .tt-reveal's hidden state never applies
   in practice — this block is a second, CSS-only line of defense. ----------- */
@media (prefers-reduced-motion: reduce) {
  .tt-public .tt-reveal,
  .tt-public .tt-reveal--up,
  .tt-public .tt-reveal--fade,
  .tt-public .tt-reveal--scale,
  .tt-public .tt-reveal--left,
  .tt-public .tt-reveal--right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .tt-public .tt-hero__glow,
  .tt-public .tt-marquee__track,
  .tt-public .tt-float {
    animation: none !important;
  }
}
