.project-laptop {
  position: relative; isolation: isolate;
  width: 100%; max-width: 900px; margin: 0; aspect-ratio: 620 / 392;
}
.project-laptop::after {
  content: ""; position: absolute; z-index: -1; inset: -20% -18% -15% -22%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 49% 55% at 62% 49%, transparent 52%, #9571ed2e 62%, transparent 78%),
    radial-gradient(ellipse 45% 25% at 35% 65%, #4679ad44, transparent 86%),
    radial-gradient(ellipse 37% 8% at 55% 81%, #a186ff32, transparent 95%);
  filter: blur(clamp(10px, 1.5vw, 24px));
  transform: rotate(-12deg);
}
/* Soften the clipped frame edge after compositing. The screen is a separate layer. */
.project-laptop-frame {
  position: absolute; inset: 0; pointer-events: none;
  filter: blur(.45px);
}
.project-laptop-frame::before {
  content: ""; position: absolute; inset: 0;
  --laptop-reflection: radial-gradient(ellipse 40% 4% at 46% 86%, #9379fa35, transparent 100%);
  background:
    var(--laptop-reflection),
    url('/images/portfolio/laptop-frame.png') center top / 145.16% auto no-repeat;
  background-image:
    var(--laptop-reflection),
    image-set(url('/images/portfolio/laptop-frame.webp') type('image/webp'),
              url('/images/portfolio/laptop-frame.png') type('image/png'));
  filter: saturate(25%);
  clip-path: polygon(
    12.7% 0, 87.3% 0, 87.9% .2%, 88.4% .65%, 88.8% 1.2%,
    89.1% 1.9%, 89.3% 2.75%, 89.4% 3.7%,
    89.4% 83.4%, 98.3% 91.5%, 98.1% 94.2%, 97.6% 95.5%,
    96.5% 96.2%, 95.4% 96.4%, 4.6% 96.4%, 3.5% 96.2%,
    2.4% 95.5%, 1.9% 94.2%, 1.7% 91.5%, 10.6% 83.4%,
    10.6% 3.7%, 10.7% 2.75%, 10.9% 1.9%, 11.2% 1.2%,
    11.6% .65%, 12.1% .2%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 82%,
    rgb(0 0 0 / 82%) 86%,
    rgb(0 0 0 / 46%) 92%,
    transparent 96.4%
  );
}
.project-laptop-screen {
  position: absolute; inset: 1.75% 11.7% 18.9%; overflow: hidden;
  border-radius: 2.5% / 3.75%; background: #111116;
}
.project-laptop-screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.project-laptop-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(128deg, #ddd2ff10, transparent 43%);
  box-shadow: inset 0 0 0 1px #ffffff16, inset 0 0 18px #08071036;
}
.project-laptop-camera {
  position: absolute; z-index: 1; top: 0; left: 50%; width: 5%; height: 2.5%;
  transform: translateX(-50%); background: #0c0c0f; border-radius: 0 0 5px 5px;
}
.project-laptop-screen img[hidden] { display: none; }

.project-phone {
  position: absolute;
  z-index: 2;
  right: 2.1%;
  bottom: 1%;
  width: 17.5%;
  aspect-ratio: 9 / 19.5;
  border-radius: 19% / 8.8%;
  background: linear-gradient(105deg, #727782, #343640 12%, #16171e 45%, #24262f 86%, #555866);
  box-shadow:
    inset 0 0 0 1px #d9dfff29,
    inset 1px 1px 2px #dfd5ff32,
    2px 1px 1px #090a0e,
    6px 9px 17px #08070c70;
  transform: perspective(1100px) rotateY(-7deg) rotate(1.4deg);
  transform-origin: 50% 94%;
}
.project-phone::before,
.project-phone::after {
  content: "";
  position: absolute;
  top: 25%;
  width: 1.4%;
  height: 13%;
  border-radius: 2px;
  background: linear-gradient(180deg, #70737d, #393b44 22%, #2a2b34 86%, #62636e);
}
.project-phone::before { left: -.85%; }
.project-phone::after { right: -.85%; top: 31%; height: 11%; }
.project-phone-screen {
  position: absolute;
  inset: 1.3% 2.8%;
  overflow: hidden;
  border: 1px solid #0d0e12;
  border-radius: 17% / 7.8%;
  background: #0c0d11;
}
.project-phone-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.project-phone-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(147deg, #e4ddff24, #d2c4ff08 23%, transparent 40%),
    linear-gradient(to bottom, transparent 87%, #06070b37);
  box-shadow: inset 0 0 0 1px #ffffff14, inset 0 0 6px #08091070;
}
.project-phone-screen::before {
  content: "";
  position: absolute;
  z-index: 1;
  bottom: 2.3%;
  left: 35%;
  width: 30%;
  height: max(1px, .7%);
  border-radius: 999px;
  background: #fff7;
  pointer-events: none;
}
.project-phone-camera {
  position: absolute;
  z-index: 1;
  top: 2.5%;
  left: 50%;
  width: 28%;
  height: 3.5%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #08090d;
  box-shadow: inset 0 1px 1px #cbc6ff1e;
}
.project-phone-camera::after {
  content: "";
  position: absolute;
  top: 24%;
  right: 10%;
  height: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 36%, #43476a, #151620 55%, #07080b);
}
.project-phone[hidden], .project-phone-screen img[hidden] { display: none; }
