/* The Partnership page's hero drawing (site/snippets/visuals/partnership-year.php,
   bulk fixes B1, 2026-11-29): the twelve months over the four lanes. Linked in
   the head by the snippet (peanut_page_css, above the fold). Every selector
   names a py- class; the fills come from the shared diagram classes in
   blocks.css. Tokens only.

   Static: the finished drawing, no sweep line. Motion (key "diagrams", like
   the other hero drawings, only with no reduced-motion preference): the
   months pop in left to right, the line sweeps the year once (900ms, then
   220ms a month), each month's marks appear as it passes (their --py-d), the
   runs grow from their left end, the line fades at month 12; done by about
   3.6s, then it rests. The keyframes name only their start state, so without
   the key the drawing is complete. */

@layer blocks {
  .py-wrap {
    width: 100%;
  }

  .diagram--pyear .py-chip,
  .diagram--pyear .py-bar,
  .diagram--pyear .py-run,
  .diagram--pyear .py-dot,
  .diagram--pyear .py-sheet,
  .diagram--pyear .py-ring {
    stroke: var(--color-ink);
    stroke-width: 1.5;
  }

  .diagram--pyear .py-bar {
    stroke-width: 1;
  }

  .diagram--pyear .py-num {
    font-size: 14px;
    font-weight: 500;
  }

  .diagram--pyear .py-lane {
    font-size: 15px;
    font-weight: 600;
  }

  .diagram--pyear .py-note {
    font-size: 14px;
    font-weight: 500;
  }

  .diagram--pyear :is(.py-track, .py-wait, .py-launch, .py-bracket, .py-rule, .py-tick, .py-sweep) {
    fill: none;
    stroke: var(--color-ink);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .diagram--pyear .py-track {
    stroke-width: 1;
    opacity: 0.18;
  }

  .diagram--pyear .py-wait {
    stroke-dasharray: 3 5;
    opacity: 0.45;
  }

  .diagram--pyear .py-launch {
    stroke-dasharray: 4 6;
    opacity: 0.5;
  }

  .diagram--pyear .py-bracket {
    opacity: 0.55;
  }

  .diagram--pyear .py-rule {
    stroke-width: 1.25;
    opacity: 0.6;
  }

  .diagram--pyear .py-tick {
    stroke-width: 1.75;
  }

  /* the sweep line shows only while it moves */
  .diagram--pyear .py-sweep {
    stroke-width: 2;
    opacity: 0;
  }
}

@layer motion {
  @media screen and (prefers-reduced-motion: no-preference) {
    html[data-fx~="diagrams"] .diagram--pyear .py-month {
      animation: py-pop 460ms var(--ease-pop) var(--py-m, 200ms) both;
      transform-box: fill-box;
      transform-origin: center;
    }

    html[data-fx~="diagrams"] .diagram--pyear :is(.py-labels, .py-launch) {
      animation: py-fade 480ms var(--ease-out) 500ms both;
    }

    html[data-fx~="diagrams"] .diagram--pyear .py-wait {
      animation: py-fade 480ms var(--ease-out) 1500ms both;
    }

    html[data-fx~="diagrams"] .diagram--pyear .py-run {
      transform-box: fill-box;
      transform-origin: 0 50%;
      animation: py-grow 660ms linear 900ms both;
    }

    html[data-fx~="diagrams"] .diagram--pyear .py-run--year {
      animation-duration: 1980ms;
      animation-delay: 1500ms;
    }

    html[data-fx~="diagrams"] .diagram--pyear .py-pop {
      transform-box: fill-box;
      transform-origin: center;
      animation: py-pop 420ms var(--ease-pop) var(--py-d, 900ms) both;
    }

    html[data-fx~="diagrams"] .diagram--pyear .py-sweep {
      animation: py-sweep 2620ms linear 900ms both;
    }

    html[data-fx~="diagrams"] .diagram--pyear .py-brackets {
      animation: py-fade 520ms var(--ease-out) 3300ms both;
    }
  }

  @keyframes py-pop {
    from {
      opacity: 0;
      transform: scale(0.4);
    }
  }

  @keyframes py-fade {
    from {
      opacity: 0;
    }
  }

  @keyframes py-grow {
    from {
      transform: scaleX(0);
    }
  }

  /* month 1's center to month 12's (11 months of 32 units), then the line fades */
  @keyframes py-sweep {
    0% {
      opacity: 0.8;
      transform: translateX(0);
    }

    92% {
      opacity: 0.8;
      transform: translateX(352px);
    }

    100% {
      opacity: 0;
      transform: translateX(352px);
    }
  }
}
