/* ============================================
   PEREZ EARTHSCAPES — Custom Styles
   ============================================ */

/* --- Base & Typography --- */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #FF6B4A;
  color: #fff;
}

/* --- Navigation --- */
#mainNav {
  transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#mainNav.nav-scrolled {
  background: rgba(28, 28, 30, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #FF6B4A;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.mobile-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: padding-left 0.3s ease;
}

.mobile-link:hover {
  padding-left: 8px;
  color: #fff;
}

/* --- Hero --- */
.hero {
  position: relative;
}

.hero-bg img {
  will-change: transform;
}

.hero-overlay {
  background: linear-gradient(
    135deg,
    rgba(28, 28, 30, 0.94) 0%,
    rgba(28, 28, 30, 0.82) 50%,
    rgba(28, 28, 30, 0.55) 100%
  );
}

.hero-scroll-indicator {
  opacity: 0.7;
}

.scroll-mouse {
  background: rgba(255, 255, 255, 0.08);
}

/* --- Section Layout --- */
.section-label {
  letter-spacing: 0.12em;
}

.section-title {
  letter-spacing: -0.02em;
}

.section-subtitle {
  line-height: 1.7;
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1023px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

.service-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  border-color: rgba(255, 107, 74, 0.2);
}

.service-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(255, 107, 74, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FF6B4A;
  margin-bottom: 1.25rem;
  transition: background 0.3s ease, transform 0.3s ease;
}

.service-card:hover .service-icon-wrap {
  background: #FF6B4A;
  color: #fff;
  transform: scale(1.05);
}

.service-title {
  letter-spacing: -0.01em;
}

.service-desc {
  font-size: 0.9375rem;
}

/* --- About --- */
.about-grid {
  position: relative;
  z-index: 1;
}

.about-img-main {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.about-img-accent {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.about-experience-badge {
  box-shadow: 0 10px 30px rgba(255, 107, 74, 0.4);
}

.about-feature {
  transition: transform 0.2s ease;
}

.about-feature:hover {
  transform: translateX(4px);
}

/* --- Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 479px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28, 28, 30, 0.85) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

.gallery-tag {
  display: inline-block;
  background: #FF6B4A;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  width: fit-content;
  margin-bottom: 0.5rem;
  transform: translateY(10px);
  transition: transform 0.4s ease 0.05s;
}

.gallery-item:hover .gallery-tag {
  transform: translateY(0);
}

.gallery-location {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  transform: translateY(10px);
  transition: transform 0.4s ease 0.1s;
}

.gallery-item:hover .gallery-location {
  transform: translateY(0);
}

/* --- Testimonials --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1023px) {
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
}

.testimonial-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.testimonial-text {
  flex: 1;
  font-size: 1rem;
  line-height: 1.75;
}

.testimonial-author {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* --- Contact Form --- */
.form-input {
  border: 1.5px solid #E5E5E5;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: #2C2C2E;
  background: #FAFAF8;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  outline: none;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.form-input::placeholder {
  color: #A0A0A4;
}

.form-input:focus {
  border-color: #FF6B4A;
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.12);
  background: #fff;
}

.form-submit {
  position: relative;
  width: 100%;
  background: #2C2C2E;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  font-family: inherit;
}

.form-submit:hover {
  background: #1C1C1E;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(28, 28, 30, 0.3);
}

.form-submit:active {
  transform: translateY(0);
}

.form-submit .submit-text,
.form-submit .submit-loading,
.form-submit .submit-success {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
  gap: 0.5rem;
}

.form-submit .submit-loading,
.form-submit .submit-success {
  display: none;
}

.form-submit.loading .submit-text,
.form-submit.loading .submit-success {
  display: none;
}

.form-submit.loading .submit-loading {
  display: flex;
}

.form-submit.success {
  background: #16A34A;
}

.form-submit.success .submit-loading,
.form-submit.success .submit-text {
  display: none;
}

.form-submit.success .submit-success {
  display: flex;
}

/* --- Footer --- */
.footer-grid {
  position: relative;
  z-index: 1;
}

.footer-link {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease, padding-left 0.3s ease;
  display: inline-block;
}

.footer-link:hover {
  color: #fff;
  padding-left: 6px;
}

.footer-social-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.footer-social-icon:hover {
  background: #FF6B4A;
  color: #fff;
  transform: translateY(-2px);
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #2C2C2E;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #FF6B4A;
  box-shadow: 0 6px 20px rgba(255, 107, 74, 0.35);
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
  }
  
  .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }
  
  .reveal:nth-child(2) { transition-delay: 0.1s; }
  .reveal:nth-child(3) { transition-delay: 0.2s; }
  .reveal:nth-child(4) { transition-delay: 0.3s; }
  .reveal:nth-child(5) { transition-delay: 0.4s; }
  .reveal:nth-child(6) { transition-delay: 0.5s; }
}

/* --- Responsive --- */
@media (max-width: 767px) {
  .hero-title {
    font-size: 2.5rem;
    line-height: 1.15;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .section-title {
    font-size: 2.25rem;
  }

  .about-img-accent {
    width: 32%;
    right: -2%;
    bottom: -4%;
  }

  .about-experience-badge {
    padding: 0.75rem 1rem;
  }

  .about-experience-badge .text-3xl {
    font-size: 1.75rem;
  }

  .contact-form-card {
    padding: 1.5rem;
  }
}

@media (max-width: 479px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .cta-primary,
  .cta-secondary {
    width: 100%;
    justify-content: center;
  }

  .about-img-accent {
    display: none;
  }
}
