@media (prefers-reduced-motion: no-preference) {
  [data-home-scroll] .services-grid::after { content: none; }
  [data-home-scroll] .service-item {
    --line-length: calc(15% + 85% * var(--service-progress, 1));
    background-image: var(--rule-on-light), var(--rule-on-light),
                      var(--right-edge, none), var(--bottom-edge, none);
    background-position: left top, left top, right top, left bottom;
    background-size: var(--line-length) 1px, 1px var(--line-length),
                     1px var(--line-length), var(--line-length) 1px;
  }
  .service-item::before, .service-item::after { opacity: var(--service-progress, 1); }
  [data-home-scroll] .service-copy h3 a > span { display: inline-block; }
  .service-item[data-reveal-pending] .service-copy h3 a > span {
    opacity: calc(.66 + .34 * var(--service-progress, 1));
    transform: translateY(calc(8px * (1 - var(--service-progress, 1))));
  }
  .service-item:focus-within { --service-progress: 1 !important; }

  .education-tile[data-reveal-pending] {
    --photo-top: calc(5% * (1 - var(--photo-progress, 1)));
    --photo-bottom: calc(62% * (1 - var(--photo-progress, 1)));
    clip-path: inset(var(--photo-top) 0 var(--photo-bottom) 0 round 8px);
  }
  .education-tile[data-reveal-pending] img { transform: scale(calc(1 + .075 * (1 - var(--photo-progress, 1)))); }

  .home-location-frame[data-reveal-pending] {
    overflow: clip;
    clip-path: inset(calc(6% * (1 - var(--map-progress, 1))) calc(9% * (1 - var(--map-progress, 1))) round clamp(14px, 1.6vw, 28px));
  }
  .home-location-frame[data-reveal-pending][data-reveal-from-top] {
    clip-path: inset(calc(var(--map-edge-inset) * (1 - var(--map-progress))) 0 0 round clamp(14px, 1.6vw, 28px));
  }
  .home-location-frame[data-reveal-pending]:focus-within { --map-progress: 1 !important; clip-path: none; overflow: visible; }
  .home-location-details {
    opacity: calc(.45 + .55 * var(--contact-progress, 1));
  }
  .home-location-details[data-reveal-pending] > * { translate: 0 calc(5px * (1 - var(--contact-progress, 1))); }
  .home-location-details:focus-within { --contact-progress: 1 !important; }
}
/* On touch screens only the aperture moves, so Google Maps can keep its
   tile surface at the same raster scale throughout the gesture. */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .home-location-frame[data-reveal-pending]:not([data-reveal-from-top]) .home-location-map {
    transform: scale(calc(1 + .055 * (1 - var(--map-progress, 1))));
  }
}
@media (prefers-reduced-motion: no-preference) and (width > 1000px) {
  .service-item:nth-child(3n) { --right-edge: var(--rule-on-light); }
  .service-item:nth-last-child(-n + 3) { --bottom-edge: var(--rule-on-light); }
}
@media (prefers-reduced-motion: no-preference) and (650px < width <= 1000px) {
  .service-item:nth-child(2n) { --right-edge: var(--rule-on-light); }
  .service-item:nth-last-child(-n + 2) { --bottom-edge: var(--rule-on-light); }
}
@media (prefers-reduced-motion: no-preference) and (width <= 650px) {
  .service-item { --right-edge: var(--rule-on-light); }
  .service-item:last-child { --bottom-edge: var(--rule-on-light); }
}
