/* -----------------------------------------------------------------------
   10d. Carrossel circular 3D
   ----------------------------------------------------------------------- */

.team-carousel {
  --cc-card-w: 280px;
  --cc-radius: 368px;
  --cc-rotation: 0;
  --cc-tilt: -5deg;
  --cc-parallax-x: 0px;
  --cc-parallax-y: 0px;

  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
}

.cc-viewport {
  position: relative;
  height: calc(var(--cc-card-w) + 158px);
  perspective: 2500px;
  perspective-origin: 50% 44%;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  outline: none;
}

.cc-viewport.is-dragging {
  cursor: grabbing;
}

.cc-viewport:focus-visible {
  outline: 2px solid var(--color-aqua);
  outline-offset: 6px;
  border-radius: var(--radius-lg);
}

.cc-stage,
.cc-world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.cc-world {
  transform: translate3d(var(--cc-parallax-x), var(--cc-parallax-y), 0);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--cc-tilt)) rotateY(calc(var(--cc-rotation) * 1deg));
  transform-origin: 50% 50%;
  will-change: transform;
}

/* Cartão posicionado no cilindro */
.cc-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cc-card-w);
  height: var(--cc-card-w);
  margin-left: calc(var(--cc-card-w) / -2);
  margin-top: calc(var(--cc-card-w) / -2);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  transform-style: preserve-3d;
  transform: rotateY(calc(var(--cc-angle) * 1deg)) translateZ(var(--cc-radius));
  cursor: pointer;
  will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent;
}

.cc-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background-color: #01212e;
  box-shadow:
    0 18px 42px -18px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(247, 239, 226, 0.14);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.team-carousel:not(.is-intro) .cc-card__inner {
  opacity: 0;
  transform: translateY(46px) scale(0.96);
}

.team-carousel.is-intro .cc-card__inner {
  animation: cc-card-rise 0.85s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: var(--cc-delay, 0ms);
}

@keyframes cc-card-rise {
  from {
    opacity: 0;
    transform: translateY(46px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cc-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  pointer-events: none;
}

.cc-card__shade {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(0, 15, 22, 0.02) 0%,
      transparent 42%,
      rgba(0, 12, 18, 0.16) 72%,
      rgba(0, 8, 12, 0.58) 100%
    ),
    radial-gradient(ellipse at 50% 46%, transparent 46%, rgba(0, 10, 16, 0.42) 100%);
  box-shadow: inset 0 0 42px rgba(0, 10, 16, 0.6);
}

.cc-card.is-active .cc-card__inner {
  box-shadow:
    0 24px 54px -16px rgba(0, 0, 0, 0.92),
    0 0 0 1.5px rgba(0, 200, 196, 0.55),
    0 0 38px -8px rgba(0, 200, 196, 0.38);
}

.cc-card:focus-visible {
  outline: none;
}

.cc-card:focus-visible .cc-card__inner {
  outline: 2px solid var(--color-aqua);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .team-carousel.is-intro .cc-card:hover .cc-card__inner {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
      0 26px 56px -18px rgba(0, 0, 0, 0.9),
      0 0 0 1px rgba(0, 200, 196, 0.4);
  }
}

/* Navegação anterior / próxima */
.cc-nav {
  position: absolute;
  top: 50%;
  z-index: 20;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(247, 239, 226, 0.18);
  background-color: rgba(0, 27, 38, 0.72);
  color: var(--color-cream);
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.8);
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.cc-nav--prev { left: clamp(0.25rem, 2.2vw, 1.75rem); }
.cc-nav--next { right: clamp(0.25rem, 2.2vw, 1.75rem); }

.cc-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cc-nav:hover {
  background-color: rgba(0, 200, 196, 0.16);
  border-color: rgba(0, 200, 196, 0.5);
  color: var(--color-aqua);
}

.cc-nav:active {
  transform: translateY(-50%) scale(0.94);
}

/* Painel de perfil sincronizado */
.cc-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.4rem);
  width: fit-content;
  max-width: min(860px, 100%);
  margin: clamp(1.6rem, 3vw, 2.4rem) auto 0;
  padding: clamp(1rem, 2vw, 1.3rem) clamp(1.25rem, 3vw, 2.1rem);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(3, 60, 78, 0.58) 0%, rgba(1, 30, 42, 0.6) 100%);
  border: 1px solid rgba(0, 200, 196, 0.16);
  border-radius: 18px;
  box-shadow:
    0 18px 44px -24px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(247, 239, 226, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cc-profile__main {
  min-width: 0;
}

.cc-profile__name {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.85rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-cream);
  text-wrap: balance;
}

.cc-profile__role {
  margin-top: 0.28rem;
  font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1rem);
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-aqua);
}

.cc-profile__edu {
  flex-shrink: 0;
  max-width: 31ch;
  padding-left: clamp(1rem, 2.4vw, 2rem);
  border-left: 1px solid rgba(247, 239, 226, 0.12);
  font-size: clamp(0.82rem, 0.78rem + 0.15vw, 0.92rem);
  line-height: 1.5;
  color: var(--color-cream-muted);
}

.cc-profile__label {
  display: block;
  margin-bottom: 0.18rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-cream-dim);
}

/* Indicadores de posição */
.cc-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.1rem;
  margin-top: 1rem;
}

.cc-dot {
  position: relative;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.cc-dot::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background-color: rgba(247, 239, 226, 0.28);
  transform: translate(-50%, -50%);
  transition:
    width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.cc-dot:hover::before {
  background-color: rgba(247, 239, 226, 0.65);
}

.cc-dot.is-active::before {
  width: 20px;
  background-color: var(--color-turquoise);
  box-shadow: 0 0 10px rgba(0, 200, 196, 0.55);
}

.cc-dot:focus-visible {
  outline: 2px solid var(--color-aqua);
  outline-offset: 2px;
}

/* -----------------------------------------------------------------------
   10e. Responsividade do carrossel
   ----------------------------------------------------------------------- */

@media (max-width: 1023px) {
  .cc-profile {
    flex-wrap: wrap;
    row-gap: 0.85rem;
  }

  .cc-profile__edu {
    flex-basis: 100%;
    max-width: none;
    padding-left: 0;
    padding-top: 0.85rem;
    border-left: 0;
    border-top: 1px solid rgba(247, 239, 226, 0.12);
    text-align: center;
  }
}

@media (max-width: 767px) {
  .cc-viewport {
    height: calc(var(--cc-card-w) + 130px);
  }

  .cc-viewport::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background: linear-gradient(
      90deg,
      rgba(1, 28, 40, 0.82) 0%,
      transparent 11%,
      transparent 89%,
      rgba(1, 28, 40, 0.82) 100%
    );
  }

  .cc-nav {
    width: 40px;
    height: 40px;
  }

  .cc-nav svg {
    width: 18px;
    height: 18px;
  }

  .cc-profile {
    flex-direction: column;
    gap: 0.7rem;
    width: 100%;
    max-width: 460px;
    padding: 1.1rem 1.25rem 1.25rem;
    text-align: center;
  }

  .cc-profile__edu {
    flex-basis: auto;
    padding-top: 0.7rem;
  }
}

@media (max-width: 479px) {
  .cc-nav {
    width: 36px;
    height: 36px;
  }

  .cc-nav--prev { left: 0; }
  .cc-nav--next { right: 0; }

  .cc-profile__name {
    font-size: 1.3rem;
  }
}
