/* ========================================
   Home Page Styles - Bold Creative Design
   ======================================== */

/* Construction Banner */
.construction-banner {
  background: var(--gradient-orange);
  color: white;
  padding: 12px 0;
  text-align: center;
  position: relative;
  z-index: 999;
  box-shadow: var(--shadow-sm);
}

.construction-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}

.construction-icon {
  font-size: 1.2rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Hero Section with Animated Gradient */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

/* Animated gradient background - left side */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 25%, #FFD700 50%, #FF6B35 75%, #F7931E 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  clip-path: polygon(0 0, 100% 0, 80% 100%, 0% 100%);
  z-index: 1;
}

/* Animated gradient background - right side */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 25%, #0093E9 50%, #4ECDC4 75%, #44A08D 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite reverse;
  clip-path: polygon(20% 0, 100% 0, 100% 100%, 0% 100%);
  z-index: 1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floating particles */
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  pointer-events: none;
  bottom: 0;
  animation: float 20s infinite;
  z-index: 2;
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(50px);
    opacity: 0;
  }
}

.hero-content {
  text-align: center;
  z-index: 10;
  max-width: 1000px;
  padding: 40px;
  position: relative;
}

.hero-title {
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 900;
  line-height: 0.9;
  margin-bottom: 20px;
  text-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

.hero-title span {
  display: block;
}

.word-trigo {
  color: var(--orange-primary);
  animation: slideInLeft 1s ease-out;
}

.word-digital {
  color: var(--teal-primary);
  animation: slideInRight 1s ease-out;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 300;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeIn 1s ease-out 0.5s forwards;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-cta {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeIn 1s ease-out 0.8s forwards;
}

/* Services Section */
.services {
  background: var(--bg-dark);
  padding: var(--section-padding) 0;
  position: relative;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px;
  max-width: 900px;
  margin: 0 auto;
}

/* Shape card with flip */
.shape-card {
  perspective: 1000px;
  height: 450px;
  cursor: pointer;
}

.shape-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.shape-card:hover .shape-card-inner {
  transform: rotateY(180deg);
}

.shape-card-front,
.shape-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shape-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.morphing-shape {
  width: 350px;
  height: 350px;
  background: var(--gradient-orange);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: morph 8s ease-in-out infinite;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(255, 107, 53, 0.4);
}

.shape-card:nth-child(2) .morphing-shape {
  background: var(--gradient-teal);
  box-shadow: 0 20px 60px rgba(78, 205, 196, 0.4);
  animation-delay: 1s;
}

.shape-card:nth-child(3) .morphing-shape {
  background: var(--gradient-purple);
  box-shadow: 0 20px 60px rgba(157, 80, 187, 0.4);
  animation-delay: 2s;
}

.shape-card:nth-child(4) .morphing-shape {
  background: var(--gradient-yellow);
  box-shadow: 0 20px 60px rgba(247, 151, 30, 0.4);
  animation-delay: 3s;
}

@keyframes morph {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  50% {
    border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
  }
  75% {
    border-radius: 40% 60% 60% 40% / 60% 50% 50% 60%;
  }
}

.shape-content {
  text-align: center;
  padding: 40px;
  z-index: 10;
}

.shape-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.shape-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.shape-description {
  font-size: 1rem;
  opacity: 0.95;
  line-height: 1.5;
}

/* Back side */
.shape-card-back {
  transform: rotateY(180deg);
}

.back-shape {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, var(--bg-card) 0%, #2d2d2d 100%);
  border-radius: 20px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 2px solid var(--orange-primary);
  box-shadow: var(--shadow-lg);
}

.shape-card:nth-child(2) .back-shape {
  border-color: var(--teal-primary);
}

.shape-card:nth-child(3) .back-shape {
  border-color: var(--purple-primary);
}

.shape-card:nth-child(4) .back-shape {
  border-color: var(--yellow-primary);
}

.back-title {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--orange-primary);
}

.shape-card:nth-child(2) .back-title {
  color: var(--teal-primary);
}

.shape-card:nth-child(3) .back-title {
  color: var(--purple-primary);
}

.shape-card:nth-child(4) .back-title {
  color: var(--yellow-primary);
}

.back-list {
  list-style: none;
  padding: 0;
}

.back-list li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
  position: relative;
  padding-left: 20px;
}

.back-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--orange-primary);
}

.shape-card:nth-child(2) .back-list li::before {
  color: var(--teal-primary);
}

.shape-card:nth-child(3) .back-list li::before {
  color: var(--purple-primary);
}

.shape-card:nth-child(4) .back-list li::before {
  color: var(--yellow-primary);
}

.back-list li:last-child {
  border-bottom: none;
}

.services-hint {
  text-align: center;
  margin-top: 60px;
  font-size: 0.9rem;
  opacity: 0.5;
  font-style: italic;
}

/* About & Contact Sections */
.about-section,
.contact-section {
  padding: var(--section-padding) 0;
  background: var(--bg-darker);
}

.about-content,
.contact-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.about-content h2,
.contact-content h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  margin-bottom: 24px;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-content p,
.contact-content p {
  font-size: 1.2rem;
  line-height: 1.8;
  opacity: 0.9;
  margin-bottom: 20px;
}

.about-cta,
.contact-cta {
  margin-top: 40px;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
  .hero::before,
  .hero::after {
    clip-path: none;
    width: 100%;
  }
  
  .hero::before {
    height: 50%;
  }
  
  .hero::after {
    height: 50%;
    top: 50%;
  }

  /* Tighten the section padding so it doesn't feel empty */
  .services {
    padding: 60px 0;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* On mobile: stack front/back vertically instead of 3D flip.
     iOS Safari doesn't reliably support preserve-3d + backface-visibility,
     causing both faces to render simultaneously and overlap. */
  .shape-card {
    height: auto;
    perspective: none;
    cursor: default;
  }

  .shape-card-inner {
    transform-style: flat;
    transition: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  /* Disable hover flip on mobile */
  .shape-card:hover .shape-card-inner {
    transform: none;
  }

  .shape-card-front,
  .shape-card-back {
    position: static;
    width: 100%;
    height: auto;
    backface-visibility: visible;
    display: flex;
    justify-content: center;
  }

  .shape-container {
    height: auto;
  }

  .morphing-shape {
    width: 240px;
    height: 240px;
    /* Pause animation to reduce mobile GPU load */
    animation-play-state: paused;
  }

  .shape-content {
    padding: 24px;
  }

  .shape-icon {
    font-size: 3rem;
    margin-bottom: 12px;
  }

  .shape-title {
    font-size: 1.5rem;
  }

  /* Back card visible below the shape on mobile */
  .shape-card-back {
    transform: none;
  }

  .back-shape {
    width: 100%;
    max-width: 340px;
    height: auto;
    padding: 28px 24px;
  }

  .back-title {
    font-size: 1.4rem;
    margin-bottom: 14px;
  }

  .back-list li {
    padding: 8px 0 8px 20px;
    font-size: 0.9rem;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  
  .about-cta,
  .contact-cta {
    flex-direction: column;
    align-items: stretch;
  }
}
