/* GNG — estilos comunes de peritaciones (index.html) y reformas (reformas.html)
   Plan visual: lenguaje de "informe pericial" — tinta azul noche, papel frío,
   un acento amarillo de rotulador para lo esencial. Plex Serif para titulares,
   Plex Sans para texto y Plex Mono para referencias/datos. */

:root {
  --ink: #13212e;
  --ink-2: #2c3d4d;
  --muted: #5b6b7a;
  --paper: #f4f6f7;
  --card: #ffffff;
  --line: #d6dde2;
  --accent: #f2c230;      /* rotulador */
  --accent-ink: #13212e;
  --deep: #0e1924;
  --ok: #1d6b52;
  --radius: 6px;
  --max: 1120px;
  --serif: "IBM Plex Serif", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

/* Variante de reformas: mismo sistema, acento de obra */
body.reformas { --accent: #e0782f; --accent-ink: #ffffff; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; max-width: 68ch; }
.lead { font-size: 1.15rem; color: var(--ink-2); }
.mark { background: linear-gradient(transparent 58%, var(--accent) 58%, var(--accent) 92%, transparent 92%); padding: 0 .1em; }
body.reformas .mark { background: linear-gradient(transparent 58%, #f6c9a6 58%, #f6c9a6 92%, transparent 92%); }

/* ---------- Cabecera ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(244,246,247,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 4px; background: var(--ink); color: #fff; display: grid; place-items: center; font: 600 .8rem/1 var(--mono); letter-spacing: .04em; }
.brand small { display: block; font: 500 .72rem/1 var(--mono); color: var(--muted); letter-spacing: .02em; margin-top: 3px; }

.switch { display: flex; background: #e6eaed; border-radius: 999px; padding: 3px; }
.switch a { text-decoration: none; padding: 6px 14px; border-radius: 999px; font-size: .9rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.switch a[aria-current="page"] { background: var(--ink); color: #fff; }

.nav-cta { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
  .top .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav-cta .btn { display: none; }
  .switch { order: 3; width: 100%; justify-content: center; }
  .switch a { flex: 1; text-align: center; }
}

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: var(--radius); font-weight: 600; font-size: 1rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.04); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-small { padding: 8px 14px; font-size: .9rem; }
.on-dark .btn-ghost { border-color: #fff; color: #fff; }
.on-dark .btn-ghost:hover { background: #fff; color: var(--ink); }

/* ---------- Hero peritaciones ---------- */
.hero { padding: 56px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 18px; }
.hero .meta { font: 500 .86rem/1.5 var(--mono); color: var(--muted); }
.hero .meta strong { color: var(--ink); font-weight: 600; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; gap: 36px; } .hero { padding-top: 32px; } }

/* Ficha del perito: el elemento memorable — una "carátula de informe" con la foto */
.dossier { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -22px rgba(19,33,46,.45); overflow: hidden; max-width: 420px; justify-self: end; width: 100%; }
@media (max-width: 860px) { .dossier { justify-self: start; } }
.dossier-head { display: flex; justify-content: space-between; padding: 12px 18px; background: var(--ink); color: #cfd8df; font: 500 .74rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.photo { position: relative; aspect-ratio: 1 / 1; background: #dfe5e9; }
.photo img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.photo .ph { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font: 500 .85rem/1.5 var(--mono); padding: 20px; }
.photo .ph b { display: block; font: 600 3.2rem/1 var(--serif); color: var(--ink-2); margin-bottom: 12px; }
.dossier-body { padding: 18px; }
.dossier-body .name { font: 600 1.25rem/1.2 var(--serif); margin: 0 0 2px; }
.dossier-body .role { color: var(--muted); font-size: .95rem; margin: 0 0 14px; }
.facts { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--line); }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.facts li span:first-child { color: var(--muted); font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.facts li span:last-child { text-align: right; font-weight: 500; }

/* ---------- Franja de compromisos ---------- */
.pledges { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pledges .wrap { display: grid; grid-template-columns: repeat(3, 1fr); }
.pledge { padding: 30px 26px; border-left: 1px solid var(--line); }
.pledge:first-child { border-left: 0; padding-left: 0; }
.pledge h3 { margin-bottom: .35em; }
.pledge p { color: var(--ink-2); margin: 0; font-size: .98rem; }
.pledge .k { font: 600 .78rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 12px; }
@media (max-width: 760px) { .pledges .wrap { grid-template-columns: 1fr; } .pledge { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0; } .pledge:first-child { border-top: 0; } }

/* ---------- Secciones ---------- */
section.block { padding: 80px 0; }
.section-head { margin-bottom: 36px; }
.section-head p { color: var(--ink-2); }

/* Proceso: secuencia real de 3 pasos */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; position: relative; counter-increment: s; }
.steps li::before { content: "0" counter(s); font: 600 .9rem/1 var(--mono); color: var(--ink); background: var(--accent); padding: 5px 8px; border-radius: 3px; display: inline-block; margin-bottom: 16px; }
body.reformas .steps li::before { color: #fff; }
.steps p { margin: 0; color: var(--ink-2); font-size: .98rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* Servicios / tipos de daño */
.cover { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.cover ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.cover li { break-inside: avoid; padding: 10px 0 10px 26px; border-bottom: 1px solid var(--line); position: relative; }
.cover li::before { content: ""; position: absolute; left: 0; top: 19px; width: 12px; height: 2px; background: var(--ink); }
@media (max-width: 860px) { .cover { grid-template-columns: 1fr; gap: 24px; } }
@media (max-width: 480px) { .cover ul { columns: 1; } }

/* Agenda */
.agenda { background: var(--deep); color: #e8eef2; }
.agenda .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.agenda h2 { color: #fff; }
.agenda p { color: #b9c6d0; }
.agenda .hours { font: 500 .92rem/1.8 var(--mono); color: #e8eef2; border-left: 3px solid var(--accent); padding-left: 16px; margin: 20px 0 28px; }
.agenda .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.agenda .tip { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 24px; }
.agenda .tip h3 { color: #fff; font-size: 1.05rem; }
.agenda .tip ol { margin: 0; padding-left: 20px; color: #c9d4dc; }
.agenda .tip li { margin-bottom: 8px; }
@media (max-width: 860px) { .agenda .wrap { grid-template-columns: 1fr; gap: 28px; } }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.4rem/1 var(--mono); color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 12px 0 0; color: var(--ink-2); }

/* Puente a la otra línea de negocio */
.bridge { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 32px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.bridge p { margin: 0; color: var(--ink-2); }

/* ---------- Reformas: hero y galería ---------- */
.hero-r { padding: 56px 0 40px; }
.hero-r .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; }
.hero-r .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
@media (max-width: 860px) { .hero-r .wrap { grid-template-columns: 1fr; gap: 20px; } }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { font: 500 .9rem/1 var(--sans); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 960px) { .projects { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .projects { grid-template-columns: 1fr; } }
.project { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.project[hidden] { display: none; }
.project button.shot { all: unset; cursor: zoom-in; display: block; width: 100%; aspect-ratio: 4 / 3; position: relative; background: repeating-linear-gradient(45deg, #e6eaed 0 12px, #edf0f2 12px 24px); }
.project button.shot:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.project .shot img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.project .shot .count { z-index: 2; }
.project .shot .ph { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font: 500 .8rem/1.5 var(--mono); color: var(--muted); padding: 16px; }
.project .shot .count { position: absolute; right: 10px; bottom: 10px; background: rgba(14,25,36,.8); color: #fff; font: 500 .75rem/1 var(--mono); padding: 6px 8px; border-radius: 3px; }
.project .info { padding: 16px 18px 18px; }
.project .tag { font: 600 .72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.project h3 { margin: 8px 0 4px; }
.project p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(8,14,20,.94); display: none; z-index: 50; align-items: center; justify-content: center; padding: 56px 16px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 4px; }
.lightbox .lb-btn { position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.lightbox .lb-close { top: 12px; right: 12px; }
.lightbox .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-cap { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #c9d4dc; font: 500 .85rem/1.4 var(--mono); }

/* ---------- Pie ---------- */
footer { background: var(--deep); color: #9fb0bd; padding: 48px 0 32px; font-size: .92rem; }
footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
footer h3 { color: #fff; font-size: 1rem; }
footer a { color: #dce4ea; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 6px; }
footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .84rem; }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; } }

/* Barra fija de contacto en móvil */
.mobile-bar { display: none; }
@media (max-width: 760px) {
  .mobile-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(244,246,247,.97); border-top: 1px solid var(--line); z-index: 30; }
  .mobile-bar .btn { padding: 12px 10px; font-size: .95rem; }
  body { padding-bottom: 76px; }
}
