/* ==================================================
   Fade In
   ================================================== */

/* Initial hidden state for every fade-in element. */
.fade-section .fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  will-change: opacity, transform;
}

/* Added by JavaScript when the section enters the viewport. */
.fade-section .fade-in.fade-in-active {
  opacity: 1;
  transform: translateY(0);
}

/* ==================================================
   Character Fade
   ================================================== */

.character-fade {
  white-space: normal;
}

.character-fade-word {
  display: inline-flex;
  margin-right: 0.25em;
  white-space: nowrap;
}

.character-fade-word:last-child {
  margin-right: 0;
}

.character-fade-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.25em);
  transition:
    opacity 320ms ease-out,
    transform 320ms ease-out;
  transition-delay: calc(var(--character-index) * 20ms);
}

.character-fade-active .character-fade-char {
  opacity: 1;
  transform: translateY(0);
}

/* Gold-gradient character variant. */
.text-gradient-gold.character-fade {
  background: none;
  color: inherit;
  -webkit-text-fill-color: initial;
}

.text-gradient-gold.character-fade .character-fade-char {
  background: linear-gradient(135deg, #c56129 0%, #f5ad59 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==================================================
   Vertical Line Reveal
   ================================================== */

.v-line {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.9s cubic-bezier(0.37, 0, 0.63, 1);
}

.v-line.is-visible {
  transform: scaleY(1);
}

/* ==================================================
   Focus In
   ================================================== */

.focus-in {
  opacity: 0;
  filter: blur(8px);
  transform: scale(0.985);
  transition:
    opacity 280ms ease-out,
    filter 280ms ease-out,
    transform 280ms ease-out;
  will-change: opacity, filter, transform;
}

.focus-in.focus-in-active {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

/* ==================================================
   Mask Reveal Up
   ================================================== */

.reveal-up {
  clip-path: inset(calc(100% + 60px) -60px -60px -60px);
  transition: clip-path 600ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: clip-path;
}

.reveal-up.reveal-up-active {
  clip-path: inset(-60px);
}

/* ==================================================
   Sticky Sections
   ================================================== */

.js-sticky-section {
  position: relative;
}

.js-sticky-left {
  align-self: flex-start;
}

@media (max-width: 991px) {
  .js-sticky-left {
    transform: none !important;
    will-change: auto !important;
  }
}

/* ==================================================
   Reduced Motion
   ================================================== */

@media (prefers-reduced-motion: reduce) {
  .fade-section .fade-in,
  .focus-in,
  .character-fade-char {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }

  .reveal-up {
    clip-path: none;
    transition: none;
  }

  .v-line {
    transform: scaleY(1);
    transition: none;
  }
}

/* ==================================================
   JavaScript Hero Parallax
   Set the hero height/min-height in Webflow or let content size it.
   Use these classes separately from the CSS parallax classes above.
   ================================================== */

.hero-parallax {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero-parallax > .hero-parallax-img {
  position: absolute;
  top: -30%;
  left: 0;
  width: 100%;
  height: 160%;
  max-width: none;
  display: block;
  object-fit: cover;
  object-position: center;
  z-index: -2;
  filter: sepia(0.35);
}

/* Above the image and below hero content; never intercepts clicks. */
.hero-parallax::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #000;
  opacity: var(--hero-overlay-opacity, 0);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero-parallax::before {
    opacity: 0;
  }

  .hero-parallax > .hero-parallax-img {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ==================================================
   Hero AI Glare
   Turned on per hero by an empty .hero-ai-glare inside the hero
   background layer (Hero Parallax prop "Toggle: AI Glare").
   That element draws the light sweep over the photo, and its presence
   turns on the status-card glow, the status text shimmer and the
   glint on the highlighted headline word.
   ================================================== */

@property --ai-glare-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* Light sweep across the photo, played once. Sits above the image, below the status card. */
.hero-ai-glare {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  background: linear-gradient(
    112deg,
    transparent 32%,
    rgba(221, 144, 88, 0.16) 43%,
    rgba(255, 214, 170, 0.34) 48.5%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 214, 170, 0.34) 51.5%,
    rgba(221, 144, 88, 0.16) 57%,
    transparent 68%
  );
  background-size: 300% 100%;
  background-position: 120% 0;
  animation: ai-glare-sweep 7s cubic-bezier(0.5, 0, 0.25, 1) 1.5s 1 both;
}

/* Glint through the highlighted last word of the headline, played once with the sweep. */
.v2-hero-parallax:has(.hero-ai-glare) .highlight-last-word {
  background-image:
    linear-gradient(100deg, transparent 40%, rgba(255, 243, 228, 0.95) 50%, transparent 60%),
    linear-gradient(90deg, #c56129 0%, #f5ad59 98.47%);
  background-size: 300% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: ai-glare-glint 7s cubic-bezier(0.5, 0, 0.25, 1) 2.1s 1 both;
}

/* Status card: light running around the edge... */
.v2-hero-bg:has(> .hero-ai-glare) .hero-status-card::before,
.v2-hero-bg:has(> .hero-ai-glare) .hero-parallax-status::before {
  content: "";
  position: absolute;
  pointer-events: none;
  background: conic-gradient(
    from var(--ai-glare-angle),
    transparent 0deg,
    transparent 200deg,
    #f4c79a 250deg,
    #dd9058 290deg,
    #c56129 320deg,
    transparent 360deg
  );
}

.v2-hero-bg:has(> .hero-ai-glare) .hero-status-card::before {
  inset: -2px;
  z-index: 2;
  padding: 2px;
  border-radius: inherit;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ai-glare-spin 3.6s linear infinite;
}

/* ...and a soft halo behind it. Floats with the card (same motion as hsFloat). */
.v2-hero-bg:has(> .hero-ai-glare) .hero-parallax-status::before {
  inset: -8px;
  z-index: 0;
  border-radius: 24px;
  filter: blur(22px);
  opacity: 0;
  transition: opacity 800ms ease 600ms;
  animation:
    ai-glare-spin 3.6s linear infinite,
    ai-glare-float 6s ease-in-out 2s infinite;
}

.v2-hero-bg:has(> .hero-ai-glare) .hero-parallax-status:has(.fade-in-active)::before {
  opacity: 0.9;
}

/* Status text shimmer. A light band blended over the text, so it works
   with the per-character .character-fade spans. */
.v2-hero-bg:has(> .hero-ai-glare) .hero-status-value {
  position: relative;
}

.v2-hero-bg:has(> .hero-ai-glare) .hero-status-value::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background: linear-gradient(
    90deg,
    transparent 0%,
    transparent 38%,
    #c56129 46%,
    #f4c79a 50%,
    #c56129 54%,
    transparent 62%,
    transparent 100%
  );
  background-size: 250% 100%;
  background-position: 100% 0;
  animation: ai-glare-text 2.6s linear 2.2s infinite;
}

.v2-hero-bg:has(> .hero-ai-glare) .hero-status-row ~ .hero-status-row .hero-status-value::after {
  animation-delay: 2.55s;
}

@keyframes ai-glare-sweep {
  0% { background-position: 120% 0; }
  38%, 100% { background-position: -20% 0; }
}

@keyframes ai-glare-glint {
  0% { background-position: 100% 0, 0 0; }
  22%, 100% { background-position: 0% 0, 0 0; }
}

@keyframes ai-glare-spin {
  to { --ai-glare-angle: 360deg; }
}

@keyframes ai-glare-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes ai-glare-text {
  from { background-position: 100% 0; }
  to { background-position: -150% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ai-glare {
    display: none;
  }

  .v2-hero-parallax:has(.hero-ai-glare) .highlight-last-word,
  .v2-hero-bg:has(> .hero-ai-glare) .hero-status-card::before,
  .v2-hero-bg:has(> .hero-ai-glare) .hero-parallax-status::before,
  .v2-hero-bg:has(> .hero-ai-glare) .hero-status-value::after {
    animation: none;
  }

  .v2-hero-bg:has(> .hero-ai-glare) .hero-status-value::after {
    display: none;
  }
}

/* ==================================================
   Hero Image Fade (Hero Parallax background photo)
   Fades the v2 hero photo in on load so it arrives with the
   hero text (.fade-in) instead of popping in. Opacity only:
   the parallax moves the image with transform, so this never
   touches transform. Pure CSS, no JS dependency, so the photo
   can't get stuck hidden if a script fails.
   ================================================== */

.v2-hero-parallax .v2-hero-img {
  animation: v2-hero-img-in 1.2s cubic-bezier(0.22, 0.72, 0.23, 1) both;
}

@keyframes v2-hero-img-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .v2-hero-parallax .v2-hero-img {
    animation: none;
  }
}
