/* Native timelines enhance the normal document. Unsupported browsers keep the entrance animations. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) and (timeline-scope: --hero-handoff) {
    #main-content { timeline-scope: --hero-handoff; }
    .who-we-help { view-timeline-name: --hero-handoff; view-timeline-axis: block; }
    .hero { overflow: clip; }
    .has-hero-overlap .hero {
      animation: hero-frame linear both;
      animation-timeline: --hero-handoff;
      animation-range: entry 0% entry 100%;
    }
    .hero__background {
      animation: hero-recede linear both;
      animation-timeline: --hero-handoff;
      animation-range: entry 0% entry 100%;
    }
    @keyframes hero-frame {
      from { clip-path: inset(0 round 0); }
      to { clip-path: inset(20px 28px round 24px); }
    }
    @keyframes hero-recede { from { scale: 1; } to { scale: 1.045; } }

    /* The spine joins the modules; row-focus.js colors the current reading row. */
    .solutions__index { position: relative; view-timeline-name: --module-spine; view-timeline-axis: block; }
    .solutions__index::before, .solutions__index::after { content: ''; position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: 1px; pointer-events: none; background: var(--border-on-light); }
    .solutions__index::after { background: var(--color-primary); transform-origin: top; animation: module-spine linear both; animation-timeline: --module-spine; animation-range: entry 30% exit 0%; }
    .service-row.motion-entered, .service-row.motion-entered h3 svg, .service-row.motion-entered .service-row__response { animation: none; }
    .service-row.motion-entered::after { animation: none; }
    .service-row::after { left: -3px; top: calc(50% - 3px); width: 7px; height: 7px; border-radius: 50%; }
    @keyframes module-spine { from { transform: scaleY(0); } to { transform: scaleY(1); } }

    /* Keep the approved fan geometry; independent translate/rotate assemble it. */
    .operating-flow { overflow: clip; view-timeline-name: --packet-entry; view-timeline-axis: block; }
    .flow-paper {
      animation: paper-assemble linear both;
      animation-timeline: --packet-entry;
      animation-range: entry 15% entry 95%;
    }
    .flow-paper--rc { --paper-x: -36px; --paper-y: -65px; --paper-turn: -9deg; }
    .flow-paper--bol { --paper-x: 0px; --paper-y: -85px; --paper-turn: 3deg; }
    .flow-paper--pod { --paper-x: 36px; --paper-y: -55px; --paper-turn: 9deg; }
    .flow-folder-front, .flow-folder-back { animation: folder-assemble linear both; animation-timeline: --packet-entry; animation-range: entry 15% entry 95%; }
    .operating-flow[data-flow-interacted] .flow-paper, .operating-flow[data-flow-interacted] .flow-folder-front, .operating-flow[data-flow-interacted] .flow-folder-back { animation: none; }
    @keyframes paper-assemble {
      from { translate: var(--paper-x) var(--paper-y); rotate: var(--paper-turn); }
      to { translate: 0 0; rotate: 0deg; }
    }
    @keyframes folder-assemble { from { translate: 0 32px; } to { translate: 0 0; } }

    .why-us { background: var(--color-light); isolation: isolate; overflow: clip; view-timeline-name: --care-entry; view-timeline-axis: block; }
    .why-us::before { content: ''; position: absolute; z-index: -1; inset: 0; background: var(--color-background); animation: audit-expand linear both; animation-timeline: --care-entry; animation-range: entry 0% cover 55%; }
    .why-us__inner { animation: audit-unfold linear both; animation-timeline: --care-entry; animation-range: entry 0% cover 55%; transform-origin: center top; }
    .why-us__intro.motion-entered h2, .why-us__commitment.motion-entered, .why-us__photo-frame, .why-us__photo.motion-entered .why-us__photo-frame, .why-us__photo img, .why-us__photo.motion-entered img { animation: none; }
    .why-us__intro.motion-entered .motion-line > span { animation: audit-line linear both; animation-timeline: --care-entry; animation-range: entry 5% cover 35%; }
    .why-us__intro.motion-entered .motion-line:nth-child(2) > span { animation-range: entry 12% cover 42%; }
    .why-us__intro.motion-entered .motion-line:nth-child(3) > span { animation-range: entry 20% cover 50%; }
    .why-us__commitment.motion-entered::after { width: 100%; animation: audit-connect linear both; animation-timeline: view(); animation-range: entry 20% cover 60%; }
    .why-us:focus-within .why-us__inner, .why-us:focus-within .motion-line > span { animation: none; }

    /* A pronounced inset-to-full-width transition stays active through the section entrance. */
    .audit { background: var(--color-light); isolation: isolate; view-timeline-name: --audit-entry; view-timeline-axis: block; }
    .audit::before { content: ''; position: absolute; z-index: -1; inset: 0; background: var(--color-primary); animation: audit-expand linear both; animation-timeline: --audit-entry; animation-range: entry 0% cover 55%; }
    .audit__inner { animation: audit-unfold linear both; animation-timeline: --audit-entry; animation-range: entry 0% cover 55%; transform-origin: center top; }
    .audit__intro.motion-entered .motion-line > span { animation: audit-line linear both; animation-timeline: --audit-entry; animation-range: entry 5% cover 35%; }
    .audit__intro.motion-entered .motion-line:nth-child(2) > span { animation-delay: 0s; animation-range: entry 12% cover 42%; }
    .audit__intro.motion-entered .motion-line:nth-child(3) > span { animation-delay: 0s; animation-range: entry 20% cover 50%; }
    .audit__invitation.motion-entered { animation: none; }
    .audit__bridge span { animation: audit-connect linear both; animation-timeline: --audit-entry; animation-range: entry 20% cover 60%; }
    .audit__bridge svg { animation: audit-arrow linear both; animation-timeline: --audit-entry; animation-range: entry 25% cover 60%; }
    .audit:focus-within .audit__inner, .audit:focus-within .motion-line > span { animation: none; }
    @keyframes audit-expand { from { clip-path: inset(48px 10% round 48px); } to { clip-path: inset(0 round 0); } }
    @keyframes audit-unfold { from { transform: translateY(48px) scale(.82); } to { transform: none; } }
    @keyframes audit-line { from { transform: translateY(110%) rotate(2deg); opacity: .45; } to { transform: none; opacity: 1; } }
    @keyframes audit-connect { from { transform: scaleX(.03); } to { transform: scaleX(1); } }
    @keyframes audit-arrow { from { transform: translateX(-24px); opacity: .35; } to { transform: none; opacity: 1; } }

    @media (max-width: 760px) {
      @keyframes hero-frame { from { clip-path: inset(0 round 0); } to { clip-path: inset(10px 10px round 16px); } }
      .service-row { padding-left: 16px; }
      .flow-paper--rc { --paper-x: -12px; --paper-y: -28px; --paper-turn: -5deg; }
      .flow-paper--bol { --paper-y: -40px; --paper-turn: 2deg; }
      .flow-paper--pod { --paper-x: 12px; --paper-y: -24px; --paper-turn: 5deg; }
      @keyframes folder-assemble { from { translate: 0 14px; } to { translate: 0 0; } }
      @keyframes audit-expand { from { clip-path: inset(24px 6% round 30px); } to { clip-path: inset(0 round 0); } }
      @keyframes audit-unfold { from { transform: translateY(28px) scale(.9); } to { transform: none; } }
    }
  }
}
