/* ==========================================================================
   Cortes y Mora Ingenieros Asociados SAS — Hoja de estilos principal
   Identidad tomada del brochure corporativo:
   rojo #D6172E · gris carbón #424243 · Playfair Display + Source Sans 3
   ========================================================================== */

:root {
  --red: #D6172E;
  --red-dk: #A50F22;
  --red-pale: #FDE8EB;
  --charcoal: #424243;
  --char-dk: #252526;
  --char-md: #5A5B5C;
  --char-lt: #8A8B8C;
  --cream: #F7F5F4;
  --light: #F2F2F2;
  --border: #E0DCDC;
  --white: #FFFFFF;

  --font-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
  --shadow: 0 10px 30px rgba(37, 37, 38, 0.10);
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--charcoal);
  background: var(--white);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
a:hover { color: var(--red-dk); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--char-dk);
  line-height: 1.15;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 900; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 700; }
h1 em, h2 em { font-style: italic; color: var(--red); }
p { margin: 0 0 1em; }

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

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 1000;
  background: var(--char-dk); color: #fff; padding: 10px 16px; border-radius: 6px;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(8px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 24px;
}
.brand img { height: 46px; width: auto; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.main-nav a {
  display: block; padding: 10px 14px; border-radius: 6px;
  color: var(--charcoal); text-decoration: none; font-weight: 600; font-size: 1rem;
}
.main-nav a:hover { color: var(--red); background: var(--red-pale); }
.main-nav a[aria-current="page"] { color: var(--red); }
.main-nav .nav-cta {
  background: var(--red); color: #fff; margin-left: 8px; padding: 10px 20px;
}
.main-nav .nav-cta:hover, .main-nav .nav-cta[aria-current="page"] { background: var(--red-dk); color: #fff; }

.nav-toggle {
  display: none; background: none; border: 0; padding: 10px; cursor: pointer; border-radius: 6px;
}
.nav-toggle span { display: block; width: 26px; height: 3px; background: var(--char-dk); margin: 5px 0; border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .brand img { height: 38px; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    display: none;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 12px var(--gutter) 20px; gap: 2px; }
  .main-nav a { padding: 14px 12px; font-size: 1.1rem; }
  .main-nav .nav-cta { margin: 10px 0 0; text-align: center; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 6px; border: 2px solid transparent;
  font-family: var(--font-body); font-size: 1rem; font-weight: 700; letter-spacing: .02em;
  text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dk); color: #fff; }
.btn-outline { border-color: currentColor; color: #fff; background: transparent; }
.btn-outline:hover { background: #fff; color: var(--char-dk); border-color: #fff; }
.btn-dark-outline { border-color: var(--charcoal); color: var(--charcoal); background: transparent; }
.btn-dark-outline:hover { background: var(--charcoal); color: #fff; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

/* ---------- Héroe ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  min-height: min(88vh, 760px); display: flex; align-items: center;
  background: var(--char-dk);
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, rgba(37,37,38,.94) 0%, rgba(37,37,38,.80) 45%, rgba(37,37,38,.30) 100%);
}
.hero .container { position: relative; z-index: 2; padding-top: 72px; padding-bottom: 72px; }
.hero-content { max-width: 680px; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--red); margin-bottom: 18px;
}
.hero .eyebrow { color: #ff6b7a; }
.hero h1 { color: #fff; }
.hero h1 em { color: #ff6b7a; }
.hero-lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: rgba(255,255,255,.85); max-width: 560px; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Encabezado de páginas internas */
.page-hero { position: relative; color: #fff; background: var(--char-dk); overflow: hidden; }
.page-hero .hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, rgba(37,37,38,.95) 0%, rgba(37,37,38,.75) 60%, rgba(37,37,38,.5) 100%);
}
.page-hero .container { position: relative; z-index: 2; padding-top: 88px; padding-bottom: 72px; }
.page-hero h1 { color: #fff; font-size: clamp(2.1rem, 4.5vw, 3.3rem); max-width: 760px; }
.page-hero h1 em { color: #ff6b7a; }
.page-hero .eyebrow { color: #ff6b7a; }
.page-hero p { color: rgba(255,255,255,.85); max-width: 640px; font-size: 1.15rem; margin: 0; }

/* ---------- Secciones ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--cream); }
.section-dark { background: var(--char-dk); color: rgba(255,255,255,.85); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { font-size: 1.15rem; color: var(--char-md); }
.section-dark .section-head p { color: rgba(255,255,255,.75); }

/* Cifras */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat { padding: 8px 0; }
.stat-num { font-family: var(--font-head); font-weight: 900; font-size: clamp(2.2rem, 4vw, 3.2rem); color: #fff; line-height: 1; }
.stat-num small { font-size: .5em; font-weight: 700; color: #ff6b7a; margin-left: 2px; }
.stat-lbl { margin-top: 10px; font-size: .95rem; color: rgba(255,255,255,.7); }
.stats-band { background: var(--red); }
.stats-band .stat-num small { color: #fff; opacity: .85; }
.stats-band .stat-lbl { color: rgba(255,255,255,.9); }
.stats-text .stat-num { font-size: clamp(1.6rem, 2.6vw, 2.1rem); color: #ff6b7a; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; } }

/* Dos columnas */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split-media { position: relative; }
.split-media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.split-media .badge {
  position: absolute; right: -16px; bottom: -20px; background: var(--red); color: #fff;
  padding: 18px 22px; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 220px;
}
.badge strong { display: block; font-family: var(--font-head); font-size: 2rem; line-height: 1; }
.badge span { font-size: .9rem; }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split-media .badge { right: 12px; bottom: -16px; }
}

.check-list { list-style: none; padding: 0; margin: 0 0 28px; }
.check-list li { position: relative; padding-left: 32px; margin-bottom: 12px; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* Tarjetas de servicio */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--light); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.card-body p { color: var(--char-md); font-size: 1rem; }
.card-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--red-pale); color: var(--red);
  display: grid; place-items: center; margin-bottom: 16px;
}
.card-icon svg { width: 26px; height: 26px; }
.card-link { margin-top: auto; font-weight: 700; text-decoration: none; }
.card-link::after { content: " →"; }

/* Servicio detallado */
.service-detail { padding: clamp(56px, 7vw, 88px) 0; border-bottom: 1px solid var(--border); scroll-margin-top: var(--header-h); }
.service-detail:last-of-type { border-bottom: 0; }
.service-detail:nth-of-type(even) .split-media { order: 2; }
@media (max-width: 900px) { .service-detail:nth-of-type(even) .split-media { order: 0; } }
.service-num { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--red); letter-spacing: .1em; }

/* Proyectos */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project {
  position: relative; border-radius: var(--radius); overflow: hidden; min-height: 340px;
  color: #fff; display: flex; align-items: flex-end; background: var(--char-dk);
}
.project img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.project:hover img { transform: scale(1.05); }
.project::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(37,37,38,0) 30%, rgba(37,37,38,.92) 100%); }
.project-body { position: relative; z-index: 1; padding: 24px; }
.project-tag { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #ff8a96; }
.project h3 { color: #fff; margin: 6px 0 4px; font-size: 1.3rem; }
.project p { margin: 0; color: rgba(255,255,255,.8); font-size: .95rem; }
.project-val { display: inline-block; margin-top: 12px; font-weight: 700; background: var(--red); padding: 4px 12px; border-radius: 4px; font-size: .9rem; }
.project.wide { grid-column: span 2; }
@media (max-width: 960px) { .projects { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .projects { grid-template-columns: 1fr; } .project.wide { grid-column: auto; } }

/* Clientes */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.client {
  display: flex; align-items: center; gap: 14px; padding: 20px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.client-mark {
  flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--charcoal); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; letter-spacing: .02em;
}
.client:nth-child(3n+1) .client-mark { background: var(--red); }
.client strong { display: block; color: var(--char-dk); line-height: 1.25; }
.client span { font-size: .88rem; color: var(--char-lt); }

.logo-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; }
.logo-strip span {
  font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--char-md);
}
.section-dark .logo-strip span { color: rgba(255,255,255,.78); }

/* Tabla de proyectos por cliente */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: .97rem; }
th { background: var(--char-dk); color: #fff; font-weight: 600; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--cream); }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
th.num { text-align: right; }

/* Equipo de socios */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.person { display: flex; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.person-initials { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; }
.person strong { display: block; font-size: 1.1rem; color: var(--char-dk); }
.person span { color: var(--char-lt); }

/* Valores */
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.value h3 { font-size: 1.2rem; }
.value p { color: var(--char-md); }

/* Equipos / galería */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--border); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery figcaption { padding: 12px 16px; font-weight: 600; font-size: .95rem; }

.equip-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.equip-list h3 { font-size: 1.1rem; border-bottom: 2px solid var(--red); padding-bottom: 8px; display: inline-block; }
.equip-list ul { list-style: none; padding: 0; margin: 0; }
.equip-list li { padding: 6px 0; border-bottom: 1px dashed var(--border); }

.licenses { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 24px 0; }
.license { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 18px; }
.license span { display: block; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #ff8a96; font-weight: 700; }
.license strong { color: #fff; font-size: 1.1rem; }

/* Llamado a la acción */
.cta { background: var(--red); color: #fff; padding: clamp(56px, 7vw, 80px) 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta h2 { color: #fff; margin: 0 0 8px; }
.cta p { margin: 0; color: rgba(255,255,255,.88); font-size: 1.15rem; }
.cta .btn-primary { background: #fff; color: var(--red); }
.cta .btn-primary:hover { background: var(--char-dk); color: #fff; }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { background: var(--char-dk); color: rgba(255,255,255,.85); border-radius: var(--radius); padding: 36px; }
.contact-info h2 { color: #fff; font-size: 1.8rem; }
.contact-item { display: flex; gap: 16px; margin-top: 24px; }
.contact-item .ic { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--red); display: grid; place-items: center; }
.contact-item .ic svg { width: 20px; height: 20px; color: #fff; }
.contact-item small { display: block; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: #ff8a96; font-weight: 700; }
.contact-item a, .contact-item address { color: #fff; font-style: normal; text-decoration: none; }
.contact-item a:hover { text-decoration: underline; }

.form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--char-dk); }
.field label .req { color: var(--red); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--char-dk);
  padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 6px; background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(214,23,46,.15); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); }
.field-error { display: none; color: var(--red-dk); font-size: .9rem; margin-top: 6px; }
.field.invalid .field-error { display: block; }
.field-hint { font-size: .85rem; color: var(--char-lt); margin-top: 4px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; color: var(--char-md); }
.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--red); flex: none; }

/* Campo trampa anti-spam: oculto para personas, visible para robots */
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.form-status { display: none; padding: 14px 18px; border-radius: 6px; margin-bottom: 18px; font-weight: 600; }
.form-status.ok { display: block; background: #E7F6EC; color: #1C6B3A; border: 1px solid #B7E1C4; }
.form-status.error { display: block; background: var(--red-pale); color: var(--red-dk); border: 1px solid #F5B5BE; }

/* ---------- Pie de página ---------- */
.site-footer { background: var(--char-dk); color: rgba(255,255,255,.7); padding: 64px 0 0; font-size: .97rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-logo { height: 44px; width: auto; filter: brightness(0) invert(1); margin-bottom: 18px; }
.site-footer h4 { font-family: var(--font-body); color: #fff; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer address { font-style: normal; }
.footer-bottom { margin-top: 48px; border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .88rem; color: rgba(255,255,255,.5); }

/* Animación de aparición */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Utilidades */
.section-tight { padding-top: 48px; padding-bottom: 48px; }
.mt-0 { margin-top: 0; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.actions-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.actions-center { justify-content: center; }
.logo-404 { height: 60px; width: auto; margin: 0 auto 40px; }
.prose { max-width: 820px; }
.prose h2 { font-size: 1.5rem; margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.note { font-size: .9rem; color: var(--char-lt); margin-top: 16px; }
