/* ==========================================================================
   Hnos. Viera — estilos de la web pública
   ========================================================================== */

@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
  --paper: #fbf8f3;
  --cream: #f3ede3;
  --sand: #e9e0d1;
  --line: #e2d9ca;
  --ink: #1d1b18;
  --ink-2: #47423b;
  --muted: #7b7368;
  --green: #195136;
  --green-2: #23694a;
  --green-dark: #0f3122;
  --orange: #d9520c;
  --orange-2: #ec5400;
  --wood: #a8743f;
  --white: #fff;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(29, 27, 24, .06), 0 8px 24px -8px rgba(29, 27, 24, .14);
  --shadow-lg: 0 2px 4px rgba(29, 27, 24, .06), 0 24px 48px -16px rgba(29, 27, 24, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video, iframe { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.15; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--green); color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon-sm { width: 1em; height: 1em; }

/* ---------- Tipografía ---------- */
.h-display {
  font-family: var(--serif); font-weight: 400; letter-spacing: -.015em;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); line-height: 1.08;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.h-section { font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin: 0 0 24px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--orange);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.eyebrow-light { color: #f0b48f; }
.lead { font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }

.prose { color: var(--ink-2); }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 1.75rem; color: var(--ink); margin: 1.8em 0 .6em; }
.prose h3 { font-size: 1.15rem; font-weight: 600; color: var(--ink); margin: 1.6em 0 .5em; }
.prose h4 { font-size: 1rem; font-weight: 600; color: var(--ink); margin: 1.4em 0 .4em; }
.prose a { color: var(--green); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--orange); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose img { border-radius: var(--radius-sm); margin: 1.4em 0; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--orange); font-family: var(--serif); font-size: 1.2rem; font-style: italic; color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0 1.6em; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--cream); color: var(--ink); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose-narrow { max-width: 72ch; }
.prose-page { max-width: 78ch; font-size: 1.05rem; }
.prose-page > p:first-child { font-size: 1.2rem; color: var(--ink); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; line-height: 1.2; white-space: nowrap;
  transition: background .25s var(--ease), color .25s, border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.btn:hover { transform: translateY(-1px); }
.btn .icon { transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn-lg { padding: 16px 30px; font-size: 1rem; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-2); box-shadow: 0 10px 24px -10px rgba(25, 81, 54, .6); }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-2); box-shadow: 0 10px 24px -10px rgba(217, 82, 12, .65); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--cream); }
.btn-ghost-light { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--green); border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link-arrow .icon { transition: transform .25s var(--ease); }
.link-arrow:hover { color: var(--orange); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* ---------- Cabecera ---------- */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s; }
/* El desenfoque va en una capa aparte: si se pone en la cabecera, el menú móvil (position: fixed) queda atrapado dentro de ella */
.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(251, 248, 243, .92); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 24px -18px rgba(0, 0, 0, .35); }
.topbar { background: var(--green-dark); color: rgba(255, 255, 255, .82); font-size: .8rem; transition: margin-top .35s var(--ease); }
.topbar-in { display: flex; align-items: center; gap: 22px; min-height: 36px; }
.topbar-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.topbar-item .icon { width: 14px; height: 14px; opacity: .75; }
a.topbar-item:hover { color: #fff; }
.topbar-sp { flex: 1; }
.site-header.is-scrolled .topbar { margin-top: -36px; }

.nav-in { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand img { height: 58px; width: auto; transition: height .3s var(--ease); }
.site-header.is-scrolled .brand img { height: 48px; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav > ul > li > a { display: inline-flex; align-items: center; gap: 4px; padding: 10px 14px; font-weight: 500; font-size: .97rem; color: var(--ink-2); border-radius: 999px; position: relative; transition: color .2s, background .2s; }
.main-nav > ul > li > a:hover { color: var(--ink); background: var(--cream); }
.main-nav > ul > li > a.is-active { color: var(--green); }
.main-nav > ul > li > a.is-active::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--orange); }
.nav-cta { padding: 11px 20px; }
.nav-toggle { display: none; margin-left: auto; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: #fff; align-items: center; justify-content: center; }
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }

/* Submenú del catálogo */
.has-sub { position: relative; }
.sub {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translate(-50%, 8px);
  width: min(640px, 90vw); padding: 14px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transition: opacity .2s, transform .25s var(--ease), visibility .2s;
}
.sub::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.has-sub:hover .sub, .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sub-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; transition: background .2s; }
.sub-item:hover { background: var(--cream); }
.sub-thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--sand); flex: none; }
.sub-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sub-item strong { display: block; font-weight: 600; font-size: .92rem; line-height: 1.3; }
.sub-item small { color: var(--muted); font-size: .8rem; }
.sub-all { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; padding: 12px; border-radius: 10px; background: var(--cream); font-weight: 600; font-size: .9rem; color: var(--green); }
.sub-all:hover { background: var(--sand); }

/* ---------- Hero ---------- */
.hero { position: relative; height: clamp(520px, calc(100svh - var(--header-h) - 36px), 860px); overflow: hidden; background: var(--green-dark); color: #fff; }
.hero-slides, .hero-slide { position: absolute; inset: 0; }
.hero-slide { opacity: 0; visibility: hidden; transition: opacity 1.2s var(--ease), visibility 1.2s; }
.hero-slide.is-active { opacity: 1; visibility: visible; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.hero-bg-empty { background: linear-gradient(135deg, var(--green-dark), var(--green)); }
.hero-slide.is-active .hero-bg { animation: kenburns 9s var(--ease) forwards; }
@keyframes kenburns { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 22, 16, .82) 0%, rgba(12, 22, 16, .55) 42%, rgba(12, 22, 16, .05) 78%), linear-gradient(0deg, rgba(0, 0, 0, .35), transparent 40%); }
.hero-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; padding-bottom: 40px; }
.hero-content > * { max-width: 640px; opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.hero-slide.is-active .hero-content > * { opacity: 1; transform: none; }
.hero-slide.is-active .hero-content > :nth-child(2) { transition-delay: .12s; }
.hero-slide.is-active .hero-content > :nth-child(3) { transition-delay: .24s; }
.hero-slide.is-active .hero-content > :nth-child(4) { transition-delay: .36s; }
.kicker { font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #f4c4a2; margin-bottom: 20px; }
.hero-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.5rem, 1.6rem + 4vw, 5rem); line-height: 1.02; letter-spacing: -.02em; margin-bottom: 22px; font-variation-settings: "opsz" 144, "SOFT" 100; }
.hero-sub { font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); color: rgba(255, 255, 255, .85); max-width: 52ch; margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-nav { position: absolute; left: 0; right: 0; bottom: 32px; z-index: 3; margin-inline: auto; }
.hero-dots { display: flex; gap: 10px; }
.hero-dot { width: 56px; height: 24px; padding: 0; border: 0; background: none; display: flex; align-items: center; }
.hero-dot span { display: block; width: 100%; height: 3px; background: rgba(255, 255, 255, .3); border-radius: 3px; position: relative; overflow: hidden; }
.hero-dot span::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
.hero-dot.is-active span::after { animation: dotfill var(--slide-ms, 6500ms) linear forwards; }
.hero.is-paused .hero-dot.is-active span::after { animation-play-state: paused; }
@keyframes dotfill { to { transform: scaleX(1); } }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(64px, 5vw + 32px, 120px); }
.section-tight { padding-block: clamp(40px, 3vw + 24px, 72px); }
.section-alt { background: var(--cream); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 4vw, 56px); }
.section-head .h-display { margin-bottom: 16px; }
.section-head-row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.section-head-row .h-display { margin-bottom: 0; }

/* Intro */
.intro-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.intro-text .h-display { margin-bottom: 26px; }
.intro-text .prose { font-size: 1.06rem; }
.intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 34px; }
.intro-media { position: relative; min-height: 520px; }
.intro-img { position: absolute; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.intro-img-a { top: 0; right: 0; width: 78%; height: 78%; }
.intro-img-b { bottom: 0; left: 0; width: 52%; height: 50%; border: 8px solid var(--paper); }
.intro-badge { position: absolute; right: 6%; bottom: 6%; background: var(--orange); color: #fff; border-radius: 50%; width: 136px; height: 136px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: var(--shadow-lg); }
.intro-badge strong { font-family: var(--serif); font-size: 2.4rem; font-weight: 500; line-height: 1; }
.intro-badge span { font-size: .78rem; letter-spacing: .04em; max-width: 90px; line-height: 1.3; margin-top: 6px; }

/* Servicios */
.services { background: var(--cream); }
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.service { position: relative; padding: 34px 28px 38px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; transition: background .35s var(--ease); }
.service:hover { background: var(--paper); }
.service-icon { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; border-radius: 14px; background: #fff; color: var(--green); margin-bottom: 26px; box-shadow: 0 1px 0 var(--line); transition: background .3s, color .3s; }
.service-icon .icon { width: 26px; height: 26px; }
.service:hover .service-icon { background: var(--green); color: #fff; }
.service-num { position: absolute; top: 30px; right: 26px; font-family: var(--serif); font-size: .95rem; color: var(--muted); }
.service h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; }
.service p { color: var(--ink-2); font-size: .95rem; margin: 0; }

/* Tiles de categoría */
.tile { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--green-dark); color: #fff; isolation: isolate; min-height: 240px; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); z-index: -1; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 20, 14, 0) 30%, rgba(10, 20, 14, .82) 100%); transition: opacity .4s; }
.tile:hover img { transform: scale(1.06); }
.tile-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 74px 24px 24px; display: flex; flex-direction: column; gap: 6px; }
.tile-count { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.tile-title { font-family: var(--serif); font-size: clamp(1.35rem, 1.1rem + .8vw, 1.8rem); line-height: 1.12; }
.tile-text { font-size: .93rem; color: rgba(255, 255, 255, .82); max-width: 46ch; }
.tile-arrow { position: absolute; right: 20px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, .5); transition: background .3s, border-color .3s, transform .3s var(--ease); }
.tile:hover .tile-arrow { background: var(--orange); border-color: var(--orange); transform: rotate(-45deg); }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 260px; gap: 16px; }
.bento .tile-lg { grid-column: span 2; grid-row: span 2; }
.bento .tile:nth-child(6) { grid-column: span 2; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.tile-cat { min-height: 380px; }

/* Valores y cifras */
.values { background: var(--green-dark); color: #fff; position: relative; overflow: hidden; }
.values::before { content: ""; position: absolute; width: 700px; height: 700px; right: -200px; top: -260px; border-radius: 50%; background: radial-gradient(closest-side, rgba(236, 84, 0, .18), transparent); }
.values .lead { color: rgba(255, 255, 255, .78); }
.values-grid { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid rgba(255, 255, 255, .14); }
.value { padding: 36px 32px 36px 0; }
.value + .value { padding-left: 32px; border-left: 1px solid rgba(255, 255, 255, .14); }
.value-num { font-family: var(--serif); color: #f0b48f; font-size: 1rem; }
.value h3 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; margin: 14px 0 10px; }
.value p { color: rgba(255, 255, 255, .74); margin: 0; }
.stats { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: 56px; }
.stat { padding: 26px 24px; border-radius: var(--radius); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.stat strong { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 1.8rem + 1.4vw, 3.2rem); line-height: 1; margin-bottom: 8px; }
.stat span { color: rgba(255, 255, 255, .72); font-size: .95rem; }

/* Tarjetas de proyecto */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px 22px; }
.card { display: flex; flex-direction: column; gap: 14px; }
.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--sand); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.card-noimg .icon { width: 40px; height: 40px; }
.card-badge { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: .78rem; font-weight: 600; }
.card-body { display: flex; flex-direction: column; gap: 4px; }
.card-cat { font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.card-title { font-family: var(--serif); font-size: 1.28rem; line-height: 1.25; transition: color .2s; }
.card:hover .card-title { color: var(--green); }

/* Cuento */
.story { background: var(--paper); }
.story-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(40px, 6vw, 96px); }
.story-head { position: sticky; top: calc(var(--header-h) + 40px); align-self: start; }
.story-body .prose { font-size: 1.08rem; columns: 2 280px; column-gap: 40px; }
.story-body .prose p { break-inside: avoid; }
.story-quote { margin: 40px 0 0; padding: 32px 36px; border-radius: var(--radius); background: var(--cream); display: flex; gap: 18px; }
.story-quote .icon { width: 36px; height: 36px; color: var(--orange); flex: none; }
.story-quote p { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 1rem + .7vw, 1.55rem); line-height: 1.4; color: var(--ink); }

/* CTA */
.cta { padding-block: clamp(40px, 4vw, 64px); background: var(--paper); }
.cta-in { display: flex; align-items: center; justify-content: space-between; gap: 32px 48px; flex-wrap: wrap; padding: clamp(36px, 5vw, 64px); border-radius: calc(var(--radius) * 1.6); background: var(--green); color: #fff; position: relative; overflow: hidden; }
.cta-in::after { content: ""; position: absolute; right: -80px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .05); pointer-events: none; }
.cta-in > div:first-child { max-width: 620px; }
.cta .h-display { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.8rem); margin-bottom: 12px; }
.cta p { color: rgba(255, 255, 255, .8); margin: 0; }
.cta-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; position: relative; z-index: 1; }
.cta-phone { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.15rem; }
.cta-phone .icon { width: 44px; height: 44px; padding: 11px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.cta-phone small { display: block; font-size: .75rem; font-weight: 500; color: rgba(255, 255, 255, .7); }

/* ---------- Cabeceras de página ---------- */
.page-hero { position: relative; padding-block: clamp(48px, 5vw, 88px) clamp(36px, 4vw, 64px); background: var(--cream); overflow: hidden; }
.page-hero .h-display { font-size: clamp(2.2rem, 1.5rem + 3vw, 4rem); margin-bottom: 16px; max-width: 18ch; }
.page-hero .lead { margin: 0; }
.page-hero-img { color: #fff; background: var(--green-dark); padding-block: clamp(80px, 9vw, 150px) clamp(40px, 4vw, 64px); }
.page-hero-img .lead, .page-hero-img .crumbs, .page-hero-img .crumbs a { color: rgba(255, 255, 255, .85); }
.page-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero-img::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(10, 22, 15, .85), rgba(10, 22, 15, .45)); }
.page-hero-img .wrap { position: relative; z-index: 2; }
.page-hero-meta { margin: 18px 0 0; font-size: .85rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #f4c4a2; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; font-size: .85rem; color: var(--muted); }
.crumbs a:hover { color: var(--orange); }
.crumbs span:last-child { color: inherit; }

/* Pestañas de categorías */
.cat-tabs-wrap { position: sticky; top: calc(var(--header-h) - 1px); z-index: 20; background: rgba(251, 248, 243, .97); border-bottom: 1px solid var(--line); }
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block: 12px; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs a { flex: none; padding: 8px 16px; border-radius: 999px; font-size: .9rem; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line); background: #fff; transition: all .2s; }
.cat-tabs a:hover { border-color: var(--ink-2); color: var(--ink); }
.cat-tabs a.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.cat-desc { margin-bottom: 40px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 36px; }
.chips-label { font-size: .9rem; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--cream); font-weight: 500; font-size: .92rem; }
.chip small { color: var(--muted); }
.chip:hover { background: var(--sand); }
.empty { padding: 48px; text-align: center; color: var(--muted); background: var(--cream); border-radius: var(--radius); }

/* ---------- Proyecto ---------- */
.project-head { padding-block: clamp(40px, 4vw, 72px) 0; }
.project-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.project-title-row .h-display { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); }
.project-meta { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .92rem; }
.project-desc { margin-top: 28px; font-size: 1.06rem; }

.gallery { columns: 4 240px; column-gap: 14px; }
.gallery-item { position: relative; display: block; margin-bottom: 14px; break-inside: avoid; border-radius: 10px; overflow: hidden; background: var(--sand); aspect-ratio: var(--ar, 4 / 3); cursor: zoom-in; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .4s; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-zoom { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .92); color: var(--ink); opacity: 0; transform: scale(.85); transition: opacity .25s, transform .25s var(--ease); }
.gallery-zoom .icon { width: 18px; height: 18px; }
.gallery-item:hover .gallery-zoom, .gallery-item:focus-visible .gallery-zoom { opacity: 1; transform: none; }

.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 20px; margin-top: 24px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-file { aspect-ratio: auto; max-height: 80vh; }
.video-file video { position: static; height: auto; max-height: 80vh; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.pager-link { display: flex; align-items: center; gap: 14px; font-family: var(--serif); font-size: 1.1rem; line-height: 1.25; }
.pager-link small { display: block; font-family: var(--sans); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.pager-link .icon { width: 44px; height: 44px; padding: 11px; border-radius: 50%; border: 1px solid var(--line); flex: none; transition: all .25s; }
.pager-link:hover .icon { background: var(--green); border-color: var(--green); color: #fff; }
.pager-next { justify-content: flex-end; text-align: right; }
.pager-all { padding: 10px 18px; border-radius: 999px; background: var(--cream); font-weight: 600; font-size: .9rem; }
.pager-all:hover { background: var(--sand); }

/* ---------- Visor (lightbox) ---------- */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(12, 14, 12, .96); display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; touch-action: pan-y; }
.lb.is-open { opacity: 1; visibility: visible; }
.lb-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; color: rgba(255, 255, 255, .8); font-size: .9rem; }
.lb-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 72px; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; user-select: none; transition: opacity .25s; }
.lb-img.is-loading { opacity: .3; }
.lb-cap { text-align: center; color: rgba(255, 255, 255, .8); padding: 12px 18px 18px; min-height: 48px; font-size: .95rem; }
.lb-btn { width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.lb-btn:hover { background: rgba(255, 255, 255, .22); }
.lb-btn .icon { width: 24px; height: 24px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
body.lb-open { overflow: hidden; }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 380px 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact-info { display: grid; gap: 18px; }
.contact-card { padding: 26px; border-radius: var(--radius); background: var(--cream); }
.contact-card h2 { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--orange); margin-bottom: 10px; }
.contact-line { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; font-weight: 600; }
.contact-line + .contact-line { border-top: 1px solid var(--line); }
.contact-line .icon { width: 40px; height: 40px; padding: 10px; border-radius: 50%; background: #fff; color: var(--green); }
.contact-line small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
a.contact-line:hover { color: var(--green); }
.contact-form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font: inherit; font-size: 1rem; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(25, 81, 54, .12); }
.has-error input, .has-error textarea { border-color: #c0392b; }
.field-error { color: #b03a2e; font-size: .85rem; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .93rem; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }
.check a { color: var(--green); text-decoration: underline; }
.check.has-error { color: #b03a2e; }
.contact-form .btn { justify-self: start; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { display: flex; gap: 14px; padding: 18px 20px; border-radius: 12px; margin-bottom: 24px; }
.notice .icon { width: 26px; height: 26px; flex: none; }
.notice p { margin: 4px 0 0; }
.notice-ok { background: #e6f2ea; color: #134a2f; }
.notice-error { background: #fbe9e6; color: #8f2d20; }
.map { height: clamp(320px, 45vw, 480px); background: var(--sand); }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.25) contrast(1.05); }

/* Portal de transparencia */
.page-transparencia h2, .page-transparencia h3 { padding-top: 1.2em; border-top: 1px solid var(--line); }
.page-transparencia img { max-width: 100%; border: 1px solid var(--line); }

.notfound { text-align: center; min-height: 50vh; }
.notfound .eyebrow::before { display: none; }
.notfound .lead { margin: 16px auto 32px; }
.notfound .hero-actions { justify-content: center; }

/* ---------- Pie ---------- */
.site-footer { background: #151a16; color: rgba(255, 255, 255, .7); font-size: .95rem; padding-top: clamp(56px, 6vw, 88px); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 48px; padding-bottom: 56px; }
.footer-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.footer-logo img { width: 56px; height: 56px; background: #fff; border-radius: 12px; padding: 6px; }
.footer-logo span { font-family: var(--serif); font-size: 1.35rem; color: #fff; line-height: 1.2; }
.footer-logo small { display: block; font-family: var(--sans); font-size: .78rem; color: rgba(255, 255, 255, .55); letter-spacing: .04em; }
.footer-brand p { max-width: 42ch; }
.site-footer h3 { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #f0b48f; margin-bottom: 18px; }
.footer-links { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 20px; }
.footer-links li { margin-bottom: 10px; break-inside: avoid; }
.footer-links a:hover, .footer-contact a:hover { color: #fff; }
.footer-contact { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.footer-contact li { display: flex; gap: 12px; }
.footer-contact .icon { color: #f0b48f; margin-top: 3px; }
.footer-contact small { color: rgba(255, 255, 255, .45); }
.social { display: flex; gap: 10px; margin-top: 18px; }
.social a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; transition: all .2s; }
.social a:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 22px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; color: rgba(255, 255, 255, .5); }
.footer-bottom nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-bottom a:hover { color: #fff; }

.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .45); transition: transform .25s var(--ease); }
.wa-float:hover { transform: scale(1.08); }
.wa-float .icon { width: 30px; height: 30px; }

/* ---------- Animación de aparición ---------- */
.reveal { transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.pre { opacity: 0; transform: translateY(24px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal.pre { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 240px; }
  .bento .tile:nth-child(6) { grid-column: auto; }
  .bento .tile:last-child:nth-child(even) { grid-column: span 2; }
  .main-nav > ul > li > a { padding: 10px 10px; }
  .topbar-item:first-child { display: none; }
}

@media (max-width: 920px) {
  :root { --header-h: 72px; }
  .brand img { height: 46px; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed; inset: calc(var(--header-h) + 36px) 0 0 0; z-index: 60; background: var(--paper);
    flex-direction: column; align-items: stretch; gap: 20px; padding: 20px var(--gutter) 40px; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .3s var(--ease), visibility .25s;
  }
  .site-header.is-scrolled .main-nav { top: var(--header-h); }
  body.nav-open .main-nav { opacity: 1; visibility: visible; transform: none; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-toggle .icon { display: none; }
  body.nav-open .nav-toggle .icon-close { display: block; }
  .main-nav > ul { flex-direction: column; gap: 0; }
  .main-nav > ul > li > a { display: flex; padding: 16px 4px; font-family: var(--serif); font-size: 1.6rem; border-radius: 0; border-bottom: 1px solid var(--line); }
  .main-nav > ul > li > a:hover { background: none; }
  .main-nav > ul > li > a.is-active::after { display: none; }
  .main-nav > ul > li > a .icon { display: none; }
  /* visibility: inherit para que el submenú se oculte (y no se pueda pulsar) cuando el menú está cerrado */
  .sub, .has-sub:hover .sub, .has-sub:focus-within .sub { position: static; transform: none; opacity: 1; visibility: inherit; width: auto; box-shadow: none; border: 0; padding: 10px 0; background: none; }
  .sub-grid { grid-template-columns: 1fr 1fr; gap: 2px 12px; }
  .sub-thumb, .sub-item small { display: none; }
  .sub-item { padding: 9px 4px; }
  .sub-item strong { font-weight: 500; font-size: .98rem; color: var(--ink-2); }
  .sub-all { display: none; }
  .has-sub:hover .sub { transform: none; }
  .nav-cta { justify-content: center; padding: 16px; }

  .intro-grid, .story-grid, .contact-grid { grid-template-columns: 1fr; }
  .intro-media { min-height: 420px; }
  .story-head { position: static; }
  .values-grid { grid-template-columns: 1fr; }
  .value, .value + .value { padding: 28px 0; border-left: 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .hero-slide::after { background: linear-gradient(180deg, rgba(12, 22, 16, .25) 0%, rgba(12, 22, 16, .8) 75%); }
  .hero-content { justify-content: flex-end; padding-bottom: 96px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar { display: none; }
  .site-header.is-scrolled .topbar { margin-top: 0; }
  .main-nav { inset: var(--header-h) 0 0 0; }
  .services-grid { grid-template-columns: 1fr; }
  .service { padding: 22px 20px 24px 84px; }
  .service-icon { position: absolute; left: 20px; top: 22px; width: 46px; height: 46px; margin: 0; }
  .service-num { top: 22px; right: 18px; }
  .bento { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .bento .tile-lg, .bento .tile:last-child:nth-child(even) { grid-column: auto; grid-row: span 1; }
  .bento .tile-lg .tile-text { display: none; }
  .tile-cat { min-height: 300px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .intro-media { min-height: 340px; }
  .intro-badge { width: 112px; height: 112px; }
  .intro-badge strong { font-size: 1.9rem; }
  .gallery { columns: 2; column-gap: 8px; }
  .gallery-item { margin-bottom: 8px; border-radius: 6px; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager-all { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .pager-link { font-size: .95rem; }
  .pager-link .icon { width: 36px; height: 36px; padding: 8px; }
  .lb-stage { padding: 0 8px; }
  .lb-prev, .lb-next { display: none; }
  .story-quote { padding: 24px; flex-direction: column; }
  .cta-actions { width: 100%; }
  .cta-actions .btn { width: 100%; }
}
