/* S1, S3b, S5. The removed lines are gone before the fold lifts the lines below. Linked after the page, outside the render-blocking sheet. Plain CSS. Why: components/scenes/LateMotion.tsx */

@property --fold { syntax: "<number>"; inherits: true; initial-value: 0; }

/* Final state: reduced motion, print, no scroll-driven animations. */
.hk > .hk-del {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 9ch 50%;
  background-size: calc(100% - 9ch - 16px) 1.5px;
}
.hk > .hk-del ~ span { --above: 1; }
.hk > .hk-del ~ .hk-del ~ span { --above: 2; }
.up-minus { font-family: var(--font-mono); font-size: 15px; color: #fb7185; }
.up-heading > b { position: relative; }
.ct-stub {
  --tear: 0 -24px;
  --tear-clip: inset(0 0 100% 0);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-self: stretch;
  padding: 18px 16px 20px;
  border-top: 2px dashed rgba(242, 178, 48, 0.6);
  border-radius: 0 0 16px 16px;
  background: rgba(12, 13, 15, 0.82);
}
.ct-stub > p {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink-3);
}
.ct-stub > a {
  display: flex;
  min-height: 44px;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  gap: 0 0.35em;
  padding: 6px 10px;
  border: 2px solid rgba(242, 178, 48, 0.7);
  border-radius: 8px;
  rotate: -3deg;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-amber);
  transition: background-color 0.2s;
}
.ct-stub > a:nth-child(odd) { rotate: 2deg; }
.ct-stub > a:hover { background: rgba(242, 178, 48, 0.12); }
.ct-stub > a > b { font-size: 22px; font-weight: 500; letter-spacing: 0; }

@media (min-width: 1024px) {
  .ct-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-content: end;
    column-gap: 48px;
  }
  .ct-body > * { grid-column: 1; }
  .ct-body > .ct-stub {
    --tear: -24px 0;
    --tear-clip: inset(0 0 0 100%);
    grid-column: 2;
    grid-row: 1 / span 5;
    align-self: end;
    border-top: 0;
    border-left: 2px dashed rgba(242, 178, 48, 0.6);
    border-radius: 0 16px 16px 0;
  }
}

@supports (animation-timeline: view()) {
  @media screen and (prefers-reduced-motion: no-preference) {
    .ar-list > li { view-timeline: --ar; }
    .up-diff > span:nth-child(3) > span {
      animation: up-fall linear both;
      animation-timeline: --ar;
      animation-range: cover 8% cover 20%;
    }

    .up-heading > b {
      color: transparent;
      counter-reset: up var(--c);
      animation: up-count linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 35%;
    }
    .up-heading > b::before {
      position: absolute;
      inset: 0 auto 0 0;
      content: counter(up);
      content: counter(up) / "";
      color: var(--color-amber);
    }

    .up-featured { timeline-scope: --hk; }
    .hk {
      view-timeline: --hk;
      animation: hk-fold linear both;
      animation-timeline: --hk;
      animation-range: cover 41% cover 47%;
    }
    .hk > span {
      transform: translateY(calc(var(--above, 0) * var(--fold) * -24px));
      animation: hk-line linear both;
      animation-timeline: --hk;
      animation-range: cover 4% cover 12%;
    }
    .hk > .hk-add { animation-name: hk-slide; }
    .hk > .hk-del {
      animation: hk-line linear both, hk-strike linear both, hk-gone linear forwards;
      animation-timeline: --hk, --hk, --hk;
      animation-range: cover 4% cover 12%, cover 30% cover 36%, cover 37% cover 41%;
    }
    .up-minus {
      display: inline-block;
      animation: hk-minus linear both;
      animation-timeline: --hk;
      animation-range: cover 47% cover 53%;
    }

    @supports (order: sibling-index()) {
      .up-diff > span:nth-child(3) > span {
        animation-range: cover calc(2% + sibling-index() * 3%) cover calc(11% + sibling-index() * 3%);
      }
      .hk > span {
        animation-range: cover calc(2% + sibling-index() * 1.6%) cover calc(8% + sibling-index() * 1.6%);
      }
      .hk > .hk-del {
        animation-range:
          cover calc(2% + sibling-index() * 1.6%) cover calc(8% + sibling-index() * 1.6%),
          cover 30% cover 36%,
          cover 37% cover 41%;
      }
    }

    /* Pixels: the stub is near the page's end, where a share of a tall viewport may never be reached. */
    .ct-stub {
      view-timeline: --stub;
      animation: stub-tear linear both;
      animation-timeline: --stub;
      animation-range: cover 0px cover 170px;
    }
    .ct-stub > a {
      animation: stub-stamp linear both;
      animation-timeline: --stub;
      animation-range: cover 130px cover 200px;
    }
    .ct-stub > a:nth-child(3) { animation-range: cover 165px cover 235px; }
    .ct-stub > a:nth-child(4) { animation-range: cover 200px cover 270px; }
    .ct-stub > a:nth-child(5) { animation-range: cover 235px cover 305px; }
    .ct-stub:focus-within,
    .ct-stub:focus-within > a { animation: none; }
  }
}

@keyframes up-fall { from { opacity: 0; translate: 0 -12px; } }
@keyframes up-count { from { --c: 0; } to { --c: var(--n); } }
@keyframes hk-line { from { opacity: 0; translate: 0 6px; } }
@keyframes hk-slide { from { opacity: 0; translate: -2ch 0; } }
@keyframes hk-strike { from { background-size: 0 1.5px; } }
@keyframes hk-gone { to { opacity: 0; } }
@keyframes hk-fold { from { --fold: 0; } to { --fold: 1; } }
@keyframes hk-minus { from { opacity: 0; translate: 0 6px; } }
@keyframes stub-tear { from { translate: var(--tear); clip-path: var(--tear-clip); } to { clip-path: inset(0); } }
@keyframes stub-stamp { from { opacity: 0; scale: 1.18; rotate: -6deg; } }
