/* ===== Variables ===== */
:root {
  --bg: #14110f;
  --bg-2: #1b1714;
  --cream: #f6efe6;
  --ink: #2a211b;
  --brick: #d9532b;
  --brick-dark: #a93a18;
  --yellow: #ffc61a;
  --muted: #b9aca0;
  --radius: 18px;
  --gutter-r: 64px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: #f3ece4;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }

.container {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: 24px var(--gutter-r);
}

.brick-bg {
  background-image:
    linear-gradient(rgba(255,255,255,.035) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255,255,255,.035) 2px, transparent 2px);
  background-size: 96px 36px;
}

/* ===== Botones ===== */
.btn {
  display: inline-block;
  padding: .9em 1.6em;
  background: var(--yellow);
  color: #1b1714;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
  box-shadow: 0 6px 0 #c79500;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #c79500; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #c79500; }
.btn--small { padding: .55em 1.2em; box-shadow: 0 4px 0 #c79500; }
.btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.btn--ghost:hover { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 2px var(--yellow); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* ===== Cabecera ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20,17,15,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.05rem; }
.brand strong { color: var(--yellow); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { text-decoration: none; font-weight: 600; opacity: .85; transition: opacity .2s, color .2s; }
.nav a:hover { opacity: 1; color: var(--yellow); }
.nav a.btn { opacity: 1; color: #1b1714; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 3px; margin: 5px 0; background: #fff; 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); }

/* ===== Hero ===== */
.hero { position: relative; padding: clamp(48px, 9vw, 110px) 0 clamp(60px, 10vw, 120px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(217,83,43,.35), transparent 65%); pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; font-weight: 800; color: var(--yellow); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 900; }
.hl { color: var(--brick); background: linear-gradient(transparent 62%, rgba(255,198,26,.35) 62%); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; margin: 28px 0 24px; }
.scroll-hint { font-size: .9rem; color: var(--muted); animation: nudge 2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(6px); } }

.hero-art { position: relative; --bh: clamp(24px, 3.6vw, 40px); padding-top: 190px; }
.hero-wall { display: flex; flex-direction: column; gap: 4px; }
.hw-row { display: flex; gap: 4px; }
.hw-brick {
  flex: 1; height: var(--bh); border-radius: 4px;
  background: linear-gradient(#e86a40, var(--brick-dark));
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.18);
  animation: drop .8s cubic-bezier(.2,.9,.3,1.25) both;
  animation-delay: var(--d);
}
.hw-brick--half { flex: .5; }
.hw-spacer { flex: 1; }
@keyframes drop {
  from { transform: translateY(-340px) rotate(var(--r, 0deg)); opacity: 0; }
  60% { opacity: 1; }
  to { transform: none; opacity: 1; }
}
.hero-worker {
  position: absolute; right: 2%; width: clamp(110px, 16vw, 170px);
  bottom: calc(5 * (var(--bh) + 4px));
  animation: float-in 1s 1.9s both;
}
@keyframes float-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ===== Secciones ===== */
.section { padding: clamp(64px, 9vw, 120px) 0; background: var(--cream); color: var(--ink); }
.section--dark { background-color: var(--bg-2); color: #f3ece4; }
.section-head { margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 900; }
.section:not(.section--dark) .eyebrow { color: var(--brick-dark); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card {
  background: #fff; border-radius: var(--radius); padding: 30px;
  box-shadow: 0 10px 30px rgba(42,33,27,.08);
  border-bottom: 6px solid var(--brick);
  transition: transform .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-8px) rotate(-.4deg); box-shadow: 0 22px 40px rgba(42,33,27,.16); }
.card__icon { display: grid; place-items: center; width: 58px; height: 58px; font-size: 1.7rem; background: var(--cream); border-radius: 14px; margin-bottom: 16px; }
.card h3 { font-size: 1.3rem; }
.card p { color: #6b5d52; margin: 0; }

/* ===== Escenas animadas ===== */
.scenes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.scene { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 24px; }
.scene__art {
  height: 250px; margin-bottom: 20px; border-radius: 14px; overflow: hidden; position: relative;
  background: linear-gradient(#2c3e55, #45607d 60%, #5a7a52 60%, #3f5a38);
  display: flex; align-items: flex-end; justify-content: center;
}
.scene h3 { font-size: 1.4rem; display: flex; align-items: center; gap: 12px; }
.scene h3 span { display: grid; place-items: center; width: 34px; height: 34px; background: var(--yellow); color: #1b1714; border-radius: 50%; font-size: 1rem; font-weight: 900; }
.scene p { color: var(--muted); margin: 0; }
.art { width: 100%; height: 100%; }
.scene:not(.active) .art *, .scene:not(.active) .mini-wall * { animation-play-state: paused !important; }

/* Grúa */
.art--crane .trolley { animation: trolley 7s ease-in-out infinite; }
.art--crane .rope { transform-box: fill-box; transform-origin: 50% 0; animation: rope 7s ease-in-out infinite; }
.art--crane .load { animation: load 7s ease-in-out infinite; }
.art--crane .newrow { animation: newrow 7s steps(1) infinite; }
@keyframes trolley { 0%, 10% { transform: translateX(0); } 45%, 60% { transform: translateX(62px); } 95%, 100% { transform: translateX(0); } }
@keyframes rope { 0%, 40% { transform: scaleY(1); } 52%, 58% { transform: scaleY(1.75); } 75%, 100% { transform: scaleY(1); } }
@keyframes load { 0%, 40% { transform: translateY(0); } 52%, 58% { transform: translateY(30px); } 75%, 100% { transform: translateY(0); } }
@keyframes newrow { 0%, 56% { opacity: 0; } 57%, 100% { opacity: 1; } }

/* Albañil (común) */
.worker .arm-front { transform-box: view-box; transform-origin: 64px 58px; animation: lay 1s ease-in-out infinite alternate; }
.worker .arm-back { transform-box: view-box; transform-origin: 36px 58px; animation: lay-back 1s ease-in-out infinite alternate; }
.worker .torso { animation: bob .5s ease-in-out infinite alternate; }
@keyframes lay { from { transform: rotate(25deg); } to { transform: rotate(-40deg); } }
@keyframes lay-back { from { transform: rotate(-10deg); } to { transform: rotate(18deg); } }
@keyframes bob { to { transform: translateY(2px); } }

/* Mini muro de la escena 2 */
.scene__art--layer, .scene__art[data-art="layer"] { gap: 6px; padding: 0 14px; }
.scene__art[data-art="layer"] .worker { width: 46%; height: auto; flex: none; }
.mini-wall { flex: 1; display: flex; flex-direction: column; gap: 3px; --bh: 18px; padding-bottom: 10px; }
.mini-wall .hw-brick { opacity: 0; animation: none; }
.scene.active .mini-wall .hw-brick { animation: drop .6s cubic-bezier(.2,.9,.3,1.25) both; animation-delay: var(--d); }

/* Carretilla */
.art--barrow-wrap { width: 100%; height: 100%; position: relative; }
.art--barrow { position: absolute; bottom: 0; left: 0; width: 64%; height: 100%; animation: walk 7s linear infinite; }
.art--barrow .wheel { transform-box: fill-box; transform-origin: center; animation: spin 1s linear infinite; }
.art--barrow .torso { animation: bob .35s ease-in-out infinite alternate; }
.art--barrow .leg-a { transform-box: view-box; transform-origin: 54px 90px; animation: step .6s ease-in-out infinite alternate; }
.art--barrow .leg-b { transform-box: view-box; transform-origin: 66px 90px; animation: step .6s ease-in-out infinite alternate-reverse; }
@keyframes walk { 0% { transform: translateX(-70%); } 100% { transform: translateX(120%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes step { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }

/* ===== Estadísticas ===== */
.stats { background: var(--brick); color: #fff; padding: 56px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; text-align: center; }
.stat strong { display: block; font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 900; line-height: 1; }
.stat span { font-weight: 600; opacity: .9; }

/* ===== Galería ===== */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.gallery figure { margin: 0; }
.gallery__item { display: block; width: 100%; padding: 0; border: 0; background: none; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; position: relative; box-shadow: 0 10px 30px rgba(42,33,27,.15); }
.gallery__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .6s; }
.gallery__item:hover img { transform: scale(1.08); }
.gallery__item::after { content: "🔍"; position: absolute; right: 14px; bottom: 14px; width: 40px; height: 40px; display: grid; place-items: center; background: var(--yellow); border-radius: 50%; opacity: 0; transform: scale(.6); transition: .25s; }
.gallery__item:hover::after, .gallery__item:focus-visible::after { opacity: 1; transform: none; }
.gallery figcaption { padding: 12px 4px 0; font-weight: 700; }

.gallery__more { text-align: center; margin: 44px 0 0; }

/* ===== Botones sociales ===== */
.btn--whatsapp { background: #25d366; color: #05220f; box-shadow: 0 6px 0 #17a04c; }
.btn--whatsapp:hover { box-shadow: 0 8px 0 #17a04c; }
.btn--whatsapp:active { box-shadow: 0 2px 0 #17a04c; }
.btn--insta { background: linear-gradient(45deg, #f9a03f, #e1306c 55%, #833ab4); color: #fff; box-shadow: 0 6px 0 #5a2578; }
.btn--insta:hover { box-shadow: 0 8px 0 #5a2578; }
.btn--insta:active { box-shadow: 0 2px 0 #5a2578; }
.contact__buttons { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }
.wa-float {
  position: fixed; left: 20px; bottom: 20px; z-index: 60;
  display: flex; align-items: center; gap: 8px; padding: 12px 18px;
  background: #25d366; color: #05220f; font-weight: 800; text-decoration: none;
  border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: pulse 2.4s ease-in-out infinite;
}
.wa-float > span:first-child { font-size: 1.4rem; line-height: 1; }
@keyframes pulse { 0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 0 0 rgba(37,211,102,.55); } 50% { box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 0 14px rgba(37,211,102,0); } }

/* ===== Testimonios ===== */
.section--alt { background: #efe4d4; }
.testimonials { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.testimonial { margin: 0; background: #fff; border-radius: var(--radius); padding: 32px 28px 26px; position: relative; box-shadow: 0 10px 30px rgba(42,33,27,.08); display: flex; flex-direction: column; justify-content: space-between; gap: 22px; }
.testimonial::before { content: "★★★★★"; color: #f2a900; letter-spacing: 3px; font-size: 1.1rem; }
.testimonial p { font-size: 1.1rem; font-style: italic; margin: 0; }
.testimonial footer { display: flex; align-items: center; gap: 14px; font-size: .9rem; color: #6b5d52; line-height: 1.35; }
.testimonial footer strong { color: var(--ink); }
.avatar { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--brick); color: #fff; font-weight: 900; }

/* ===== Lightbox ===== */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; color: #fff; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(10,8,6,.92); }
.lightbox figure { margin: 0; max-width: min(1000px, 80vw); text-align: center; }
.lightbox img { max-height: 76vh; margin-inline: auto; border-radius: 12px; }
.lightbox figcaption { margin-top: 12px; font-weight: 700; }
.lightbox__close, .lightbox__nav { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; cursor: pointer; transition: background .2s; }
.lightbox__close:hover, .lightbox__nav:hover { background: var(--brick); }
.lightbox__close { top: 20px; right: 20px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

/* ===== Contacto ===== */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 900; }
.contact__list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; font-size: 1.1rem; }
.contact__list a { text-decoration: none; font-weight: 700; }
.contact__list a:hover { color: var(--yellow); }
.form { display: grid; gap: 18px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); padding: 30px; border-radius: var(--radius); }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: .95rem; }
.form input, .form textarea {
  font: inherit; color: #fff; background: rgba(0,0,0,.35);
  border: 2px solid rgba(255,255,255,.15); border-radius: 12px; padding: 12px 14px; resize: vertical;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--yellow); }
.form input:user-invalid, .form textarea:user-invalid { border-color: #ff6b5b; }
.form__note { margin: 0; min-height: 1.4em; font-size: .9rem; color: var(--muted); }

/* ===== Pie ===== */
.site-footer { background: #0d0b09; padding: 26px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-inner a { text-decoration: none; font-weight: 700; }
.footer-inner a:hover { color: var(--yellow); }

/* ===== Muro de progreso (scroll) ===== */
.wall-progress { position: fixed; right: 0; bottom: 0; width: 44px; height: 100vh; z-index: 40; pointer-events: none; --row: 14px; }
.wall-progress__wall { position: absolute; inset: auto 0 0 0; display: flex; flex-direction: column-reverse; box-shadow: -4px 0 20px rgba(0,0,0,.35); }
.wp-row { display: flex; height: var(--row); opacity: 0; transform: translateY(-14px) scale(.9); transition: opacity .3s, transform .35s cubic-bezier(.2,.9,.3,1.3); }
.wp-row.on { opacity: 1; transform: none; }
.wp-brick { background: linear-gradient(#e86a40, var(--brick-dark)); border: 1px solid #5a1f0b; box-sizing: border-box; flex: 2; }
.wp-brick--half { flex: 1; }
.wall-progress__worker { position: absolute; right: 0; bottom: 0; width: 60px; transition: transform .35s cubic-bezier(.2,.9,.3,1.1); will-change: transform; }

/* ===== Revelado al hacer scroll ===== */
.js .reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s ease; transition-delay: var(--rd, 0s); }
.js .reveal.visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .hero-inner, .contact { grid-template-columns: 1fr; }
  .hero-art { max-width: 460px; }
}
@media (max-width: 700px) {
  :root { --gutter-r: 40px; }
  .wall-progress { width: 24px; --row: 10px; }
  .wall-progress__worker { width: 40px; }
  .nav-toggle { display: block; }
  .nav {
    position: absolute; inset: 68px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 18px;
    padding: 24px; background: rgba(20,17,15,.97); border-bottom: 1px solid rgba(255,255,255,.1);
    transform: translateY(-120%); transition: transform .3s; visibility: hidden;
  }
  .nav.open { transform: none; visibility: visible; }
  .brand span { font-size: .95rem; }
  .wa-float { padding: 14px; left: 14px; bottom: 14px; }
  .wa-float__label { display: none; }
}

/* ===== Accesibilidad: reducir movimiento ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
