/* ============================================================
   EY Ingeniería y Construcción — hoja de estilos del sitio
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f2f2f0;
  --bg-tint: #e3f0e4;
  --ink: #101010;
  --text: #2b2b2b;
  --text-muted: #6b6b6b;
  --green: #00700a;
  --green-deep: #00530a;
  --green-soft: #3d8a44;
  --white: #ffffff;
  --line: #e2e2df;
  --shadow: 0 18px 40px -18px rgba(16, 16, 16, 0.28);

  --font-head: "Montserrat", Arial, Helvetica, sans-serif;
  --font-body: "Open Sans", Arial, Helvetica, sans-serif;

  --maxw: 1180px;
  --gap: clamp(1.25rem, 2vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181a;
    --bg-alt: #1c211f;
    --bg-tint: #1b2a20;
    --ink: #f5f6f4;
    --text: #d7dbd8;
    --text-muted: #9aa39d;
    --green: #34a840;
    --green-deep: #4bc257;
    --green-soft: #8fd196;
    --white: #ffffff;
    --line: #2a2f2c;
    --shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  --bg: #15181a;
  --bg-alt: #1c211f;
  --bg-tint: #1b2a20;
  --ink: #f5f6f4;
  --text: #d7dbd8;
  --text-muted: #9aa39d;
  --green: #34a840;
  --green-deep: #4bc257;
  --green-soft: #8fd196;
  --white: #ffffff;
  --line: #2a2f2c;
  --shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  margin: 0 0 0.5em;
  line-height: 1.15;
  text-wrap: balance;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.9rem;
}

p { margin: 0 0 1em; max-width: 62ch; }
p.lead { font-size: 1.1rem; color: var(--text); }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

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

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  padding: 0.85em 1.6em;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-deep); transform: translateY(-1px); }
.btn-ghost { border-color: rgba(255,255,255,0.55); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.1); }
.btn-outline { border-color: var(--green); color: var(--green); }
.btn-outline:hover { background: var(--green); color: #fff; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand-word { display: none; }

.nav-links {
  display: none;
  gap: clamp(1.1rem, 2vw, 2rem);
  list-style: none;
  margin: 0; padding: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--text);
  padding: 0.35em 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-links a:hover { color: var(--green); border-color: var(--green); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-cta { display: none; padding: 0.6em 1.2em; font-size: 0.85rem; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  color: var(--ink);
}
.nav-toggle svg { width: 20px; height: 20px; }

.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 0.9rem clamp(1.25rem, 4vw, 2.5rem);
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 880px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
  .brand-word { display: block; font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; color: var(--ink); }
  .nav-cta { display: inline-flex; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: min(86vh, 760px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}
.hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 60%;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,12,10,0.15) 0%, rgba(10,12,10,0.35) 55%, rgba(10,12,10,0.86) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding-block: clamp(2.5rem, 8vh, 5rem);
  width: 100%;
}
.hero .eyebrow { color: var(--green-soft); }
.hero h1 {
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  max-width: 16ch;
  margin-bottom: 0.4em;
}
.hero p.lead {
  color: rgba(255,255,255,0.88);
  max-width: 52ch;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: rgba(255,255,255,0.16);
  border-top: 1px solid rgba(255,255,255,0.22);
}
.hero-stats div {
  background: rgba(10,12,10,0.55);
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
}
.hero-stats strong {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  color: #fff;
}
.hero-stats span { font-size: 0.82rem; color: rgba(255,255,255,0.75); }

/* ---------- sections ---------- */
section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { margin-inline: auto; text-align: center; }

/* ---------- quienes somos ---------- */
.about-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.about-media { position: relative; }
.about-media img { border-radius: 4px; box-shadow: var(--shadow); }
.about-media .badge {
  position: absolute;
  left: -1rem; bottom: -1.2rem;
  background: var(--green);
  color: #fff;
  padding: 1rem 1.3rem;
  border-radius: 2px;
  font-family: var(--font-head);
  box-shadow: var(--shadow);
}
.about-media .badge strong { display: block; font-size: 1.6rem; }
.about-media .badge span { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.9; }

@media (min-width: 900px) {
  .about-grid { grid-template-columns: 0.9fr 1.1fr; }
}

/* ---------- servicios ---------- */
.service-cards {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 2.2rem;
}
.service-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.service-card .thumb { aspect-ratio: 4/3; overflow: hidden; }
.service-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.service-card .body { padding: 1.3rem 1.4rem 1.6rem; }
.service-card h3 { font-size: 1.05rem; margin-bottom: 0.4em; }
.service-card p { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 0; }

.service-detail {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  display: grid;
  gap: var(--gap);
}
@media (min-width: 760px) {
  .service-detail { grid-template-columns: 1fr 1fr; }
}
.service-detail article {
  background: var(--bg);
  border-left: 3px solid var(--green);
  padding: 1.4rem 1.6rem;
  border-radius: 2px;
}
.service-detail h4 { font-size: 1rem; letter-spacing: 0.02em; text-transform: uppercase; }
.service-detail p { color: var(--text-muted); font-size: 0.94rem; margin-bottom: 0; }

/* ---------- proyectos ---------- */
.project-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-top: 2.2rem;
}
.project-card {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 4/5;
  cursor: pointer;
  background: var(--ink);
  border: 0;
  padding: 0;
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}
.project-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.project-card:hover img { transform: scale(1.06); }
.project-card.no-photo { background: var(--ink); }
.project-card.no-photo img.watermark {
  width: 52%; height: 52%;
  object-fit: contain;
  margin: 24% auto 0;
  opacity: 0.22;
  transition: none;
}
.project-card.no-photo:hover img.watermark { transform: none; }
.project-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,12,10,0) 35%, rgba(10,12,10,0.88) 100%);
}
.project-card .info {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 1;
  padding: 1.3rem 1.4rem;
  color: #fff;
}
.project-card .tag {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-soft);
  margin-bottom: 0.35em;
}
.project-card h3 { color: #fff; font-size: 1.15rem; margin-bottom: 0.2em; }
.project-card .place { font-size: 0.82rem; color: rgba(255,255,255,0.78); }

/* lightbox */
.lightbox {
  position: fixed; inset: 0;
  z-index: 1000;
  display: none;
  background: rgba(8,9,8,0.92);
  overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 3.5rem) 1rem;
}
.lightbox.open { display: block; }
.lightbox-panel {
  max-width: 980px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: sticky;
  top: 1rem;
  margin-left: auto;
  margin-right: 1rem;
  display: flex;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: rgba(8,9,8,0.65);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
}
.lightbox-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2px;
}
.lightbox-photos img { width: 100%; height: 260px; object-fit: cover; }
.lightbox-body { padding: clamp(1.5rem, 4vw, 2.5rem); }
.lightbox-body .eyebrow { margin-bottom: 0.5rem; }
.lightbox-body h3 { font-size: 1.6rem; }
.lightbox-stats { display: flex; flex-wrap: wrap; gap: 1.6rem; margin: 1.2rem 0; }
.lightbox-stats div strong { display: block; font-family: var(--font-head); font-size: 1.3rem; color: var(--green); }
.lightbox-stats div span { font-size: 0.82rem; color: var(--text-muted); }
.lightbox-place { font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }

/* ---------- contacto ---------- */
.contact-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
}
@media (min-width: 860px) {
  .contact-grid { grid-template-columns: 1.1fr 0.9fr; }
}
.contact-card {
  background: var(--bg-tint);
  border-radius: 6px;
  padding: clamp(1.8rem, 4vw, 2.6rem);
}
.contact-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.contact-row:last-child { border-bottom: none; }
.contact-row .icon {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.contact-row .icon svg { width: 18px; height: 18px; }
.contact-row strong { display: block; font-family: var(--font-head); font-size: 0.95rem; }
.contact-row span, .contact-row a { color: var(--text-muted); text-decoration: none; font-size: 0.94rem; }
.contact-row a:hover { color: var(--green); }

.contact-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: clamp(1.8rem, 4vw, 2.6rem);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.contact-cta .btn { justify-content: center; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.2rem;
  background: var(--bg-alt);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; }
.footer-brand img { height: 26px; }
.footer-brand span { font-family: var(--font-head); font-weight: 700; font-size: 0.9rem; color: var(--text-muted); }
.footer-meta { font-size: 0.82rem; color: var(--text-muted); }

/* ---------- reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .project-card img { transition: none; }
}
