.scroll-progress {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-progress {
    display: block;
    position: fixed;
    z-index: 10;
    inset: env(safe-area-inset-top, 0px) 0 auto;
    height: 3px;
    pointer-events: none;
  }

  .scroll-progress-bar {
    height: 100%;
    background: var(--orange);
    transform: scaleX(0);
    transform-origin: left;
  }

  .hero-parallax { --parallax-travel: 16%; }
  .company-photo-motion { --photo-travel: 6%; --photo-scale: 1.16; }

  [data-reveal-state="waiting"]:not(:focus-within) {
    opacity: 0;
  }

  [data-scroll-reveal="photo"][data-reveal-state="entering"]::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(0deg, transparent 28%, color-mix(in srgb, var(--orange) 54%, transparent) 70%, transparent 98%);
    animation: photo-light-sweep 740ms var(--out) var(--reveal-delay, 0ms) backwards;
  }

  @keyframes photo-light-sweep {
    0% { opacity: 0; transform: translateY(78%); }
    30% { opacity: .53; }
    100% { opacity: 0; transform: translateY(-103%); }
  }
}

@media (min-width: 651px) and (prefers-reduced-motion: no-preference) {
  .line-card:nth-child(2), .company-metrics > :nth-child(2), .resource-grid > :nth-child(2) { --reveal-delay: 70ms; }
  .line-card:nth-child(3), .resource-grid > :nth-child(3) { --reveal-delay: 124ms; }
  .resource-grid > :nth-child(4) { --reveal-delay: 162ms; }
}

@media (max-width: 650px) and (prefers-reduced-motion: no-preference) {
  .hero-parallax { --parallax-travel: 11%; }
  .company-photo-motion { --photo-travel: 4%; --photo-scale: 1.12; }
}

@supports (animation-timeline: view()) and (animation-range: entry 0% entry 100%) {
  @media (prefers-reduced-motion: no-preference) {
    .hero { view-timeline-name: --hero-view; }
    .company-photo--main { view-timeline-name: --company-photo-view; }

    .scroll-progress-bar {
      animation: reading-progress linear both;
      animation-timeline: scroll(root block);
    }

    .hero-parallax {
      animation: hero-drift linear both;
      animation-timeline: --hero-view;
      animation-range: exit 0% exit 100%;
    }

    .hero-frame {
      animation: hero-frame-expand linear both;
      animation-timeline: --hero-view;
      animation-range: exit 0% exit 46%;
    }

    .hero-light {
      animation: hero-light-cross linear both;
      animation-timeline: --hero-view;
      animation-range: exit 1% exit 49%;
    }

    .hero-scroll-shade {
      animation: hero-shade-in linear both;
      animation-timeline: --hero-view;
      animation-range: exit 0% exit 46%;
    }

    .company-photo-motion {
      animation: project-photo-drift linear both;
      animation-timeline: --company-photo-view;
      animation-range: cover 0% cover 100%;
    }

    @keyframes reading-progress { to { transform: scaleX(1); } }
    @keyframes hero-drift { to { transform: translateY(var(--parallax-travel)); } }
    @keyframes hero-frame-expand {
      from { transform: translateX(0) scale(1); }
      to {
        transform: translateX(var(--hero-frame-shift)) scale(var(--hero-frame-scale));
        border-radius: 0;
        outline-color: transparent;
      }
    }
    @keyframes hero-light-cross {
      0% { transform: translateX(-75%); opacity: 0; }
      21%, 64% { opacity: .64; }
      100% { transform: translateX(88%); opacity: 0; }
    }
    @keyframes hero-shade-in { to { opacity: 1; } }
    @keyframes project-photo-drift {
      from { transform: translateY(calc(0% - var(--photo-travel))) scale(var(--photo-scale)); }
      to { transform: translateY(var(--photo-travel)) scale(var(--photo-scale)); }
    }
  }
}
