/* ============================================================
   CASA DE KELLO — HOJA DE ESTILOS
   Extraído y organizado desde el <style> inline del HTML.

   SISTEMA DE BREAKPOINTS (todos max-width, de menor a mayor):
     ≤ 480px   móvil pequeño
     ≤ 768px   móvil / tablet vertical (hasta 768 inclusive; el drawer,
               el dock táctil y los modales en una columna viven aquí)
     ≤ 1024px  tablet horizontal
     ≤ 1279px  laptop. Se usa 1279 (no 1280) para que un viewport de
               1280px o más conserve intacto el diseño de escritorio.
   Excepciones documentadas:
     · max-width: 380px (tv-retro.css): reglas solo para pantallas muy
       estrechas (iPhone SE / Android compacto), que no deben afectar a
       390–480px.
     · min-width: 769px (house.css): par complementario de ≤768 para el
       dock de escritorio.
     · hover: hover/pointer: fine para efectos que no deben quedarse
       "pegados" en pantallas táctiles.
     · max-height: 480px + landscape: móvil horizontal.
   Preferir clamp()/min()/max()/aspect-ratio antes que nuevos breakpoints.
   ============================================================ */

:root{
  --black-deep:#0c0a08;
  --black:#161210;
  --black-soft:#201a16;
  --cream:#efe6d5;
  --cream-dim:#c9beac;
  --amber:#c97a45;
  --amber-hot:#e0955c;
  --stone:#8a8177;
  --grain-opacity:0.05;
}

*{margin:0;padding:0;box-sizing:border-box;}
html {
  /* Scroll nativo ágil sin conflicto con GSAP ScrollTrigger scrub */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Fondo y esquema oscuros en la raíz: evita la franja blanca bajo la página
     (zona de la barra de gestos en Android y rebote de scroll en iOS). */
  background: var(--black);
  color-scheme: dark;
}
body {
  background: var(--black);
  color: var(--cream);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

/* Eliminación del retardo táctil de 300ms en dispositivos móviles */
button,
a,
.v360-thumb-btn,
.v360-hotspot,
.grg-cube-card,
.disco-obj-card,
.wall-photo-item,
.drawer-item,
.drawer-nav-link{
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.v360-thumb-btn,
.v360-hotspot,
.grg-cube-card,
.disco-obj-card,
.wall-photo-item,
.drawer-item,
.drawer-nav-link{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
}

.grain{
  position:fixed; inset:0; z-index:200; pointer-events:none;
  opacity:var(--grain-opacity); mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation:grainshift 0.6s steps(4) infinite;
}
@keyframes grainshift{
  0%{transform:translate(0,0)} 25%{transform:translate(-2%,2%)}
  50%{transform:translate(2%,-1%)} 75%{transform:translate(-1%,-2%)}
  100%{transform:translate(0,0)}
}
/* Optimización de alto impacto: desactiva el costoso re-rasterizado continuo en móviles */
@media (max-width: 768px), (prefers-reduced-motion: reduce) {
  .grain {
    animation: none;
    mix-blend-mode: normal;
    opacity: 0.035;
  }
}
.vignette{
  position:fixed; inset:0; z-index:150; pointer-events:none;
  background:radial-gradient(ellipse at center, transparent 40%, rgba(8,6,5,0.55) 100%);
}

/* ---------- entrada ---------- */
#entrada{
  height:100vh;
  height:100dvh;
  width:100%;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  position:relative;
  background:radial-gradient(ellipse 65% 55% at 50% 45%, var(--black-soft) 0%, var(--black) 55%, #141414 100%);
  overflow:hidden;
}

.dust{ position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.dust span{
  position:absolute;
  border-radius:50%;
  background:var(--cream-dim);
  opacity:0;
  animation:dustFloat var(--dur, 9s) ease-in-out infinite;
  animation-delay:var(--del, 0s);
}
@keyframes dustFloat{
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  25% { opacity: var(--max-op, 0.28); }
  75% { opacity: var(--max-op, 0.28); }
  100% { transform: translate3d(var(--dx, 20px), var(--dy, -60px), 0); opacity: 0; }
}
@media (prefers-reduced-motion: reduce){
  .dust span{ animation:none; opacity:0.12; }
}

/* faint architectural house behind the logo (estilo exacto de referencia) */
.entrada-house-wrap{
  position:absolute;
  left:50%; top:50%;
  width:min(94vw, 760px);
  transform:translate(-50%,-50%);
  z-index:1;
  pointer-events:none;
  transition:opacity 0.6s ease;
}
.entrada-house-wrap svg{ width:100%; height:auto; overflow:visible; display:block; }
.eh-line{
  fill:none; stroke:rgba(189, 128, 83, 0.42); stroke-width:1.25;
  stroke-linecap:round; stroke-linejoin:round;
  opacity:0.65;
  transition:stroke 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease, filter 0.7s ease;
}
.eh-line.draw{
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
}
.entrada-house-wrap.charged .eh-line{
  stroke:var(--amber-hot); opacity:0.85;
  filter:drop-shadow(0 0 10px rgba(224,149,92,0.45));
}
.entrada-house-wrap.charged #eh-door{
  stroke:var(--amber-hot); opacity:1;
  filter:drop-shadow(0 0 14px rgba(224,149,92,0.7));
}

.door-glow-burst{
  position:absolute; left:50%; top:78%;
  width:220px; height:220px; margin-left:-110px; margin-top:-110px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(224,149,92,0.95) 0%, rgba(201,122,69,0.5) 35%, rgba(12,10,8,0) 70%);
  opacity:0; transform:scale(0.3);
  pointer-events:none; z-index:3; filter:blur(2px);
}


/* ---------- Pausa de animaciones infinitas que no se ven ---------- */
/* Modal de habitación o visor 360 abierto: la escena de fondo queda tapada */
.is-overlay-open :is(#entrada, #la-casa) *,
.is-overlay-open :is(#entrada, #la-casa) *::before,
.is-overlay-open :is(#entrada, #la-casa) *::after,
/* Visor 360 abierto: el modal de habitación queda tapado detrás */
.is-360-open #roomModal *,
.is-360-open #roomModal *::before,
.is-360-open #roomModal *::after,
/* Secciones de primer nivel fuera del viewport (clase puesta por IntersectionObserver) */
#entrada.is-offscreen *,
#entrada.is-offscreen *::before,
#entrada.is-offscreen *::after,
#la-casa.is-offscreen *,
#la-casa.is-offscreen *::before,
#la-casa.is-offscreen *::after {
  animation-play-state: paused;
}


/* ---------- Accesibilidad: foco visible y utilidades ---------- */
:focus-visible{
  outline: 2px solid var(--amber-hot);
  outline-offset: 3px;
}
:focus:not(:focus-visible){ outline: none; }

.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ---------- Reduced motion: contenido completo, sin animaciones ---------- */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .grain{ display:none; }
}
/* Sin timeline de scroll: la escena de la casa muestra su estado final */
html.reduce-motion #la-casa{ min-height:0; height:auto; }
