/* ==========================================================================
   MCenvíos — Editorial / Swiss-grid stylesheet
   ========================================================================== */

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --paper-dim: #f4f4f4;
  --navy: #0a1630;
  --orange: #ed7034;
  --orange-dim: rgba(237, 112, 52, 0.14);
  --line: #e2e2e2;
  --line-dark: rgba(255, 255, 255, 0.14);
  --gray: #62625e;
  --gray-on-dark: #aab0c0;
  --white: #ffffff;

  --font-display: 'Inter', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;

  --max-width: 1320px;
  --gutter: 32px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 800;
}

p {
  line-height: 1.7;
  margin: 0;
  color: var(--gray);
}

.rule {
  height: 1px;
  background: var(--line);
  border: none;
  margin: 0;
}

.num-tag {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--orange);
}

/* ------------------------- Header ------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 22px 0;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  padding: 14px 0;
}

.brand img {
  height: 30px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  position: relative;
  padding-bottom: 4px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--orange);
  transition: width 0.25s var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 26px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

/* ------------------------- Hero (editorial) ------------------------- */

.hero {
  position: relative;
  padding-top: 180px;
  padding-bottom: 90px;
  background: var(--paper);
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 40px;
  align-items: start;
}

.hero-logo {
  height: 92px;
  margin-bottom: 32px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.hero-eyebrow span {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 6.4rem);
  letter-spacing: -0.03em;
  margin-bottom: 32px;
  max-width: 14ch;
}

.hero h1 .accent {
  color: var(--orange);
}

.hero-lead {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.hero-lead p {
  font-size: 1.05rem;
  color: var(--ink);
  max-width: 38ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.btn-underline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--orange);
  transition: gap 0.2s var(--ease-out), color 0.2s ease;
}

.btn-underline:hover {
  gap: 14px;
  color: var(--orange);
}

/* sticky side index */

.hero-index,
.side-index {
  position: sticky;
  top: 180px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-index a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray);
  transition: color 0.2s ease;
}

.side-index a .n {
  font-size: 0.72rem;
  color: var(--line);
}

.side-index a.active,
.side-index a:hover {
  color: var(--ink);
}

.side-index a.active .n,
.side-index a:hover .n {
  color: var(--orange);
}

/* hero parallax media strip */

.hero-media {
  position: relative;
  margin-top: 70px;
  height: 320px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-media [data-parallax] {
  position: absolute;
  inset: -20% 0;
  background-image: url('../img/slide/s3.jpg');
  background-size: cover;
  background-position: center;
  filter: grayscale(0.35) contrast(1.05);
}

.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--navy) 0%, rgba(10, 22, 48, 0.55) 35%, rgba(237, 112, 52, 0.25) 100%);
  mix-blend-mode: multiply;
}

/* ------------------------- Sections ------------------------- */

.section {
  padding: 120px 0;
  border-top: 1px solid var(--line);
}

.section.dark {
  background: var(--navy);
  border-top-color: var(--line-dark);
  color: var(--white);
}

.section.dark p {
  color: var(--gray-on-dark);
}

.section-head {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 64px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  max-width: 22ch;
}

.section.dark h2 {
  color: var(--white);
}

/* ------------------------- Nosotros ------------------------- */

.nosotros-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 60px;
}

.nosotros-statement {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}

.nosotros-statement .accent {
  color: var(--orange);
}

.nosotros-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.nosotros-foot img {
  height: 52px;
}

.nosotros-foot p {
  font-size: 0.88rem;
  margin: 0;
}

.nosotros-side {
  border-left: 1px solid var(--line);
  padding-left: 36px;
}

.nosotros-side h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray);
  margin-bottom: 14px;
}

.nosotros-side p {
  font-size: 0.95rem;
  color: var(--ink);
}

/* ------------------------- SLA (dark, parallax) ------------------------- */

.sla {
  position: relative;
  overflow: hidden;
}

.sla [data-parallax] {
  position: absolute;
  inset: -25% 0;
  background-image: url('../img/parallax/mcenvios.mx-city.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.22;
}

.sla .container {
  position: relative;
  z-index: 1;
}

.sla-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.sla-item {
  padding: 0 48px;
  border-left: 1px solid var(--line-dark);
}

.sla-item:first-child {
  padding-left: 0;
  border-left: none;
}

.sla-item .num-tag {
  display: block;
  margin-bottom: 18px;
}

.sla-item h3 {
  color: var(--white);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin-bottom: 16px;
  max-width: 16ch;
}

.sla-item small {
  display: block;
  margin-top: 18px;
  color: var(--gray-on-dark);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* ------------------------- Servicios (editorial list) ------------------------- */

.services-list {
  border-top: 1px solid var(--line);
}

.service-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 36px 0;
  padding-left: 24px;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s ease;
}

.service-row:hover {
  background: var(--paper-dim);
}

.service-row .num-tag {
  font-size: 1rem;
}

.service-row h3 {
  font-size: 1.5rem;
  font-weight: 700;
  transition: color 0.2s ease, transform 0.2s var(--ease-out);
}

.service-row:hover h3 {
  color: var(--orange);
  transform: translateX(6px);
}

.service-row p {
  font-size: 0.95rem;
  margin: 0;
}

.service-row-new {
  background: var(--orange-dim);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 3px 0 0 var(--orange);
  padding-left: 24px;
}

.service-row-new:hover {
  background: var(--orange-dim);
}

.service-row-new h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.service-row-new:hover h3 {
  transform: translateX(6px);
}

.new-badge {
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--orange);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ------------------------- Portafolio ------------------------- */

.portfolio-showcase {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: start;
}

/* accordion list */

.portfolio-accordion {
  border-top: 1px solid var(--line);
}

.portfolio-acc-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.acc-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 30px 0;
}

.acc-head .num-tag {
  flex-shrink: 0;
}

.acc-head h3 {
  flex: 1;
  font-size: 1.3rem;
  margin: 0;
  transition: color 0.25s ease;
}

.portfolio-acc-item.active .acc-head h3 {
  color: var(--orange);
}

.chevron {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease-out);
}

.portfolio-acc-item.active .chevron {
  transform: rotate(-135deg);
  border-color: var(--orange);
}

.acc-body {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease-out);
}

.acc-body ul {
  list-style: none;
  margin: 0;
  padding: 0 0 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acc-body li {
  position: relative;
  padding-left: 22px;
  color: var(--gray);
  font-size: 0.96rem;
  line-height: 1.65;
}

.acc-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 1px;
  background: var(--orange);
}

/* stage (sticky image) */

.portfolio-stage {
  position: sticky;
  top: 140px;
  height: 460px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.stage-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}

.stage-img.active {
  opacity: 1;
}

/* ------------------------- Contacto ------------------------- */

.contact {
  background: var(--navy);
  color: var(--white);
}

.contact .section-head h2 {
  color: var(--white);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.contact-item {
  padding: 0 40px;
  border-left: 1px solid var(--line-dark);
}

.contact-item:first-child {
  padding-left: 0;
  border-left: none;
}

.contact-item h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 20px;
}

.contact-item address {
  font-style: normal;
  color: var(--gray-on-dark);
  font-size: 0.95rem;
  line-height: 1.8;
}

.contact-item a {
  display: block;
  color: var(--white);
  font-weight: 600;
  font-size: 0.98rem;
  margin-top: 14px;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
  width: fit-content;
}

.contact-item a:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* ------------------------- Footer ------------------------- */

.site-footer {
  background: var(--navy);
  color: var(--gray-on-dark);
  padding: 36px 0;
  border-top: 1px solid var(--line-dark);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
}

.footer-row img {
  height: 22px;
}

.footer-links a {
  margin-left: 18px;
  color: var(--gray-on-dark);
}

.footer-links a:hover {
  color: var(--orange);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-version {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.03em;
}

/* ------------------------- Reveal ------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  [data-parallax] {
    transform: none !important;
  }
}

/* ------------------------- Responsive ------------------------- */

@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-index {
    display: none;
  }

  .nosotros-grid {
    grid-template-columns: 1fr;
  }

  .nosotros-side {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 28px;
  }

  .sla-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .sla-item {
    border-left: none;
    padding-left: 0;
  }

  .sla-item:first-child {
    border-bottom: 1px solid var(--line-dark);
    padding-bottom: 40px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-item {
    border-left: none;
    padding-left: 0;
  }

  .contact-item:not(:first-child) {
    border-top: 1px solid var(--line-dark);
    padding-top: 32px;
  }
}

@media (max-width: 820px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    background: var(--paper);
    width: 280px;
    padding: 100px 32px 32px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 99;
    border-left: 1px solid var(--line);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 760px) {
  .hero-lead {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .portfolio-showcase {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .portfolio-stage {
    position: static;
    height: 280px;
    order: -1;
  }

  .service-row {
    grid-template-columns: 50px 1fr;
    grid-template-areas:
      'num title'
      'desc desc';
  }

  .service-row .num-tag { grid-area: num; }
  .service-row h3 { grid-area: title; }
  .service-row p { grid-area: desc; margin-top: 12px; }
}

@media (max-width: 540px) {
  .section {
    padding: 80px 0;
  }

  .hero {
    padding-top: 130px;
  }

  .hero-logo {
    height: 64px;
    margin-bottom: 24px;
  }
}

/* ------------------------- WhatsApp floating CTA ------------------------- */

.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  border-radius: 50%;
  color: var(--white);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
}

.whatsapp-float:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.4);
}

.whatsapp-float::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25d366;
  opacity: 0.5;
  animation: whatsapp-pulse 2.4s infinite;
  z-index: -1;
}

@keyframes whatsapp-pulse {
  0% { transform: scale(1); opacity: 0.45; }
  70% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-float::before {
    animation: none;
    display: none;
  }
}

@media (max-width: 540px) {
  .whatsapp-float {
    right: 18px;
    bottom: 18px;
    width: 52px;
    height: 52px;
  }
}
