@import url('https://fonts.cdnfonts.com/css/ica-rubrik-black');
@import url('https://fonts.cdnfonts.com/css/poppins');

:root {
  --quantity: 36;
  --card-width: 200px;
  --card-height: 250px;
  --ring-radius: 1320px;
  --scene-perspective: 4200px;
  --slider-top: 7%;
  --slider-tilt: -20deg;
  --slider-duration: 46s;
  --view-scale: 0.52;
  --view-y-offset: 180px;
  --ink: #25283b;
  --paper: #f5f2ea;
}

.banner {
  width: 100%;
  height: 100vh;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.slider {
  position: absolute;
  width: var(--card-width);
  height: var(--card-height);
  top: var(--slider-top);
  left: calc(50% - (var(--card-width) / 2));
  transform-style: preserve-3d;
  transform: perspective(var(--scene-perspective));
  animation: autoRun var(--slider-duration) linear infinite;
  z-index: 4;
}

@keyframes autoRun {
  from {
    transform:
      perspective(var(--scene-perspective))
      translateY(var(--view-y-offset))
      scale(var(--view-scale))
      rotateX(var(--slider-tilt))
      rotateY(0deg);
  }
  to {
    transform:
      perspective(var(--scene-perspective))
      translateY(var(--view-y-offset))
      scale(var(--view-scale))
      rotateX(var(--slider-tilt))
      rotateY(360deg);
  }
}

.slider .item {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  position: absolute;
  inset: 0;
  padding: 0;
  transform:
    rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg))
    translateZ(var(--ring-radius));
  transform-style: preserve-3d;
  outline-offset: 7px;
}

.slider .item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(16, 18, 30, 0.28);
  pointer-events: none;
}

.content {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1400px, 100vw);
  height: max-content;
  padding-bottom: 82px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}

.content h1 {
  font-family: 'ICA Rubrik', Georgia, serif;
  font-size: clamp(8rem, 15vw, 16em);
  line-height: 0.88em;
  color: var(--ink);
  position: relative;
  letter-spacing: -0.05em;
}

.content h1::after {
  position: absolute;
  inset: 0;
  content: attr(data-content);
  z-index: 2;
  -webkit-text-stroke: 2px #d2d2d2;
  color: transparent;
}

.content .author {
  font-family: Poppins, system-ui, sans-serif;
  text-align: right;
  max-width: 260px;
  color: #070707;
  padding-right: 10px;
}

.content h2 {
  font-size: clamp(2rem, 3vw, 3em);
  line-height: 1.1;
  margin-bottom: 10px;
}

.content p {
  font-size: 0.95rem;
  line-height: 1.45;
}

.content .model {
  background-image: url(images/model.png);
  width: 100%;
  height: 75vh;
  position: absolute;
  bottom: 0;
  left: 0;
  background-size: auto 130%;
  background-repeat: no-repeat;
  background-position: top center;
  z-index: 1;
}

.card-popover {
  position: fixed;
  right: clamp(16px, 4vw, 72px);
  bottom: clamp(16px, 7vh, 64px);
  z-index: 30;
  width: min(430px, calc(100vw - 32px));
  background: rgba(245, 242, 234, 0.95);
  border: 1px solid rgba(37, 40, 59, 0.18);
  border-radius: 24px;
  box-shadow: 0 26px 80px rgba(12, 15, 28, 0.28);
  color: #10121d;
  font-family: Poppins, system-ui, sans-serif;
  overflow: hidden;
}

.card-popover[hidden] {
  display: none;
}

.card-popover img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}

.popover-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(245, 242, 234, 0.92);
  color: #10121d;
  cursor: pointer;
  font: 700 1.1rem/1 Poppins, system-ui, sans-serif;
}

.popover-copy {
  padding: 18px 20px 4px;
  text-align: left;
}

.popover-kicker {
  color: #6b5a2f;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.popover-copy h2 {
  font-size: 1.35rem;
  line-height: 1.18;
  margin-bottom: 8px;
}

.popover-copy p:last-child {
  font-size: 0.95rem;
  line-height: 1.55;
}

.popover-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px 20px;
}

.popover-actions button {
  flex: 1;
  border: 1px solid rgba(37, 40, 59, 0.22);
  border-radius: 999px;
  background: #fffaf0;
  color: #171923;
  cursor: pointer;
  font: 700 0.82rem/1 Poppins, system-ui, sans-serif;
  padding: 12px 14px;
}

@media screen and (max-width: 1180px) {
  :root {
    --card-width: 160px;
    --card-height: 210px;
    --ring-radius: 1220px;
    --scene-perspective: 3600px;
    --view-scale: 0.68;
  }

  .content .author {
    max-width: 220px;
  }
}

@media screen and (max-width: 767px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  :root {
    --card-width: 40px;
    --card-height: 58px;
    --ring-radius: 230px;
    --scene-perspective: 1300px;
    --slider-top: 10%;
    --slider-tilt: -20deg;
    --view-scale: 0.68;
    --view-y-offset: 132px;
    --slider-duration: 58s;
  }

  .banner {
    min-height: 100svh;
  }

  .content {
    padding: 0 18px 54px;
    justify-content: center;
  }

  .content h1 {
    width: 100%;
    text-align: center;
    font-size: clamp(3.6rem, 18vw, 5.6rem);
  }

  .content .author {
    max-width: 320px;
    width: 100%;
    text-align: center;
    padding: 0;
  }

  .content .model {
    height: 70vh;
    background-size: auto 105%;
  }

  .card-popover {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }
}
