/**
 * Homepage hero — animated eCard theme showcase (floating carousel + featured card).
 */

.mkt-hero-showcase {
  position: relative;
  width: 100%;
  min-height: clamp(440px, 52vw, 680px);
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  --hero-showcase-fit-w: 300px;
  --hero-showcase-fit-h: 560px;
  --hero-showcase-device-w: 280px;
  --hero-orbit-fit-w: 200px;
  --hero-orbit-fit-h: 380px;
  --hero-orbit-device-w: 188px;
  --parallax-x: 0px;
  --parallax-y: 0px;
}

.mkt-hero-showcase[hidden] {
  display: none !important;
}

.mkt-hero-showcase__stage {
  position: relative;
  width: min(100%, 640px);
  height: clamp(440px, 52vw, 680px);
  margin: 0 auto;
  transform: translate3d(var(--parallax-x), var(--parallax-y), 0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.mkt-hero-showcase__glow {
  position: absolute;
  inset: 10% 8% 14%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(37, 99, 235, 0.14), transparent 68%),
    radial-gradient(ellipse 55% 50% at 50% 55%, rgba(255, 255, 255, 0.75), transparent 72%);
  filter: blur(2px);
  animation: mkt-hero-glow-breathe 24s ease-in-out infinite;
}

.mkt-hero-showcase__orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mkt-hero-showcase__card {
  position: absolute;
  transform-origin: center center;
  will-change: transform;
  filter: drop-shadow(0 18px 40px rgba(15, 23, 42, 0.14));
  pointer-events: none;
}

.mkt-hero-showcase__card .ecard-preview-fit {
  max-width: var(--ecard-preview-fit-max-w, var(--hero-orbit-fit-w));
  height: var(--ecard-preview-fit-max-h, var(--hero-orbit-fit-h));
  --ecard-preview-fit-max-w: var(--hero-orbit-fit-w);
  --ecard-preview-fit-max-h: var(--hero-orbit-fit-h);
}

.mkt-hero-showcase__card .theme-preview-device {
  max-width: var(--ecard-preview-device-max-w, var(--hero-orbit-device-w));
}

.mkt-hero-showcase__card--orbit {
  opacity: 0.88;
  z-index: 1;
  animation-duration: 14s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.mkt-hero-showcase__card--orbit[data-slot="0"] {
  left: 2%;
  top: 14%;
  transform: rotate(-10deg) scale(0.78);
  animation-delay: 0s;
  z-index: 2;
}

.mkt-hero-showcase__card--orbit[data-slot="1"] {
  right: 0;
  top: 8%;
  transform: rotate(8deg) scale(0.74);
  animation-delay: -2.5s;
  z-index: 1;
}

.mkt-hero-showcase__card--orbit[data-slot="2"] {
  left: 0;
  bottom: 10%;
  transform: rotate(-6deg) scale(0.7);
  animation-delay: -5s;
  opacity: 0.78;
  filter: blur(0.4px) drop-shadow(0 14px 32px rgba(15, 23, 42, 0.12));
}

.mkt-hero-showcase__card--orbit[data-slot="3"] {
  right: 4%;
  bottom: 12%;
  transform: rotate(7deg) scale(0.72);
  animation-delay: -7s;
  opacity: 0.8;
}

.mkt-hero-showcase__card--orbit[data-slot="4"] {
  left: 28%;
  top: 2%;
  transform: rotate(-4deg) scale(0.66);
  animation-delay: -9s;
  opacity: 0.72;
  filter: blur(0.6px) drop-shadow(0 12px 28px rgba(15, 23, 42, 0.1));
}

.mkt-hero-showcase__featured {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: min(92%, var(--hero-showcase-fit-w));
  transform: translate(-50%, -50%);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease;
  filter: drop-shadow(0 28px 56px rgba(37, 99, 235, 0.22));
  pointer-events: auto;
}

.mkt-hero-showcase__featured.is-transitioning {
  opacity: 0.72;
  filter: drop-shadow(0 20px 40px rgba(37, 99, 235, 0.14));
}

.mkt-hero-showcase__featured .ecard-preview-fit {
  max-width: var(--ecard-preview-fit-max-w, var(--hero-showcase-fit-w));
  height: var(--ecard-preview-fit-max-h, var(--hero-showcase-fit-h));
  --ecard-preview-fit-max-w: var(--hero-showcase-fit-w);
  --ecard-preview-fit-max-h: var(--hero-showcase-fit-h);
}

.mkt-hero-showcase__featured .theme-preview-device {
  max-width: var(--ecard-preview-device-max-w, var(--hero-showcase-device-w));
}

.mkt-hero-showcase__featured-inner {
  animation: mkt-hero-featured-float 20s ease-in-out infinite;
}

.mkt-hero-showcase__theme-label {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--portal-ink-muted, #64748b);
  opacity: 0.9;
}

.mkt-home-page .mkt-hero__inner:has(.mkt-hero-showcase:not([hidden])) {
  align-items: center;
}

@media (min-width: 900px) {
  .mkt-home-page .mkt-hero__inner:has(.mkt-hero-showcase:not([hidden])) {
    grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
    gap: clamp(20px, 3vw, 40px);
  }

  .mkt-hero-showcase {
    min-height: 600px;
  }

  .mkt-hero-showcase__stage {
    width: min(100%, 680px);
    height: 620px;
  }
}

@media (min-width: 1200px) {
  .mkt-home-page .mkt-hero__inner:has(.mkt-hero-showcase:not([hidden])) {
    grid-template-columns: minmax(0, 0.88fr) minmax(440px, 1.12fr);
    max-width: 1280px;
  }

  .mkt-hero-showcase {
    --hero-showcase-fit-w: 320px;
    --hero-showcase-fit-h: 600px;
    --hero-showcase-device-w: 300px;
  }
}

@media (max-width: 899px) {
  .mkt-hero-showcase__card--orbit[data-slot="2"],
  .mkt-hero-showcase__card--orbit[data-slot="4"] {
    display: none;
  }

  .mkt-hero-showcase__card--orbit[data-slot="0"] {
    left: -2%;
    top: 18%;
    transform: rotate(-8deg) scale(0.68);
  }

  .mkt-hero-showcase__card--orbit[data-slot="1"] {
    right: -2%;
    top: 12%;
    transform: rotate(7deg) scale(0.66);
  }

  .mkt-hero-showcase__card--orbit[data-slot="3"] {
    right: 2%;
    bottom: 14%;
    transform: rotate(5deg) scale(0.64);
  }

  .mkt-hero-showcase__glow {
    inset: 14% 10% 16%;
  }
}

@media (max-width: 599px) {
  .mkt-hero-showcase {
    min-height: 400px;
    --hero-showcase-fit-w: 260px;
    --hero-showcase-fit-h: 500px;
    --hero-showcase-device-w: 248px;
  }

  .mkt-hero-showcase__stage {
    height: clamp(380px, 58vh, 480px);
  }

  .mkt-hero-showcase__orbit {
    display: none;
  }

  .mkt-hero-showcase__featured {
    width: min(94%, var(--hero-showcase-fit-w));
  }

  .mkt-hero-showcase__glow {
    inset: 18% 6% 20%;
    animation: none;
  }
}

.mkt-hero-showcase__card--orbit[data-slot="0"] {
  --orbit-rotate: -10deg;
  --orbit-scale: 0.78;
  animation-name: mkt-hero-orbit-float-0;
}

.mkt-hero-showcase__card--orbit[data-slot="1"] {
  --orbit-rotate: 8deg;
  --orbit-scale: 0.74;
  animation-name: mkt-hero-orbit-float-1;
}

.mkt-hero-showcase__card--orbit[data-slot="2"] {
  --orbit-rotate: -6deg;
  --orbit-scale: 0.7;
  animation-name: mkt-hero-orbit-float-2;
}

.mkt-hero-showcase__card--orbit[data-slot="3"] {
  --orbit-rotate: 7deg;
  --orbit-scale: 0.72;
  animation-name: mkt-hero-orbit-float-3;
}

.mkt-hero-showcase__card--orbit[data-slot="4"] {
  --orbit-rotate: -4deg;
  --orbit-scale: 0.66;
  animation-name: mkt-hero-orbit-float-4;
}

@keyframes mkt-hero-orbit-float-0 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-10deg) scale(0.78); }
  50% { transform: translate3d(0, -7px, 0) rotate(-10deg) scale(0.78); }
}

@keyframes mkt-hero-orbit-float-1 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(8deg) scale(0.74); }
  50% { transform: translate3d(0, -9px, 0) rotate(8deg) scale(0.74); }
}

@keyframes mkt-hero-orbit-float-2 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-6deg) scale(0.7); }
  50% { transform: translate3d(0, -6px, 0) rotate(-6deg) scale(0.7); }
}

@keyframes mkt-hero-orbit-float-3 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(7deg) scale(0.72); }
  50% { transform: translate3d(0, -8px, 0) rotate(7deg) scale(0.72); }
}

@keyframes mkt-hero-orbit-float-4 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-4deg) scale(0.66); }
  50% { transform: translate3d(0, -5px, 0) rotate(-4deg) scale(0.66); }
}

@keyframes mkt-hero-featured-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -5px, 0); }
}

@keyframes mkt-hero-glow-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.88; transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .mkt-hero-showcase__card--orbit,
  .mkt-hero-showcase__featured-inner,
  .mkt-hero-showcase__glow {
    animation: none !important;
  }

  .mkt-hero-showcase__stage {
    transition: none;
  }
}
