/* ================================================================
   SERVICIOS INDUSTRIALES MyM — Design System
   Palette: #FACC15 #020617 #EAB308 #F8FAFC #0B0F19
   Fonts:  Clash Display (headings) + Satoshi (body)
   ================================================================ */

/* ---------- BASE ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  background: #020617;
  color: #F8FAFC;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Improve image rendering globally */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  font-style: italic; /* for alt text */
  max-width: 100%;
  height: auto;
}

/* Specific fix for high-DPI canvas visually */
canvas {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ---------- FOCUS ---------- */
*:focus-visible {
  outline: 2px solid #FACC15;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- NAV LINKS ---------- */
.nav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #94A3B8;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: #EAB308;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: #EAB308;
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* ---------- BUTTONS ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #EAB308;
  color: #020617;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(234, 179, 8, 0.25);
}

.btn-primary:hover {
  background: #FACC15;
  color: #000;
  box-shadow: 0 8px 30px rgba(250, 204, 21, 0.4);
  transform: translateY(-2px);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 24px rgba(37, 211, 102, 0.25);
}

.btn-whatsapp:hover {
  background: #20BD5A;
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.35);
  transform: translateY(-2px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid rgba(234, 179, 8, 0.4);
  color: #EAB308;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.3s;
}

.btn-ghost:hover {
  border-color: #FACC15;
  color: #020617;
  background: #FACC15;
  transform: translateY(-2px);
}

/* ---------- SECTION LABEL ---------- */
.section-label {
  display: inline-block;
  color: #EAB308;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ---------- HERO SLIDESHOW ---------- */
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 2s ease-in-out;
  will-change: opacity;
  transform: scale(1.05);
}

.hero-slide.active {
  opacity: 1;
  animation: heroZoom 8s ease-in-out forwards;
}

@keyframes heroZoom {
  0% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* ---------- ANIMATIONS ---------- */
.anim-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease-out 0.1s forwards;
}

.anim-up-d1 {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease-out 0.25s forwards;
}

.anim-up-d2 {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease-out 0.4s forwards;
}

.anim-up-d3 {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease-out 0.55s forwards;
}

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

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ---------- TRUST STRIP ---------- */
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  color: rgba(248, 250, 252, 0.8);
}

/* ---------- SERVICE CARDS ---------- */
.service-card {
  display: block;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  height: 380px;
  text-decoration: none;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover {
  transform: translateY(-6px);
}

.service-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover .service-card-img {
  transform: scale(1.06);
}

.service-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.6) 40%, rgba(2, 6, 23, 0.1) 100%);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: background 0.4s;
}

.service-card:hover .service-card-overlay {
  background: linear-gradient(to top, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.7) 50%, rgba(2, 6, 23, 0.2) 100%);
}

.service-card-number {
  font-family: "Clash Display", Georgia, serif;
  font-size: 48px;
  font-weight: 700;
  color: rgba(234, 179, 8, 0.15);
  position: absolute;
  top: 24px;
  left: 28px;
  line-height: 1;
}

/* ---------- STEP NUMBER ---------- */
.step-number {
  width: 64px;
  height: 64px;
  background: rgba(234, 179, 8, 0.12);
  border: 2px solid #EAB308;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Clash Display", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: #FACC15;
  margin: 0 auto 20px;
}

/* ---------- DIFF ITEM ---------- */
.diff-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.diff-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #EAB308;
}

/* ---------- MOBILE MENU (SIMPLE FULLSCREEN) ---------- */
.mobile-menu {
  position: fixed;
  top: 64px; /* Start right below the header */
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.98); /* mym-dark with opacity */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 48;
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  pointer-events: none;
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 20px;
  gap: 24px;
  flex: 1;
}

.mobile-link {
  font-size: 1.5rem;
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
  text-align: center;
}

.mobile-link.active, .mobile-link:hover {
  color: #FACC15; /* mym-teal */
}

.mobile-menu-footer {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ---------- HEADER SHRUNK ---------- */
.header-scrolled {
  background: rgba(7, 9, 26, 0.97) !important;
  backdrop-filter: blur(24px) saturate(150%) !important;
  border-bottom-color: rgba(234, 179, 8, 0.12) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
}

/* ---------- FAQ ---------- */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-answer.open {
  max-height: 600px;
}

.faq-chevron {
  transition: transform 0.3s ease;
}

.faq-chevron.rotated {
  transform: rotate(180deg);
}

/* ---------- FORM STATES ---------- */
.field-error {
  border-color: #EF4444 !important;
}

.field-valid {
  border-color: #22C55E !important;
}

/* ---------- GALLERY ---------- */
.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(27, 33, 38, 0.5) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* ---------- ABOUT TIMELINE ---------- */
.timeline-line {
  position: absolute;
  left: 23px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #EAB308, transparent);
}

.timeline-dot {
  width: 12px;
  height: 12px;
  background: #FACC15;
  border: 3px solid #0B0F19;
  border-radius: 50%;
  position: absolute;
  left: 18px;
  top: 6px;
}

/* ---------- RESPONSIVE: service cards mobile ---------- */
@media (max-width: 767px) {
  .service-card {
    height: 320px;
  }
}

/* ---------- HERO SCROLLYTELLING ---------- */
#hero {
  background-color: #0e1216;
}

#hero-sticky {
  box-shadow: inset 0 0 150px rgba(0,0,0,0.8);
}

#hero-canvas {
  will-change: transform, opacity;
  transform: translateZ(0);
}

/* Glassmorphism for UI elements */
.glass-ui {
  background: rgba(30, 38, 44, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Section label enhancement */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #EAB308;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.section-label::before {
  content: '';
  width: 30px;
  height: 2px;
  background: currentColor;
  opacity: 0.4;
}

/* Custom animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Cinematic text styles */
.text-glow {
  text-shadow: 0 0 30px rgba(108, 167, 185, 0.3);
}

/* Mobile adjustments */
@media (max-width: 1024px) {
  #hero-start-content .max-w-2xl {
    text-align: center;
    margin: 0 auto;
  }
  #hero-start-content .max-w-2xl .flex {
    justify-content: center;
  }
  #hero-start-content .max-w-2xl img {
    margin: 0 auto;
  }
}

/* Responsive fixes for end content */
@media (max-width: 768px) {
  #hero-end-content .max-w-xl {
    text-align: center;
    margin: 0 auto;
  }
  #hero-end-content .text-right {
    text-align: center !important;
  }
  #hero-end-content .grid {
    grid-cols: 1;
    text-align: center;
  }
  #hero-end-content .ml-auto {
    margin-right: auto !important;
  }
}

/* ============================================================ */
/* NEW ANIMATIONS & MODAL EFFECTS                               */
/* ============================================================ */

/* Image Floating Animation */
@keyframes floatY {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0px); }
}

.animate-floating {
  animation: floatY 6s ease-in-out infinite;
}

/* Image Hover Zoom for Clickable Images */
.hover-zoom-img {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  cursor: zoom-in;
}

.hover-zoom-img:hover {
  transform: scale(1.04);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  border-color: rgba(234, 179, 8, 0.4); /* Tailwind yellow-500 equivalent */
  z-index: 20;
}

/* Modal specific body lock */
.modal-open {
  overflow: hidden;
}