:root {
  --icon-3d-bg: linear-gradient(145deg, #9ac1ff 0%, #5d89ff 45%, #3d5ede 100%);
  --icon-3d-gloss: linear-gradient(160deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.08) 60%, rgba(255, 255, 255, 0) 100%);
  --icon-3d-shadow: 0 12px 22px rgba(39, 75, 178, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.5), inset 0 -6px 10px rgba(21, 36, 99, 0.28);
}

html[data-icon-theme="gold"] {
  --icon-3d-bg: linear-gradient(145deg, #f2cd89 0%, #ce9a45 45%, #9d6a24 100%);
  --icon-3d-shadow: 0 12px 22px rgba(132, 91, 22, 0.34), inset 0 1px 2px rgba(255, 248, 227, 0.58), inset 0 -6px 10px rgba(90, 53, 11, 0.32);
}

html[data-icon-theme="teal"] {
  --icon-3d-bg: linear-gradient(145deg, #8de8df 0%, #33b7a9 45%, #1b8279 100%);
  --icon-3d-shadow: 0 12px 22px rgba(20, 114, 104, 0.32), inset 0 1px 2px rgba(235, 255, 252, 0.56), inset 0 -6px 10px rgba(10, 72, 67, 0.28);
}

html[data-icon-theme="violet"] {
  --icon-3d-bg: linear-gradient(145deg, #b8b5ff 0%, #7a6ef0 45%, #5345ca 100%);
  --icon-3d-shadow: 0 12px 22px rgba(64, 53, 154, 0.34), inset 0 1px 2px rgba(242, 241, 255, 0.52), inset 0 -6px 10px rgba(35, 28, 102, 0.28);
}

.icon-3d-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--icon-3d-bg);
  box-shadow: var(--icon-3d-shadow);
  color: #f8fbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex-shrink: 0;
  transform: translateZ(0);
}

.icon-3d-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--icon-3d-gloss);
  z-index: 0;
}

.icon-3d-badge::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 10%;
  height: 16%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  filter: blur(0.2px);
  z-index: 1;
}

.icon-3d-badge svg {
  width: 18px;
  height: 18px;
  display: block;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
}

.icon-3d-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-3d-sm {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.icon-3d-sm svg {
  width: 14px;
  height: 14px;
}

.icon-3d-xs {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

.icon-3d-xs svg {
  width: 12px;
  height: 12px;
}

.icon-3d-lg {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.icon-3d-lg svg {
  width: 22px;
  height: 22px;
}

h2.icon-3d-title,
h3.icon-3d-title {
  gap: 8px;
}

.cdeis-3d-host {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.cdeis-3d-host > :not(.cdeis-3d-scene) {
  position: relative;
  z-index: 1;
}

.cdeis-3d-scene {
  --scene-metal: #d1a452;
  --scene-face: #f4d791;
  --scene-edge: #9a6a28;
  --scene-blue: #5d89ff;
  --scene-teal: #2ab7a5;
  position: absolute;
  top: 50%;
  right: clamp(14px, 5vw, 72px);
  width: clamp(150px, 24vw, 280px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  perspective: 780px;
  pointer-events: none;
  z-index: 0;
}

.cdeis-3d-scene::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 5%;
  bottom: 8%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(20, 35, 64, 0.22), rgba(20, 35, 64, 0));
  transform: rotateX(62deg);
  filter: blur(2px);
}

.cdeis-3d-core {
  position: absolute;
  inset: 18%;
  transform-style: preserve-3d;
  animation: cdeis3dFloat 8s ease-in-out infinite;
}

.cdeis-3d-prism {
  position: absolute;
  inset: 18% 20% 20% 20%;
  transform-style: preserve-3d;
  transform: rotateX(58deg) rotateZ(-36deg);
}

.cdeis-3d-face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 20px 32px rgba(25, 38, 74, 0.2);
}

.cdeis-3d-face.top {
  background: linear-gradient(145deg, var(--scene-face), var(--scene-metal));
  transform: translateZ(34px);
  clip-path: polygon(50% 0, 100% 28%, 82% 100%, 18% 100%, 0 28%);
}

.cdeis-3d-face.left {
  background: linear-gradient(135deg, #b77d2d, var(--scene-edge));
  transform: rotateY(90deg) translateZ(44px);
  transform-origin: left center;
}

.cdeis-3d-face.right {
  background: linear-gradient(135deg, #e8bb62, #b88432);
  transform: rotateX(90deg) translateZ(-44px);
  transform-origin: bottom center;
}

.cdeis-3d-ring {
  position: absolute;
  inset: 8%;
  border: 10px solid rgba(93, 137, 255, 0.2);
  border-top-color: rgba(42, 183, 165, 0.55);
  border-right-color: rgba(209, 164, 82, 0.55);
  border-radius: 999px;
  transform: rotateX(66deg) rotateZ(-18deg);
  box-shadow: 0 12px 26px rgba(30, 50, 92, 0.16);
}

.cdeis-3d-plate {
  position: absolute;
  left: 18%;
  right: 18%;
  height: 18px;
  border-radius: 7px;
  transform: rotateX(68deg) rotateZ(-28deg);
  box-shadow: 0 14px 24px rgba(17, 30, 61, 0.18);
}

.cdeis-3d-plate.one {
  bottom: 21%;
  background: linear-gradient(90deg, var(--scene-blue), #b8ccff);
}

.cdeis-3d-plate.two {
  bottom: 14%;
  left: 26%;
  right: 8%;
  background: linear-gradient(90deg, var(--scene-teal), #b8fff5);
}

.cdeis-3d-plate.three {
  bottom: 7%;
  left: 8%;
  right: 30%;
  background: linear-gradient(90deg, var(--scene-metal), #f8e1a7);
}

@keyframes cdeis3dFloat {
  0%, 100% {
    transform: translate3d(0, -4px, 0) rotateZ(0deg);
  }
  50% {
    transform: translate3d(0, 8px, 0) rotateZ(2deg);
  }
}

@media (min-width: 820px) {
  .cdeis-3d-host.has-cdeis-3d-scene {
    padding-right: clamp(240px, 30vw, 380px);
  }
}

@media (max-width: 819px) {
  .cdeis-3d-scene {
    position: relative;
    top: auto;
    right: auto;
    width: min(220px, 72vw);
    margin: 18px auto 0;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cdeis-3d-core {
    animation: none;
  }
}
