/* ==========================================================================
   Hero Slider - Dynamic Portal Effect & Rounded Floating Card
   ========================================================================== */

.portal-hero {
  position: relative;
  width: calc(100% - 2.5rem);
  max-width: 1440px;
  margin: 1.25rem auto 0 auto;
  border-radius: 2rem; /* Bordes redonditos */
  min-height: 520px;
  height: clamp(520px, 75vh, 680px);
  background-color: #00120b;
  overflow: hidden;
  perspective: 1200px;
  user-select: none;
  box-shadow: 0 20px 48px -10px rgba(1, 45, 29, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.portal-hero-stage {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 2rem;
  overflow: hidden;
  transform-style: preserve-3d;
}

.portal-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 2rem;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 500ms cubic-bezier(0.25, 1, 0.5, 1), visibility 500ms cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform;
}

.portal-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 10;
}

.portal-slide.is-entering {
  z-index: 20;
  opacity: 1;
  visibility: visible;
  animation: portalEnter 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portal-slide.is-leaving {
  z-index: 5;
  animation: portalLeave 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Continuous Ken Burns Zoom & Ambient Movement */
.portal-layer-bg {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  animation: kenBurnsContinuous 20s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes kenBurnsContinuous {
  0% {
    transform: scale(1) translate(0%, 0%);
  }
  33% {
    transform: scale(1.14) translate(-1.8%, -1.2%);
  }
  66% {
    transform: scale(1.06) translate(1.2%, 1.5%);
  }
  100% {
    transform: scale(1.18) translate(-1%, -0.8%);
  }
}

.portal-layer-aperture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 25%, rgba(1, 45, 29, 0.95) 100%);
  pointer-events: none;
  z-index: 2;
}

.portal-layer-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(1, 35, 23, 0.94) 0%, rgba(1, 35, 23, 0.78) 45%, rgba(1, 35, 23, 0.35) 100%);
  z-index: 3;
}

.portal-ring-mask {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120vw;
  height: 120vw;
  max-width: 1600px;
  max-height: 1600px;
  transform: translate(-50%, -50%) scale(0.2);
  border-radius: 50%;
  box-shadow: 0 0 120px 40px rgba(165, 208, 185, 0.35), inset 0 0 80px 20px rgba(165, 208, 185, 0.2);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.portal-slide.is-entering .portal-ring-mask {
  animation: ringPulse 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes portalEnter {
  0% {
    clip-path: circle(0% at 50% 50%);
    transform: scale(1.25) translateZ(200px);
    filter: brightness(1.5) contrast(1.1);
  }
  100% {
    clip-path: circle(150% at 50% 50%);
    transform: scale(1) translateZ(0);
    filter: brightness(1) contrast(1);
  }
}

@keyframes portalLeave {
  0% {
    transform: scale(1) translateZ(0);
    opacity: 1;
  }
  100% {
    transform: scale(0.85) translateZ(-300px);
    opacity: 0;
  }
}

@keyframes ringPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0;
  }
}

.portal-content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  pointer-events: none;
}

.portal-text-group {
  max-width: 640px;
  pointer-events: auto;
}

.portal-animate-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 450ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.portal-slide.is-active .portal-animate-item:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 100ms;
}

.portal-slide.is-active .portal-animate-item:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 180ms;
}

.portal-slide.is-active .portal-animate-item:nth-child(3) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 260ms;
}

.portal-slide.is-active .portal-animate-item:nth-child(4) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 340ms;
}

/* Navigation Overlays */
.portal-nav-bar {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  pointer-events: none;
}

.portal-progress-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  z-index: 60;
  pointer-events: auto;
}

.portal-progress-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 250ms ease;
  position: relative;
  z-index: 70;
  pointer-events: auto;
}

.portal-progress-item:hover,
.portal-progress-item.is-active {
  opacity: 1;
}

.portal-progress-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.05em;
}

.portal-progress-track {
  position: relative;
  width: 44px;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  overflow: hidden;
}

.portal-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background-color: #a5d0b9;
  border-radius: 99px;
  transition: width 100ms linear;
}

.portal-progress-item.is-active .portal-progress-fill {
  background-color: #b0f1cc;
}

.portal-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(1, 35, 23, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  position: relative;
  z-index: 60;
  pointer-events: auto;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.portal-counter {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0 0.4rem;
}

.portal-btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  position: relative;
  z-index: 70;
  pointer-events: auto;
  transition: all 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.portal-btn-arrow:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.12);
}

.portal-btn-arrow:active {
  transform: scale(0.92);
}

@media (prefers-reduced-motion: reduce) {
  .portal-layer-bg {
    animation: none !important;
  }
  .portal-slide.is-entering,
  .portal-slide.is-leaving {
    animation: none !important;
  }
  .portal-slide {
    transition: opacity 300ms ease !important;
  }
  .portal-animate-item {
    transition: opacity 250ms ease !important;
    transform: none !important;
  }
}

@media (max-width: 768px) {
  .portal-hero {
    width: calc(100% - 1rem);
    margin: 0.75rem auto 0 auto;
    border-radius: 1.5rem;
    min-height: 480px;
    height: 80vh;
  }
  .portal-hero-stage,
  .portal-slide {
    border-radius: 1.5rem;
  }
  .portal-content {
    padding: 1.5rem 1.25rem;
  }
  .portal-nav-bar {
    bottom: 1.25rem;
    padding: 0 1.25rem;
    flex-direction: column-reverse;
    gap: 1rem;
    align-items: flex-start;
  }
  .portal-progress-track {
    width: 28px;
  }
}