/* ============================================================
   XINEKA — Ingenieros Contratistas Generales S.A.C.
   Dark industrial-warm · mobile-first
   ============================================================ */

:root {
  --bg: #14110d;
  --bg-2: #1a1611;
  --surface: #211c15;
  --line: rgba(232, 190, 120, 0.14);
  --text: #f4efe7;
  --muted: #a89f91;
  --accent: #ef8a2b;
  --accent-soft: rgba(239, 138, 43, 0.12);
  --wsp: #25d366;
  --wsp-dark: #128c4a;
  --radius: 14px;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

::selection { background: var(--accent); color: #14110d; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Utilidades ---------- */
.container { width: min(1120px, 100% - 40px); margin-inline: auto; }

.kicker {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 7vw, 54px);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.subtitle {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 5vw, 32px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 56px 0 20px;
}

.lead { color: var(--muted); max-width: 56ch; margin-top: 12px; }

.section { padding: 72px 0 84px; }
.section--alt { background: var(--bg-2); }

[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: 0;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }

.btn--accent { background: var(--accent); color: #180f04; }
.btn--accent:hover { background: #ffa04a; }

.btn--wsp { background: var(--wsp); color: #06331a; }
.btn--wsp:hover { background: #3ee27e; }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(244, 239, 231, 0.4);
}
.btn--ghost:hover { border-color: var(--text); background: rgba(244, 239, 231, 0.07); }

.btn--block { width: 100%; }

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.header.is-solid {
  background: rgba(20, 17, 13, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.header__inner {
  width: min(1200px, 100% - 32px);
  margin-inline: auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { text-decoration: none; display: flex; align-items: center; gap: 10px; line-height: 1; }
.brand__logo { width: 40px; height: 40px; flex: 0 0 auto; }
.brand__col { display: flex; flex-direction: column; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.06em;
}
.brand__dot { color: var(--accent); }
.brand__sub {
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.nav { display: flex; align-items: center; gap: 26px; }
.nav__link {
  text-decoration: none;
  font-weight: 500;
  font-size: 15.5px;
  color: var(--text);
  opacity: 0.85;
  padding: 10px 2px;
  transition: opacity 0.2s, color 0.2s;
}
.nav__link:hover { opacity: 1; color: var(--accent); }
.nav__cta { min-height: 42px; padding: 8px 20px; }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  padding: 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
  z-index: 110;
}
.burger span {
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .burger { display: flex; }
  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    background: rgba(20, 17, 13, 0.97);
    backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .nav.is-open { opacity: 1; pointer-events: auto; }
  .nav__link { font-family: var(--font-display); font-size: 32px; text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 20px; }
  .nav__cta { margin-top: 18px; font-size: 18px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  animation: kenburns 18s ease-out both;
}
@keyframes kenburns {
  from { transform: scale(1.12); }
  to { transform: scale(1); }
}
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(20, 17, 13, 0.97) 8%, rgba(20, 17, 13, 0.55) 45%, rgba(20, 17, 13, 0.35) 70%, rgba(20, 17, 13, 0.55) 100%);
}
.hero__content {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
  padding: calc(var(--header-h) + 40px) 0 88px;
}
.hero__kicker {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 10.5vw, 88px);
  line-height: 0.98;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  max-width: 14ch;
}
.hero__title em {
  font-style: normal;
  color: var(--accent);
}
.hero__text { color: #d8d1c5; max-width: 52ch; margin-top: 18px; font-size: 17px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 44px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid rgba(244, 239, 231, 0.18);
}
.hero__stats dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 38px;
  line-height: 1;
  color: var(--accent);
}
.hero__stats dd { color: #cfc8bb; font-size: 14px; margin-top: 4px; }

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(244, 239, 231, 0.45);
  border-radius: 14px;
  display: flex;
  justify-content: center;
}
.hero__scroll span {
  width: 4px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 7px;
  animation: scrollhint 1.8s ease-in-out infinite;
}
@keyframes scrollhint {
  0%, 100% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(12px); opacity: 0.2; }
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  background: var(--accent);
  transform: rotate(-1.2deg) scale(1.02);
  margin-block: -10px 26px;
  position: relative;
  z-index: 5;
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: 26px;
  width: max-content;
  padding: 12px 0;
  animation: marquee 26s linear infinite;
}
.marquee__track span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #221303;
  white-space: nowrap;
}
.marquee__track i { color: rgba(34, 19, 3, 0.55); font-style: normal; font-size: 11px; }
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Servicios ---------- */
.cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 320px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 32px max(20px, calc((100% - 1120px) / 2)) 12px;
  scrollbar-width: none;
}
.cards::-webkit-scrollbar { display: none; }

.card {
  scroll-snap-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(239, 138, 43, 0.5); }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; }
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card__media img { transform: scale(1.06); }
.card__body { padding: 18px 18px 22px; }
.card__body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.card__body p { color: var(--muted); font-size: 15px; }

@media (min-width: 861px) {
  .cards {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-columns: unset;
    overflow: visible;
    width: min(1120px, 100% - 40px);
    margin-inline: auto;
    padding: 36px 0 0;
  }
}

/* ---------- Filtros + Galería ---------- */
.filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 26px max(20px, calc((100% - 1120px) / 2)) 6px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.chip:hover { color: var(--text); border-color: rgba(239, 138, 43, 0.5); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #180f04; font-weight: 600; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: min(1120px, 100% - 40px);
  margin: 18px auto 0;
}
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(4, 1fr); } }

.tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 5;
  background: var(--surface);
}
.tile.is-hidden { display: none; }
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.tile:hover img { transform: scale(1.05); }
.tile figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 26px 12px 10px;
  font-size: 13px;
  font-weight: 500;
  background: linear-gradient(to top, rgba(15, 12, 8, 0.85), transparent);
}

/* ---------- Videos ---------- */
.videos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: min(640px, 100% - 40px);
  margin: 8px auto 0;
}
.video-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-card video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; display: block; }
.video-card figcaption { padding: 14px 16px; font-size: 15px; color: var(--muted); }
.video-card strong { color: var(--text); }

/* ---------- Nosotros ---------- */
.about {
  display: grid;
  gap: 34px;
  align-items: center;
}
@media (min-width: 900px) { .about { grid-template-columns: 1.05fr 1fr; gap: 56px; } }

.about__media { position: relative; border-radius: var(--radius); overflow: hidden; }
.about__media img { width: 100%; height: 100%; object-fit: cover; }
.about__badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: rgba(20, 17, 13, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.about__text .title { font-size: clamp(30px, 5.4vw, 42px); margin-bottom: 16px; }
.about__text p { color: var(--muted); margin-bottom: 14px; }

.about__points { list-style: none; margin-top: 22px; display: grid; gap: 12px; }
.about__points li {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  font-size: 15px;
  color: var(--muted);
}
.about__points strong { color: var(--text); }

/* ---------- Proceso ---------- */
.steps {
  list-style: none;
  display: grid;
  gap: 14px;
  counter-reset: paso;
}
@media (min-width: 861px) { .steps { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.step span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}
.step h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.step p { color: var(--muted); font-size: 14.5px; }

/* ---------- Testimonios ---------- */
.testis {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(84%, 340px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 32px max(20px, calc((100% - 1120px) / 2)) 12px;
  scrollbar-width: none;
}
.testis::-webkit-scrollbar { display: none; }
@media (min-width: 1000px) {
  .testis {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-columns: unset;
    overflow: visible;
    width: min(1120px, 100% - 40px);
    margin-inline: auto;
    padding: 36px 0 0;
  }
}

.testi {
  scroll-snap-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
}
.testi__stars { color: #f5b942; letter-spacing: 3px; font-size: 15px; margin-bottom: 12px; }
.testi__text { color: var(--muted); font-size: 15px; flex: 1; }
.testi footer { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.testi footer strong { font-size: 15px; }
.testi footer span { color: var(--muted); font-size: 13px; }

/* ---------- Contacto ---------- */
.contact {
  display: grid;
  gap: 24px;
  margin-top: 34px;
}
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1.1fr; gap: 32px; } }

.contact__direct,
.contact__form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.contact__direct h3,
.contact__form h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.contact__direct > p { color: var(--muted); margin-bottom: 18px; }

.contact__list { list-style: none; margin-top: 24px; display: grid; gap: 16px; }
.contact__list li { display: flex; align-items: flex-start; gap: 12px; color: var(--muted); font-size: 15px; }
.contact__list a { color: var(--text); text-decoration: none; }
.contact__list a[href^="tel"] { white-space: nowrap; }
.contact__list a:hover { color: var(--accent); }
.contact__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.contact__formnote { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field label span { color: var(--accent); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color 0.2s ease;
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }
.field input::placeholder,
.field textarea::placeholder { color: rgba(168, 159, 145, 0.55); }
.field select:invalid { color: rgba(168, 159, 145, 0.75); }

/* ---------- Footer ---------- */
.footer { background: #0f0d0a; border-top: 1px solid var(--line); }
.footer__grid {
  display: grid;
  gap: 32px;
  padding: 48px 0 36px;
}
@media (min-width: 700px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }

.footer__tag { color: var(--muted); font-size: 14px; margin-top: 10px; }
.footer h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}
.footer nav a, .footer div > a { display: block; color: var(--muted); text-decoration: none; padding: 5px 0; font-size: 15px; }
.footer nav a:hover, .footer div > a:hover { color: var(--text); }
.footer div > p { color: var(--muted); font-size: 15px; padding: 5px 0; }

.footer__bar {
  border-top: 1px solid rgba(232, 190, 120, 0.08);
  padding: 18px 0 max(18px, env(safe-area-inset-bottom));
  text-align: center;
}
.footer__bar p { color: #6e675c; font-size: 13px; padding-inline: 20px; }

/* ---------- FAB WhatsApp ---------- */
.fab {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wsp);
  color: #06331a;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s ease;
}
.fab:hover { transform: scale(1.08); }
.fab:active { transform: scale(0.95); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 8, 6, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox figure {
  max-width: min(92vw, 900px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
}
.lightbox figcaption { text-align: center; padding: 14px 10px 0; color: var(--muted); font-size: 15px; }
.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: rgba(244, 239, 231, 0.08);
  border: 1px solid rgba(244, 239, 231, 0.2);
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(244, 239, 231, 0.18); }
.lightbox__close { top: max(16px, env(safe-area-inset-top)); right: 16px; }
.lightbox__nav--prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__media img { animation: none; }
  .marquee__track { animation: none; }
  .hero__scroll span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}
