/* ========================================
   SECTION-SPECIFIC STYLES
   Hero, Intro, Services, Tech, Testimonials, Contact, Footer
   ======================================== */

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 24px 40px; /* Reducido padding */
  overflow: hidden;
  width: 100%;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(150, 175, 2, 0.15) 0%,
    rgba(11, 11, 11, 1) 70%
  );
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  opacity: 1;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 11, 11, 0.2) 0%, rgba(11, 11, 11, 0.9) 65%);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.6;
  transition: transform 0.3s ease-out;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  text-align: center;
  padding-top: 20px;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px; /* Espaciado consistente entre elementos */
}

.hero__content h1 {
  font-size: clamp(2rem, 3.5vw, 3.2rem); /* Reducido */
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0;
  line-height: 1.2;
}

.hero__content p {
  color: var(--color-muted);
  font-size: clamp(0.95rem, 1.5vw, 1.05rem); /* Reducido */
  margin-bottom: 0;
  line-height: 1.4;
}

.hero__actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Forzar 3 columnas */
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* ========================================
   INTRO SECTION
   ======================================== */

.intro__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Forzar 3 columnas en desktop */
  gap: 20px; /* Reducido de 24px */
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ========================================
   SERVICES SECTION
   ======================================== */

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ========================================
   TECHNOLOGIES SECTION
   ======================================== */

.technologies {
  overflow: hidden;
  padding-top: 40px !important; /* Reducir espacio superior */
  padding-bottom: 60px; /* Espacio de respiro inferior */
  width: 100%;
}

.technologies .section__heading {
  margin-bottom: 24px; /* Reducir espacio entre heading y contenido */
}

.tech-marquee {
  position: relative;
  border-radius: 28px;
  border: 1px solid rgba(150, 175, 2, 0.28);
  background: rgba(20, 20, 20, 0.8);
  padding: 20px 0; /* Reducido de 28px a 20px */
  max-width: 960px;
  margin: 0 auto 24px; /* Reducido de 32px a 24px */
  overflow: hidden;
}

.tech-marquee::after,
.tech-marquee::before {
  content: "";
  position: absolute;
  top: 0;
  width: 120px;
  height: 100%;
  z-index: 2;
}

.tech-marquee::before {
  left: 0;
  background: linear-gradient(90deg, #141414, transparent);
}

.tech-marquee::after {
  right: 0;
  background: linear-gradient(-90deg, #141414, transparent);
}

.tech-marquee__track {
  display: flex;
  gap: 48px;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-muted);
  white-space: nowrap;
  animation: marquee 22s linear infinite;
}

.tech-marquee__track span {
  letter-spacing: 0.08em;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: var(--max-width);
  margin: 12px auto 0; /* Reducido de 18px a 12px */
  padding-bottom: 20px; /* Espacio adicional debajo del grid */
}

.tech-category {
  background: rgba(18, 18, 18, 0.6);
  border: 1px solid rgba(150, 175, 2, 0.15);
  border-radius: 16px;
  padding: 14px;
}

.tech-category h3 {
  font-size: 1rem;
  color: var(--color-primary);
  margin-bottom: 10px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
}

.tech-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  background: rgba(11, 11, 11, 0.4);
  border: 1px solid rgba(150, 175, 2, 0.1);
  border-radius: 10px;
  transition: all var(--transition-base);
}

.tech-item:hover {
  background: rgba(150, 175, 2, 0.08);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(150, 175, 2, 0.15);
}

.tech-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0.9) contrast(1.1);
  transition: all var(--transition-base);
}

.tech-item:hover .tech-logo {
  filter: brightness(1.1) contrast(1.2);
  transform: scale(1.1);
}

/* Fallback para iconos emoji (deprecado) */
.tech-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.tech-item span {
  font-size: 0.7rem;
  color: var(--color-muted);
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tech-item:hover span {
  color: var(--color-text);
}

/* ========================================
   CLIENTS SECTION
   ======================================== */

.clients {
  padding: 80px 24px;
  background: rgba(150, 175, 2, 0.03);
}

.clients__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: rgba(11, 11, 11, 0.5);
  border: 1px solid rgba(150, 175, 2, 0.15);
  border-radius: 12px;
  transition: all var(--transition-base);
  cursor: default;
  min-height: 120px;
}

.client-logo img {
  max-width: 100%;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%) brightness(0.8) opacity(0.7);
  transition: all var(--transition-base);
}

.client-logo:hover img {
  filter: grayscale(0%) brightness(1) opacity(1);
  transform: scale(1.05);
}

.client-logo--text span {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(244, 244, 244, 0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition-base);
}

.client-logo:hover {
  border-color: var(--color-primary);
  background: rgba(150, 175, 2, 0.08);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(150, 175, 2, 0.15);
}

.client-logo--text:hover span {
  color: var(--color-primary);
}

/* ========================================
   TESTIMONIALS SECTION
   ======================================== */

.testimonials__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ========================================
   CONTACT SECTION
   ======================================== */

.contact {
  background: linear-gradient(160deg, rgba(150, 175, 2, 0.12), rgba(11, 11, 11, 0.95));
  min-height: auto; /* No fullscreen para permitir ver el footer */
  padding: 80px 24px 120px; /* Padding extra abajo */
}

.contact__cta {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.contact__cta h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  color: var(--color-text);
}

.contact__cta p {
  color: var(--color-muted);
  font-size: 1.1rem;
  max-width: 650px;
  line-height: 1.6;
}

.contact__actions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.btn--large {
  padding: 16px 32px;
  font-size: 1.05rem;
}

.contact__quick-info {
  display: flex;
  gap: 32px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.quick-info-item .icon {
  font-size: 1.3rem;
}

/* ========================================
   MODAL
   ======================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.modal__content {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 15, 15, 0.98), rgba(11, 11, 11, 0.98));
  border: 1px solid rgba(150, 175, 2, 0.3);
  border-radius: 20px;
  padding: 40px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all var(--transition-base);
}

.modal__close:hover {
  background: rgba(150, 175, 2, 0.15);
  color: var(--color-primary);
  transform: rotate(90deg);
}

.modal__header {
  margin-bottom: 32px;
  padding-right: 40px;
}

.modal__header h2 {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  margin-bottom: 8px;
  color: var(--color-text);
}

.modal__header p {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Form Styles */
.contact__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 14px 16px;
  background: rgba(244, 244, 244, 0.05);
  border: 1px solid rgba(150, 175, 2, 0.25);
  border-radius: 8px;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition-base);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2396af02' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  cursor: pointer;
}

.form-group select option {
  background: #0b0b0b;
  color: var(--color-text);
  padding: 12px 16px;
}

.form-group select option:hover,
.form-group select option:checked {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-secondary));
  color: #0b0b0b;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(150, 175, 2, 0.08);
  box-shadow: 0 0 0 3px rgba(150, 175, 2, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(244, 244, 244, 0.4);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.btn--full {
  width: 100%;
  grid-column: 1 / -1;
  margin-top: 8px;
}

@media (max-width: 968px) {
  .contact__content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 640px) {
  .contact__form {
    grid-template-columns: 1fr;
    padding: 24px;
  }
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  min-height: 100vh; /* Fullscreen para scroll snap */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 24px;
  background: #050505;
  border-top: 1px solid rgba(150, 175, 2, 0.18);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  scroll-snap-align: none; /* Disabled by default - JS will enable on desktop if needed */
  /* Prevent auto-scroll to footer on load */
  scroll-margin-top: 0;
  position: relative;
}

.footer__content {
  max-width: var(--max-width);
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer__brand img {
  width: 62px;
  opacity: 0.7;
}

.footer__brand span {
  display: block;
  color: rgba(244, 244, 244, 0.55);
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--color-muted);
}

.footer__links a:hover {
  color: var(--color-primary);
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablet & Large Mobile */
@media (max-width: 768px) {
  .hero {
    padding: 50px 16px 30px;
  }

  .hero__content {
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 16px;
  }

  .hero__content h1 {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
  }

  .hero__content p {
    font-size: clamp(0.9rem, 2vw, 1rem);
  }

  .hero__actions {
    gap: 10px;
    flex-direction: column;
    width: 100%;
    align-items: center;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 300px;
  }

  .hero__metrics {
    grid-template-columns: 1fr; /* Una columna en mobile */
    gap: 10px;
    max-width: 100%;
  }

  /* Intro section */
  .intro__grid {
    grid-template-columns: 1fr; /* Una columna en mobile */
    gap: 14px;
  }

  .intro__card {
    padding: 18px 16px;
  }

  .intro__card h3 {
    font-size: 1.1rem;
  }

  .intro__card p {
    font-size: 0.9rem;
  }

  /* Services section */
  .services__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Technologies section */
  .technologies {
    padding-bottom: 40px; /* Más espacio en mobile */
  }

  .tech-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: 0; /* Remover en mobile, el padre ya tiene */
  }

  .tech-category {
    padding: 16px;
  }

  .tech-items {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
  }

  /* Testimonials section */
  .testimonials__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Contact section */
  .contact {
    padding: 60px 16px 60px; /* Menos padding en mobile */
  }

  .contact__actions {
    flex-direction: column;
    width: 100%;
  }

  .contact__actions .btn {
    width: 100%;
  }

  .contact__quick-info {
    flex-direction: column;
    gap: 16px;
  }

  /* Modal */
  .modal__content {
    padding: 32px 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .footer {
    padding: 40px 24px;
    min-height: auto; /* No fullscreen en mobile */
    scroll-snap-align: none; /* Disable snap en mobile */
  }

  .footer__content {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .footer__links {
    flex-direction: column;
  }
}

/* Tablet Medium - Métricas en fila */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero__metrics {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 700px;
  }

  .metric {
    padding: 10px 12px;
  }

  .metric__value {
    font-size: 1.5rem;
  }

  .metric__label {
    font-size: 0.7rem;
  }

  /* Intro en tablet */
  .intro__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 900px;
  }

  .intro__card {
    padding: 20px 16px;
  }

  /* Services en tablet */
  .services__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  /* Technologies en tablet */
  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .tech-category {
    padding: 18px;
  }

  .tech-items {
    grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
  }

  .intro__card h3 {
    font-size: 1.05rem;
  }

  .intro__card p {
    font-size: 0.85rem;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .hero {
    padding: 40px 12px 30px;
  }

  .hero__content {
    gap: 12px;
  }

  .hero__content h1 {
    font-size: clamp(1.6rem, 5vw, 2rem);
  }

  .hero__actions {
    flex-direction: column;
    width: 100%;
    align-items: center;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 280px;
  }

  /* Reduce spacing for all sections */
  .section__heading {
    margin-bottom: 32px;
  }

  .section__heading h2 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }

  /* Contact form */
  .contact__form {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .contact__header h2 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
  }
}

/* Very Small Screens - Ensure content fits */
@media (max-width: 360px) {
  .hero {
    padding: 30px 12px;
  }

  .section {
    padding: 40px 12px;
  }

  .metric {
    padding: 12px;
  }

  .intro__card,
  .service-card,
  .testimonial-card {
    padding: 16px;
  }
}
