:root {
  --navy: #2b2a5c;
  --navy-deep: #232149;
  --orange: #f5a623;
  --orange-hover: #e09400;
  --gray-100: #f3f4f7;
  --white: #fff;
  --muted: #6f7090;
  --bdr: #e3e4ec;
  --font: 'Barlow', sans-serif;
  --radius-btn: 10px 10px 28px 4px;
  --header-h: 92px;
  --transition: 0.28s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  font-family: var(--font);
  color: var(--navy);
  line-height: 1.5;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 5vw; }
.section { padding: 100px 0; }

/* ─── REVEAL ─── */
[data-reveal] { opacity: 0; translate: 0 28px; transition: opacity .65s ease, translate .65s ease; }
[data-reveal].revealed { opacity: 1; translate: 0 0; }

/* ─── HEADER ─── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center;
  height: var(--header-h); padding-left: 5vw; padding-right: 0;
  background: var(--white);
  box-shadow: 0 0 0 0 rgba(0,0,0,.0);
  transition: height .3s ease, box-shadow .3s ease;
}
.site-header.scrolled { box-shadow: 0 2px 18px rgba(0,0,0,.09); height: 74px; }

.logo {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.logo-badge {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; color: var(--navy);
  letter-spacing: 0; flex-shrink: 0;
  transition: width .3s ease, height .3s ease, font-size .3s ease;
}
.site-header.scrolled .logo-badge { width: 44px; height: 44px; font-size: 18px; }
.logo-wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.logo-wordmark strong { font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.logo-wordmark small { font-size: 9px; font-weight: 500; letter-spacing: .22em; color: var(--muted); }
.site-header.scrolled .logo-wordmark strong { font-size: 22px; }

.main-nav { display: flex; gap: 38px; margin-left: auto; margin-right: 48px; }
.main-nav a {
  font-weight: 500; font-size: 16px; color: var(--navy);
  position: relative; padding: 6px 0;
}
.main-nav a::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
  background: var(--orange); transition: width var(--transition);
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }
.main-nav a:hover, .main-nav a.active { color: var(--orange); }

.header-cta {
  background: var(--orange); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 0 44px; height: var(--header-h);
  font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; align-self: stretch;
  transition: height .3s ease;
}
.site-header.scrolled .header-cta { height: 74px; }
.header-cta:hover { background: var(--orange-hover); }

.nav-toggle { display: none; }

/* ─── HERO ─── */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  overflow: hidden; margin-top: calc(-1 * var(--header-h));
  padding-top: var(--header-h);
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(rgba(22,21,44,.72), rgba(35,33,73,.8)), url('https://placehold.co/1920x1080/2c2b5e/ffffff?text=IMECSA') center/cover;
}
.hero-content { position: relative; z-index: 2; max-width: 940px; }
.hero h1 {
  font-size: clamp(2.6rem, 5.2vw, 4.6rem); line-height: 1.08;
  font-weight: 300; color: var(--white); margin: 20px 0 32px;
}
.hero h1 strong { font-weight: 700; display: block; }
.hero-lines {
  position: absolute; right: 0; top: 10%; height: 80%; width: min(48%, 760px);
  z-index: 1; pointer-events: none;
}

/* ─── EYEBROW & TITLE ─── */
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.eyebrow span { font-weight: 600; font-size: 20px; letter-spacing: .03em; }
.eyebrow.white, .eyebrow.white span { color: var(--white); }
.eyebrow:not(.white), .eyebrow:not(.white) span { color: var(--navy); }
.chevrons { width: 34px; height: 20px; color: var(--orange); flex-shrink: 0; }

.title { font-size: clamp(2rem, 3.6vw, 3.4rem); font-weight: 300; line-height: 1.15; letter-spacing: -.01em; }
.title strong { font-weight: 700; }
.title.white { color: var(--white); }
.title.center { text-align: center; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--orange); color: var(--white);
  font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: .03em;
  padding: 15px 36px; border-radius: var(--radius-btn); transition: background var(--transition), translate var(--transition);
}
.btn:hover { background: var(--orange-hover); translate: 0 -2px; }
.btn-sm { padding: 12px 28px; font-size: 14px; border-radius: 8px 8px 22px 4px; }
.plus { font-size: 20px; font-weight: 400; line-height: 1; }

/* ─── SECTION HEAD ─── */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 48px; flex-wrap: wrap;
}

/* ─── SERVICES ─── */
.services { background: var(--navy-deep); padding: 110px 0; }
.services-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px;
}

/* ─── CARD ─── */
.card {
  position: relative; overflow: hidden; border-radius: 12px; display: block;
}
.card img {
  width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/10;
}
.card-caption {
  position: absolute; inset: auto 0 0 0;
  display: flex; align-items: center; gap: 14px;
  padding: 26px 30px 22px;
  background: linear-gradient(transparent, rgba(22,21,44,.88) 40%);
  color: var(--white); font-weight: 500; font-size: 18px;
}
.card-caption > span:last-child { flex: 1; }

.card-badge {
  width: 46px; height: 46px; border-radius: 5px; background: var(--orange);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-badge--float {
  position: absolute; left: 24px; bottom: 68px; z-index: 3;
}
.card-proj { aspect-ratio: 3/4; }
.card-proj img { aspect-ratio: 3/4; }

/* ─── CTA BAND ─── */
.cta-band { background: var(--navy-deep); padding: 100px 0 0; }
.cta-photo {
  position: relative; margin-top: 48px; margin-bottom: 0; border-radius: 16px; overflow: hidden;
}
.cta-photo img { width: 100%; }
.photo-btn {
  position: absolute; top: 28px; left: 28px;
  padding: 13px 32px; font-size: 15px; border-radius: 10px 10px 28px 4px;
}

/* ─── STATS ─── */
.stats-section { padding-top: 80px; padding-bottom: 80px; }
.stats { display: grid; grid-template-columns: 1fr 2fr; gap: 60px; align-items: center; }
.stat-main { padding: 10px 0; }
.stat-num {
  font-size: clamp(4.4rem, 8vw, 6.8rem); font-weight: 800; line-height: .95; color: var(--navy);
  display: block; letter-spacing: -.02em;
}
.stat-num em { font-style: normal; font-weight: 600; font-size: .42em; vertical-align: super; letter-spacing: 0; }
.stat-label { font-size: 22px; font-weight: 300; color: var(--navy); margin-top: 6px; letter-spacing: .01em; }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.stat-card {
  border: 1px solid var(--bdr); border-radius: 14px; padding: 38px 22px 30px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.stat-card svg { color: var(--orange); }
.stat-card strong { font-size: 40px; font-weight: 800; line-height: 1; }
.stat-card span { font-size: 16px; font-weight: 400; color: var(--muted); }

/* ─── PROJECTS ─── */
.projects { padding-bottom: 100px; }
.carousel-viewport { margin-left: 5vw; margin-right: 5vw; overflow: hidden; }
.carousel {
  display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 10px; scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel .card-proj {
  flex: 0 0 calc((100% - 84px) / 3.85); scroll-snap-align: start;
}

.pager { display: flex; gap: 14px; margin-top: 44px; justify-content: center; }
.pager button {
  width: 60px; height: 10px; border: 1px solid var(--navy); background: transparent; border-radius: 10px;
  cursor: pointer; transition: background var(--transition), border-color var(--transition);
}
.pager button.active { background: var(--orange); border-color: var(--orange); }
.pager button:hover:not(.active) { border-color: var(--orange); }

/* ─── TESTIMONIOS ─── */
.testimonios { background: var(--gray-100); padding-bottom: 80px; }
.testimonials-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
}
.t-card {
  background: var(--navy); border-radius: 18px; padding: 42px 26px 36px;
  position: relative; color: var(--white); text-align: center;
}
.t-card--orange { background: var(--orange); color: var(--navy); }
.t-card p { font-weight: 300; font-size: 15px; line-height: 1.6; margin-top: 10px; }
.t-quote {
  display: block; font-family: Georgia, 'Times New Roman', serif;
  font-size: 64px; line-height: 0.5; text-align: left; opacity: .35;
}
.t-quote--close { text-align: right; margin-top: 12px; }

/* ─── CLIENTES ─── */
.clientes { padding-top: 80px; padding-bottom: 90px; }
.logos {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 44px; margin-top: 48px;
}
.logos img { height: 60px; width: auto; max-width: 160px; filter: grayscale(1); opacity: .75; }

/* ─── NEWS ─── */
.news { padding-bottom: 100px; }
.news-card {
  display: grid; grid-template-columns: 45% 1fr; gap: 48px; margin-top: 36px;
  align-items: center;
}
.news-card:hover .news-body h3 { color: var(--orange); }
.news-img { border-radius: 14px; overflow: hidden; }
.news-img img { width: 100%; }
.news-body { padding: 12px 0; }
.news-file {
  display: inline-block; border: 1px solid #c9cad6; padding: 8px 24px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--navy); letter-spacing: .02em; margin-bottom: 16px;
}
.news-body h3 { font-size: 26px; font-weight: 700; margin-bottom: 8px; transition: color var(--transition); }
.news-body p { font-size: 17px; color: var(--muted); font-weight: 300; }

/* ─── FOOTER ─── */
.site-footer { background: var(--navy); color: var(--white); padding: 80px 0 40px; }
.footer-main { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-logo { margin-bottom: 14px; display: block; }
.logo-badge--sm { width: 50px; height: 50px; font-size: 20px; }
.footer-label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); margin-top: 6px; }
.footer-text { font-size: 17px; font-weight: 500; line-height: 1.5; }
.footer-link { font-size: 18px; font-weight: 600; transition: color var(--transition); }
.footer-link:hover { color: var(--orange); }

.footer-col--nav { gap: 14px; }
.footer-col--nav a:not(.btn) {
  font-size: 16px; font-weight: 500; padding: 2px 0; transition: color var(--transition);
}
.footer-col--nav a:not(.btn):hover { color: var(--orange); }
.footer-col--nav .btn { margin-top: 14px; align-self: flex-start; }

.footer-bottom {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding-top: 36px; border-top: 1px solid rgba(255,255,255,.12);
}
.footer-members-label { font-size: 14px; font-weight: 400; color: var(--muted); }
.footer-members { display: flex; align-items: center; gap: 0; }
.member { padding: 6px 22px; font-size: 14px; font-weight: 500; border-right: 1px solid rgba(255,255,255,.2); }
.member:last-child { border-right: none; }
.member strong { font-weight: 800; font-size: 15px; }
.footer-copy { font-size: 13px; color: var(--muted); margin-top: 16px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1080px) {
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .news-card { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .section { padding: 70px 0; }
  .services-grid, .stats { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--white);
    padding: 0; margin: 0; max-height: 0; overflow: hidden;
    transition: max-height .4s ease, padding .4s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,.06);
  }
  .main-nav.open { max-height: 320px; padding: 16px 5vw 24px; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--bdr); font-size: 17px; }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 6px; margin-left: auto; margin-right: 20px;
    background: none; border: none; cursor: pointer; padding: 6px; z-index: 101;
  }
  .nav-toggle span {
    display: block; width: 28px; height: 2.5px; background: var(--navy); border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
  }
  .nav-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
  .news-card { grid-template-columns: 1fr; gap: 24px; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 36px; }

  .hero-lines { width: 50%; opacity: .5; }
  .carousel .card-proj { flex: 0 0 calc((100% - 56px) / 2.05); }
}

@media (max-width: 600px) {
  .site-header { height: 68px; } :root { --header-h: 68px; }
  .logo-badge { width: 40px; height: 40px; font-size: 16px; }
  .logo-wordmark strong { font-size: 20px; }
  .logo-wordmark small { font-size: 7px; }
  .header-cta { padding: 0 24px; font-size: 13px; height: 68px; }
  .site-header.scrolled { height: 60px; --header-h: 60px; }
  .site-header.scrolled .header-cta { height: 60px; }
  .stat-cards { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .logos { gap: 28px; }
  .logos img { height: 44px; }
  .carousel .card-proj { flex: 0 0 calc((100% - 28px) / 1.2); }
  .carousel-viewport { margin-left: 3vw; margin-right: 3vw; }
  .footer-main { grid-template-columns: 1fr; }

  .cta-photo .photo-btn { top: 14px; left: 14px; padding: 10px 22px; font-size: 13px; }
  .hero h1 { font-size: 2rem; }
  .stats { grid-template-columns: 1fr; }
}
