/* =============================================================
   HabitableWhite · Portada: entrada con scroll y proyectos
   Las reglas .world-* son las de proyecto.css (Pirineo); aquí se
   adaptan a la portada. Se carga después de styles.css.
   ============================================================= */
.world { position: relative; height: 460vh; background: var(--noche-alpina); }
.world-stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden; color: var(--inv-texto);
}
.world-poster, .world-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 45%;
}
.world-video { opacity: 0; transition: opacity .6s var(--ease-out); }
.world.has-video .world-video { opacity: 1; }
.world-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgb(20 32 38 / .45) 0%, transparent 22%),
    linear-gradient(0deg, rgb(20 32 38 / .78) 0%, rgb(20 32 38 / .28) 38%, transparent 62%);
}

.world-copy {
  position: absolute; z-index: 2;
  left: var(--gutter); right: var(--gutter);
  bottom: calc(clamp(4.5rem, 9vh, 7rem) + env(safe-area-inset-bottom, 0px));
  display: grid;
}
.world-beat {
  grid-area: 1 / 1; align-self: end;
  max-width: 34rem;
  opacity: 0; transform: translateY(1.25rem);
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out);
  pointer-events: none;
}
.world-beat.is-active { opacity: 1; transform: none; pointer-events: auto; }
.world-beat .eyebrow { margin-bottom: 1.1rem; }
.world-title {
  font-size: clamp(2.125rem, 1.3rem + 3.6vw, 4.75rem);
  font-weight: 500; line-height: 1.04; letter-spacing: var(--track-head);
  text-wrap: balance; max-width: 14ch;
  text-shadow: 0 2px 30px rgb(20 32 38 / .35);
}
.world-text {
  margin-top: 1.1rem; max-width: 36ch;
  font-size: var(--fs-body); line-height: 1.5; color: var(--inv-texto-2);
}
.world-beat .btn { margin-top: 1.75rem; }
.btn--glass {
  background: rgb(246 248 248 / .14); color: var(--blanco-hielo);
  box-shadow: inset 0 0 0 1px rgb(246 248 248 / .32);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.btn--glass:hover { background: var(--blanco-hielo); color: var(--noche-alpina); }
.btn-arrow--down { transform: rotate(90deg); }
.btn:hover .btn-arrow--down { transform: rotate(90deg) translateX(3px); }

.world-rail {
  position: absolute; z-index: 2; right: var(--gutter);
  bottom: calc(clamp(4.5rem, 9vh, 7rem) + env(safe-area-inset-bottom, 0px));
  display: none; gap: .9rem; text-align: right;
  font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase;
}
.world-rail li { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; color: rgb(246 248 248 / .42); transition: color .5s var(--ease-out); }
.world-rail li::after { content: ""; width: 1.5rem; height: 1px; background: currentColor; transition: width .5s var(--ease-out); }
.world-rail li.is-active { color: var(--blanco-hielo); }
.world-rail li.is-active::after { width: 3rem; }

.world-hint {
  position: absolute; z-index: 2; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  font-size: .6875rem; font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--inv-texto-2); transition: opacity .4s linear;
}
.world-hint i { width: 1px; height: 2.25rem; background: rgb(246 248 248 / .25); position: relative; overflow: hidden; }
.world-hint i::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
  background: var(--blanco-hielo); animation: world-hint 1.8s var(--ease-soft) infinite;
}
@keyframes world-hint { to { top: 100%; } }
@media (max-width: 860px) and (orientation: portrait) {
  .world-copy { bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)); }   /* que «Desliza para entrar» no pise el texto */
}
@media (max-height: 500px) {   /* móvil en horizontal: el texto no cabe bajo la cabecera */
  .world-hint { display: none; }
  .world-copy { bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); }
  .world-title { font-size: 1.75rem; }
  .world-text { margin-top: .5rem; }
  .world-beat .btn { margin-top: .75rem; }
}

.world-bar { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 2px; background: rgb(246 248 248 / .12); }
.world-bar span { display: block; height: 100%; background: var(--blanco-hielo); transform-origin: 0 50%; transform: scaleX(0); }

/* --- Entrada de la portada --- */
.mundo { height: 620vh; }
.mundo-frame { position: absolute; inset: 0; overflow: hidden; background: var(--noche-alpina); }
.mundo .world-poster, .mundo .world-video { object-position: center 50%; }
.mundo .world-title { max-width: 16ch; }
.mundo .hero-acciones { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.mundo .hero-acciones .btn { margin-top: 0; }
.mundo-paso { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) and (orientation: portrait) {
  .world-copy { bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)); }
}
/* Móvil en vertical: el vídeo sigue en horizontal, como una franja en el centro */
@media (max-width: 719px) and (orientation: portrait) {
  .mundo { height: 520vh; --franja: max(calc(var(--nav-h) + 1rem), calc(50svh - 28.125vw - 6rem)); }
  .mundo-frame { inset: auto 0 auto 0; top: var(--franja); aspect-ratio: 16 / 9; }
  .mundo .world-shade { top: var(--franja); bottom: auto; aspect-ratio: 16 / 9; width: 100%; background: linear-gradient(0deg, rgb(20 32 38 / .35), transparent 30%); }
  .mundo .world-copy { top: calc(var(--franja) + 56.25vw + 1.75rem); bottom: auto; }
  .mundo .world-beat { align-self: start; }
  .mundo .world-title { font-size: clamp(1.875rem, 1.2rem + 3.6vw, 2.5rem); }
  .mundo .world-text { margin-top: .75rem; }
  .mundo .hero-acciones { margin-top: 1.25rem; }
  .mundo .world-hint { display: none; }
  .mundo .hero-acciones { flex-wrap: nowrap; gap: .5rem; }
  .mundo .hero-acciones .btn { padding: .85em 1em; font-size: .9375rem; }
}
@media (max-height: 500px) {
  .world-hint { display: none; }
  .world-copy { bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); }
  .world-title { font-size: 1.75rem; }
  .world-text { margin-top: .5rem; }
  .mundo .hero-acciones { margin-top: .75rem; }
  .mundo .world-shade { background: linear-gradient(90deg, rgb(20 32 38 / .88) 0%, rgb(20 32 38 / .55) 48%, transparent 78%); }
}
@media (prefers-reduced-motion: reduce) {
  .mundo { height: auto; }
  .mundo .world-stage { position: relative; }
  .mundo .world-beat:not(:first-child) { display: none; }
  .mundo .world-beat:first-child { opacity: 1; transform: none; }
  .world-hint, .world-bar { display: none; }
}

/* --- Proyectos en cuadrícula --- */
.bento { display: grid; gap: 1rem; }
.bento-card {
  position: relative; display: block; overflow: hidden; border-radius: 10px; color: var(--blanco-hielo);
  background: var(--noche-alpina); aspect-ratio: 4 / 3; isolation: isolate;
}
.bento-card--grande { aspect-ratio: 4 / 5; }
.bento-media, .bento-media img, .bento-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bento-media img, .bento-media video { transition: transform 1.2s var(--ease-out); }
.bento-card:hover .bento-media img, .bento-card:hover .bento-media video { transform: scale(1.04); }
.bento-card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(0deg, rgb(14 23 28 / .86) 0%, rgb(14 23 28 / .35) 38%, transparent 64%);
}
.bento-texto { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: clamp(1.25rem, 2.6vw, 2rem); display: grid; gap: .45rem; }
.bento-etiqueta { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--inv-texto-2); }
.bento-titulo { font-size: clamp(1.375rem, 1.1rem + 1vw, 2rem); font-weight: 500; line-height: 1.12; letter-spacing: -.02em; max-width: 20ch; text-wrap: balance; }
.bento-card--grande .bento-titulo { font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem); }
.bento-dato { font-size: var(--fs-small); color: var(--inv-texto-2); }
.bento-flecha {
  position: absolute; z-index: 2; top: 1rem; right: 1rem; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center; background: rgb(246 248 248 / .14); box-shadow: inset 0 0 0 1px rgb(246 248 248 / .3);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .4s var(--ease-out), color .4s var(--ease-out);
}
.bento-flecha .btn-arrow { width: 1.1rem; height: 1.1rem; }
.bento-card:hover .bento-flecha { background: var(--blanco-hielo); color: var(--noche-alpina); }
.bento-card:focus-visible { outline: 2px solid var(--azul-glaciar); outline-offset: 3px; }
@media (min-width: 720px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento-card--grande { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
}
@media (min-width: 1100px) {
  .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: clamp(15rem, 20vw, 21rem); }
  .bento-card { aspect-ratio: auto; }
  .bento-card--grande { grid-column: 1 / 9; grid-row: span 2; aspect-ratio: auto; }
  .bento-card--lado { grid-column: 9 / 13; }
  .bento-card--mitad { grid-column: span 6; }
}

/* --- CRM a medida --- */
.crm-medida .section-intro { color: var(--inv-texto-2); }
.crm-pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.crm-pasos li { padding-top: 1.25rem; border-top: 1px solid var(--inv-hairline); min-width: 0; }
.crm-pasos span { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--track-label); color: var(--inv-texto-2); }
.crm-pasos h3 { margin-top: .8rem; font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.01em; }
.crm-pasos p { margin-top: .5rem; color: var(--inv-texto-2); max-width: 38ch; }
.crm-ejemplos-titulo { margin-top: clamp(3rem, 6vw, 4.5rem); font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--inv-texto-2); }
.crm-ejemplos { margin-top: 1rem; display: grid; gap: 1rem; }
.crm-aviso { min-width: 0; padding: 1.25rem 1.35rem; border-radius: 14px; background: var(--blanco-hielo); color: var(--noche-alpina); box-shadow: 0 24px 48px -28px rgb(0 0 0 / .6); }
.crm-sector { font-size: .6875rem; font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--azul-glaciar-hover); }
.crm-asunto { margin-top: .5rem; font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.crm-cuerpo { margin-top: .35rem; font-size: var(--fs-small); color: var(--texto-2); line-height: 1.5; }
.crm-cta { margin-top: clamp(2.5rem, 5vw, 3.5rem); display: flex; flex-wrap: wrap; gap: .75rem; }
@media (min-width: 720px) {
  .crm-pasos, .crm-ejemplos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Qué hace HabitableWhite --- */
.qh-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qh {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 13rem; min-width: 0;
  overflow: hidden; border-radius: 10px; isolation: isolate; color: var(--blanco-hielo); background: var(--noche-alpina);
}
.qh-media, .qh-media img, .qh-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qh-media { z-index: -1; }
.qh-media img, .qh-media video { transition: transform 1.2s var(--ease-out); }
a.qh:hover .qh-media img, a.qh:hover .qh-media video { transform: scale(1.05); }
.qh-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgb(14 23 28 / .85) 0%, rgb(14 23 28 / .3) 45%, transparent 70%); }
.qh-texto { padding: clamp(1rem, 2vw, 1.5rem); display: grid; gap: .35rem; }
.qh h3 { font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem); font-weight: 500; line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; }
.qh p { font-size: var(--fs-small); line-height: 1.45; color: var(--inv-texto-2); max-width: 34ch; }
.qh-flecha {
  position: absolute; top: .85rem; right: .85rem; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center;
  background: rgb(246 248 248 / .14); box-shadow: inset 0 0 0 1px rgb(246 248 248 / .3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .4s var(--ease-out), color .4s var(--ease-out);
}
.qh-flecha .btn-arrow { width: 1rem; height: 1rem; }
a.qh:hover .qh-flecha { background: var(--blanco-hielo); color: var(--noche-alpina); }
a.qh:focus-visible { outline: 2px solid var(--azul-glaciar); outline-offset: 3px; }
/* fichas de solo texto */
.qh--dato { background: var(--azul-glaciar); }
.qh--tienda, .qh--estrategia { background: var(--hielo); color: var(--noche-alpina); }
.qh--tienda p, .qh--estrategia p { color: var(--texto-2); }
.qh--tienda .qh-flecha, .qh--estrategia .qh-flecha { background: var(--blanco-hielo); box-shadow: none; }
.qh-cifra { font-size: clamp(2.75rem, 2rem + 3vw, 4.5rem) !important; font-weight: 500; line-height: 1 !important; letter-spacing: -.04em; color: var(--blanco-hielo) !important; font-variant-numeric: tabular-nums; }
.qh-cifra-pie { margin-bottom: .75rem; }
.qh-icono { font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem) !important; line-height: 1 !important; color: var(--azul-glaciar-hover) !important; margin-bottom: .5rem; }
.qh--webs, .qh--foto, .qh--3d, .qh--estrategia { grid-column: span 2; }
.qh--redes { grid-row: span 2; }
@media (max-width: 719px) {
  .qh { min-height: 11rem; }
  .qh--webs, .qh--foto, .qh--3d { min-height: 15rem; }
  .qh p:not(.qh-cifra):not(.qh-cifra-pie):not(.qh-icono) { font-size: .8125rem; }
}
@media (min-width: 960px) {
  .qh-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(15rem, auto); }
  .qh { min-height: 0; }
  .qh--webs { grid-column: span 2; grid-row: span 2; }
  .qh--redes { grid-column: span 1; grid-row: span 2; }
  .qh--foto, .qh--3d, .qh--estrategia { grid-column: span 2; }
}
/* fotos claras: más sombra para que se lea el texto */
.qh--ia .qh-media::after, .qh--crm .qh-media::after { background: linear-gradient(0deg, rgb(14 23 28 / .92) 0%, rgb(14 23 28 / .62) 55%, rgb(14 23 28 / .2) 100%); }
.qh-cifra { white-space: nowrap; }
@media (max-width: 719px) { .qh-cifra { font-size: 2.25rem !important; } }

/* Entrada: la promesa ocupa más; el subtítulo resalta «Tu negocio, sin ruido» */
.mundo .world-beat:first-child .world-title { max-width: 18ch; }
.mundo .world-text strong { color: var(--blanco-hielo); font-weight: 600; }
@media (max-width: 719px) and (orientation: portrait) {
  .mundo .world-beat:first-child .world-title { font-size: 1.75rem; }
  .mundo .world-beat:first-child .world-text { font-size: .9375rem; }
}
/* Historia */
.historia-enlace { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--azul-glaciar-hover); }
.historia-enlace:hover .btn-arrow { transform: translateX(3px); }
.historia-lead a { text-decoration: underline; text-underline-offset: .18em; }
@media (min-width: 720px) {
  .mundo .world-beat:first-child .world-title { font-size: clamp(2.25rem, 1.3rem + 2.6vw, 4rem); max-width: 15ch; }
  .mundo .world-shade {
    background:
      linear-gradient(90deg, rgb(20 32 38 / .78) 0%, rgb(20 32 38 / .45) 34%, transparent 58%),
      linear-gradient(180deg, rgb(20 32 38 / .45) 0%, transparent 22%),
      linear-gradient(0deg, rgb(20 32 38 / .78) 0%, rgb(20 32 38 / .28) 38%, transparent 62%);
  }
}

/* --- Apps a medida --- */
.apps-grid { display: grid; gap: 1rem; }
.app-card { min-width: 0; padding: 1rem 1rem 1.5rem; border-radius: 14px; background: var(--blanco-hielo); box-shadow: 0 1px 0 rgb(20 32 38 / .06), 0 20px 40px -30px rgb(20 32 38 / .35); }
.app-ventana { display: grid; gap: .6rem; padding: .85rem; border-radius: 10px; background: var(--noche-alpina); margin-bottom: 1.25rem; }
.app-puntos { display: flex; gap: .3rem; }
.app-puntos i { width: .45rem; height: .45rem; border-radius: 50%; background: rgb(246 248 248 / .25); }
.app-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.app-chips li { font-size: .6875rem; font-weight: 600; letter-spacing: .02em; padding: .3em .7em; border-radius: 999px; background: rgb(246 248 248 / .12); color: var(--blanco-hielo); }
.app-chips li:first-child { background: var(--azul-glaciar); }
.app-linea { display: block; height: .45rem; border-radius: 4px; background: rgb(246 248 248 / .14); }
.app-linea--corta { width: 60%; }
.app-card h3 { padding-inline: .25rem; font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.01em; }
.app-card p { margin-top: .4rem; padding-inline: .25rem; color: var(--texto-2); font-size: 1rem; line-height: 1.5; }
.apps-cta { margin-top: clamp(2.5rem, 5vw, 3.5rem); display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.apps-cta p { font-size: var(--fs-lead); font-weight: 500; letter-spacing: -.01em; }
@media (min-width: 720px) { .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .apps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.app-card--ancha { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .app-card--ancha { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.5rem; align-items: center; }
  .app-card--ancha .app-ventana { margin-bottom: 0; }
}
