/* Two product demos on the home page. All decoration is outside the link hit areas. */
@property --model-service-blade {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
#model-services .model-lane-visual {
  position: relative;
  isolation: isolate;
}

/* These plates have their own entrances, independent of the general image reveal. */
#model-services .model-lane-visual.estuary-aperture img {
  clip-path: none;
}

#model-services .model-lane--domestic .model-lane-content {
  --relay-gutter: clamp(21px, 2.8vw, 43px);
  --relay-top: 8px;
  position: relative;
  padding-top: max(31px, var(--relay-gutter));
}

/* Three circuit traces meet at two elbows. The trace lives in the gutter
   beneath the screenshot, leaving the page capture and information clear. */
#model-services .model-lane--domestic .model-lane-content::before {
  content: '';
  position: absolute;
  pointer-events: none;
  inset-inline: var(--relay-gutter);
  top: var(--relay-top);
  height: 15px;
  --copper: #9c7cb9;
  --contact: #674381;
  background:
    radial-gradient(circle at 3px 4.5px, var(--contact) 2px, transparent 2.5px),
    radial-gradient(circle at 30% 11.5px, var(--contact) 1.5px, transparent 2px),
    radial-gradient(circle at 70% 11.5px, var(--contact) 1.5px, transparent 2px),
    radial-gradient(circle at calc(100% - 3px) 4.5px, var(--contact) 2px, transparent 2.5px),
    linear-gradient(90deg, var(--copper) 30%, transparent 30% 70%, var(--copper) 70%) 0 4px / 100% 1px,
    linear-gradient(90deg, transparent 30%, var(--copper) 30% 70%, transparent 70%) 0 11px / 100% 1px,
    linear-gradient(var(--copper), var(--copper)) 30% 4px / 1px 8px,
    linear-gradient(var(--copper), var(--copper)) 70% 4px / 1px 8px;
  background-repeat: no-repeat;
}

#model-services .model-lane--domestic:focus-within .model-lane-content::before {
  --copper: #8364bb;
  --contact: #7339a6;
}

@media (prefers-reduced-motion: no-preference) {
  /* A bank of eight translucent optical blades, with an icy edge on each
     blade. The mask retracts each blade within its own cell. */
  #model-services .model-lane--business .model-lane-visual::before {
    position: absolute;
    content: '';
    pointer-events: none;
    z-index: 1;
    inset: 0;
    opacity: 0;
    background:
      linear-gradient(114deg, transparent 6%, #fff9fd65 43%, transparent 61%),
      linear-gradient(90deg, #211052b8, #9ca9f29e 66%, #e4d4ffb3 88%, #fae5fff0 97%, #6470cc9e);
    background-size: 100% 100%, 12.5% 100%;
    mask-image: linear-gradient(90deg, black 0 var(--model-service-blade), transparent calc(var(--model-service-blade) + 2%));
    mask-size: 12.5% 100%;
  }

  #model-services .model-lane--business.lower-in-view .model-lane-visual::before {
    animation: service-louvre-open 1.05s cubic-bezier(.25,.68,.27,1) both;
  }

  #model-services .model-lane--business .model-lane-visual::after {
    position: absolute;
    content: '';
    pointer-events: none;
    z-index: 2;
    inset: 0;
    opacity: 0;
    background: linear-gradient(115deg, transparent 37%, #bbadff3d 47%, #fff1ff8a 50%, transparent 57%);
  }

  #model-services .model-lane--business:focus-within .model-lane-visual::after {
    animation: service-glass-light .72s ease-out both;
  }

  /* The first packet follows the actual route on entry. The second plays
     on a deliberate revisit with a pointer or a keyboard. */
  #model-services .model-lane--domestic .model-lane-content::after,
  #model-services .model-lane--domestic .model-lane-content > .showcase-eyebrow::after {
    position: absolute;
    content: '';
    pointer-events: none;
    inset-inline: var(--relay-gutter);
    top: var(--relay-top);
    height: 15px;
    opacity: 0;
    background: radial-gradient(ellipse, #fff 0 16%, #f944bb 31%, #7842d2 55%, transparent 78%) 0 1px / 9px 7px no-repeat;
    filter: drop-shadow(0 0 2px #d556be85);
  }

  #model-services .model-lane--domestic.lower-in-view .model-lane-content::after {
    animation: service-relay-hop 1.25s linear .08s both;
  }

  #model-services .model-lane--domestic:focus-within .model-lane-content > .showcase-eyebrow::after {
    animation: service-relay-hop .95s linear both;
  }

  /* The tile itself stays still while the reader is aiming at links. */
  #model-services .model-lane:hover .model-lane-visual img {
    transform: none;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #model-services .model-lane--business:hover .model-lane-visual::after {
    animation: service-glass-light .72s ease-out both;
  }

  #model-services .model-lane--domestic:hover .model-lane-content > .showcase-eyebrow::after {
    animation: service-relay-hop .95s linear both;
  }
}

@keyframes service-louvre-open {
  0% { opacity: 0; --model-service-blade: 90%; }
  12% { opacity: .74; }
  32% { --model-service-blade: 80%; }
  100% { opacity: 0; --model-service-blade: 0%; }
}

@keyframes service-glass-light {
  0% { opacity: 0; transform: translateX(-85%); }
  25% { opacity: .62; }
  100% { opacity: 0; transform: translateX(85%); }
}

@keyframes service-relay-hop {
  0% { opacity: 0; background-position: 0 1px; }
  8% { opacity: 1; background-position: 0 1px; }
  32% { background-position: 30% 1px; }
  39% { background-position: 30% 8px; }
  68% { background-position: 70% 8px; }
  75% { background-position: 70% 1px; }
  94% { opacity: 1; background-position: 100% 1px; }
  100% { opacity: 0; background-position: 100% 1px; }
}
