:root {
  --orange: #EE6A12;
  --orange-dark: #C9550A;
  --orange-soft: #FFE6D3;
  --forest: #1E3A2B;
  --forest-2: #2C4F3A;
  --cream: #F7F3EA;
  --sand: #EFE7D6;
  --ink: #161816;
  --muted: #5B635C;
  --line: #DED6C4;
  --radius: 14px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: "Inter", system-ui, sans-serif; color: var(--ink); background: var(--cream);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }
h1, h2, h3 { font-family: "Outfit", "Inter", sans-serif; line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; scroll-margin-top: 60px; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--orange); margin-bottom: 14px;
}
.lead { font-size: 1.1rem; color: var(--muted); max-width: 62ch; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 24px;
  border-radius: 999px; border: 0; cursor: pointer; font-weight: 600; text-decoration: none;
  transition: background .2s, transform .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-ghost { border: 1.5px solid rgba(255,255,255,.6); color: #fff; background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn svg { width: 18px; height: 18px; }

/* Aparición al hacer scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Header ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background .25s, box-shadow .25s; }
.site-header.scrolled { background: rgba(247,243,234,.96); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(8px); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: block; position: relative; height: 46px; }
.brand img { height: 46px; width: auto; transition: opacity .25s; }
.brand .logo-dark { position: absolute; inset: 0; opacity: 0; }
.scrolled .brand .logo-dark { opacity: 1; }
.scrolled .brand .logo-light { opacity: 0; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { text-decoration: none; color: #fff; font-weight: 500; font-size: .95rem; position: relative; }
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -6px; height: 2px; background: var(--orange); transition: right .25s;
}
.nav-links a:not(.btn):hover::after, .nav-links a.active::after { right: 0; }
.scrolled .nav-links a { color: var(--ink); }
.nav-links a.btn { color: #fff; padding: 10px 18px; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 8px; }
.scrolled .menu-toggle { color: var(--ink); }

/* ---------- Hero con video ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 140px 0 120px; color: #fff; overflow: hidden; background: var(--forest); }
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, rgba(16,34,24,.92) 0%, rgba(16,34,24,.75) 42%, rgba(16,34,24,.25) 80%);
}
.hero .wrap { position: relative; z-index: 2; width: 100%; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 4rem); font-weight: 800; max-width: 17ch; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: #FFB27A; }
.hero p { font-size: 1.15rem; max-width: 54ch; color: rgba(255,255,255,.88); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.video-toggle {
  position: absolute; z-index: 2; right: 24px; bottom: 96px; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.5); background: rgba(0,0,0,.25); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.video-toggle svg { width: 18px; height: 18px; }
.trust {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; background: rgba(16,34,24,.72); backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,.1);
}
.trust .wrap { display: flex; flex-wrap: wrap; gap: 8px 36px; padding-top: 18px; padding-bottom: 18px; font-size: .9rem; color: rgba(255,255,255,.8); }
.trust strong { color: #fff; font-weight: 600; }

/* ---------- Residencia: stepper ---------- */
.res-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 64px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: .9rem; font-weight: 500; }
.stepper { background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.step-tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.step-tab {
  background: none; border: 0; padding: 18px 8px 14px; cursor: pointer; color: var(--muted); font-size: .82rem;
  font-weight: 500; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; line-height: 1.25;
}
.step-tab b {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--sand);
  color: var(--ink); font-family: "Outfit", sans-serif; font-size: 1rem; transition: background .2s, color .2s;
}
.step-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--orange); transform: scaleX(0); transition: transform .3s; }
.step-tab[aria-selected="true"] { color: var(--ink); }
.step-tab[aria-selected="true"] b { background: var(--orange); color: #fff; }
.step-tab[aria-selected="true"]::after { transform: scaleX(1); }
.step-panel { padding: 32px; min-height: 230px; }
.step-panel h3 { font-size: 1.45rem; }
.step-panel p { color: var(--muted); }
.step-panel ul { margin: 0; padding-left: 20px; color: var(--muted); }
.step-panel li { margin-bottom: 4px; }
.step-nav { display: flex; justify-content: space-between; align-items: center; padding: 0 32px 28px; }
.step-nav button { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; font-weight: 500; }
.step-nav button:hover { border-color: var(--orange); color: var(--orange-dark); }
.step-progress { flex: 1; height: 4px; background: var(--sand); margin: 0 16px; border-radius: 4px; overflow: hidden; }
.step-progress i { display: block; height: 100%; background: var(--orange); width: 20%; transition: width .35s; }

/* ---------- Servicios ---------- */
.services { background: var(--forest); color: #fff; }
.services .lead { color: rgba(255,255,255,.75); }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; }
.svc {
  background: var(--forest-2); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 26px;
  transition: transform .25s, border-color .25s, background .25s;
}
.svc:hover { transform: translateY(-4px); border-color: rgba(238,106,18,.6); background: #335a43; }
.svc .ico { width: 46px; height: 46px; border-radius: 12px; background: rgba(238,106,18,.16); color: #FF9A55; display: grid; place-items: center; margin-bottom: 16px; }
.svc .ico svg { width: 24px; height: 24px; }
.svc p { color: rgba(255,255,255,.75); margin: 0; font-size: .96rem; }

/* ---------- Proyectos ---------- */
.projects-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 36px; }
.ptabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin-bottom: 28px; }
.ptab {
  position: relative; background: none; border: 0; padding: 20px 24px 4px 0; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; color: var(--muted); transition: color .2s;
}
.ptab::before {
  content: ""; position: absolute; left: 0; right: 24px; top: -1px; height: 2px; background: var(--forest);
  transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.ptab-n { grid-row: span 2; font-family: "Outfit", sans-serif; font-size: .85rem; font-weight: 600; letter-spacing: .06em; padding-top: 4px; color: #A9A190; transition: color .2s; }
.ptab-t { font-family: "Outfit", sans-serif; font-size: 1.2rem; font-weight: 600; line-height: 1.3; }
.ptab-d { font-size: .85rem; }
.ptab:hover { color: var(--ink); }
.ptab:hover::before { transform: scaleX(.25); }
.ptab[aria-selected="true"] { color: var(--ink); }
.ptab[aria-selected="true"] .ptab-n { color: var(--orange); }
.ptab[aria-selected="true"] .ptab-d { color: var(--muted); }
.ptab[aria-selected="true"]::before { transform: scaleX(1); }
.ptab:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
.ppanel { display: grid; grid-template-columns: 1.25fr 1fr; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.ppanel[hidden] { display: none; }
.ppanel.fade { animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.gallery { padding: 14px; display: grid; gap: 10px; }
.gallery-main { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--sand); cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gallery-main:hover img { transform: scale(1.03); }
.gallery-main .zoom { position: absolute; right: 12px; bottom: 12px; background: rgba(22,24,22,.7); color: #fff; border-radius: 999px; font-size: .78rem; padding: 6px 12px; }
.thumbs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; aspect-ratio: 16 / 10; background: var(--sand); opacity: .7; transition: opacity .2s, border-color .2s; }
.thumbs button:hover { opacity: 1; }
.thumbs button[aria-current="true"] { border-color: var(--orange); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pbody { padding: 36px 36px 36px 22px; display: flex; flex-direction: column; justify-content: center; }
.pbody .num { font-family: "Outfit", sans-serif; color: var(--orange); font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.pbody h3 { font-size: 1.65rem; }
.pbody p { color: var(--muted); }
.pbody ul { padding: 0; margin: 4px 0 0; list-style: none; }
.pbody li { padding: 9px 0 9px 28px; position: relative; border-top: 1px solid var(--line); font-size: .96rem; }
.pbody li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.note { font-size: .8rem; color: var(--muted); margin-top: 12px; }

/* Modelo interactivo */
.model { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: stretch; margin-top: 64px; }
.calc { background: var(--forest); color: #fff; border-radius: 20px; padding: 34px; display: flex; flex-direction: column; }
.calc .lead { color: rgba(255,255,255,.75); font-size: 1rem; }
.calc label { font-weight: 600; display: flex; justify-content: space-between; margin-top: 10px; }
.calc input[type=range] { width: 100%; accent-color: var(--orange); margin: 14px 0 22px; }
.calc-out { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: auto; }
.calc-out div { background: var(--forest-2); border-radius: 12px; padding: 16px; }
.calc-out strong { display: block; font-family: "Outfit", sans-serif; font-size: 1.9rem; line-height: 1.1; color: #FFB27A; }
.calc-out span { font-size: .85rem; color: rgba(255,255,255,.75); }
.plan-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.plan-card svg { width: 100%; height: auto; }
.plan-card svg g { transition: opacity .3s; }
.plan-card svg g.off { opacity: .08; }
.layer-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.layer-toggles button {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font-size: .86rem; font-weight: 500; display: inline-flex; align-items: center; gap: 8px;
}
.layer-toggles button i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.layer-toggles button[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }

/* Video del proyecto */
.showreel { position: relative; margin-top: 64px; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 16 / 7; }
.showreel video { width: 100%; height: 100%; object-fit: cover; }
.showreel .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 32px 28px; color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,.7), rgba(0,0,0,0)); display: flex; justify-content: space-between; align-items: end; gap: 20px;
}
.showreel .cap h3 { margin: 0; font-size: 1.5rem; }
.showreel .cap p { margin: 4px 0 0; color: rgba(255,255,255,.8); font-size: .95rem; }

/* ---------- Empresa ---------- */
.company { background: var(--sand); }
.about-grid { max-width: 820px; }
.ceo { display: flex; gap: 20px; align-items: center; margin-top: 28px; }
.ceo-photo { width: 105px; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(30, 58, 43, .18); flex: none; }
.ceo strong { display: block; }
.ceo span { color: var(--muted); font-size: .92rem; }

/* ---------- Ubicación ---------- */
.map-box { display: grid; grid-template-columns: 340px 1fr; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin-top: 40px; }
.map-side { padding: 14px; display: grid; gap: 10px; align-content: start; }
.map-opt {
  text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 18px; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.map-opt:hover { border-color: var(--orange); }
.map-opt[aria-selected="true"] { border-color: var(--orange); background: var(--orange-soft); }
.map-opt strong { display: block; font-family: "Outfit", sans-serif; font-size: 1.1rem; margin-bottom: 4px; }
.map-opt span { display: block; color: var(--muted); font-size: .9rem; }
.map-side a { color: var(--orange-dark); font-weight: 600; text-decoration: none; font-size: .92rem; padding: 4px 6px; }
.map-box iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; background: var(--sand); }

/* ---------- Contacto ---------- */
.contact { background: var(--forest); color: #fff; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.contact .lead { color: rgba(255,255,255,.78); }
.contact-list { display: grid; gap: 12px; margin-top: 28px; }
.contact-item { display: flex; gap: 16px; align-items: center; padding: 16px 20px; border-radius: var(--radius); background: var(--forest-2); text-decoration: none; border: 1px solid rgba(255,255,255,.08); transition: border-color .2s; }
a.contact-item:hover { border-color: var(--orange); }
.contact-item svg { width: 22px; height: 22px; color: #FF9A55; flex: none; }
.contact-item small { display: block; color: rgba(255,255,255,.6); font-size: .8rem; }
.wa-form { background: #fff; color: var(--ink); border-radius: 20px; padding: 32px; }
.wa-form h3 { font-size: 1.4rem; }
.wa-form p { color: var(--muted); font-size: .95rem; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field legend { font-weight: 600; font-size: .9rem; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; font: inherit; background: var(--cream);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--orange); background: #fff; }
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts label { cursor: pointer; position: relative; }
.opts input { position: absolute; opacity: 0; pointer-events: none; }
.opts span { display: inline-block; border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: .88rem; font-weight: 500; transition: all .2s; }
.opts input:checked + span { background: var(--orange); border-color: var(--orange); color: #fff; }
.opts input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.wa-form .btn { width: 100%; background: #1FA855; color: #fff; }
.wa-form .btn:hover { background: #178A45; }

/* ---------- Footer ---------- */
footer { background: #12261B; color: rgba(255,255,255,.7); padding: 36px 0; font-size: .88rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.foot img { height: 40px; width: auto; }

.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 58px; height: 58px; border-radius: 50%; background: #25D366; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: transform .2s; }
.wa-float:hover { transform: scale(1.07); }
.wa-float svg { width: 30px; height: 30px; color: #fff; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,14,12,.92); display: none; align-items: center; justify-content: center; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 88vh; max-width: 92vw; border-radius: 10px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 1.5rem; display: grid; place-items: center; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  section { padding: 72px 0; }
  .res-grid, .projects-head, .model, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .svc-grid { grid-template-columns: 1fr 1fr; }
  .ppanel { grid-template-columns: 1fr; }
  .pbody { padding: 10px 26px 30px; }
  .map-box { grid-template-columns: 1fr; }
  .map-side { grid-template-columns: 1fr 1fr; }
  .map-side a { grid-column: span 2; }
  .map-box iframe { min-height: 340px; }
  .showreel { aspect-ratio: 16 / 10; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .ptab { padding: 16px 10px 4px 0; display: block; }
  .ptab::before { right: 10px; }
  .ptab-n { display: block; padding: 0; }
  .ptab-t { display: block; font-size: 1rem; }
  .ptab-d { display: none; }
  .menu-toggle { display: block; }
  .nav-links {
    position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); padding: 8px 16px 20px; box-shadow: 0 12px 24px rgba(0,0,0,.12); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { color: var(--ink); padding: 14px 4px; border-bottom: 1px solid var(--line); }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links a.btn { margin-top: 14px; border: 0; }
  .brand, .brand img { height: 38px; }
  .hero { padding-bottom: 150px; }
  .hero::before { background: linear-gradient(180deg, rgba(16,34,24,.85) 0%, rgba(16,34,24,.7) 60%, rgba(16,34,24,.55) 100%); }
  .video-toggle { bottom: auto; top: 90px; right: 16px; }
  .trust .wrap { gap: 4px 20px; font-size: .82rem; }
  .svc-grid { grid-template-columns: 1fr; }
  .step-tab { font-size: 0; gap: 0; padding: 14px 4px; }
  .step-panel { padding: 24px; }
  .step-nav { padding: 0 24px 24px; }
  .calc-out { grid-template-columns: 1fr; }
  .map-side { grid-template-columns: 1fr; }
  .map-side a { grid-column: auto; }
  .showreel .cap { flex-direction: column; align-items: start; padding: 40px 20px 20px; }
  .wa-form { padding: 24px; }
}
