/* Profithome — componentes web (CSS). Usa las variables de tokens.css.
   Reglas: esquinas rectas, múltiplos de 8, una sola acción primaria, oliva solo acento. */

html { font-variant-ligatures: no-common-ligatures; }
body { margin: 0; font-family: var(--font-sans); font-size: 18px; line-height: 28px; color: var(--texto); background: var(--fondo); font-synthesis: none; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .ph-serif { font-family: var(--font-serif); font-weight: 600; font-variant-ligatures: no-common-ligatures; margin: 0; color: inherit; }
h1, h4 { font-weight: 500; }
h1 b, h1 strong, h2 b, h2 strong, h3 b, h3 strong { font-weight: inherit; }
table, input, select, textarea, .ph-num { font-variant-numeric: tabular-nums lining-nums; }
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
img { display: block; max-width: 100%; }
p { margin: 0; }

/* ---------- Texto ---------- */
.ph-display { font: 500 64px/72px var(--font-serif); }
.ph-h1 { font: 500 48px/56px var(--font-serif); }
.ph-h2 { font: 600 36px/44px var(--font-serif); }
.ph-h3 { font: 600 28px/36px var(--font-serif); }
.ph-h4 { font: 500 22px/30px var(--font-serif); }
.ph-cuerpo { font: 400 18px/28px var(--font-sans); }
.ph-pequeno { font: 400 15px/22px var(--font-sans); }
.ph-etiqueta { font: 600 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--acento); }
.ph-sobre-azul .ph-etiqueta { color: var(--hueso); }
.ph-fuente { font: 400 15px/22px var(--font-sans); color: var(--texto); }
.ph-medida { max-width: var(--medida-texto); }

/* ---------- Superficies ---------- */
.ph-sobre-azul { background: var(--azul-profit); color: var(--texto-inverso); }
.ph-sobre-noche { background: var(--noche); color: var(--texto-inverso); }
.ph-sobre-blanco { background: var(--blanco); }
.ph-contenedor { max-width: var(--contenedor); margin: 0 auto; padding: 0 var(--space-3); }

/* ---------- Foco ---------- */
.ph-btn:focus-visible, .ph-link:focus-visible, .ph-nav a:focus-visible, .ph-campo input:focus-visible,
.ph-campo select:focus-visible, .ph-campo textarea:focus-visible, .ph-check input:focus-visible, .ph-wa:focus-visible, .ph-burger:focus-visible {
  outline: 2px solid var(--foco); outline-offset: 2px;
}
.ph-sobre-azul .ph-btn:focus-visible, .ph-sobre-azul .ph-link:focus-visible, .ph-sobre-azul a:focus-visible { outline-color: var(--hueso); }
.is-focus { outline: 2px solid var(--foco) !important; outline-offset: 2px; }

/* ---------- Botones ---------- */
.ph-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); height: 48px; padding: 0 var(--space-3);
  font: 600 15px/22px var(--font-sans); text-decoration: none; white-space: nowrap; cursor: pointer; border: 1px solid transparent; border-radius: 0; }
/* Primario: azul Profit con texto Hueso. Nunca relleno oliva. Uno por vista. */
.ph-btn-primario { background: var(--azul-profit); color: var(--hueso); border-color: var(--azul-profit); }
.ph-btn-primario:hover, .ph-btn-primario.is-hover { background: var(--noche); border-color: var(--noche); color: var(--hueso); text-decoration: underline; text-underline-offset: 4px; }
/* Primario sobre azul: invertido */
.ph-sobre-azul .ph-btn-primario, .ph-sobre-noche .ph-btn-primario { background: var(--hueso); color: var(--azul-profit); border-color: var(--hueso); }
.ph-sobre-azul .ph-btn-primario:hover, .ph-sobre-azul .ph-btn-primario.is-hover { background: var(--blanco); border-color: var(--blanco); color: var(--azul-profit); text-decoration: underline; text-underline-offset: 4px; }
/* Secundario: contorno azul, sin relleno. Menos peso que el primario. */
.ph-btn-secundario { background: transparent; color: var(--azul-profit); border-color: var(--borde-campo); }
.ph-btn-secundario:hover, .ph-btn-secundario.is-hover { background: var(--piedra); color: var(--azul-profit); }
.ph-sobre-azul .ph-btn-secundario { color: var(--hueso); border-color: var(--hueso); }
.ph-sobre-azul .ph-btn-secundario:hover { background: var(--noche); }
.ph-btn[aria-disabled="true"], .ph-btn:disabled { background: var(--piedra); border-color: var(--piedra); color: var(--azul-profit); cursor: not-allowed; }
.ph-btn-bloque { width: 100%; }
/* Enlace de acción */
.ph-link { font: 600 15px/22px var(--font-sans); color: var(--azul-profit); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.ph-link:hover { text-decoration-thickness: 2px; }
.ph-sobre-azul .ph-link { color: var(--hueso); }

/* ---------- Cabecera ---------- */
.ph-header { background: var(--fondo); border-bottom: 1px solid var(--linea); }
.ph-header-in { height: 80px; display: flex; align-items: center; gap: var(--space-4); max-width: var(--contenedor); margin: 0 auto; padding: 0 var(--space-3); }
.ph-header-logo { display: block; flex: none; }
.ph-header-logo img { height: 44px; width: auto; }
.ph-nav { display: flex; align-items: center; gap: var(--space-3); margin-left: var(--space-2); }
.ph-nav a, .ph-nav button { font: 400 15px/22px var(--font-sans); color: var(--azul-profit); text-decoration: none; background: none; border: 0; padding: var(--space-1) 0; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-1); }
.ph-nav a:hover, .ph-nav button:hover { text-decoration: underline; text-underline-offset: 6px; }
.ph-nav [aria-current="page"] { font-weight: 600; box-shadow: inset 0 -2px 0 var(--azul-profit); }
.ph-caret { width: 8px; height: 8px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.ph-header-dcha { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.ph-clientes { font: 400 15px/22px var(--font-sans); color: var(--azul-profit); text-decoration: underline; text-underline-offset: 4px; padding-right: var(--space-3); border-right: 1px solid var(--linea); }
.ph-desplegable { position: relative; }
.ph-menu-sub { position: absolute; top: calc(100% + 24px); left: -24px; min-width: 240px; background: var(--blanco); border: 1px solid var(--linea); padding: var(--space-1) 0; z-index: 5; }
.ph-menu-sub a { display: block; padding: 12px var(--space-3); font: 400 15px/22px var(--font-sans); color: var(--azul-profit); text-decoration: none; }
.ph-menu-sub a:hover { background: var(--hueso); text-decoration: none; }
/* Cabecera mínima (landing y /analisis): solo logo */
.ph-header-min .ph-header-in { height: 64px; }
/* Móvil */
.ph-header-movil .ph-header-in { height: 64px; gap: var(--space-2); padding: 0 var(--space-2) 0 var(--space-3); }
.ph-header-movil .ph-header-logo img { height: 36px; }
.ph-burger { margin-left: auto; width: 48px; height: 48px; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; color: var(--azul-profit); }
.ph-burger span { display: block; width: 24px; height: 2px; background: currentColor; }
.ph-burger.is-open span:nth-child(2) { opacity: 0; }
.ph-burger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.ph-burger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.ph-panel-movil { background: var(--fondo); padding: var(--space-2) var(--space-3) var(--space-4); display: flex; flex-direction: column; }
.ph-panel-movil > a:not(.ph-btn), .ph-panel-movil > .ph-pm-grupo > span { display: flex; align-items: center; min-height: 56px; border-bottom: 1px solid var(--linea); font: 400 18px/28px var(--font-sans); color: var(--azul-profit); text-decoration: none; }
.ph-pm-grupo > span { justify-content: space-between; }
.ph-pm-sub a { display: flex; align-items: center; min-height: 48px; padding-left: var(--space-2); border-bottom: 1px solid var(--linea); font: 400 15px/22px var(--font-sans); color: var(--azul-profit); text-decoration: none; }
.ph-panel-movil .ph-btn { margin-top: var(--space-1); }
.ph-panel-movil > a.ph-clientes { border: 0; min-height: 0; text-decoration: underline; text-underline-offset: 4px; font-size: 15px; padding: var(--space-3) 0 var(--space-2); }

/* ---------- Formularios ---------- */
.ph-campo { display: flex; flex-direction: column; gap: var(--space-1); }
.ph-campo label, .ph-label { font: 600 15px/22px var(--font-sans); color: var(--azul-profit); }
.ph-campo .ph-opcional { font-weight: 400; }
.ph-campo input, .ph-campo select, .ph-campo textarea { height: 48px; width: 100%; padding: 0 var(--space-2); font: 400 18px/28px var(--font-sans); color: var(--azul-profit); background: var(--blanco); border: 1px solid var(--borde-campo); border-radius: 0; appearance: none; }
.ph-campo textarea { height: auto; min-height: 120px; padding: 12px var(--space-2); }
.ph-campo select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23162442' stroke-width='1.75' stroke-linecap='square'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: var(--space-6); }
.ph-campo input::placeholder { color: var(--azul-profit); opacity: .72; }
.ph-campo input:focus, .ph-campo select:focus, .ph-campo textarea:focus, .ph-campo.is-foco input { box-shadow: inset 0 0 0 1px var(--azul-profit); outline: 2px solid var(--foco); outline-offset: 2px; }
.ph-ayuda { font: 400 15px/22px var(--font-sans); color: var(--azul-profit); }
.ph-msg { display: flex; align-items: flex-start; gap: var(--space-1); font: 400 15px/22px var(--font-sans); }
.ph-msg svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.ph-campo.is-error input, .ph-campo.is-error select { border-color: var(--estado-error); box-shadow: inset 0 0 0 1px var(--estado-error); }
.ph-campo.is-error .ph-msg { color: var(--estado-error); }
.ph-campo.is-ok input { border-color: var(--estado-exito); }
.ph-campo.is-ok .ph-msg { color: var(--estado-exito); }
.ph-campo.is-disabled input { background: var(--piedra); border-style: dashed; cursor: not-allowed; }
.ph-check { display: flex; gap: 12px; align-items: flex-start; font: 400 15px/22px var(--font-sans); color: var(--azul-profit); }
.ph-check input { flex: none; appearance: none; width: 24px; height: 24px; margin: 0; border: 1px solid var(--borde-campo); background: var(--blanco); display: grid; place-content: center; cursor: pointer; }
.ph-check input:checked { background: var(--azul-profit); }
.ph-check input:checked::after { content: ""; width: 12px; height: 7px; border-left: 2px solid var(--hueso); border-bottom: 2px solid var(--hueso); transform: rotate(-45deg) translate(1px, -1px); }
.ph-check.is-aviso input { border-color: var(--estado-aviso); box-shadow: inset 0 0 0 1px var(--estado-aviso); }
.ph-opciones { display: grid; gap: var(--space-1); }
.ph-opcion { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 var(--space-2); background: var(--blanco); border: 1px solid var(--borde-campo); font: 400 18px/28px var(--font-sans); color: var(--azul-profit); cursor: pointer; }
.ph-opcion.is-sel { box-shadow: inset 0 0 0 2px var(--azul-profit); font-weight: 600; }
.ph-opcion .ph-radio { flex: none; width: 20px; height: 20px; border: 1px solid var(--borde-campo); display: grid; place-content: center; }
.ph-opcion.is-sel .ph-radio::after { content: ""; width: 10px; height: 10px; background: var(--azul-profit); }
.ph-aviso-caja { display: flex; gap: 12px; padding: var(--space-2); background: var(--blanco); border: 1px solid currentColor; font: 400 15px/22px var(--font-sans); }
.ph-aviso-caja svg { flex: none; width: 24px; height: 24px; }
.ph-aviso-caja.exito { color: var(--estado-exito); }
.ph-aviso-caja.aviso { color: var(--estado-aviso); }
.ph-aviso-caja.error { color: var(--estado-error); }
.ph-aviso-caja.info { color: var(--estado-info); }
.ph-aviso-caja p { color: var(--azul-profit); }
.ph-aviso-caja strong { display: block; color: currentColor; font-weight: 600; }

/* ---------- Tarjetas ---------- */
.ph-tarjeta { background: var(--superficie); border: 1px solid var(--linea); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.ph-tarjeta-icono { width: 32px; height: 32px; }
.ph-tarjeta .ph-link { margin-top: auto; padding-top: var(--space-1); }
.ph-rejilla { display: grid; gap: var(--space-3); }
.ph-rejilla-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ph-rejilla-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ph-rejilla-auto { grid-template-columns: repeat(auto-fit, minmax(264px, 1fr)); }

/* ---------- Caso ---------- */
.ph-caso { background: var(--superficie); border: 1px solid var(--linea); display: flex; flex-direction: column; }
.ph-caso-cuerpo { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.ph-cifra { display: flex; flex-direction: column; }
.ph-cifra-pre { font: 400 15px/22px var(--font-sans); color: var(--azul-profit); }
.ph-cifra-num { font: 600 48px/56px var(--font-serif); color: var(--acento); font-variant-numeric: tabular-nums lining-nums; }
.ph-caso .ph-fuente { padding-top: var(--space-2); border-top: 1px solid var(--linea); margin-top: auto; }

/* ---------- Bloque de cifra con fuente ---------- */
.ph-prueba { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4) var(--space-6); align-items: start; padding: var(--space-6); background: var(--superficie); border: 1px solid var(--linea); }
.ph-prueba-num { font: 600 64px/72px var(--font-serif); color: var(--acento); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.ph-prueba .ph-fuente { grid-column: 2; }
.ph-prueba.ph-sobre-azul { background: var(--azul-profit); border-color: var(--azul-profit); }
.ph-prueba.ph-sobre-azul .ph-prueba-num, .ph-prueba.ph-sobre-azul .ph-fuente { color: var(--hueso); }

/* ---------- Imagen de referencia ---------- */
.ph-img { position: relative; background: var(--piedra); aspect-ratio: 3 / 2; display: flex; align-items: flex-end; overflow: hidden; }
.ph-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.ph-img-pie { position: relative; margin: var(--space-1); padding: 4px var(--space-1); background: var(--hueso); font: 400 12px/16px var(--font-sans); color: var(--azul-profit); }
.ph-img-vacia { align-items: center; justify-content: center; text-align: center; padding: var(--space-3); }
.ph-img-vacia .ph-img-desc { font: 400 15px/22px var(--font-sans); color: var(--azul-profit); max-width: 32ch; }

/* ---------- WhatsApp flotante ---------- */
.ph-wa { position: fixed; right: var(--space-3); bottom: var(--space-3); width: 48px; height: 48px; display: grid; place-content: center; background: var(--blanco); color: var(--azul-profit); border: 1px solid var(--borde-campo); text-decoration: none; z-index: 20; }
.ph-wa:hover { background: var(--hueso); }
.ph-wa svg { width: 24px; height: 24px; }
.ph-wa.is-static { position: static; }

/* ---------- Pie ---------- */
.ph-footer { background: var(--noche); color: var(--hueso); }
.ph-footer-in { max-width: var(--contenedor); margin: 0 auto; padding: var(--space-8) var(--space-3) var(--space-4); }
.ph-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-4); }
.ph-footer img { height: 32px; width: auto; }
.ph-footer h4 { font: 600 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; margin-bottom: var(--space-2); }
.ph-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.ph-footer a { color: var(--hueso); font: 400 15px/22px var(--font-sans); text-decoration: none; }
.ph-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.ph-footer-desc { font: 400 15px/22px var(--font-sans); margin-top: var(--space-3); max-width: 32ch; }
.ph-footer-legal { margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--noche); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font: 400 15px/22px var(--font-sans); }
.ph-footer-legal span { margin-right: auto; }
.ph-footer-min .ph-footer-in { padding-top: var(--space-4); }
.ph-footer-min .ph-footer-legal { margin-top: 0; border-top: 0; padding-top: 0; }

/* ---------- Patrones (solo bandas sin texto) ---------- */
.ph-banda { height: 96px; background-color: var(--azul-profit); }
.ph-banda-fina { height: 48px; }
@media (max-width: 767px) { .ph-banda-fina { height: 40px; } }
.ph-banda-reticula { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath fill='%2367673F' d='M8 8h16v16h-8v-8h-8z'/%3E%3C/svg%3E"); background-size: 40px 40px; }
.ph-banda-escalera { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' fill='%2367673F'%3E%3Crect x='0' y='24' width='12' height='12'/%3E%3Crect x='0' y='36' width='12' height='12'/%3E%3Crect x='12' y='12' width='12' height='12'/%3E%3Crect x='12' y='24' width='12' height='12'/%3E%3Crect x='24' y='0' width='12' height='12'/%3E%3Crect x='24' y='12' width='12' height='12'/%3E%3Crect x='36' y='0' width='12' height='12'/%3E%3Crect x='36' y='36' width='12' height='12'/%3E%3C/svg%3E"); background-size: 48px 48px; }
.ph-banda-mosaico { background-color: var(--hueso); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='80'%3E%3Crect x='8' y='8' width='12' height='12' fill='%2367673F'/%3E%3Crect x='20' y='8' width='12' height='12' fill='%2367673F'/%3E%3Crect x='20' y='20' width='12' height='12' fill='%2367673F'/%3E%3Crect x='60' y='8' width='12' height='12' fill='%2367673F'/%3E%3Crect x='60' y='20' width='12' height='12' fill='%2367673F'/%3E%3Crect x='48' y='20' width='12' height='12' fill='%2367673F'/%3E%3Crect x='88' y='20' width='12' height='12' fill='%23162442'/%3E%3Crect x='88' y='8' width='12' height='12' fill='%23162442'/%3E%3Crect x='100' y='8' width='12' height='12' fill='%23162442'/%3E%3Crect x='20' y='60' width='12' height='12' fill='%23162442'/%3E%3Crect x='8' y='60' width='12' height='12' fill='%23162442'/%3E%3Crect x='8' y='48' width='12' height='12' fill='%23162442'/%3E%3Crect x='48' y='48' width='12' height='12' fill='%2367673F'/%3E%3Crect x='60' y='48' width='12' height='12' fill='%2367673F'/%3E%3Crect x='60' y='60' width='12' height='12' fill='%2367673F'/%3E%3Crect x='100' y='60' width='12' height='12' fill='%2367673F'/%3E%3Crect x='88' y='60' width='12' height='12' fill='%2367673F'/%3E%3Crect x='88' y='48' width='12' height='12' fill='%2367673F'/%3E%3C/svg%3E"); background-size: 120px 80px; }

/* ---------- Anotaciones del mockup (no van a producción) ---------- */
.ph-hueco { border: 1px dashed var(--azul-profit); background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(22,36,66,.04) 8px 16px); padding: var(--space-2); display: flex; flex-direction: column; gap: 4px; }
.ph-hueco b { font: 600 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.ph-hueco span { font: 400 15px/22px var(--font-sans); }
.ph-pendiente { display: inline-flex; align-items: center; gap: var(--space-1); padding: 4px var(--space-1); border: 1px solid var(--estado-aviso); color: var(--estado-aviso); background: var(--blanco); font: 600 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.ph-pendiente svg { width: 16px; height: 16px; }
.ph-bloque-pendiente { outline: 1px dashed var(--estado-aviso); outline-offset: 8px; }

/* ---------- Utilidades para previews ---------- */
.ph-demo { padding: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ph-demo-col { padding: var(--space-3); display: grid; gap: var(--space-3); }
.ph-demo-nota { font: 400 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--azul-profit); width: 100%; }
.ph-sobre-azul .ph-demo-nota { color: var(--hueso); }

/* ---------- PROPUESTA · Patrón digital «Retícula de línea» (pendiente de OK de Pedro) ----------
   Derivado del símbolo: retícula de 5×5 módulos (módulo 40 px, celda de 200 px) en trazo de 1 px,
   con la flecha de tres módulos dibujada en contorno en algunas celdas. Sin tonos intermedios:
   claro = Piedra sobre Hueso; azul = Noche sobre azul Profit (tono sobre tono). */
.ph-linea { background-repeat: repeat; background-size: 400px 400px; }
.ph-linea-claro { background-color: var(--hueso); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' fill='none' stroke='%23E4DED3' stroke-width='1' shape-rendering='crispEdges'%3E%3Cpath d='M-3.5 0.5h8M0.5 -3.5v8M-3.5 40.5h8M0.5 36.5v8M-3.5 80.5h8M0.5 76.5v8M-3.5 120.5h8M0.5 116.5v8M-3.5 160.5h8M0.5 156.5v8M-3.5 200.5h8M0.5 196.5v8M-3.5 240.5h8M0.5 236.5v8M-3.5 280.5h8M0.5 276.5v8M-3.5 320.5h8M0.5 316.5v8M-3.5 360.5h8M0.5 356.5v8M36.5 0.5h8M40.5 -3.5v8M36.5 40.5h8M40.5 36.5v8M36.5 80.5h8M40.5 76.5v8M36.5 120.5h8M40.5 116.5v8M36.5 160.5h8M40.5 156.5v8M36.5 200.5h8M40.5 196.5v8M36.5 240.5h8M40.5 236.5v8M36.5 280.5h8M40.5 276.5v8M36.5 320.5h8M40.5 316.5v8M36.5 360.5h8M40.5 356.5v8M76.5 0.5h8M80.5 -3.5v8M76.5 40.5h8M80.5 36.5v8M76.5 80.5h8M80.5 76.5v8M76.5 120.5h8M80.5 116.5v8M76.5 160.5h8M80.5 156.5v8M76.5 200.5h8M80.5 196.5v8M76.5 240.5h8M80.5 236.5v8M76.5 280.5h8M80.5 276.5v8M76.5 320.5h8M80.5 316.5v8M76.5 360.5h8M80.5 356.5v8M116.5 0.5h8M120.5 -3.5v8M116.5 40.5h8M120.5 36.5v8M116.5 80.5h8M120.5 76.5v8M116.5 120.5h8M120.5 116.5v8M116.5 160.5h8M120.5 156.5v8M116.5 200.5h8M120.5 196.5v8M116.5 240.5h8M120.5 236.5v8M116.5 280.5h8M120.5 276.5v8M116.5 320.5h8M120.5 316.5v8M116.5 360.5h8M120.5 356.5v8M156.5 0.5h8M160.5 -3.5v8M156.5 40.5h8M160.5 36.5v8M156.5 80.5h8M160.5 76.5v8M156.5 120.5h8M160.5 116.5v8M156.5 160.5h8M160.5 156.5v8M156.5 200.5h8M160.5 196.5v8M156.5 240.5h8M160.5 236.5v8M156.5 280.5h8M160.5 276.5v8M156.5 320.5h8M160.5 316.5v8M156.5 360.5h8M160.5 356.5v8M196.5 0.5h8M200.5 -3.5v8M196.5 40.5h8M200.5 36.5v8M196.5 80.5h8M200.5 76.5v8M196.5 120.5h8M200.5 116.5v8M196.5 160.5h8M200.5 156.5v8M196.5 200.5h8M200.5 196.5v8M196.5 240.5h8M200.5 236.5v8M196.5 280.5h8M200.5 276.5v8M196.5 320.5h8M200.5 316.5v8M196.5 360.5h8M200.5 356.5v8M236.5 0.5h8M240.5 -3.5v8M236.5 40.5h8M240.5 36.5v8M236.5 80.5h8M240.5 76.5v8M236.5 120.5h8M240.5 116.5v8M236.5 160.5h8M240.5 156.5v8M236.5 200.5h8M240.5 196.5v8M236.5 240.5h8M240.5 236.5v8M236.5 280.5h8M240.5 276.5v8M236.5 320.5h8M240.5 316.5v8M236.5 360.5h8M240.5 356.5v8M276.5 0.5h8M280.5 -3.5v8M276.5 40.5h8M280.5 36.5v8M276.5 80.5h8M280.5 76.5v8M276.5 120.5h8M280.5 116.5v8M276.5 160.5h8M280.5 156.5v8M276.5 200.5h8M280.5 196.5v8M276.5 240.5h8M280.5 236.5v8M276.5 280.5h8M280.5 276.5v8M276.5 320.5h8M280.5 316.5v8M276.5 360.5h8M280.5 356.5v8M316.5 0.5h8M320.5 -3.5v8M316.5 40.5h8M320.5 36.5v8M316.5 80.5h8M320.5 76.5v8M316.5 120.5h8M320.5 116.5v8M316.5 160.5h8M320.5 156.5v8M316.5 200.5h8M320.5 196.5v8M316.5 240.5h8M320.5 236.5v8M316.5 280.5h8M320.5 276.5v8M316.5 320.5h8M320.5 316.5v8M316.5 360.5h8M320.5 356.5v8M356.5 0.5h8M360.5 -3.5v8M356.5 40.5h8M360.5 36.5v8M356.5 80.5h8M360.5 76.5v8M356.5 120.5h8M360.5 116.5v8M356.5 160.5h8M360.5 156.5v8M356.5 200.5h8M360.5 196.5v8M356.5 240.5h8M360.5 236.5v8M356.5 280.5h8M360.5 276.5v8M356.5 320.5h8M360.5 316.5v8M356.5 360.5h8M360.5 356.5v8'/%3E%3Cpath d='M80.5 80.5h80v80h-40v-40h-40zM280.5 240.5h80v80h-40v-40h-40z'/%3E%3C/svg%3E"); }
.ph-linea-azul { background-color: var(--azul-profit); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' fill='none' stroke='%230E1830' stroke-width='1' shape-rendering='crispEdges'%3E%3Cpath d='M-3.5 0.5h8M0.5 -3.5v8M-3.5 40.5h8M0.5 36.5v8M-3.5 80.5h8M0.5 76.5v8M-3.5 120.5h8M0.5 116.5v8M-3.5 160.5h8M0.5 156.5v8M-3.5 200.5h8M0.5 196.5v8M-3.5 240.5h8M0.5 236.5v8M-3.5 280.5h8M0.5 276.5v8M-3.5 320.5h8M0.5 316.5v8M-3.5 360.5h8M0.5 356.5v8M36.5 0.5h8M40.5 -3.5v8M36.5 40.5h8M40.5 36.5v8M36.5 80.5h8M40.5 76.5v8M36.5 120.5h8M40.5 116.5v8M36.5 160.5h8M40.5 156.5v8M36.5 200.5h8M40.5 196.5v8M36.5 240.5h8M40.5 236.5v8M36.5 280.5h8M40.5 276.5v8M36.5 320.5h8M40.5 316.5v8M36.5 360.5h8M40.5 356.5v8M76.5 0.5h8M80.5 -3.5v8M76.5 40.5h8M80.5 36.5v8M76.5 80.5h8M80.5 76.5v8M76.5 120.5h8M80.5 116.5v8M76.5 160.5h8M80.5 156.5v8M76.5 200.5h8M80.5 196.5v8M76.5 240.5h8M80.5 236.5v8M76.5 280.5h8M80.5 276.5v8M76.5 320.5h8M80.5 316.5v8M76.5 360.5h8M80.5 356.5v8M116.5 0.5h8M120.5 -3.5v8M116.5 40.5h8M120.5 36.5v8M116.5 80.5h8M120.5 76.5v8M116.5 120.5h8M120.5 116.5v8M116.5 160.5h8M120.5 156.5v8M116.5 200.5h8M120.5 196.5v8M116.5 240.5h8M120.5 236.5v8M116.5 280.5h8M120.5 276.5v8M116.5 320.5h8M120.5 316.5v8M116.5 360.5h8M120.5 356.5v8M156.5 0.5h8M160.5 -3.5v8M156.5 40.5h8M160.5 36.5v8M156.5 80.5h8M160.5 76.5v8M156.5 120.5h8M160.5 116.5v8M156.5 160.5h8M160.5 156.5v8M156.5 200.5h8M160.5 196.5v8M156.5 240.5h8M160.5 236.5v8M156.5 280.5h8M160.5 276.5v8M156.5 320.5h8M160.5 316.5v8M156.5 360.5h8M160.5 356.5v8M196.5 0.5h8M200.5 -3.5v8M196.5 40.5h8M200.5 36.5v8M196.5 80.5h8M200.5 76.5v8M196.5 120.5h8M200.5 116.5v8M196.5 160.5h8M200.5 156.5v8M196.5 200.5h8M200.5 196.5v8M196.5 240.5h8M200.5 236.5v8M196.5 280.5h8M200.5 276.5v8M196.5 320.5h8M200.5 316.5v8M196.5 360.5h8M200.5 356.5v8M236.5 0.5h8M240.5 -3.5v8M236.5 40.5h8M240.5 36.5v8M236.5 80.5h8M240.5 76.5v8M236.5 120.5h8M240.5 116.5v8M236.5 160.5h8M240.5 156.5v8M236.5 200.5h8M240.5 196.5v8M236.5 240.5h8M240.5 236.5v8M236.5 280.5h8M240.5 276.5v8M236.5 320.5h8M240.5 316.5v8M236.5 360.5h8M240.5 356.5v8M276.5 0.5h8M280.5 -3.5v8M276.5 40.5h8M280.5 36.5v8M276.5 80.5h8M280.5 76.5v8M276.5 120.5h8M280.5 116.5v8M276.5 160.5h8M280.5 156.5v8M276.5 200.5h8M280.5 196.5v8M276.5 240.5h8M280.5 236.5v8M276.5 280.5h8M280.5 276.5v8M276.5 320.5h8M280.5 316.5v8M276.5 360.5h8M280.5 356.5v8M316.5 0.5h8M320.5 -3.5v8M316.5 40.5h8M320.5 36.5v8M316.5 80.5h8M320.5 76.5v8M316.5 120.5h8M320.5 116.5v8M316.5 160.5h8M320.5 156.5v8M316.5 200.5h8M320.5 196.5v8M316.5 240.5h8M320.5 236.5v8M316.5 280.5h8M320.5 276.5v8M316.5 320.5h8M320.5 316.5v8M316.5 360.5h8M320.5 356.5v8M356.5 0.5h8M360.5 -3.5v8M356.5 40.5h8M360.5 36.5v8M356.5 80.5h8M360.5 76.5v8M356.5 120.5h8M360.5 116.5v8M356.5 160.5h8M360.5 156.5v8M356.5 200.5h8M360.5 196.5v8M356.5 240.5h8M360.5 236.5v8M356.5 280.5h8M360.5 276.5v8M356.5 320.5h8M360.5 316.5v8M356.5 360.5h8M360.5 356.5v8'/%3E%3Cpath d='M80.5 80.5h80v80h-40v-40h-40zM280.5 240.5h80v80h-40v-40h-40z'/%3E%3C/svg%3E"); }
.ph-linea-libre { background-image: none; }

/* ---------- Listado sobrio de proyectos (ref. Driessen) ---------- */
.ph-lista { border-top: 1px solid var(--azul-profit); }
.ph-lista-fila { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) 176px; gap: var(--space-3); align-items: baseline; padding: var(--space-3) 0; border-bottom: 1px solid var(--linea); color: var(--azul-profit); text-decoration: none; }
.ph-lista-fila:hover .ph-lista-nombre { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.ph-lista-nombre { font: 500 22px/30px var(--font-serif); }
.ph-lista-dato { font: 400 15px/22px var(--font-sans); }
.ph-lista-cifra { font: 600 22px/30px var(--font-serif); color: var(--acento); text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.ph-lista-cab { padding: var(--space-1) 0; border-bottom: 0; }
.ph-lista-cab span { font: 600 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Proyecto con foto grande (ref. Norm) ---------- */
.ph-proyecto { display: flex; flex-direction: column; gap: var(--space-2); }
.ph-proyecto .ph-img { aspect-ratio: 4 / 3; }
.ph-proyecto-meta { font: 600 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--azul-profit); display: flex; gap: var(--space-1); }
.ph-proyecto-meta i { font-style: normal; color: var(--acento); }
.ph-proyecto h3 { font: 500 28px/36px var(--font-serif); }

/* ---------- Comparativa de grosor de titular (decisión pendiente) ---------- */
.ph-medium { font-weight: 500 !important; }
@media (max-width: 767px) {
  .ph-display { font-size: 36px; line-height: 44px; }
  .ph-prueba-num { font-size: 48px; line-height: 56px; }
  .ph-h1 { font-size: 36px; line-height: 44px; }
  .ph-h2 { font-size: 28px; line-height: 36px; }
  .ph-h3 { font-size: 22px; line-height: 30px; }
  .ph-rejilla-3, .ph-rejilla-2 { grid-template-columns: 1fr; }
  .ph-prueba { grid-template-columns: 1fr; padding: var(--space-4); }
  .ph-prueba .ph-fuente { grid-column: 1; }
  .ph-footer-grid { grid-template-columns: 1fr 1fr; }
  .ph-lista-fila { grid-template-columns: 1fr auto; }
  .ph-lista-fila .ph-lista-dato { grid-column: 1; }
}
.ph-etiqueta i { font-style: normal; color: var(--azul-profit); }

/* ---------- Movimiento e interacción (17/11) ----------
   Calma: transiciones de 200-600 ms, curva suave, nada que rebote ni parpadee.
   Todo dentro de prefers-reduced-motion: no-preference. Sin contadores animados. */
:root { --ease: cubic-bezier(.2, .7, .2, 1); }
.ph-btn { transition: background-color 200ms var(--ease), border-color 200ms var(--ease), color 200ms var(--ease); }
.ph-link { transition: text-decoration-thickness 200ms var(--ease); }
.ph-flecha { display: inline-block; transition: transform 300ms var(--ease); }
a:hover .ph-flecha, .ph-proyecto:hover .ph-flecha { transform: translateX(4px); }

/* Desplegable de Soluciones: se abre al pasar el ratón o con el teclado */
.ph-desplegable .ph-menu-sub { visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity 200ms var(--ease), transform 200ms var(--ease), visibility 0s linear 200ms; }
.ph-desplegable:hover .ph-menu-sub, .ph-desplegable:focus-within .ph-menu-sub { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.ph-desplegable:hover .ph-caret, .ph-desplegable:focus-within .ph-caret { transform: rotate(225deg) translate(-2px, -1px); }
.ph-caret { transition: transform 200ms var(--ease); }

/* Cabecera fija que se compacta al hacer scroll */
.ph-header-fija { position: sticky; top: 0; z-index: 30; }

/* Tarjetas, proyectos y filas */
.ph-tarjeta { transition: border-color 300ms var(--ease); }
.ph-tarjeta:hover { border-color: var(--oliva); }
.ph-proyecto { cursor: pointer; }
.ph-proyecto .ph-img { overflow: hidden; }
.ph-proyecto .ph-img > * { transition: transform 600ms var(--ease); }
.ph-proyecto:hover .ph-img > * { transform: scale(1.03); }
.ph-proyecto h3 { text-decoration: underline transparent; text-underline-offset: 6px; text-decoration-thickness: 1px; transition: text-decoration-color 300ms var(--ease); }
.ph-proyecto:hover h3 { text-decoration-color: currentColor; }
.ph-fila { transition: background-color 300ms var(--ease), padding 300ms var(--ease); }
.ph-lista-fila { transition: background-color 300ms var(--ease); }
.ph-lista-fila:hover { background: var(--blanco); }

/* Retícula viva (propia de Profithome): al pasar el ratón, la flecha de tres módulos
   se dibuja en la celda y se apaga despacio, como un rastro del criterio. Solo con ratón. */
.ph-reticula-viva { position: relative; overflow: hidden; display: grid; grid-template-columns: repeat(auto-fill, 80px); grid-auto-rows: 80px; align-content: start; }
.ph-reticula-viva span { display: block; position: relative; }


@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    /* Aparición suave al entrar en pantalla: 24 px y opacidad, una vez */
    .ph-reveal { animation: ph-entra linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    @keyframes ph-entra { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
    /* Cabecera: de 80 a 64 px en los primeros 160 px de scroll */
    .ph-header-fija .ph-header-in { animation: ph-compacta linear both; animation-timeline: scroll(root); animation-range: 0 160px; }
    @keyframes ph-compacta { to { height: 64px; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
  .ph-reticula-viva span { display: none; }
}

/* ---------- Cabecera adaptable y regla del logo (17/11) ----------
   El logo completo nunca baja de 36 px de alto (≈127 px de ancho): por debajo, el nombre deja de leerse.
   ≥1024 px (portátil y escritorio): cabecera completa, logo a 44 px desde 1200 px y a 40 px entre 1024 y 1199 (36 px al compactarse con el scroll).
   768-1023 px: logo a 40 px, se queda el botón primario; menú y Área de clientes pasan a la hamburguesa.
   <768 px: logo a 36 px y hamburguesa; el botón primario va dentro del panel y en el hero de cada página. */
.ph-header-dcha .ph-burger { margin-left: 0; }
.ph-burger { display: none; }
@media (min-width: 1024px) { .ph-panel-movil { display: none !important; } }
@media (min-width: 1024px) and (max-width: 1199px) {
  .ph-header-logo img { height: 40px; }
  .ph-header-in { gap: var(--space-3); }
  .ph-nav { gap: 20px; margin-left: 0; }
  .ph-header-dcha { gap: var(--space-2); }
  .ph-clientes { padding-right: var(--space-2); }
}
@media (max-width: 1023px) {
  .ph-nav, .ph-header-dcha > .ph-clientes { display: none; }
  .ph-burger { display: inline-flex; }
  .ph-header-logo img { height: 40px; }
  .ph-header-in { gap: var(--space-2); }
}
@media (max-width: 767px) {
  .ph-header-dcha > .ph-btn { display: none; }
  .ph-header-logo img { height: 36px; }
  .ph-header-in { height: 64px; padding: 0 var(--space-2) 0 var(--space-3); }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 1024px) {
  @supports (animation-timeline: view()) {
    .ph-header-fija .ph-header-logo img { animation: ph-logo-compacta linear both; animation-timeline: scroll(root); animation-range: 0 160px; }
    @keyframes ph-logo-compacta { to { height: 36px; } }
  }
}

/* ---------- Movimiento · segunda ronda (17/11) ---------- */
/* Retícula viva: al pasar el ratón se construye la flecha del símbolo en la celda (2 × 2 módulos de 40 px):
   primero el módulo de abajo a la derecha y, 90 ms después, la barra superior. Oliva sobre azul, como el negativo del logo. */
.ph-reticula-viva span::before, .ph-reticula-viva span::after { content: ""; position: absolute; width: 39px; height: 39px; opacity: 0; transition: opacity 1600ms var(--ease); background: var(--oliva); }
.ph-reticula-viva span::before { left: 41px; top: 41px; }
.ph-reticula-viva span::after { left: 41px; top: 1px; box-shadow: -40px 0 0 0 var(--oliva); }
.ph-linea-claro.ph-reticula-viva span::before, .ph-linea-claro.ph-reticula-viva span::after { background: var(--azul-profit); }
.ph-linea-claro.ph-reticula-viva span::after { box-shadow: -40px 0 0 0 var(--azul-profit); }
@media (hover: hover) {
  .ph-reticula-viva span:hover::before { opacity: 1; transition: opacity 0ms; }
  .ph-reticula-viva span:hover::after { opacity: 1; transition: opacity 0ms 90ms; }
}

/* Tarjeta: al pasar el ratón, borde y raya superior en oliva que se dibuja de izquierda a derecha */
.ph-tarjeta { position: relative; }
.ph-tarjeta::before { content: ""; position: absolute; left: -1px; top: -1px; height: 4px; width: 0; background: var(--oliva); transition: width 400ms var(--ease); }
.ph-tarjeta:hover::before { width: calc(100% + 2px); }

/* Icono que se construye sobre su retícula al entrar en pantalla */
.ph-icono { width: 48px; height: 48px; position: relative; color: var(--azul-profit); }
.ph-icono svg { position: relative; width: 48px; height: 48px; overflow: visible; }

/* Filas de «Cómo trabajamos» */
.ph-fila-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr); column-gap: 24px; row-gap: 16px; align-items: start; }
.ph-fila-accion { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
@media (max-width: 1199px) { .ph-fila-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } .ph-fila-accion { grid-column: 2; align-items: flex-start; } }
@media (max-width: 767px) { .ph-fila-grid { grid-template-columns: 1fr; } .ph-fila-accion { grid-column: 1; } }

/* Tríptico vivo: paralaje con el scroll y una respiración lenta, como una Live Photo */
.ph-vivo { position: relative; overflow: hidden; margin: 0; background: var(--piedra); aspect-ratio: 4 / 5; }
.ph-vivo-in { position: absolute; inset: -8% 0; }
.ph-vivo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-desfase { margin-top: 96px; }
@media (max-width: 767px) { .ph-desfase { margin-top: 0; } }

@media (prefers-reduced-motion: no-preference) {
  .ph-vivo img { animation: ph-respira 9s ease-in-out infinite alternate; transform-origin: 50% 60%; }
  .ph-vivo.d2 img { animation-delay: -3s; } .ph-vivo.d3 img { animation-delay: -6s; }
  @keyframes ph-respira { from { transform: scale(1); } to { transform: scale(1.06) translateX(-1%); } }
  @supports (animation-timeline: view()) {
    .ph-vivo-in { animation: ph-paralaje linear both; animation-timeline: view(); animation-range: cover; }
    @keyframes ph-paralaje { from { transform: translateY(-6%); } to { transform: translateY(6%); } }
    .ph-icono path { stroke-dasharray: 100 100; animation: ph-traza linear both; animation-timeline: view(); animation-range: entry 40% cover 45%; }
    @keyframes ph-aparece { from { opacity: 0; } to { opacity: 1; } }
    @keyframes ph-traza { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
  }
}

/* Filas de «Cómo trabajamos»: mismo destacado que las tarjetas (17/11) */
.ph-fila { position: relative; transition: background-color 300ms var(--ease), box-shadow 300ms var(--ease); }
.ph-fila::before { content: ""; position: absolute; left: 0; top: -1px; height: 4px; width: 0; background: var(--oliva); transition: width 400ms var(--ease); }
.ph-fila:hover { background: var(--blanco); box-shadow: inset 0 0 0 1px var(--oliva); }
.ph-fila:hover::before { width: 100%; }
.ph-fila.ph-fila-grid { padding-left: 24px !important; padding-right: 24px !important; }

/* Retícula viva en pantallas táctiles (18/11): sin ratón, las flechas se construyen solas
   una tras otra, en bucle lento, mientras el bloque está en pantalla. */
@media (hover: none) and (prefers-reduced-motion: no-preference) {
  .ph-reticula-viva span::before { animation: ph-flecha-a 6s var(--ease) infinite; }
  .ph-reticula-viva span::after { animation: ph-flecha-b 6s var(--ease) infinite; }
  .ph-reticula-viva span:nth-child(2)::before, .ph-reticula-viva span:nth-child(2)::after { animation-delay: 1.5s; }
  .ph-reticula-viva span:nth-child(3)::before, .ph-reticula-viva span:nth-child(3)::after { animation-delay: 3s; }
  .ph-reticula-viva span:nth-child(4)::before, .ph-reticula-viva span:nth-child(4)::after { animation-delay: 4.5s; }
  @keyframes ph-flecha-a { 0%, 100% { opacity: 0; } 4%, 18% { opacity: 1; } 45% { opacity: 0; } }
  @keyframes ph-flecha-b { 0%, 2%, 100% { opacity: 0; } 6%, 18% { opacity: 1; } 45% { opacity: 0; } }
}
