* {
  box-sizing: border-box;
}
html {
  --body-bg: hsl(210, 20%, 20%);
}
body {
  margin: 0;
  height: 100vh;
  font-family: system-ui, -apple-system, sans-serif;
}
section {
  position: relative;
  z-index: -1;
  padding: clamp(3em, 6vw, 5em);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column-reverse;
  gap: 2em;
  background: radial-gradient(var(--body-bg), #000);
  overflow-x: hidden;
}
#img-container {
  margin-left: 8em;
  height: 280px;
  width: 280px;
  perspective: 500px;
  transform-style: preserve-3d;
}
.box {
  height: 280px;
  width: 280px;
  position: absolute;
  top: 50%;
  border: 1px solid #bbb;
  border-radius: 1.5em;
  box-shadow: 0 0 8px hsla(0deg, 0%, 0%, 75%);
  transition: 800ms ease-in-out;
  overflow: hidden;
}
.box img {
  width: 100%;
  height: 100%;
}
.box:first-of-type {
  left: 15%;
  opacity: 0;
  z-index: 5;
  transform: translate(-50%,-50%) rotateY(-10deg);
}
.box:nth-of-type(2) {
  left: 20%;
  opacity: 1;
  z-index: 5;
  transform: translate(-50%,-50%) rotateY(-10deg);
}
.box:nth-of-type(3) {
  left: 25%;
  opacity: 0.75;
  z-index: 10;
  transform: translate(-50%,-50%) rotateY(-10deg) translateZ(-40px);
}
.box:nth-of-type(4) {
  left: 30%;
  opacity: 0.5;
  z-index: 5;
  transform: translate(-50%,-50%) rotateY(-10deg) translateZ(-100px);
  color: #eee;
}

.card {
  --br: 1em;
  position: relative;
  padding: 1vmin 1em;
  width: min(400px,95%);
  background: linear-gradient(30deg,#2F3238,hsl(210, 56%, 24%));
  color: #dce3f9;
  border-radius: var(--br);
}
.card::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: var(--br);
  --color1: hsla(0deg, 0%, 96%, 30%);
  --color2: hsla(0deg, 0%, 90%, 75%);
  background: linear-gradient(35deg, var(--color1), var(--color2));
  background: conic-gradient(var(--color1), var(--color2) 15%, var(--color1) 25%), hsl(210, 95%, 8%);
  background-blend-mode: screen;
}
@media (width>768px) {
  section { flex-direction: row;}
  .card::after { inset: -1px;}
}
.shadow {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(315deg, hsl(210,50%,30%), hsl(210,40%,10%));
  filter: blur(25px);
  transform: translateY(20px) scale(0.9);
  z-index: -1;
}