/* Deal Flow page motion.
   - Hero + header animate on load (pure CSS).
   - Everything marked data-reveal animates once as it scrolls into view (dealflow.js adds .pf-ready, then .is-in).
   Uses animations rather than transitions so existing hover effects keep working. Disabled for reduced motion. */

@media (prefers-reduced-motion: no-preference) {
  /* ---------- on load ---------- */
  .pf-head { animation: pf-down .8s cubic-bezier(.2, .7, .2, 1) both; }
  .pf-hero > * { animation: pf-up .9s cubic-bezier(.2, .7, .2, 1) both; }
  .pf-hero > :nth-child(1) { animation-delay: .15s; }
  .pf-hero > :nth-child(2) { animation-delay: .3s; }
  .pf-hero > :nth-child(3) { animation-delay: .5s; }
  .pf-line { transform-origin: left center; animation: pf-grow 1.5s cubic-bezier(.65, 0, .35, 1) .7s both; }

  /* ---------- on scroll ---------- */
  /* plain blocks (section headings, footer) */
  .pf-ready [data-reveal="up"]:not(.is-in),
  .pf-ready [data-reveal="fade"]:not(.is-in) { opacity: 0; }
  [data-reveal="up"].is-in   { animation: pf-up .85s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) backwards; }
  [data-reveal="fade"].is-in { animation: pf-fade 1s ease var(--d, 0s) backwards; }

  /* portfolio cards: the card stays put (so the grid lines never flash), its contents stagger in */
  .pf-ready [data-reveal="card"] { position: relative; overflow: hidden; }
  .pf-ready [data-reveal="card"]:not(.is-in) > * { opacity: 0; }
  [data-reveal="card"].is-in > * { animation: pf-up .75s cubic-bezier(.2, .7, .2, 1) backwards; }
  [data-reveal="card"].is-in > :nth-child(1) { animation-delay: calc(var(--d, 0s) + 0s); }
  [data-reveal="card"].is-in > :nth-child(2) { animation-delay: calc(var(--d, 0s) + .1s); }
  [data-reveal="card"].is-in > :nth-child(3) { animation-delay: calc(var(--d, 0s) + .18s); }
  [data-reveal="card"].is-in > :nth-child(4) { animation-delay: calc(var(--d, 0s) + .26s); }
  [data-reveal="card"].is-in .company-logo { animation: pf-pop .8s cubic-bezier(.2, .9, .3, 1.3) calc(var(--d, 0s) + .05s) backwards; }
  /* a thin gold line sweeps across the top of each card, then fades */
  .pf-ready [data-reveal="card"]::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: #D4AF37;
    transform: scaleX(0); transform-origin: left; opacity: 0; pointer-events: none;
  }
  [data-reveal="card"].is-in::before { animation: pf-sweep 1.5s cubic-bezier(.65, 0, .35, 1) var(--d, 0s) both; }

  /* event figures: photo wipes open and settles from a slight zoom, caption follows */
  .pf-ready [data-reveal="figure"]:not(.is-in) > div { clip-path: inset(0 0 100% 0); }
  .pf-ready [data-reveal="figure"]:not(.is-in) > figcaption { opacity: 0; }
  [data-reveal="figure"].is-in > div { animation: pf-wipe 1.1s cubic-bezier(.65, 0, .35, 1) var(--d, 0s) backwards; }
  [data-reveal="figure"].is-in > div img { animation: pf-zoom 1.6s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) backwards; }
  [data-reveal="figure"].is-in > figcaption { animation: pf-up .8s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0s) + .55s) backwards; }

  @keyframes pf-up    { from { opacity: 0; transform: translateY(22px); } }
  @keyframes pf-down  { from { opacity: 0; transform: translateY(-14px); } }
  @keyframes pf-fade  { from { opacity: 0; } }
  @keyframes pf-grow  { from { transform: scaleX(0); } }
  @keyframes pf-pop   { from { opacity: 0; scale: .5; } }
  @keyframes pf-wipe  { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes pf-zoom  { from { scale: 1.18; } }
  @keyframes pf-sweep { 0% { transform: scaleX(0); opacity: 1; } 65% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
}

@media print {
  [data-reveal], [data-reveal] > *, .pf-hero > * { opacity: 1 !important; clip-path: none !important; animation: none !important; }
}
