/* Home hero on big screens: three real screens set at an angle in depth, lit by one passing light. */
@property --lift { syntax: '<length>'; inherits: false; initial-value: 0px; }

/* A wider right column than the plain pair had, so three screens have room. */
.hero[aria-labelledby="hero-h"] .inner:has(.hero-stage) { grid-template-columns: minmax(0, 1fr) minmax(0, min(33vw, 56svh)); column-gap: 3.5vw; }
.hero-stage {
  --px: 0; --py: 0; --sy: 0;
  display: block;
  position: relative;
  aspect-ratio: 100 / 122;
  perspective: 1700px;
  perspective-origin: 20% 45%;
}
.hs-panel {
  --k: 1; --z: 0px; --lit: 1;
  position: absolute;
  width: 80%;
  display: block;
  color: var(--text-2);
  text-decoration: none;
  transform:
    translate3d(calc(var(--px) * var(--k) * -16px), calc(var(--py) * var(--k) * -10px + var(--sy) * var(--k) * -80px), calc(var(--z) + var(--lift)))
    rotateY(calc(-16deg + var(--px) * 3.5deg))
    rotateX(calc(4deg - var(--py) * 2.5deg));
  transition: --lift .6s var(--e);
  will-change: transform;
}
.hs-a { --k: .45; --z: -150px; --lit: .74; --i: 0; top: 3%;  left: 2%; }
.hs-b { --k: .9;  --z: -60px;  --lit: .87; --i: 1; top: 33%; left: 20%; }
.hs-c { --k: 1.5; --z: 30px;   --lit: 1;   --i: 2; top: 62%; left: 4%; }

/* Shop and systems on big screens: two of the same real screens fill the right third beside the words. */
.hero:not([aria-labelledby="hero-h"]) .inner:has(> .hero-stage) { display: grid; max-width: var(--w-wide); grid-template-columns: minmax(0, 1fr) minmax(0, min(32vw, 58svh)); column-gap: 3.5vw; align-items: center; }
.hero:not([aria-labelledby="hero-h"]) .inner:has(> .hero-stage) > :not(.hero-stage) { grid-column: 1; }
.hero-stage.hs-two { aspect-ratio: 100 / 86; }
.hs-two .hs-a { top: 2%; left: 2%; }
.hs-two .hs-b { --k: 1.5; --z: 30px; --lit: 1; top: 47%; left: 18%; }

.hs-tag {
  display: inline-flex; gap: .7em; align-items: baseline; margin: 0 0 .6rem; padding: .4em .75em;
  font-size: 15px; line-height: 1.3; white-space: nowrap;
  border-radius: 6px; background: color-mix(in srgb, var(--bg) 90%, transparent);
}
.hs-tag b { color: var(--accent); font-family: var(--f-display); font-weight: 700; }

.hs-frame {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-3);
  box-shadow: 0 28px 50px -22px rgba(0, 0, 0, .75), 0 70px 120px -50px rgba(0, 0, 0, .7);
}
.hs-frame img { display: block; width: 100%; height: auto; filter: brightness(var(--lit)); transition: filter .6s var(--e); }
/* A faint top-left sheen, like glass catching the room light. */
.hs-frame::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, 0) 38%);
}
/* The light that sweeps across each screen once, back to front. */
.hs-frame::after {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 45%; z-index: 2; pointer-events: none;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .13) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-120%) skewX(-12deg);
  opacity: 0;
}

.hs-panel:hover, .hs-panel:focus-visible { --lift: 40px; color: var(--text); }
.hs-panel:hover img, .hs-panel:focus-visible img { filter: brightness(1); }
.hs-panel:hover .hs-tag, .hs-panel:focus-visible .hs-tag { text-decoration: underline; text-underline-offset: 3px; }
.hs-panel:focus-visible { outline: none; }
.hs-panel:focus-visible .hs-frame { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (prefers-reduced-motion: no-preference) {
  /* Wait hidden for the preloader and the images, then focus in back to front. */
  html.js .hero-stage .hs-panel { opacity: 0; animation: hs-show 0s 5s forwards; }
  html.js.loaded .hero-stage.is-ready .hs-panel { animation: hs-in 1.5s var(--e) calc(var(--i) * .28s) both; }
  html.js.loaded .hero-stage.is-ready .hs-frame::after { animation: hs-sweep 2.4s cubic-bezier(.45, 0, .2, 1) calc(1.1s + var(--i) * .4s) 1 both; }
}
@keyframes hs-in { from { opacity: 0; filter: blur(10px); } to { opacity: 1; filter: blur(0); } }
@keyframes hs-show { to { opacity: 1; } }
@keyframes hs-sweep { 0% { opacity: 1; transform: translateX(-120%) skewX(-12deg); } 100% { opacity: 1; transform: translateX(260%) skewX(-12deg); } }

@media (prefers-reduced-motion: reduce) {
  .hs-panel { transition: none; will-change: auto; }
  .hs-frame img { transition: none; }
  .hs-frame::after { display: none; }
}
