/* ==========================================================
   WEB DESIGN MASTER
   PROJECT SHOWCASE
   VERSION PUZZLE / FRAGMENT
========================================================== */

.wdm-universes,
.wdm-universes * {
  box-sizing: border-box;
}

.wdm-universes {

  --ecommerce: #000000;
  --services: #000000;
  --health: #000000;
  --finance: #000000;
  --education: #000000;
  --luxury: #000000;

  position: relative;

  width: 100%;
  min-height: 980px;

  padding:
    90px
    20px
    80px;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 50% 62%,
      rgba(80, 105, 150, 0.065),
      transparent 32%
    ),
    #ffffff;

  color: #111318;
}


/* ==========================================================
   BACKGROUND LIGHT
========================================================== */

.wdm-universes::before {

  content: "";

  position: absolute;

  left: 50%;
  top: 62%;

  width: 900px;
  height: 560px;

  transform:
    translate(-50%, -50%);

  border-radius: 50%;

  background:
    radial-gradient(
      ellipse,
      rgba(145, 160, 190, 0.08),
      transparent 68%
    );

  filter: blur(30px);

  pointer-events: none;
}


/* ==========================================================
   HEADER
========================================================== */

.wdm-universes__heading {

  position: relative;

  z-index: 30;

  width: min(100%, 1100px);

  margin:
    0
    auto
    48px;

  text-align: center;
}

.wdm-universes__eyebrow {

  display: inline-block;

  margin-bottom: 16px;

  font-size: 11px;

  font-weight: 700;

  letter-spacing: 0.23em;

  color: #979da7;
}

.wdm-universes__title {

  max-width: 1000px;

  margin: 0 auto;

  font-size:
    clamp(
      44px,
      4vw,
      68px
    );

  line-height: 1.02;

  letter-spacing: -0.05em;

  font-weight: 650;

  color: #15171b;
}

.wdm-universes__title span {

  display: block;

  color: #9ba0a9;
}

.wdm-universes__subtitle {

  width: min(
    100%,
    680px
  );

  margin:
    24px
    auto
    0;

  font-size: 15px;

  line-height: 1.7;

  color: #747a83;
}


/* ==========================================================
   CAROUSEL
========================================================== */

.wdm-carousel {

  position: relative;

  z-index: 10;

  width: 100%;

  max-width: 1700px;

  margin: 0 auto;
}


/* ==========================================================
   VIEWPORT
========================================================== */

.wdm-carousel__viewport {

  position: relative;

  width: 100%;
  height: 590px;

  overflow: visible;

  perspective: 1900px;

  perspective-origin:
    center
    45%;

  cursor: grab;

  user-select: none;

  touch-action: pan-y;
}

.wdm-carousel__viewport.is-dragging {

  cursor: grabbing;
}


/* ==========================================================
   STAGE
========================================================== */

.wdm-carousel__stage {

  position: relative;

  width: 100%;
  height: 100%;

  transform-style: preserve-3d;

  transition:
    transform
    0.38s
    cubic-bezier(.2,.75,.25,1);
}

.wdm-carousel__viewport.is-dragging
.wdm-carousel__stage {

  transition: none;
}


/* ==========================================================
   CARD
========================================================== */

.wdm-sector-card {

  --accent: var(--ecommerce);

  position: absolute;

  left: 50%;
  top: 0;

  width: 440px;
  height: 530px;

  margin-left: -220px;

  transform-style: preserve-3d;

  cursor: pointer;

  opacity: 0;

  transition:
    transform
    0.72s
    cubic-bezier(.19,.81,.22,1),
    opacity
    0.5s
    ease,
    filter
    0.55s
    ease;

  will-change:
    transform,
    opacity;
}


/* ==========================================================
   THEMES
========================================================== */

.wdm-sector-card[data-theme="ecommerce"] {
  --accent: var(--ecommerce);
}

.wdm-sector-card[data-theme="services"] {
  --accent: var(--services);
}

.wdm-sector-card[data-theme="health"] {
  --accent: var(--health);
}

.wdm-sector-card[data-theme="finance"] {
  --accent: var(--finance);
}

.wdm-sector-card[data-theme="education"] {
  --accent: var(--education);
}

.wdm-sector-card[data-theme="luxury"] {
  --accent: var(--luxury);
}


/* ==========================================================
   GLOW
========================================================== */

.wdm-sector-card__glow {

  position: absolute;

  left: 50%;
  top: 95px;

  width: 350px;
  height: 310px;

  transform:
    translateX(-50%)
    translateZ(-50px);

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      color-mix(
        in srgb,
        var(--accent) 25%,
        transparent
      ),
      transparent 68%
    );

  filter: blur(42px);

  opacity: 0;

  transition:
    opacity 0.45s ease,
    transform 0.55s ease;

  pointer-events: none;
}


/* ==========================================================
   VISUAL
========================================================== */

.wdm-sector-card__visual {

  position: relative;

  width: 100%;
  height: 430px;

  transform-style: preserve-3d;

  transition:
    transform 0.18s ease-out,
    filter 0.5s ease;

  filter:
    drop-shadow(
      0
      26px
      32px
      rgba(15, 20, 31, 0.14)
    );
}


/* ==========================================================
   PUZZLE / FRAGMENT IMAGE
========================================================== */

.wdm-sector-card__fragment {

  position: absolute;

  top: 0;

  height: 100%;

  background-repeat: no-repeat;

  background-size:
    440px
    430px;

  backface-visibility: hidden;

  transition:
    transform
    0.65s
    cubic-bezier(.19,.81,.22,1),
    filter
    0.45s
    ease;
}


/* ==========================================================
   LEFT FRAGMENT
========================================================== */

.wdm-sector-card__fragment--left {

  left: 0;

  width: 43%;

  background-position:
    left
    center;

  clip-path: polygon(

    5% 7%,
    91% 3%,

    96% 14%,
    90% 22%,
    97% 29%,

    95% 42%,
    100% 49%,
    94% 56%,

    96% 69%,
    88% 76%,
    95% 84%,

    90% 96%,
    9% 99%,

    4% 87%,
    8% 77%,
    2% 66%,

    7% 54%,
    2% 43%,
    7% 33%,

    2% 21%
  );

  transform:
    translate3d(
      -4px,
      5px,
      7px
    );
}


/* ==========================================================
   CENTER FRAGMENT
========================================================== */

.wdm-sector-card__fragment--center {

  left: 27%;

  width: 48%;

  background-position:
    center
    center;

  clip-path: polygon(

    8% 3%,
    89% 4%,

    95% 13%,
    89% 21%,
    97% 28%,

    94% 41%,
    100% 49%,
    94% 57%,

    97% 70%,
    89% 78%,
    96% 86%,

    89% 97%,
    10% 96%,

    4% 86%,
    11% 78%,
    3% 70%,

    6% 57%,
    0% 49%,
    6% 41%,

    3% 28%,
    11% 21%
  );

  transform:
    translate3d(
      0,
      -3px,
      17px
    );
}


/* ==========================================================
   RIGHT FRAGMENT
========================================================== */

.wdm-sector-card__fragment--right {

  right: 0;

  width: 43%;

  background-position:
    right
    center;

  clip-path: polygon(

    8% 4%,
    94% 7%,

    99% 19%,
    94% 30%,
    99% 41%,

    94% 53%,
    100% 65%,
    94% 76%,

    99% 87%,
    92% 97%,

    10% 99%,

    4% 88%,
    12% 81%,
    4% 73%,

    6% 60%,
    0% 52%,
    6% 44%,

    3% 32%,
    13% 24%,
    5% 16%
  );

  transform:
    translate3d(
      4px,
      5px,
      7px
    );
}


/* ==========================================================
   SHADE
========================================================== */

.wdm-sector-card__shade {

  position: absolute;

  inset: 0;

  pointer-events: none;

  opacity: 0;

  background:
    linear-gradient(
      180deg,
      transparent 58%,
      rgba(10, 14, 22, 0.1)
    );

  transition:
    opacity 0.45s ease;
}


/* ==========================================================
   CONTENT
========================================================== */

.wdm-sector-card__info {

  position: relative;

  z-index: 10;

  display: flex;

  align-items: flex-start;

  gap: 16px;

  width: 100%;

  margin-top: 22px;

  padding:
    0
    20px;

  transition:
    opacity
    0.4s
    ease,
    transform
    0.4s
    ease;
}

.wdm-sector-card__number {

  padding-top: 6px;

  font-size: 12px;

  line-height: 1;

  font-weight: 700;

  letter-spacing: 0.12em;

  color: var(--accent);
}

.wdm-sector-card__text h3 {

  margin: 0;

  font-size: 30px;

  line-height: 1.05;

  font-weight: 650;

  letter-spacing: -0.035em;

  color: var(--accent);
}

.wdm-sector-card__text p {

  margin:
    9px
    0
    0;

  font-size: 14px;

  line-height: 1.45;

  font-weight: 400;

  color: #8f959f;
}


/* ==========================================================
   ACTIVE CARD
========================================================== */

.wdm-sector-card.is-active
.wdm-sector-card__glow {

  opacity: 1;

  transform:
    translateX(-50%)
    translateZ(-25px)
    scale(1.15);
}

.wdm-sector-card.is-active
.wdm-sector-card__visual {

  filter:
    saturate(1.05)
    contrast(1.02)
    drop-shadow(
      0
      34px
      38px
      rgba(15, 20, 31, 0.18)
    );
}


/* ==========================================================
   ACTIVE PUZZLE FRAGMENTS
========================================================== */

.wdm-sector-card.is-active
.wdm-sector-card__fragment--left {

  transform:
    translate3d(
      -8px,
      5px,
      20px
    );
}

.wdm-sector-card.is-active
.wdm-sector-card__fragment--center {

  transform:
    translate3d(
      0,
      -5px,
      34px
    );
}

.wdm-sector-card.is-active
.wdm-sector-card__fragment--right {

  transform:
    translate3d(
      8px,
      5px,
      20px
    );
}


/* ==========================================================
   ACTIVE SHADE
========================================================== */

.wdm-sector-card.is-active
.wdm-sector-card__shade {

  opacity: 1;
}


/* ==========================================================
   INACTIVE CARDS
========================================================== */

.wdm-sector-card:not(.is-active)
.wdm-sector-card__visual {

  filter:
    grayscale(58%)
    saturate(68%)
    brightness(0.78)
    contrast(0.93)
    drop-shadow(
      0
      18px
      24px
      rgba(15, 20, 30, 0.08)
    );
}

.wdm-sector-card:not(.is-active)
.wdm-sector-card__info {

  opacity: 0.40;

  transform:
    translateY(4px);
}


/* ==========================================================
   HOVER INACTIVE CARD
========================================================== */

.wdm-sector-card:not(.is-active):hover
.wdm-sector-card__visual {

  filter:
    grayscale(25%)
    saturate(85%)
    brightness(0.9)
    contrast(0.97)
    drop-shadow(
      0
      22px
      28px
      rgba(15,20,30,0.11)
    );
}


/* ==========================================================
   CONTROLS
========================================================== */

.wdm-carousel__controls {

  position: relative;

  z-index: 50;

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 22px;

  margin-top: 8px;
}


/* ==========================================================
   BUTTONS
========================================================== */

.wdm-carousel__button {

  display: flex;

  align-items: center;

  justify-content: center;

  width: 46px;
  height: 46px;

  padding: 0;

  border:
    1px
    solid
    #e2e5ea;

  border-radius: 50%;

  background:
    rgba(
      255,
      255,
      255,
      0.88
    );

  color: #171a20;

  cursor: pointer;

  backdrop-filter:
    blur(12px);

  transition:
    transform
    0.25s
    ease,
    border-color
    0.25s
    ease,
    box-shadow
    0.25s
    ease;
}

.wdm-carousel__button:hover {

  transform:
    scale(1.08);

  border-color:
    #c9ced6;

  box-shadow:
    0
    8px
    24px
    rgba(20,25,35,.08);
}

.wdm-carousel__button span {

  transform:
    translateY(-1px);

  font-size: 17px;
}


/* ==========================================================
   PROGRESS
========================================================== */

.wdm-carousel__progress {

  display: flex;

  align-items: center;

  gap: 11px;

  min-width: 180px;
}

.wdm-carousel__current,
.wdm-carousel__total {

  font-size: 10px;

  font-weight: 700;

  letter-spacing: .08em;

  color: #9298a1;
}

.wdm-carousel__line {

  position: relative;

  width: 115px;
  height: 1px;

  overflow: hidden;

  background: #dfe2e7;
}

.wdm-carousel__line-fill {

  position: absolute;

  inset:
    0
    auto
    0
    0;

  width: 16.66%;

  background: #1b1e24;

  transition:
    width
    .5s
    cubic-bezier(.19,.81,.22,1);
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 1150px) {

  .wdm-carousel__viewport {

    transform:
      scale(.86);

    transform-origin:
      top center;

    margin-bottom:
      -65px;
  }
}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 767px) {

  .wdm-universes {

    min-height: auto;

    padding:
      70px
      16px
      60px;
  }

  .wdm-universes__heading {

    margin-bottom: 40px;
  }

  .wdm-universes__title {

    font-size:
      clamp(
        37px,
        11vw,
        48px
      );
  }

  .wdm-universes__subtitle {

    font-size: 14px;
  }

  .wdm-carousel__viewport {

    width: 125%;

    height: 520px;

    margin-left: -12.5%;

    transform:
      scale(.68);

    transform-origin:
      top center;

    margin-bottom:
      -120px;
  }

  .wdm-carousel__controls {

    margin-top: 0;
  }
}


/* ==========================================================
   REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

  .wdm-sector-card,
  .wdm-sector-card__visual,
  .wdm-sector-card__fragment,
  .wdm-carousel__stage {

    transition-duration:
      .01ms !important;
  }
}