/* ============================================================
   SAUI — why.css  (Why page)
   ============================================================ */

@layer component {

  /* Hovering a cost or security list item highlights the strong label */
  #compounding-cost li strong,
  #security-record li strong {
    transition: color var(--t-fast);
  }

  #compounding-cost li:hover strong,
  #security-record li:hover strong {
    color: var(--c-accent);
  }

  /* CTA link: arrow slides right on hover */
  .why-page section:last-child a::after {
    content: '\00a0\2192';
    display: inline-block;
    transition: transform var(--t-fast);
  }

  .why-page section:last-child a:hover::after {
    transform: translateX(4px);
  }

  @supports (animation-timeline: scroll()) {

    @keyframes why-heading-reveal {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    @keyframes cost-item-enter {
      from { opacity: 0; transform: translateX(-20px); }
      to   { opacity: 1; transform: translateX(0); }
    }

    .why-page section h2 {
      animation: why-heading-reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }

    #compounding-cost ul {
      view-timeline-name: --cost-list;
      view-timeline-axis: block;
    }

    #compounding-cost li {
      animation: cost-item-enter linear both;
      animation-timeline: --cost-list;
    }

    #compounding-cost li:nth-child(1) { animation-range: entry 0%  entry 30%; }
    #compounding-cost li:nth-child(2) { animation-range: entry 15% entry 45%; }
    #compounding-cost li:nth-child(3) { animation-range: entry 30% entry 60%; }
    #compounding-cost li:nth-child(4) { animation-range: entry 45% entry 75%; }
    #compounding-cost li:nth-child(5) { animation-range: entry 60% entry 90%; }

    #security-record ul {
      view-timeline-name: --security-list;
      view-timeline-axis: block;
    }

    #security-record li {
      animation: cost-item-enter linear both;
      animation-timeline: --security-list;
    }

    #security-record li:nth-child(1) { animation-range: entry 0%  entry 30%; }
    #security-record li:nth-child(2) { animation-range: entry 15% entry 45%; }
    #security-record li:nth-child(3) { animation-range: entry 30% entry 60%; }
    #security-record li:nth-child(4) { animation-range: entry 45% entry 75%; }

    @media (prefers-reduced-motion: reduce) {
      .why-page section h2 { animation: none; opacity: 1; transform: none; }
      #compounding-cost li { animation: none; opacity: 1; transform: none; }
      #security-record li { animation: none; opacity: 1; transform: none; }
    }
  }
}
