/* Estilos compartidos por la casa y el living room */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --night: #0a0910;
  --room: #0e0c09;
  --wood-dark: #1a1208;
  --wood: #2a1e0e;
  --gold: #c4872a;
  --gold-bright: #f0a830;
  --parchment: rgba(212, 196, 168, 0.92);
  --dust: rgba(138, 122, 98, 0.8);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Cormorant Garamond', serif;
  color: var(--parchment);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Cursor personalizado: el ojo. Solo en pantallas con mouse.
   images/cursor/eye-sheet.webp = 3 capas lado a lado: globo · iris · brillo */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  html, body, a, button { cursor: none; }
  .cursor {
    --size: 56px;                 /* ✏️ tamaño del ojo en pantalla */
    display: block;
    position: fixed;
    left: 0; top: 0;
    width: var(--size); height: var(--size);
    margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.45));
    opacity: 0;
    transition: opacity 0.3s;
  }
  .cursor.ready { opacity: 1; }
  .cursor .eye {
    position: absolute; inset: 0;
    transition: transform 0.25s cubic-bezier(.3,1.6,.5,1);
  }
  .cursor .eye-part {
    position: absolute; inset: 0;
    background: url('../images/cursor/eye-sheet.webp') no-repeat;
    background-size: 300% 100%;
  }
  .cursor .eye-ball  { background-position: 0% 0; }
  .cursor .eye-shine { background-position: 100% 0; }
  /* el iris se recorta dentro del globo */
  .cursor .eye-clip {
    position: absolute; inset: 6%;
    border-radius: 50%;
    overflow: hidden;
  }
  .cursor .eye-iris {
    inset: -6.8%;                 /* compensa el recorte para que el iris quede alineado */
    background-position: 50% 0;
    will-change: transform;
  }
  .cursor .eye-iris-scale { position: absolute; inset: 0; transition: transform 0.35s cubic-bezier(.3,1.6,.5,1); }
  .cursor.hover .eye-iris-scale { transform: scale(1.22); }   /* pupila dilatada */
  .cursor.drag  .eye { transform: scale(0.92, 0.8); }          /* entrecierra al arrastrar */
  .cursor.press .eye { transform: scale(1.04, 0.9); }          /* se aplasta un poco al hacer click */

  /* Párpado: baja de arriba hacia abajo al parpadear */
  .cursor .eye-lid {
    position: absolute; inset: 0;
    background: url('../images/cursor/eye-lid.webp') no-repeat center / 100% 100%;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.12s ease-out;
  }
  .cursor.blink .eye-lid { clip-path: inset(0 0 0 0); transition: clip-path 0.07s ease-in; }
}

/* Fade de entrada */
.page-reveal {
  position: fixed; inset: 0;
  background: #000;
  z-index: 1000;
  pointer-events: none;
  animation: revealFade 1.3s ease 0.1s forwards;
}
@keyframes revealFade { from { opacity: 1; } to { opacity: 0; } }

/* Fade de salida entre páginas */
.transition-overlay {
  position: fixed; inset: 0;
  background: #000;
  z-index: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.9s ease;
}
.transition-overlay.active { opacity: 1; pointer-events: all; }

@keyframes hintPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ── ANIMACIÓN DE CARGA (logo) ── */
.loader {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, #17110a 0%, #0a0806 70%);
  transition: opacity 0.6s ease;
}
.loader.ld-out { opacity: 0; pointer-events: none; }
.has-loader .page-reveal { display: none; }
.ld-mark {
  position: relative;
  width: var(--ld-size, 340px);
  aspect-ratio: 2355 / 870;
  perspective: 900px;
  transform: translateX(27.09%);          /* la M sola, centrada */
  transition: transform 0.9s cubic-bezier(.2,.8,.2,1);
  animation: ldIn 0.6s ease both;
}
.ld-form .ld-mark { transform: none; }    /* se corre para formar "Mena" */
.ld-out .ld-mark { transform: scale(1.04); transition: transform 0.6s ease; }
.ld-mark > * { position: absolute; inset: 0; }
.ld-mark svg { display: block; width: 100%; height: 100%; }
.ld-wing { transform-origin: 22.91% 50%; will-change: transform; }
.ld-left  { clip-path: inset(0 77.09% 0 0); }
.ld-right { clip-path: inset(0 0 0 22.91%); }
.ld-glow { filter: blur(16px); opacity: 0.6; will-change: opacity; }
.ld-sheen {
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  background: linear-gradient(105deg, transparent 38%, rgba(255,110,110,.85) 44%, rgba(255,220,120,.9) 47%, rgba(120,255,170,.85) 50%, rgba(110,190,255,.9) 53%, rgba(200,130,255,.8) 56%, transparent 62%) no-repeat;
  background-size: 300% 100%;
  background-position: 100% 0;
  mix-blend-mode: screen;
  opacity: 0;
}
.loader-full .ld-sheen { animation: ldSheen 1.5s ease-in-out 0.55s both; }
.ld-ena { opacity: 0; transform: translateX(-3%); transition: opacity 0.7s ease 0.25s, transform 0.9s cubic-bezier(.2,.8,.2,1) 0.15s; }
.ld-form .ld-ena { opacity: 1; transform: none; }
.loader-short .ld-mark { animation-duration: 0.25s; }
.loader-reduced .ld-mark { animation: none; }
@keyframes ldIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ldSheen {
  0%   { background-position: 100% 0; opacity: 0; }
  15%  { opacity: 0.9; }
  85%  { opacity: 0.9; }
  100% { background-position: 0% 0; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}