/*
 * Lo propio de la portada (app/views/home.php). La base (colores, tipografías, botones,
 * tarjetas, formulario, preguntas, cabecera) está en css/marca.css.
 * Fotos y videos en /media/portada/ (origen y licencia en su CREDITOS.md).
 */

/* ---------- Tarjetas 3D de «Lo que hacemos» (js/portada-pilares.js) ---------- */
/* Parten con su foto; cuando el 3D está listo (.is-lista) la foto se va y queda el lienzo sobre fondo oscuro, en los dos temas */
.pt-pilar3d { background: radial-gradient(120% 90% at 50% 38%, #0b3640 0%, #00131a 72%); }
.pt-pilar3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .6s ease; cursor: grab; }
.pt-pilar3d canvas:active { cursor: grabbing; }
.pt-pilar3d > img { transition: opacity .6s ease; }
.pt-pilar3d.is-lista canvas { opacity: 1; }
.pt-pilar3d.is-lista > img { opacity: 0; }
.pt-ia__rotulos, .pt-ia__chat { display: none; }
.pt-ia.is-lista .pt-ia__rotulos { display: block; position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pt-ia__rotulo { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: .72rem; font-weight: 600; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 6px #00131a, 0 0 2px #00131a; will-change: transform; }
.pt-ia__rotulo--nivel { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: #7fd9d3; }
.pt-ia__rotulo.is-activo { color: #fff; background: var(--pt-orange); padding: 2px 9px; border-radius: 999px; text-shadow: none; }
.pt-ia.is-lista .pt-ia__chat { display: grid; gap: 6px; position: absolute; left: 12px; right: 12px; top: 12px; pointer-events: none; }
.pt-ia__chat p { margin: 0; padding: 7px 11px; border-radius: 12px; font-size: .8rem; line-height: 1.35; max-width: 92%; opacity: 0; transform: translateY(4px); transition: opacity .4s ease, transform .4s ease; }
.pt-ia__pregunta { justify-self: end; background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .16); border-bottom-right-radius: 4px; backdrop-filter: blur(6px); }
.pt-ia__respuesta { justify-self: start; background: rgba(0, 19, 26, .78); color: rgba(255, 255, 255, .92); border: 1px solid rgba(255, 111, 15, .55); border-bottom-left-radius: 4px; backdrop-filter: blur(6px); }
.pt-ia__respuesta b { color: var(--pt-orange-soft); margin-right: 4px; }
.pt-ia__chat.is-pregunta .pt-ia__pregunta, .pt-ia__chat.is-respuesta .pt-ia__respuesta { opacity: 1; transform: none; }

/* ---------- Flota 3D ---------- */
.pt-flota { overflow: hidden; }
.pt-flota::after { content: ""; position: absolute; right: -10%; top: 10%; width: 70%; height: 80%; pointer-events: none; z-index: 0; background: radial-gradient(closest-side, rgba(255, 111, 15, .13), transparent 70%); }
.pt-flota .pt-wrap { position: relative; z-index: 1; }
.pt-flota__grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.pt-flota__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 26px; }
.pt-flota__tab { border: 1.5px solid var(--pt-line); background: transparent; color: var(--pt-muted); border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: .92rem; cursor: pointer; transition: all .2s ease; }
.pt-flota__tab:hover { color: var(--pt-text); border-color: rgba(var(--pt-tinta), .3); }
.pt-flota__tab[aria-selected="true"] { background: var(--pt-orange); border-color: var(--pt-orange); color: #fff; }
.pt-flota__tab:focus-visible { outline: 3px solid rgba(255, 111, 15, .5); outline-offset: 2px; }
.pt-flota__info { border-top: 1px solid var(--pt-line); padding-top: 20px; min-height: 120px; }
.pt-flota__info small { display: block; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--pt-faint); margin-bottom: 8px; }
.pt-flota__info p { color: var(--pt-text); font-size: 1.12rem; line-height: 1.5; margin: 0; max-width: 36ch; }
.pt-flota__aviso { margin: 18px 0 0; font-size: .85rem; color: var(--pt-faint); }
.pt-flota__stage { position: relative; aspect-ratio: 4 / 3; border-radius: 24px; }
/* El piso del 3D se desvanece hacia los bordes del lienzo: sin esto se ve el corte del rectángulo */
.pt-flota__stage canvas {
    position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab;
    -webkit-mask-image: radial-gradient(ellipse closest-side at 50% 50%, #000 72%, transparent 100%);
            mask-image: radial-gradient(ellipse closest-side at 50% 50%, #000 72%, transparent 100%);
}
.pt-flota__stage canvas:active { cursor: grabbing; }
.pt-flota__cargando { position: absolute; inset: auto 0 18% 0; text-align: center; color: var(--pt-faint); font-size: .9rem; transition: opacity .4s ease; }
.pt-flota__cargando.is-oculto { opacity: 0; }
.pt-flota__pista { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); font-size: .82rem; color: var(--pt-faint); white-space: nowrap; }
.pt-flota__respaldo { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 24px; }
.pt-flota__stage.is-respaldo .pt-flota__respaldo { display: block; }
.pt-flota__stage.is-respaldo canvas, .pt-flota__stage.is-respaldo .pt-flota__pista { display: none; }
.pt-flota .pt-tarjetas { margin-top: clamp(56px, 7vw, 88px); }

.pt-rubros__otro { margin: 30px 0 0; }

/* ---------- Demo (formulario sobre foto) ---------- */
.pt-demo { overflow: hidden; }
.pt-demo__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.pt-demo::before { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(100deg, var(--pt-bg) 0%, rgba(0, 19, 26, .86) 46%, rgba(0, 19, 26, .62) 100%), linear-gradient(0deg, var(--pt-bg) 0%, transparent 25%, transparent 75%, var(--pt-bg) 100%); }
.pt-demo .pt-wrap { position: relative; z-index: 1; }
.pt-demo__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.pt-demo .pt-title { font-size: clamp(2.3rem, 5vw, 4rem); }
.pt-demo .pt-lead { margin-bottom: 36px; }
.pt-demo__wa { display: inline-flex; align-items: center; gap: 10px; color: var(--pt-text); text-decoration: none; font-weight: 600; }
.pt-demo__wa i { font-size: 1.4rem; color: #25d366; }
.pt-demo__wa:hover { color: var(--pt-text); text-decoration: underline; }

@media (max-width: 991.98px) {
    .pt-flota__grid, .pt-demo__grid { grid-template-columns: 1fr; }
    .pt-flota__stage { aspect-ratio: 1 / 1; max-height: 70vh; width: 100%; }
    .pt-pilar__img.pt-pilar3d { aspect-ratio: 4 / 5; max-height: 78vh; width: 100%; }
}
