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

/* Initial hidden state for every fade-in element.
   Mostly a fade, with a very small 8px rise. */
.fade-section .fade-in {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 1s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 1s cubic-bezier(0.25, 0.1, 0.25, 1);
  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; }
}

/* The content wrapper right after the hero fades in with the photo,
   so its edge doesn't sit hard against the hero while the rest of the
   page arrives. Opacity only, same reasons as above. */
.v2-hero-parallax + .v2-content-wrapper {
  animation: v2-hero-img-in 1.2s cubic-bezier(0.22, 0.72, 0.23, 1) 0.15s both;
}

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

/* ==================================================
   Word Fade (pairs with animation.js)
   Hero titles (.heading-1-v2) and the quote card fade in
   word by word. Opacity only: nothing slides up.
   Tune the feel with the three variables below.
   ================================================== */

:root {
  --word-fade-duration: 700ms;
  --word-fade-stagger: 45ms;
  --word-fade-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Once the words are split, the heading (or quote text) itself
   stays put and visible; the words carry the fade instead.
   Overrides the .fade-in slide-up. */
.fade-section .fade-in.word-fade-host,
.heading-1-v2.word-fade-host,
.fade-section .fade-in.word-fade-target,
.word-fade-target {
  opacity: 1;
  transform: none;
  transition: none;
}

.word-fade-host .word-fade-item {
  opacity: 0;
  transition: opacity var(--word-fade-duration) var(--word-fade-ease);
  transition-delay: calc(
    var(--fade-delay, 0ms) + var(--word-index, 0) * var(--word-fade-stagger)
  );
}

.word-fade-host.word-fade-play .word-fade-item {
  opacity: 1;
}

/* ==================================================
   Quote Card
   Classes: .quote-card (the dark card)
            .quote-card-text (the quote)
            .quote-card-cite (name and title)
   Also works with the Webflow build: .quote-text and
   .quote-attribution inside a card. The card is the .quote-text's
   parent, found here with :has() so it starts hidden before JS runs.
   The card fades in, then the quote words, then the attribution.
   Layout and colors are set in Webflow; this file only animates.
   ================================================== */

.quote-card,
:has(> .quote-text) {
  --fade-delay: 600ms; /* words start after the card is mostly in */
  opacity: 0;
  transition: opacity var(--word-fade-duration) var(--word-fade-ease) 150ms;
}

.quote-card.quote-card-active,
:has(> .quote-text).quote-card-active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .word-fade-host .word-fade-item,
  .quote-card,
  :has(> .quote-text) {
    opacity: 1;
    transition: none;
  }
}

/* ==================================================
   Quote Halo
   Same comet ring and halo as the black button on light
   (.btn-dark.is-light in core/buttons.css): same layers,
   gradients, halo size and blur, at the is-light strengths
   (ring .85, halo .15). Always on, one slow lap.
   Fades in after the quote words (quote-card-active is
   added by animation.js).
   ================================================== */

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

:is(.quote-card, :has(> .quote-text)) {
  --quote-halo-speed: 10s;       /* one lap */
  --quote-radius: 24px;          /* card corner, rounds the halo */
  --quote-fill: #141313;         /* card fill (Background Dark) */
  --head-width: 3px;             /* same as the buttons */
  --tail-width: 1px;
  --ring-rest: .85;              /* btn-dark */
  --halo-rest: .15;              /* btn-dark.is-light */
  position: relative;
  isolation: isolate;
}

/* Comet ring: head (full thickness), cover (repeats the fill so the
   tail only shows in the thin outer line), tail (thin outer line) */
:is(.quote-card, :has(> .quote-text))::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: var(--tail-width) solid transparent;
  padding: calc(var(--head-width) - var(--tail-width));
  border-radius: inherit;
  background:
    conic-gradient(
      from var(--quote-halo-angle),
      rgba(197, 97, 41, 0) 0%,
      rgba(197, 97, 41, 0) 80%,
      #C56129 90%,
      #F5AD59 97%,
      rgba(245, 173, 89, 0) 98.5%
    ) border-box,
    linear-gradient(var(--quote-fill), var(--quote-fill)) padding-box,
    conic-gradient(
      from var(--quote-halo-angle),
      rgba(197, 97, 41, 0) 0%,
      rgba(197, 97, 41, 0) 27%,
      rgba(197, 97, 41, 0.35) 32%,
      #C56129 48%,
      #DD9058 75%,
      #F5AD59 97%,
      rgba(245, 173, 89, 0) 98.5%
    ) border-box;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease 1.4s;
  animation: quote-halo-spin var(--quote-halo-speed) linear infinite;
}

/* Halo that rides with the head, drawn outside the card only */
:is(.quote-card, :has(> .quote-text))::after {
  content: "";
  position: absolute;
  inset: -20px;
  z-index: 1;
  padding: 20px;
  border-radius: calc(var(--quote-radius) + 20px);
  background: conic-gradient(
    from var(--quote-halo-angle),
    rgba(197, 97, 41, 0) 0%,
    rgba(197, 97, 41, 0) 70%,
    rgba(197, 97, 41, 0.5) 88%,
    #F5AD59 97%,
    rgba(245, 173, 89, 0) 99%
  ) content-box;
  filter: blur(8px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease 1.4s;
  animation: quote-halo-spin var(--quote-halo-speed) linear infinite;
}

:is(.quote-card, :has(> .quote-text)).quote-card-active::before { opacity: var(--ring-rest); }
:is(.quote-card, :has(> .quote-text)).quote-card-active::after { opacity: var(--halo-rest); }

@keyframes quote-halo-spin {
  to { --quote-halo-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.quote-card, :has(> .quote-text))::before,
  :is(.quote-card, :has(> .quote-text))::after {
    animation: none;
  }
}
