/* AGTI Ingeniería — colores de marca tomados del logo:
   azul #7092BE ("Ingeniería") y gris plata #C3C3C3 ("AGTI") */
:root {
  --brand: #7092be;        /* azul de marca (decorativo, íconos, acentos) */
  --brand-ink: #3f6496;    /* azul de marca oscurecido para texto y botones (AA) */
  --brand-ink-2: #34557f;
  --silver: #c3c3c3;       /* gris plata de marca */
  --ink: #1d2430;          /* texto principal */
  --ink-2: #8e959e;        /* gris de marca para trazos (logo, ilustración) */
  --muted: #5f6775;
  --line: #e6e9ee;
  --line-2: #d5dae2;
  --tint: #f3f6fa;         /* fondo suave azulado */
  --bg: #ffffff;
  --radius: 14px;
  --wrap: 1120px;
  --navy: #1e3556;         /* azul de marca profundo para fondos */
  --navy-2: #2c4c78;
  --on-navy: #ffffff;
  --on-navy-muted: #c4d3e8;
  --brand-light: #a9c1e0;  /* azul de marca aclarado para acentos sobre azul */
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
svg { display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.03em; font-weight: 800; }
h1 { font-size: clamp(2.3rem, 4.6vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand-ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.eyebrow { font-size: .8rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: .8em; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-2); }
.brand__mark { width: 36px; height: 36px; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__mark { width: 40px; height: 40px; }
.brand__text b { font-size: 1.45rem; font-weight: 800; letter-spacing: .02em; color: var(--ink-2); }
.brand__text i { font-style: normal; font-size: .86rem; font-weight: 800; color: var(--brand); margin-top: 1px; }
.brand--sm .brand__mark { width: 28px; height: 28px; }
.brand--sm .brand__text b { font-size: 1.05rem; }
.brand--sm .brand__text i { font-size: .68rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .85em 1.5em; border-radius: 999px; background: var(--brand-ink); color: #fff; font: inherit; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .15s, transform .15s; }
.btn:hover { background: var(--brand-ink-2); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--tint); }
.btn--sm { padding: .55em 1.15em; font-size: .92rem; }
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 3px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.86); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav__menu { display: flex; align-items: center; gap: 32px; }
.nav__menu a:not(.btn) { text-decoration: none; color: var(--muted); font-size: .95rem; transition: color .15s; }
.nav__menu a:not(.btn):hover { color: var(--ink); }
.nav__toggle { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; padding: 0; }
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 6px auto; transition: transform .2s; }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Hero — bloque azul de marca */
.hero {
  --ink-2: #ffffff; --tint: rgba(255,255,255,.06); --line-2: rgba(255,255,255,.3); --brand: var(--brand-light);
  position: relative; overflow: hidden; color: var(--on-navy);
  background: var(--navy);
  isolation: isolate;
  padding: clamp(64px, 10vw, 128px) 0 clamp(40px, 5vw, 56px);
}
.hero__bg { position: absolute; inset: 0; z-index: -1; background: url("img/hero-torres.webp") center 60% / cover no-repeat; }
.hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(30,53,86,.97) 0%, rgba(30,53,86,.88) 42%, rgba(30,53,86,.45) 100%), linear-gradient(0deg, rgba(23,42,69,.9) 0%, transparent 40%); }
.hero__inner { display: grid; grid-template-columns: 1fr; }
.hero .eyebrow { color: var(--brand-light); }
.hero h1 { max-width: 17ch; }
.hero h1 span { color: var(--brand-light); }
.lead { font-size: clamp(1.08rem, 1.5vw, 1.25rem); color: var(--on-navy-muted); max-width: 52ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2.2em; }
.hero .btn { background: #fff; color: var(--navy); }
.hero .btn:hover { background: #e8eef7; }
.hero .btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn--ghost:hover { background: rgba(255,255,255,.08); }
.hero__art { margin: 0; justify-self: end; width: 100%; max-width: 440px; }
.facts { list-style: none; margin: clamp(56px, 8vw, 96px) 0 0; padding: 28px 0 0; border-top: 1px solid rgba(255,255,255,.14); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.facts strong { display: block; font-size: 1.1rem; font-weight: 800; }
.facts span { font-size: .9rem; color: var(--on-navy-muted); }

/* Sections */
.section { padding: clamp(72px, 10vw, 128px) 0; scroll-margin-top: 72px; }
.section--tint { background: var(--tint); }
.section__head { max-width: 680px; margin-bottom: 56px; }

/* Sección azul (contacto) */
.section--brand { background: var(--navy); color: var(--on-navy); }
.section--brand .eyebrow { color: var(--brand-light); }
.section--brand .muted, .section--brand .contact span { color: var(--on-navy-muted); }
.section--brand .contact a { color: #fff; }
.section--brand .form { color: var(--ink); border-color: transparent; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); }

/* Services */
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.service { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s, transform .2s; }
.service__img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--tint); transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.service:hover .service__img { transform: scale(1.04); }
.service__body { position: relative; padding: 0 32px 32px; }
.service:hover { border-color: #c9d6e8; box-shadow: 0 16px 36px -24px rgba(63,100,150,.45); transform: translateY(-2px); }
.service ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.service li { position: relative; padding-left: 18px; color: var(--muted); font-size: .96rem; }
.service li::before { content: ""; position: absolute; left: 0; top: .65em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.icon { width: 48px; height: 48px; padding: 11px; border-radius: 12px; background: var(--brand-ink); stroke: #fff; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.service .icon { margin: -24px 0 18px; position: relative; box-shadow: 0 0 0 5px var(--bg); }

/* Logos de clientes */
.logos { --cols: 5; list-style: none; margin: 0 0 56px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.logos li { flex: 0 0 calc((100% - (var(--cols) - 1) * 12px) / var(--cols)); }
.logos li { display: flex; align-items: center; justify-content: center; height: 104px; padding: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; transition: border-color .25s, box-shadow .25s, transform .3s cubic-bezier(.2,.7,.2,1); }
.logos li:hover { border-color: #c9d6e8; box-shadow: 0 14px 30px -24px rgba(63,100,150,.5); transform: translateY(-2px); }
.logos img { max-width: 100%; max-height: 64px; width: auto; height: auto; object-fit: contain; filter: grayscale(1); opacity: .65; transition: filter .35s, opacity .35s; }
.logos li:hover img { filter: none; opacity: 1; }
.logos img.logo--white { filter: brightness(0); opacity: .5; }
.logos img.logo--tall { max-height: 76px; }
.logos img.logo--light { filter: grayscale(1) brightness(.55) contrast(1.4); opacity: .75; }
.logos li:hover img.logo--light { filter: none; opacity: 1; }
.logos li:hover img.logo--white { filter: brightness(0) invert(27%) sepia(30%) saturate(900%) hue-rotate(185deg); opacity: 1; }
.wordmark { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.15; font-size: .78rem; font-weight: 600; color: #7b8391; letter-spacing: .02em; transition: color .3s; }
.wordmark b { font-size: 1.02rem; font-weight: 800; letter-spacing: -.01em; }
.logos li:hover .wordmark { color: var(--brand-ink); }

/* Projects */
.projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.projects li { display: flex; flex-direction: column; gap: 2px; padding: 20px 0; border-bottom: 1px solid var(--line-2); }
.projects b { font-weight: 650; }
.projects span { color: var(--muted); font-size: .95rem; }

/* Split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.split > div > p:not(.eyebrow) { color: var(--muted); font-size: 1.04rem; }
.about__img { display: block; width: 100%; height: auto; aspect-ratio: 21 / 8; object-fit: cover; object-position: center 35%; border-radius: var(--radius); margin-top: clamp(40px, 6vw, 64px); }
@media (max-width: 720px) { .about__img { aspect-ratio: 16 / 10; } }
.team { display: grid; gap: 12px; }
.team__item { display: flex; gap: 16px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.team__item b { display: block; font-weight: 650; }
.team__item span { color: var(--muted); font-size: .93rem; }

/* Contact */
.contact { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 18px; }
.contact li { display: flex; flex-direction: column; }
.contact span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.contact a { text-decoration: none; font-size: 1.1rem; font-weight: 600; color: var(--brand-ink); }
.contact a:hover { text-decoration: underline; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); box-shadow: 0 20px 40px -32px rgba(29,36,48,.35); }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 500; }
.form .full { grid-column: 1 / -1; }
.form input, .form select, .form textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; width: 100%; transition: border-color .15s; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--brand-ink); outline: none; box-shadow: 0 0 0 3px rgba(112,146,190,.25); }
.form textarea { resize: vertical; min-height: 110px; }
.form [aria-invalid="true"] { border-color: #d14343; }
.form__note { margin: 0; font-size: .9rem; color: var(--brand-ink); min-height: 1.4em; }

/* Footer */
.footer { background: #172a45; padding: 28px 0; font-size: .86rem; color: var(--on-navy-muted); --ink-2: #fff; --brand: var(--brand-light); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer p { margin: 0; text-align: right; }
@media (max-width: 720px) { .footer p { text-align: left; } }

/* Header al hacer scroll */
.nav { transition: box-shadow .3s ease, background .3s ease; }
.nav.is-scrolled { box-shadow: 0 8px 24px -18px rgba(29,36,48,.35); }

/* FAQ */
.faq__list { display: grid; gap: 12px; max-width: 860px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); transition: border-color .25s ease, box-shadow .25s ease; }
.faq details[open] { border-color: #c9d6e8; box-shadow: 0 14px 30px -24px rgba(63,100,150,.45); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px; font-weight: 700; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 12px; height: 12px; border-right: 2px solid var(--brand-ink); border-bottom: 2px solid var(--brand-ink); transform: rotate(45deg) translateY(-3px); transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq__a { overflow: hidden; transition: height .35s cubic-bezier(.2,.7,.2,1); }
.faq__a p { margin: 0; padding: 0 24px 22px; color: var(--muted); }

/* ===== Animaciones (solo si el usuario no pidió reducir movimiento) ===== */
@media (prefers-reduced-motion: no-preference) {
  :root { --ease: cubic-bezier(.2,.7,.2,1); }

  /* Aparición al hacer scroll, escalonada con --d */
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease) var(--d, 0ms), transform .7s var(--ease) var(--d, 0ms), border-color .2s, box-shadow .2s; }
  .reveal.is-in { opacity: 1; transform: none; }
  .service.reveal.is-in:hover { transform: translateY(-3px); transition-delay: 0ms; }

  /* Entrada de la portada en cascada */
  @keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
  .hero__copy > * { opacity: 0; animation: fadeUp .9s var(--ease) forwards; }
  .hero__copy > :nth-child(1) { animation-delay: .05s; }
  .hero__copy > :nth-child(2) { animation-delay: .15s; }
  .hero__copy > :nth-child(3) { animation-delay: .28s; }
  .hero__copy > :nth-child(4) { animation-delay: .4s; }
  .facts li { opacity: 0; animation: fadeUp .9s var(--ease) forwards; }
  .facts li:nth-child(1) { animation-delay: .55s; }
  .facts li:nth-child(2) { animation-delay: .63s; }
  .facts li:nth-child(3) { animation-delay: .71s; }
  .facts li:nth-child(4) { animation-delay: .79s; }

  /* Zoom lento de la foto de portada */
  @keyframes slowZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
  .hero__bg { animation: slowZoom 9s cubic-bezier(.2,.7,.2,1) both; }

  /* La torre se dibuja */
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
  .hero__art svg { animation: pop 1.1s var(--ease) both; }
  .tower path { stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 1.8s var(--ease) .3s forwards; }
  .tower path:nth-child(2) { animation-delay: .8s; }
  .tower path:nth-child(3) { animation-delay: 1.1s; }
  .dish { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop .6s var(--ease) 1.4s forwards; }

  /* Ondas de señal que laten */
  @keyframes signal { 0%, 100% { opacity: .15; } 30% { opacity: 1; } }
  .waves path { animation: signal 2.4s ease-in-out infinite; }
  .waves path:nth-child(1) { animation-delay: 1.6s; }
  .waves path:nth-child(2) { animation-delay: 1.85s; }
  .waves path:nth-child(3) { animation-delay: 2.1s; }

  /* Logo: leve giro al pasar el mouse */
  .brand__mark { transition: transform .4s var(--ease); }
  .brand:hover .brand__mark { transform: rotate(-4deg) scale(1.05); }

  /* Botones e interacciones */
  .btn { transition: background .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease); }
  .btn:hover { box-shadow: 0 10px 24px -12px rgba(30,53,86,.55); }
  .btn:active { transform: translateY(0) scale(.98); }
  .projects li { transition: padding-left .3s var(--ease), opacity .7s var(--ease) var(--d, 0ms), transform .7s var(--ease) var(--d, 0ms); }
  .projects li:hover { padding-left: 8px; }
  .team__item { transition: border-color .25s, transform .3s var(--ease), opacity .7s var(--ease) var(--d, 0ms); }
  .team__item:hover { border-color: #c9d6e8; }
  .nav__menu a:not(.btn) { position: relative; }
  .nav__menu a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--brand-ink); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
  .nav__menu a:not(.btn):hover::after { transform: scaleX(1); }

  /* Menú móvil desplegable suave */
  @media (max-width: 720px) {
    .nav__menu { display: flex; opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s; }
    .nav__menu.is-open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition-delay: 0s; }
    .nav__menu a:not(.btn)::after { display: none; }
  }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* Responsive */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logos { --cols: 3; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .nav__toggle { display: block; }
  .nav__menu { position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 20px; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .nav__menu.is-open { display: flex; }
  .nav__menu a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav__menu .btn { margin-top: 16px; }
  .services, .projects { grid-template-columns: 1fr; }
  .logos { --cols: 2; }
  .logos li { height: 92px; }
  .service__body { padding: 0 24px 24px; }
  .form { grid-template-columns: 1fr; }
}
