/* ============================================
   3D CUBE — Hero Element
   ============================================ */

.cube-scene {
  width: 264px;
  height: 264px;
  perspective: 800px;
  perspective-origin: 50% 50%;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: cubeFloat 24s ease-in-out infinite;
  transform: rotateX(-15deg) rotateY(0deg);
}

.cube__face {
  position: absolute;
  width: 264px;
  height: 264px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  text-align: center;
  padding: 1.5rem;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.10);
}

.cube__face-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.cube__face-title {
  font-size: 1.275rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Individuelle Seiten-Farben — satte Flaechen, weisse Schrift */
.cube__face--front .cube__face-label,
.cube__face--front .cube__face-title {
  color: #fff;
}
.cube__face--front {
  border-color: rgba(43, 94, 158, 0.3);
  background: #2B5E9E;
}

.cube__face--right .cube__face-label,
.cube__face--right .cube__face-title {
  color: #fff;
}
.cube__face--right {
  border-color: rgba(181, 52, 60, 0.3);
  background: #B5343C;
}

.cube__face--back .cube__face-label,
.cube__face--back .cube__face-title {
  color: #fff;
}
.cube__face--back {
  border-color: rgba(46, 139, 87, 0.3);
  background: #2E8B57;
}

.cube__face--left {
  border-color: #ffffff;
  background-color: #ffffff;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  justify-content: flex-end;
  padding-bottom: 2rem;
}

.cube__face-team {
  position: absolute;
  top: 8%;
  left: 10%;
  width: 80%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
  z-index: 1;
}

.cube__face-logo {
  max-width: 60%;
  max-height: 22%;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.cube__face--front  { transform: translateZ(132px); }
.cube__face--back   { transform: rotateY(180deg) translateZ(132px); }
.cube__face--right  { transform: rotateY(90deg) translateZ(132px); }
.cube__face--left   { transform: rotateY(-90deg) translateZ(132px); }
.cube__face--top    { transform: rotateX(90deg) translateZ(132px); }
.cube__face--bottom { transform: rotateX(-90deg) translateZ(132px); }

/* ============================================
   3D FALLING CUBES — Hero Background
   ============================================ */

#etti-cube-scene {
  position: absolute;
  inset: 0;
  perspective: 1400px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

#etti-cube-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(200,200,200,0.45) 100%);
  pointer-events: none;
  z-index: 1;
}

.etti-cube-wrap {
  position: absolute;
  top: -200px;
  transform-style: preserve-3d;
}

.etti-cube {
  position: relative;
  transform-style: preserve-3d;
  animation: ettiSpin linear infinite;
}

.etti-face {
  position: absolute;
}

@keyframes ettiFall {
  0%   { transform: translateY(-180px) translateX(0px); opacity: 0; }
  6%   { opacity: 1; }
  88%  { opacity: 0.88; }
  100% { transform: translateY(112vh) translateX(var(--drift)); opacity: 0; }
}

@keyframes ettiSpin {
  from { transform: rotateX(0deg)      rotateY(0deg)      rotateZ(0deg); }
  to   { transform: rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz)); }
}

/* Deckel + Unterseite: 4 Dreiecke laufen zur Mitte zusammen.
   Kanten in Seitenfarbe, kein weisser Border/Backdrop sichtbar.
   Top-Div (vor rotateX): oben=Back(Gruen), rechts=Right(Rot), unten=Front(Blau), links=Left(Weiss)
   Bottom-Div (vor rotateX): oben=Front(Blau), rechts=Right(Rot), unten=Back(Gruen), links=Left(Weiss) */
.cube__face--top,
.cube__face--bottom {
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.cube__face--top {
  background: conic-gradient(
    from 315deg at 50% 50%,
    #2E8B57 0deg 90deg,
    #B5343C 90deg 180deg,
    #2B5E9E 180deg 270deg,
    #ffffff 270deg 360deg
  );
}

.cube__face--bottom {
  background: conic-gradient(
    from 315deg at 50% 50%,
    #2B5E9E 0deg 90deg,
    #B5343C 90deg 180deg,
    #2E8B57 180deg 270deg,
    #ffffff 270deg 360deg
  );
}

@keyframes cubeFloat {
  0%, 100% {
    transform: rotateX(-15deg) rotateY(0deg);
  }
  20% {
    transform: rotateX(-18deg) rotateY(-90deg);
  }
  40% {
    transform: rotateX(-12deg) rotateY(-180deg);
  }
  60% {
    transform: rotateX(-20deg) rotateY(-270deg);
  }
  80% {
    transform: rotateX(-15deg) rotateY(-360deg);
  }
}

/* ============================================
   FLOATING MICRO-CUBES — CTA Background
   ============================================ */

.floating-cubes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.floating-cube {
  position: absolute;
  border: 1px solid rgba(43, 94, 158, 0.12);
  animation: float linear infinite;
  opacity: 0;
}

.floating-cube:nth-child(1) {
  width: 20px; height: 20px;
  top: 15%; left: 8%;
  animation-duration: 12s;
  animation-delay: 0s;
}
.floating-cube:nth-child(2) {
  width: 14px; height: 14px;
  top: 60%; left: 15%;
  animation-duration: 16s;
  animation-delay: 2s;
}
.floating-cube:nth-child(3) {
  width: 28px; height: 28px;
  top: 30%; right: 12%;
  animation-duration: 14s;
  animation-delay: 4s;
}
.floating-cube:nth-child(4) {
  width: 10px; height: 10px;
  top: 70%; right: 20%;
  animation-duration: 18s;
  animation-delay: 1s;
}
.floating-cube:nth-child(5) {
  width: 16px; height: 16px;
  top: 45%; left: 30%;
  animation-duration: 15s;
  animation-delay: 3s;
}
.floating-cube:nth-child(6) {
  width: 22px; height: 22px;
  top: 20%; right: 30%;
  animation-duration: 13s;
  animation-delay: 5s;
}
.floating-cube:nth-child(7) {
  width: 12px; height: 12px;
  bottom: 20%; left: 45%;
  animation-duration: 17s;
  animation-delay: 2.5s;
}
.floating-cube:nth-child(8) {
  width: 18px; height: 18px;
  top: 50%; right: 40%;
  animation-duration: 11s;
  animation-delay: 6s;
}

@keyframes float {
  0% {
    opacity: 0;
    transform: translateY(30px) rotate(0deg);
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) rotate(180deg);
  }
}

/* ============================================
   CUBE SERVICE ICONS (SVG-like with CSS)
   ============================================ */

.cube-icon {
  width: 56px;
  height: 56px;
  position: relative;
  margin-bottom: 1.5rem;
}

/* Arbeitsorganisation: Stacked cubes (structure) */
.cube-icon--org {
  display: grid;
  grid-template-columns: repeat(2, 22px);
  grid-template-rows: repeat(2, 22px);
  gap: 12px;
  transform: rotate(-5deg);
  transition: gap 0.8s ease;
}

.cube-icon--org span {
  border: 1.5px solid var(--color-primary);
  border-radius: 2px;
  transition: all 0.8s ease;
}

.service-card:hover .cube-icon--org {
  gap: 2px;
}

.service-card:hover .cube-icon--org span {
  background: rgba(43, 94, 158, 0.12);
}

/* Kommunikation: Two connected cubes */
.cube-icon--comm {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cube-icon--comm span:nth-child(1),
.cube-icon--comm span:nth-child(3) {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--color-secondary);
  border-radius: 2px;
  flex-shrink: 0;
  transition: all 0.8s ease;
}

.cube-icon--comm span:nth-child(2) {
  width: 12px;
  height: 1.5px;
  background: var(--color-secondary);
  flex-shrink: 0;
}

.service-card:hover .cube-icon--comm span:nth-child(1) { transform: translateX(6px); background: rgba(181, 52, 60, 0.1); }
.service-card:hover .cube-icon--comm span:nth-child(3) { transform: translateX(-6px); background: rgba(181, 52, 60, 0.1); }

/* Persoenlichkeitsentwicklung: Unfolding cube */
.cube-icon--dev {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.cube-icon--dev span:nth-child(1) {
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--color-tertiary);
  border-radius: 2px;
  transition: all 0.8s ease;
}

.cube-icon--dev span:nth-child(2) {
  display: flex;
  gap: 14px;
}

.cube-icon--dev span:nth-child(2)::before,
.cube-icon--dev span:nth-child(2)::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--color-tertiary);
  border-radius: 2px;
  display: block;
  transition: all 0.8s ease;
}

.service-card:hover .cube-icon--dev span:nth-child(1) {
  background: rgba(46, 139, 87, 0.1);
  transform: translateY(6px);
}

.service-card:hover .cube-icon--dev span:nth-child(2)::before {
  transform: translateX(5px);
  background: rgba(46, 139, 87, 0.1);
}

.service-card:hover .cube-icon--dev span:nth-child(2)::after {
  transform: translateX(-5px);
  background: rgba(46, 139, 87, 0.1);
}

/* ============================================
   RESPONSIVE CUBE
   ============================================ */
@media (max-width: 1024px) {
  .cube-scene {
    width: 192px;
    height: 192px;
  }

  .cube__face {
    width: 192px;
    height: 192px;
  }

  .cube__face--front  { transform: translateZ(96px); }
  .cube__face--back   { transform: rotateY(180deg) translateZ(96px); }
  .cube__face--right  { transform: rotateY(90deg) translateZ(96px); }
  .cube__face--left   { transform: rotateY(-90deg) translateZ(96px); }
  .cube__face--top    { transform: rotateX(90deg) translateZ(96px); }
  .cube__face--bottom { transform: rotateX(-90deg) translateZ(96px); }
}
