/* Fernandez Masonry Inc — brand palette from the brand manual */
:root {
  --carbon: #1C1B1A;
  --grafito: #3A3836;
  --pizarra: #6B6865;
  --piedra: #A19D98;
  --caliza: #D6D2CC;
  --marmol: #F4F2EE;
  --accent: #C9A46A;        /* warm sandstone, taken from the project photos */
  --accent-dark: #7E5F2C;   /* darker sandstone for small text on light backgrounds (AA contrast) */
  --white: #fff;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.nav-open, body.lb-open { overflow: hidden; }
body {
  margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.65;
  color: var(--grafito); background: var(--marmol); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); color: var(--carbon); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; }
body, h1, h2, h3 { font-variant-numeric: lining-nums; }
h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); letter-spacing: -.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 1000; background: var(--accent); color: var(--carbon); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 600 .95rem/1 var(--sans); letter-spacing: .04em; text-decoration: none; cursor: pointer;
  padding: 1em 1.6em; border-radius: 999px; border: 2px solid transparent;
  transition: transform .35s var(--ease), background .3s, color .3s, box-shadow .3s;
}
.btn-sm { padding: .7em 1.2em; font-size: .85rem; }
.btn-lg { padding: 1.15em 2em; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: var(--carbon); box-shadow: 0 10px 30px -10px rgba(201,164,106,.7); }
.btn-accent:hover { background: #d8b67f; transform: translateY(-2px); }
.btn-ghost { border-color: rgba(255,255,255,.55); color: var(--white); }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: var(--white); }
.btn-ghost-dark { border-color: var(--pizarra); color: var(--carbon); background: transparent; }
.icon-phone { width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 0 1 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.2.2 2.4.6 3.6.1.3 0 .7-.2 1z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 0 1 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.2.2 2.4.6 3.6.1.3 0 .7-.2 1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Preloader ---------- */
.preloader { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2000; background: var(--carbon); display: grid; place-content: center; justify-items: center; gap: 22px; transition: opacity .7s var(--ease), visibility .7s; animation: preloaderFailsafe .6s 4s forwards; }
/* Failsafe: the preloader hides itself after 4s even if a script never runs */
@keyframes preloaderFailsafe { to { opacity: 0; visibility: hidden; } }
.preloader img { width: 220px; height: auto; opacity: 0; animation: fadeUp .9s .1s var(--ease) forwards; }
.preloader-bar { width: 160px; height: 2px; background: rgba(255,255,255,.12); position: relative; overflow: hidden; }
.preloader-bar::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: translateX(-100%); animation: load 1s .2s var(--ease) forwards; }
.loaded .preloader { opacity: 0; visibility: hidden; }
@keyframes load { to { transform: translateX(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Top bar & header ---------- */
.topbar { background: var(--carbon); color: var(--caliza); font-size: .78rem; letter-spacing: .05em; position: relative; z-index: 60; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 40px; }
.topbar-phone { text-decoration: none; font-weight: 600; color: var(--white); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.lang-switch { display: inline-flex; border: 1px solid var(--pizarra); border-radius: 999px; overflow: hidden; }
.lang-switch button { background: none; border: 0; color: var(--caliza); font: 600 .72rem var(--sans); padding: 5px 10px; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--carbon); }

.site-header { position: absolute; top: 40px; left: 0; right: 0; z-index: 50; transition: background .4s, box-shadow .4s, transform .4s var(--ease); }
.site-header.is-fixed { position: fixed; top: 0; background: rgba(244,242,238,.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 6px 30px -12px rgba(0,0,0,.25); }
/* backdrop-filter and transform trap position:fixed children, so drop them while the mobile menu is open */
.nav-open .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; transform: none; }
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 84px; }
.brand img { width: 170px; height: auto; }
.brand .logo-dark { display: none; }
.is-fixed .brand .logo-light { display: none; }
.is-fixed .brand .logo-dark { display: block; }
.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a:not(.btn) { color: var(--white); text-decoration: none; font-weight: 500; font-size: .92rem; position: relative; padding: 6px 0; }
.main-nav a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.main-nav a:not(.btn):hover::after { transform: scaleX(1); transform-origin: left; }
.is-fixed .main-nav a:not(.btn) { color: var(--carbon); }
.menu-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.menu-toggle .bar { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--white); transition: transform .4s var(--ease), opacity .3s; }
.menu-toggle .b1 { top: 15px; } .menu-toggle .b2 { top: 21px; } .menu-toggle .b3 { top: 27px; }
.is-fixed .menu-toggle .bar { background: var(--carbon); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; color: var(--white); overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); animation: kenburns 18s ease-out forwards; }
@keyframes kenburns { to { transform: scale(1.02); } }
.hero-overlay { position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(28,27,26,.88) 0%, rgba(28,27,26,.6) 45%, rgba(28,27,26,.15) 100%), linear-gradient(0deg, rgba(28,27,26,.6), transparent 40%); }
.hero-content { padding: 160px 0 110px; max-width: 760px; margin-left: max(16px, calc((100% - var(--container)) / 2)); }
.kicker { text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; font-weight: 600; color: var(--accent); }
.hero-title { color: var(--white); font-size: clamp(3rem, 8vw, 6.2rem); font-weight: 600; line-height: 1.02; margin: .25em 0 .35em; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > * { display: inline-block; transition: transform 1.1s var(--ease); }
.js .hero-title .line > * { transform: translateY(110%); }
.hero-title em { font-style: italic; color: var(--accent); }
.loaded .hero-title .line > * { transform: none; }
.loaded .hero-title .line:nth-child(2) > * { transition-delay: .12s; }
.loaded .hero-title .line:nth-child(3) > * { transition-delay: .24s; }
.hero-sub { font-size: clamp(1rem, 1.6vw, 1.18rem); max-width: 560px; color: var(--caliza); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.scroll-cue { position: absolute; bottom: 30px; left: 50%; width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.6); border-radius: 20px; transform: translateX(-50%); }
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; background: var(--white); border-radius: 2px; animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Marquee ---------- */
.marquee { background: var(--accent); color: var(--carbon); overflow: hidden; padding: 18px 0; }
.marquee-track { display: flex; width: max-content; gap: 34px; align-items: center; animation: marquee 38s linear infinite; font: 600 1.35rem var(--serif); white-space: nowrap; }
.marquee-track i { font-style: normal; font-size: .8rem; opacity: .6; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.dark { background: var(--carbon); color: var(--caliza); }
.dark h2, .dark h3 { color: var(--marmol); }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: .76rem; font-weight: 700; color: var(--accent-dark); display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 34px; height: 2px; background: currentColor; }
.dark .eyebrow { color: var(--accent); }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-lead { font-size: 1.1rem; }

/* Intro */
.intro-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.intro-media { position: relative; border-radius: var(--radius); }
.intro-media img { border-radius: var(--radius); width: 100%; height: auto; aspect-ratio: 4/4.3; object-fit: cover; }
.intro-badge { position: absolute; right: -24px; bottom: 34px; background: var(--carbon); color: var(--marmol); padding: 22px 26px; border-radius: var(--radius); box-shadow: 0 30px 60px -25px rgba(0,0,0,.6); display: flex; flex-direction: column-reverse; }
.badge-num { font: 600 2.8rem/1 var(--serif); color: var(--accent); }
.badge-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .16em; margin-bottom: 6px; }
.intro-text h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
.trust-list { list-style: none; padding: 0; margin: 34px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.trust-list li { border-top: 2px solid var(--carbon); padding-top: 14px; display: flex; flex-direction: column; font-size: .85rem; }
.trust-list strong { font-family: var(--serif); font-size: 1.05rem; color: var(--carbon); }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; perspective: 1000px; }
.service-card { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4; background: var(--grafito); transform-style: preserve-3d; transition: transform .5s var(--ease), box-shadow .5s; }
.service-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.service-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(28,27,26,.92) 100%); transition: background .5s; }
.service-card:hover img { transform: scale(1.08); }
.service-card:hover { box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); }
.service-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 22px; transform: translateZ(30px); }
.service-num { font: 600 .8rem var(--sans); color: var(--accent); letter-spacing: .15em; }
.service-body h3 { color: var(--white); margin: .3em 0 .2em; font-size: 1.3rem; }
.service-body p { font-size: .86rem; color: var(--caliza); margin: 0; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .6s var(--ease), opacity .5s; }
.service-card:hover .service-body p, .service-card:focus-within .service-body p { max-height: 80px; opacity: 1; }
.services-more { margin-top: 36px; text-align: center; color: var(--piedra); }

/* Before / after */
.compare-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.compare { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; -webkit-user-select: none; user-select: none; touch-action: pan-y; cursor: ew-resize; -webkit-tap-highlight-color: transparent; box-shadow: 0 40px 80px -40px rgba(0,0,0,.5); }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; -webkit-touch-callout: none; pointer-events: none; }
.compare-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; background: var(--white); transform: translateX(-50%); pointer-events: none; }
.compare-handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--carbon); display: grid; place-items: center; font-weight: 700; letter-spacing: 2px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; pointer-events: none; } /* keyboard only; pointer drag is handled in main.js */
.compare:has(.compare-range:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; }
.compare-tag { position: absolute; top: 16px; padding: 6px 12px; border-radius: 999px; background: rgba(28,27,26,.75); color: var(--white); font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }
.tag-before { left: 16px; } .tag-after { right: 16px; }
.link-arrow { font-weight: 600; color: var(--carbon); text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 3px; }
.link-arrow::after { content: " →"; transition: margin .3s; }
.link-arrow:hover::after { margin-left: 6px; }

/* Projects */
.projects { background: var(--white); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.filter { background: transparent; border: 1.5px solid var(--caliza); color: var(--grafito); font: 600 .85rem var(--sans); padding: .65em 1.2em; border-radius: 999px; cursor: pointer; transition: all .3s; }
.filter:hover { border-color: var(--carbon); }
.filter.is-active { background: var(--carbon); border-color: var(--carbon); color: var(--marmol); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 230px; grid-auto-flow: dense; gap: 14px; }
.g-item { margin: 0; position: relative; border-radius: 12px; overflow: hidden; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.g-item.tall { grid-row: span 2; }
.g-item.wide { grid-column: span 2; }
.g-item.is-out { display: none; }
.g-open { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.g-open:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), filter .6s; }
.g-item:hover img { transform: scale(1.07); }
.g-item figcaption { position: absolute; left: 12px; bottom: 12px; right: 12px; color: var(--white); font-size: .82rem; font-weight: 600; background: rgba(28,27,26,.72); padding: 8px 12px; border-radius: 8px; transform: translateY(12px); opacity: 0; transition: all .4s var(--ease); pointer-events: none; }
.g-item:hover figcaption, .g-item:focus-within figcaption { transform: none; opacity: 1; }

/* Process */
.process-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: s; position: relative; }
.process-steps li { position: relative; }
.process-steps figure { margin: 0 0 22px; border-radius: 12px; overflow: hidden; aspect-ratio: 4/5; }
.process-steps img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.4); transition: filter .6s, transform 1s var(--ease); }
.process-steps li:hover img { filter: none; transform: scale(1.05); }
.step-num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); font: 600 1rem var(--serif); margin-bottom: 12px; }
.process-steps p { font-size: .9rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.about-media { position: relative; height: 620px; }
.parallax-img { position: absolute; border-radius: var(--radius); overflow: hidden; box-shadow: 0 40px 70px -35px rgba(0,0,0,.55); will-change: transform; }
.parallax-img img { width: 100%; height: 100%; object-fit: cover; }
.parallax-img:first-child { left: 0; top: 0; width: 62%; height: 88%; }
.parallax-img.second { right: 0; bottom: 0; width: 46%; height: 60%; border: 8px solid var(--marmol); }
.commitments { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; margin-top: 30px; }
.commit-icon { color: var(--accent-dark); font-size: .9rem; }
.commit h3 { font-size: 1.15rem; margin: .4em 0 .3em; }
.commit p { font-size: .9rem; margin: 0; }

/* CTA band */
.cta-band { position: relative; padding: clamp(90px, 12vw, 150px) 0; color: var(--white); text-align: center; overflow: hidden; isolation: isolate; }
.cta-band-bg { position: absolute; inset: -15% 0; z-index: -2; }
.cta-band-bg img { width: 100%; height: 100%; object-fit: cover; }
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(28,27,26,.78); }
.cta-band h2 { color: var(--white); }
.cta-band p { color: var(--caliza); font-size: 1.1rem; }
.cta-band .hero-ctas { justify-content: center; }

/* Areas */
.areas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.city-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.city-chips li { padding: .7em 1.2em; border-radius: 999px; background: var(--white); border: 1.5px solid var(--caliza); font-weight: 600; font-size: .9rem; color: var(--carbon); transition: transform .3s var(--ease), background .3s, color .3s; }
.city-chips li:hover { background: var(--carbon); color: var(--marmol); transform: translateY(-3px); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 30px 0 0; }
.contact-list li { display: flex; flex-direction: column; padding: 16px 0; border-bottom: 1px solid var(--grafito); }
.contact-list span { font-size: .75rem; text-transform: uppercase; letter-spacing: .16em; color: var(--piedra); }
.contact-list a, .contact-list strong { font: 600 1.35rem var(--serif); color: var(--marmol); text-decoration: none; }
.contact-list a:hover { color: var(--accent); }
.quote-form { background: var(--grafito); border-radius: 20px; padding: clamp(24px, 4vw, 40px); box-shadow: 0 40px 80px -40px rgba(0,0,0,.8); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 6px; color: var(--caliza); }
.field input, .field select, .field textarea { width: 100%; font: 400 16px var(--sans); -webkit-appearance: none; appearance: none; color: var(--white); background: var(--carbon); border: 1.5px solid var(--pizarra); border-radius: 10px; padding: .85em 1em; transition: border-color .3s, box-shadow .3s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,164,106,.3); }
.field [aria-invalid="true"] { border-color: #E07A6B; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; color: var(--caliza); margin-bottom: 14px; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.form-note { font-size: .78rem; color: var(--caliza); }
.form-note a { color: var(--white); }
.form-status { margin: 14px 0 0; font-weight: 600; color: var(--accent); min-height: 1.4em; }

/* Footer */
.site-footer { background: #121110; color: var(--piedra); padding: 70px 0 100px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--grafito); }
.footer-brand img { width: 240px; height: auto; margin-bottom: 16px; }
.site-footer h3 { color: var(--marmol); font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .18em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 24px; font-size: .8rem; }
.footer-bottom p { margin: 0; }
.footer-bottom nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* Mobile bar */
.mobile-bar { display: none; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 900; background: rgba(18,17,16,.95); display: grid; place-items: center; padding: 60px 70px; animation: fadeIn .3s; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 1100px; text-align: center; }
.lightbox img { max-height: 78vh; width: auto; margin: 0 auto; border-radius: 10px; animation: zoomIn .45s var(--ease); }
.lightbox figcaption { color: var(--caliza); margin-top: 14px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.08); border: 0; color: var(--white); width: 52px; height: 52px; border-radius: 50%; font-size: 2rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: var(--accent); color: var(--carbon); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.94); } }

/* Cookie banner */
.cookie { position: fixed; left: 16px; bottom: 16px; z-index: 800; max-width: 420px; background: var(--marmol); color: var(--grafito); border-radius: 14px; padding: 18px 20px; box-shadow: 0 20px 50px -15px rgba(0,0,0,.45); font-size: .85rem; animation: fadeUp .5s var(--ease); }
.cookie[hidden] { display: none; }
.cookie div { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Chatbot ---------- */
.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 700; display: flex; align-items: center; gap: 10px; background: var(--carbon); color: var(--marmol); border: 2px solid var(--accent); border-radius: 999px; padding: 12px 20px 12px 14px; font: 600 .9rem var(--sans); cursor: pointer; box-shadow: 0 18px 40px -12px rgba(0,0,0,.55); transition: transform .4s var(--ease); animation: fabIn .8s 2.2s var(--ease) both; }
.chat-fab:hover { transform: translateY(-3px) scale(1.03); }
@keyframes fabIn { from { opacity: 0; transform: translateY(30px) scale(.8); } }
.chat-fab-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); position: relative; }
.chat-fab-icon::before { content: ""; position: absolute; inset: 6px; background: var(--carbon); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-5 4V6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-5 4V6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") center/contain no-repeat; }
.chat-ping { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.chat-ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: ping 1.8s infinite; }
@keyframes ping { to { transform: scale(2.6); opacity: 0; } }
.chat-fab[aria-expanded="true"] .chat-ping { display: none; }
.chat-panel { position: fixed; right: 22px; bottom: 90px; z-index: 710; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); height: min(560px, calc(100svh - 120px)); background: var(--marmol); border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.55); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right; animation: chatIn .45s var(--ease); }
.chat-panel[hidden] { display: none; }
@keyframes chatIn { from { opacity: 0; transform: translateY(20px) scale(.92); } }
.chat-head { background: var(--carbon); color: var(--marmol); display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.chat-head img { width: 70px; height: auto; }
.chat-head div { display: flex; flex-direction: column; line-height: 1.3; flex: 1; }
.chat-head strong { font-family: var(--serif); font-size: 1.02rem; }
.chat-online { font-size: .72rem; color: var(--piedra); display: flex; align-items: center; gap: 6px; }
.chat-online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6FCF7F; }
.chat-close { background: none; border: 0; color: var(--marmol); font-size: 1.6rem; cursor: pointer; width: 36px; height: 36px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { max-width: 84%; padding: 10px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.5; animation: msgIn .35s var(--ease); white-space: pre-line; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.msg.bot { background: var(--white); color: var(--grafito); border-bottom-left-radius: 4px; align-self: flex-start; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.msg.user { background: var(--carbon); color: var(--marmol); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg a { color: var(--accent-dark); font-weight: 600; }
.msg.user a { color: var(--accent); }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--piedra); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.chat-quick button { background: var(--white); border: 1.5px solid var(--caliza); color: var(--carbon); border-radius: 999px; padding: 7px 12px; font: 600 .78rem var(--sans); cursor: pointer; transition: all .25s; }
.chat-quick button:hover { border-color: var(--accent); background: var(--accent); }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--caliza); background: var(--white); }
.chat-input input { flex: 1; min-width: 0; border: 1.5px solid var(--caliza); border-radius: 999px; padding: 10px 14px; font: 400 16px var(--sans); -webkit-appearance: none; appearance: none; } /* 16px stops iOS from zooming on focus */
.chat-input input:focus { outline: none; border-color: var(--accent); }
.chat-input button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--carbon); color: var(--accent); cursor: pointer; font-size: 1rem; }

/* ---------- Scroll reveal ---------- */
.js .reveal-up { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal-up.in { opacity: 1; transform: none; }
.js .reveal-stagger > * { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal-stagger.in > * { opacity: 1; transform: none; }
.js .reveal-mask img { clip-path: inset(0 100% 0 0 round var(--radius)); transition: clip-path 1.4s var(--ease); }
.js .reveal-mask.in img { clip-path: inset(0 0 0 0 round var(--radius)); }
.js .reveal-mask .intro-badge { opacity: 0; transform: translateY(20px); transition: all .8s .9s var(--ease); }
.js .reveal-mask.in .intro-badge { opacity: 1; transform: none; }
.hero .reveal-up { transition-delay: .45s; }
.hero .hero-ctas.reveal-up { transition-delay: .6s; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .menu-toggle { display: block; z-index: 2; }
  .main-nav { position: fixed; inset: 0; background: var(--carbon); flex-direction: column; justify-content: center; gap: 26px; transform: translateX(100%); transition: transform .6s var(--ease); }
  .main-nav a:not(.btn) { color: var(--marmol) !important; font: 600 1.7rem var(--serif); }
  .nav-open .main-nav { transform: none; }
  .nav-open .menu-toggle .bar { background: var(--marmol); }
  .nav-open .menu-toggle .b1 { transform: translateY(6px) rotate(45deg); }
  .nav-open .menu-toggle .b2 { opacity: 0; }
  .nav-open .menu-toggle .b3 { transform: translateY(-6px) rotate(-45deg); }
  .intro-grid, .compare-grid, .about-grid, .areas-grid, .contact-grid { grid-template-columns: 1fr; }
  .intro-badge { right: 12px; }
  .about-media { height: 480px; }
  .topbar-free { display: none; }
}
@media (max-width: 640px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .topbar-lic { display: none; }
  .topbar-inner { justify-content: flex-end; }
  .brand img { width: 136px; }
  .header-inner { min-height: 70px; }
  .hero-content { padding: 130px 0 90px; }
  .hero-ctas .btn { width: 100%; }
  .services-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .service-body { padding: 14px; }
  .service-body h3 { font-size: 1.02rem; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 170px; gap: 10px; }
  .g-item.wide { grid-column: span 2; }
  .process-steps { grid-template-columns: 1fr; }
  .process-steps figure { aspect-ratio: 16/10; }
  .trust-list { grid-template-columns: 1fr; }
  .commitments { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .about-media { height: 400px; }
  .mobile-bar { display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 690; height: calc(64px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--carbon); box-shadow: 0 -6px 20px rgba(0,0,0,.2); }
  .mobile-bar a { display: grid; place-items: center; font-weight: 700; text-decoration: none; letter-spacing: .04em; }
  .mb-call { background: var(--carbon); color: var(--marmol); }
  .mb-quote { background: var(--accent); color: var(--carbon); }
  .chat-fab { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); right: 14px; padding: 10px; }
  .chat-fab-label { display: none; }
  .chat-panel { right: 16px; bottom: calc(140px + env(safe-area-inset-bottom, 0px)); height: min(520px, calc(100vh - 190px)); height: min(520px, calc(100svh - 170px - env(safe-area-inset-bottom, 0px))); }
  .cookie { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); right: 12px; left: 12px; max-width: none; padding: 14px 16px; }
  /* While the cookie notice is up on phones, the chat button waits so the two never overlap */
  .cookie-open .chat-fab { display: none; }
  .chat-open .cookie { display: none; }
  .nav-open .cookie { display: none; }
  .lightbox { padding: 60px 10px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .marquee-track { animation: none; }
  .hero-media img { transform: none; }
}

/* Lining numerals where the font shorthand resets them */
.badge-num, .contact-list a, .contact-list strong, .marquee-track, .step-num { font-variant-numeric: lining-nums; }

/* Custom arrow for selects (appearance: none removes the native one on iOS) */
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23C9A46A' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; padding-right: 40px; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Send buttons in the chat and the form */
a.lead-btn, button.lead-btn { display: block; width: 100%; box-sizing: border-box; border: 0; cursor: pointer; font-family: inherit; font-size: inherit; margin-top: 8px; padding: 11px 14px; border-radius: 999px; background: var(--accent); color: var(--carbon); font-weight: 700; text-align: center; text-decoration: none; }

/* Service areas grouped by region */
.area-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 32px; }
.area-group h3 { font-size: 1.15rem; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--caliza); }
.area-group .city-chips { gap: 8px; }
.area-group .city-chips li { padding: .45em .9em; font-size: .82rem; }
@media (max-width: 900px) { .area-groups { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .area-groups { grid-template-columns: 1fr; gap: 28px; } }

/* Service cards open a detail window */
.service-open { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; padding: 0; background: transparent; border: 0; border-radius: var(--radius); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.service-open:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.service-view { display: inline-block; margin-top: 8px; color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.footer-service { text-align: left; text-decoration: none; }
.footer-service:hover { color: var(--accent); }
.service-modal { position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(18,17,16,.82); animation: fadeIn .3s; }
.service-modal[hidden] { display: none; }
.service-modal-box { position: relative; width: min(920px, 100%); max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: var(--marmol); border-radius: 18px; animation: zoomIn .4s var(--ease); }
.service-modal-close { position: sticky; top: 12px; float: right; z-index: 2; width: 44px; height: 44px; margin: 12px 12px -56px 0; border: 0; border-radius: 50%; background: var(--carbon); color: var(--marmol); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.service-modal-content { display: grid; grid-template-columns: 2fr 3fr; clear: both; }
.service-modal-img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
.service-modal-text { padding: 36px 36px 32px; }
.service-modal-text h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); padding-right: 40px; }
.service-modal-text h3 { font-family: var(--sans); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-dark); margin: 0 0 10px; }
.service-modal-lists { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 18px 0; }
.service-modal-text ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
.service-modal-text li { padding-left: 18px; position: relative; }
.service-modal-text li::before { content: "◆"; position: absolute; left: 0; top: .35em; font-size: .55rem; color: var(--accent-dark); }
.service-modal-note { font-size: .88rem; color: var(--pizarra); margin-bottom: 14px; }
.service-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 720px) {
  .service-modal { padding: 12px; }
  .service-modal-content { grid-template-columns: 1fr; }
  .service-modal-img { height: 200px; min-height: 0; }
  .service-modal-text { padding: 22px 20px 24px; }
  .service-modal-actions .btn { width: 100%; }
}

/* Phones: the chat fills the free screen and sits above the keyboard */
@media (max-width: 640px), (max-height: 500px) {
  body.chat-open { overflow: hidden; }
  .chat-open .mobile-bar, .chat-open .chat-fab { display: none; }
  .chat-panel {
    top: var(--chat-top, 0px); right: 0; bottom: auto; left: 0;
    width: 100%; height: 100vh; height: var(--chat-height, 100dvh);
    border-radius: 0; transform-origin: bottom center;
  }
  .chat-head { padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-bottom: 10px; flex: none; }
  .chat-log { min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 14px; }
  .chat-quick { flex: none; padding: 0 14px 8px; }
  .chat-input { flex: none; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .chat-panel.keyboard-open .chat-input { padding-bottom: 8px; }
  .msg { max-width: 90%; }
}

/* While the keyboard is open, give the conversation as much room as possible */
@media (max-width: 640px), (max-height: 500px) {
  .chat-panel.keyboard-open .chat-online, .chat-panel.keyboard-open .chat-head img { display: none; }
  .chat-panel.keyboard-open .chat-head { padding-top: 6px; padding-bottom: 6px; }
  .chat-panel.keyboard-open .chat-quick { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
  .chat-panel.keyboard-open .chat-quick button { flex: none; }
  .chat-panel.keyboard-open .chat-log { padding-top: 8px; padding-bottom: 8px; }
}

/* The Close option always sits at the right */
.chat-quick .quick-close { margin-left: auto; }

/* Links to the service pages */
.service-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 34px; }
.service-links a { color: var(--caliza); font-size: .86rem; text-underline-offset: 3px; }
.service-links a:hover { color: var(--accent); }
.service-modal-page { font-size: .88rem; margin-bottom: 8px; }
.service-modal-page a { color: var(--accent-dark); font-weight: 700; }
