/* Marca HabitaTest: isotipo y logotipo. Se carga después de app.css y lo sobrescribe. */

/* Cabecera: el cuerpo del isotipo hereda el color del texto; el acento cambia con el fondo.
   Sobre el video va todo en blanco: petróleo claro y destello no llegan a 3:1 sobre cielo claro. */
.marca { gap: 9px; font-family: 'Montserrat', sans-serif; font-weight: 700; letter-spacing: -.02em; --ht-acento: var(--blanco, #fff); }
.cabecera.solida .marca { --ht-acento: var(--petroleo-claro, #35B6C2); }
.cabecera.sobre-claro .marca { --ht-acento: var(--petroleo, #087F8C); }
.marca svg.ht-iso { width: 38px; height: 38px; flex: none; }
@media (max-width: 560px) { .marca svg.ht-iso { width: 34px; height: 34px; } }
.ht-logotipo > span { color: var(--ht-acento); transition: color .3s; }
/* El texto pequeño necesita 4,5:1 aunque pase contenido marino bajo la cabecera semitransparente */
.cabecera.sobre-claro .ht-logotipo > span { color: var(--petroleo-osc, #066672); }
.ht-a { stroke: var(--ht-acento); transition: stroke .3s; }
.ht-af { fill: var(--ht-acento); transition: fill .3s; }
.ht-pista { stroke: currentColor; opacity: .28; }
/* 584.34 = 2π·93, la circunferencia del anillo */
.ht-prog { stroke: var(--ht-acento); stroke-dasharray: 584.34; stroke-dashoffset: 584.34; opacity: 0; transition: stroke .3s; }
.ht-visto { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke .3s, stroke-dashoffset .4s cubic-bezier(.65,0,.35,1), opacity .1s; }
.ht-on .ht-visto { stroke-dashoffset: 0; opacity: 1; }

/* Entrada: la lupa revela la casa, una vez por sesión. No captura el puntero.
   Clases en <html>: ht-entra (primera visita de la sesión, la pone el script en línea), ht-vista (ya se vio),
   ht-va (marca.js tomó el control), ht-rev (aparece el texto), ht-fuera (terminó).
   Sin JS, o si marca.js no llega, el logo queda estático y la capa se retira sola a los 4,5 s. */
.entrada { position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; justify-items: center; background: #fff; color: var(--marino, #0A2F50); font-size: clamp(32px, 8vw, 40px); pointer-events: none; animation: ht-salida .45s 4.5s ease forwards; --ht-acento: var(--petroleo, #087F8C); }
.entrada .ht-iso { width: min(56vw, 230px); height: auto; }
.entrada .ht-logotipo { margin: 4px 0 0; font: 700 1em/1 'Montserrat', sans-serif; letter-spacing: -.02em; }
.entrada .ht-filete { width: 6.25em; height: 2px; margin: 8px 0 6px; background: var(--petroleo, #087F8C); transform-origin: left; }
.entrada .ht-descriptor { margin: 0; font: 500 .325em/1.3 'Montserrat', sans-serif; letter-spacing: .01em; color: var(--gris, #526473); }
/* La cabecera inicial es blanca: no se muestra hasta que la capa blanca se retira */
.cabecera { animation: ht-llega .45s 4.5s ease backwards; }
@keyframes ht-salida { to { opacity: 0; visibility: hidden; } }
@keyframes ht-llega { from { opacity: 0; } }

.ht-vista .entrada { display: none; }
.ht-vista .cabecera { animation: none; }
.ht-entra:not(.ht-va) .entrada > * { visibility: hidden; } /* el logo estático no debe asomarse antes de la animación */
.ht-va .entrada { animation: none; }
.ht-va .cabecera { animation: none; opacity: 0; }
.ht-va .entrada > :not(svg) { opacity: 0; transform: translateY(10px); transition: opacity .45s, transform .45s cubic-bezier(.2,.7,.2,1); }
.ht-va .entrada > .ht-filete { opacity: 1; transform: scaleX(0); transition-delay: .12s; }
.ht-va .entrada > .ht-descriptor { transition-delay: .24s; }
.ht-va.ht-rev .entrada > * { opacity: 1; transform: none; }
.ht-fuera .entrada { animation: ht-salida .45s ease forwards; }
.ht-fuera .cabecera { animation: ht-llega .45s ease; opacity: 1; }

/* Pie: isotipo estático. Va como fondo porque app.js reescribe el contenido de .pie-marca */
.pie-marca::before { content: ''; display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -4px; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath fill='%2335B6C2' d='M22.4 5h3.4v6.5h-3.4z'/%3E%3Cpath d='M3 15.5L16 3.6L29 15.5' stroke='%2335B6C2' stroke-width='3.6'/%3E%3Cpath d='M7.3 13.5V26.2H13.2' stroke='%23fff' stroke-width='2.6'/%3E%3Cpath fill='%23fff' d='M12.6 11.4h4v4h-4z'/%3E%3Ccircle cx='22.3' cy='23' r='5.4' stroke='%23fff' stroke-width='2.6'/%3E%3Cpath d='M26.6 27.3L29.2 29.9' stroke='%23fff' stroke-width='3.4'/%3E%3Cpath d='M19.6 23.1l1.9 1.9l3.2-4' stroke='%2335B6C2' stroke-width='2.2'/%3E%3C/svg%3E"); }

@media (prefers-reduced-motion: no-preference) {
  /* El subtítulo de la portada espera a que la entrada se retire */
  html:not(.ht-vista) .subtitulo .pp { animation-delay: calc(3.1s + var(--i) * .14s), calc(5.1s + var(--i) * .14s); }
}
@media (prefers-reduced-motion: reduce) {
  .entrada { display: none; }
  .cabecera { animation: none; }
  .ht-prog, .ht-visto { stroke-dashoffset: 0; opacity: 1; transition: none; }
  .ht-a, .ht-af, .ht-logotipo > span { transition: none; }
}
