/* ========================================= */
/*  1. BASE & RESET                          */
/* ========================================= */
body {
  font-family: "Poppins", sans-serif;
}

.font-display {
  font-family: "Poppins", sans-serif;
}

/* ========================================= */
/*  2. GLOBAL ANIMATIONS                     */
/* ========================================= */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-up {
  animation: fade-in-up 0.6s ease-out forwards;
}

.shake-animation {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

/* ========================================= */
/*  3. UTILITIES                             */
/* ========================================= */
.hidden {
  display: none !important;
}

.hide-scroll::-webkit-scrollbar {
  display: none;
}

.hide-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.input-error {
  border-color: #ef4444 !important;
  color: #dc2626 !important;
}

/* Colors */
.text-green {
  color: #22c55e;
}

.bg-blue-100 {
  background-color: #dbeafe;
}

.bg-blue-200 {
  background-color: #bfdbfe;
}

.bg-slate-100 {
  background-color: #f1f5f9;
}

.bg-slate-200 {
  background-color: #e2e8f0;
}

.icon-box {
  padding: 0.5rem;
  border-radius: 0.25rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-blue {
  background-color: #2563eb;
}

.icon-gray {
  background-color: #cbd5e1;
}

/* Skeletons */
.skeleton-bar {
  border-radius: 0.25rem;
}

.sk-long {
  height: 0.5rem;
  width: 6rem;
  margin-bottom: 0.25rem;
}

.sk-short {
  height: 0.5rem;
  width: 4rem;
}

/* Status Dots */
.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
}

.dot-red {
  background-color: #f87171;
}

.dot-yellow {
  background-color: #facc15;
}

.dot-green {
  background-color: #4ade80;
}

.status-text {
  font-family: monospace;
  font-size: 10px;
  color: #94a3b8;
}

/* ========================================= */
/*  4. NAVBAR & MENU                         */
/* ========================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5rem;
  background-color: rgba(15, 23, 42, 0.8);
  /* Dark Glass */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 40;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
}

.brand-logo {
  margin-right: auto;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  cursor: pointer;
  color: #f8fafc;
}

.brand-logo img {
  transition: all 0.3s ease;
  filter: brightness(0) invert(1);
}

.brand-logo:hover img {
  transform: scale(1.05);
}

.brand-highlight {
  color: #2563eb;
}

.desktop-menu {
  display: flex;
  gap: 2rem;
  margin-right: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
}

.nav-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #f97316;
}

.btn-primary {
  padding: 0.625rem 1.25rem;
  background-color: #0f172a;
  margin-left: auto;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  display: none;
  border-radius: 1rem;
}

.btn-primary:hover {
  background-color: #1e293b;
}

/* Mobile Menu */
.btn-mobile-toggle {
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background-color: white;
  padding-top: 6rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-overlay:not(.hidden) {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-link {
  font-size: 1.5rem;
  font-weight: 500;
  color: #0f172a;
  text-decoration: none;
}

@media (min-width: 768px) {
  .desktop-menu {
    display: flex;
  }

  .btn-mobile-toggle {
    display: none;
    margin-left: auto;
    color: #cbd5e1;
  }

  .mobile-overlay {
    display: none !important;
  }

  .btn-primary {
    display: block;
  }
}

/* ========================================= */
/*  5. HEADER SECTION                        */
/* ========================================= */
.aws-gradient {
  position: relative;
  background-color: #0f172a;
  overflow: hidden;
}

.aws-gradient::before {
  content: "";
  position: absolute;
  inset: -100%;
  will-change: transform;
  background: radial-gradient(circle at 20% 30%, #ff0080 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, #4f46e5 0%, transparent 50%),
    radial-gradient(circle at 40% 70%, #7c3aed 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, #ec4899 0%, transparent 50%),
    radial-gradient(circle at 10% 85%, #f97316 0%, transparent 50%);
  filter: blur(60px);
  opacity: 0.7;
  z-index: 0;
  animation: meshMovement 60s ease-in-out infinite alternate;
}

@keyframes meshMovement {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }

  33% {
    transform: translate(5%, -5%) scale(1.1) rotate(2deg);
  }

  66% {
    transform: translate(-5%, 5%) scale(0.9) rotate(-2deg);
  }

  100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
}

.aws-gradient>* {
  position: relative;
  z-index: 10;
}

.headline {
  font-size: 2rem;
  font-weight: 700;
  color: rgb(0, 0, 0);
  overflow: hidden;
  height: 1.4em;
  display: inline-block;
}

.rotating-word {
  display: inline-block;
  white-space: nowrap;
  line-height: 1.2em;
  position: relative;
}

.word {
  display: inline-block;
  white-space: pre;
}

/* Header Carousel Premium */
.carousel-container {
  position: absolute;
  top: 55%;
  right: 2%;
  /* Más cerca del borde para dar aire al texto */
  width: 750px;
  /* ¡Más grande! */
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 0 50px rgba(0, 242, 255, 0.15));
  /* Aura cian premium */
  animation: float-device 6s ease-in-out infinite;
  /* Levitación suave */
}

@keyframes float-device {

  0%,
  100% {
    transform: translateY(-50%) perspective(1000px) rotateY(-12deg);
  }

  50% {
    transform: translateY(-53%) perspective(1000px) rotateY(-12deg);
  }
}

@media (max-width: 1024px) {
  .carousel-container {
    display: none;
    /* Oculto en móviles para evitar colisiones con el texto */
  }
}

.carousel-slide {
  position: absolute;
  width: 100%;
  height: auto;
  border-radius: 20px;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 1.2s ease-in-out, transform 1.2s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 10;
}

/* ========================================= */
/*  6. SERVICES (FLIP CARDS)                 */
/* ========================================= */
.carta-contenedor {
  perspective: 1000px;
  width: 100%;
  height: 400px;
  position: relative;
}

.girar-carta {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carta-contenedor:hover .girar-carta {
  transform: rotateY(180deg);
}

.girar-carta-frente,
.girar-carta-dorso {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.girar-carta-frente {
  background-color: #ffffff;
  color: #333;
  z-index: 2;
  position: relative;
}

.girar-carta-frente img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: brightness(70%);
}

.girar-carta-frente .carta-texto-frente {
  position: relative;
  z-index: 2;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  border-radius: 5px;
  text-align: center;
}

.girar-carta-dorso {
  background-color: #000000;
  color: white;
  transform: rotateY(180deg);
}

.girar-carta-dorso .carta-texto-dorso {
  padding: 10px;
  text-align: center;
}

/* ========================================= */
/*  7. CASES (STACKED CARDS)                 */
/* ========================================= */
.cases-animated {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100vh;
  background: white;
}

/* Gradient Border for Cards (Replacing border-t-4) */
.card-gradient-border {
  position: relative;
}

.card-gradient-border::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #7c3aed 0%, #f97316 100%);
  z-index: 10;
}

/* Stacked Sticky Effect (Desktop only) */
@media (min-width: 1024px) {
  .sticky-card {
    position: sticky;
    top: 6rem;
    box-shadow: 0 -25px 50px -12px rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    /* Fix for GSAP fighting with Tailwind transitions */
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
  }

  .sticky-card:nth-child(1) {
    top: 6rem;
  }

  .sticky-card:nth-child(2) {
    top: 7rem;
  }

  .sticky-card:nth-child(3) {
    top: 8rem;
  }
}

/* Text & Video Panels */
.text-wrap,
.p-wrap {
  position: relative;
  overflow: hidden;
  height: 75vh;
  flex: 1;
}

.text-wrap {
  width: 420px;
}

.p-wrap {
  width: 45%;
}

.block {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.block video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Panel Text */
.panel-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  position: absolute;
  inset: 0;
  text-align: left;
  padding: 40px 25px;
  transform: translateY(100%);
  opacity: 0;
  cursor: pointer;
  transition: color 0.3s ease;
}

.panel-text-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  transform: translateY(-8%);
}

.panel-text .case-kicker {
  font-size: 12px;
  font-weight: bold;
  color: #94a3b8;
  letter-spacing: 2px;
}

.panel-text .case-title {
  font-size: 48px;
  font-weight: 700;
  color: #0f172a;
}

.panel-text .case-subtitle {
  font-size: 20px;
  font-weight: 400;
  margin-top: 10px;
  color: #64748b;
  transition: all 0.3s ease;
}

.panel-text .case-cta {
  margin-top: 20px;
  font-weight: bold;
  font-size: 14px;
  color: #0f172a;
  transition: all 0.3s ease;
}

/* Hover Effects */
.panel-text:hover .case-title {
  color: #2563eb;
}

.panel-text:hover .case-subtitle {
  transform: translateY(-2px);
}

.panel-text:hover .case-cta {
  color: #2563eb;
  transform: translateX(4px);
}

/* ========================================= */
/*  8. CASE STUDY MODAL                      */
/* ========================================= */
.modal-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

#modal-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  color: white;
  box-sizing: border-box;
  background-color: #1e3a8a;
  transition: background-color 0.3s ease;
}

#modal-sidebar span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-bottom: 0.5rem;
  display: block;
  font-family: sans-serif;
}

#modal-client {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  line-height: 1.2;
  font-family: sans-serif;
}

.tech-tag {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-family: monospace;
  width: max-content;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .modal-body {
    flex-direction: row;
    align-items: stretch;
  }

  #modal-sidebar {
    width: 33.3333%;
    height: auto;
    min-height: 100%;
  }
}

/* ========================================= */
/*  9. FOOTER & OTHER CARDS                  */
/* ========================================= */
.footer-content {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-family: monospace;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
}

.card-footer {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid #f8fafc;
  padding-bottom: 1rem;
}

.window-controls {
  display: flex;
  gap: 0.5rem;
}

.main-content {
  padding-top: 8rem;
  display: flex;
  justify-content: center;
  padding-bottom: 4rem;
}

.card-container {
  display: none;
  perspective: 1000px;
}

.card-3d {
  position: relative;
  width: 24rem;
  height: 24rem;
  background-color: rgb(0, 0, 0);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid #f1f5f9;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: rotateY(12deg) rotateX(6deg);
  transition: transform 700ms;
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: rotate(0deg);
}

.item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.item-active {
  background-color: #eff6ff;
  border-color: #dbeafe;
}

.item-inactive {
  background-color: #f8fafc;
  border-color: #f1f5f9;
  opacity: 0.5;
}

@media (min-width: 1024px) {
  .card-container {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}