/* =========================================================================
   Felicitación de Navidad (navidad.php): bola de nieve con la web del cliente
   dentro. La bola es una fotografía generada con IA; la web, la nieve y los
   reflejos del cristal se componen encima. Las tres medidas --cx, --cy y --r
   dicen dónde está la esfera dentro de la foto (centro y radio, en tanto por
   uno del lado de la imagen) y cambian con cada foto.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

.navidad {
    margin: 0; min-height: 100vh; min-height: 100svh; background: #060606; color: #fff;
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6; -webkit-font-smoothing: antialiased;
}
.navidad__marco {
    min-height: 100vh; min-height: 100svh; display: grid; align-items: center;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(16px, 3vw, 56px);
    max-width: 1500px; margin-inline: auto; padding: clamp(16px, 3vw, 44px);
}

/* ---------- Escena: la foto de la bola ---------- */
.nvd-escena {
    --foto: url(../img/navidad/bola-calida.webp); --cx: .5; --cy: .46; --r: .275; --suelo: .755;
    position: relative; width: min(100%, 88vh); width: min(100%, 88svh); aspect-ratio: 1; justify-self: end;
    background: var(--foto) center / cover no-repeat;
    -webkit-mask-image: radial-gradient(closest-side, #000 76%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 76%, transparent 100%);
}
.navidad--sereno .nvd-escena { --foto: url(../img/navidad/bola-serena.webp); --cy: .465; --r: .255; --suelo: .745; }
.nvd-escena.agitando { animation: nvd-agitar .7s cubic-bezier(.3, .6, .3, 1); }
@keyframes nvd-agitar {
    0% { transform: none; }
    15% { transform: translate(-1.6%, .4%) rotate(-2.4deg); }
    32% { transform: translate(1.5%, -.3%) rotate(2.2deg); }
    50% { transform: translate(-1%, .2%) rotate(-1.4deg); }
    70% { transform: translate(.6%, 0) rotate(.8deg); }
    100% { transform: none; }
}

/* ---------- La esfera: todo lo que va dentro del cristal ---------- */
.nvd-bola {
    position: absolute; left: calc((var(--cx) - var(--r)) * 100%); top: calc((var(--cy) - var(--r)) * 100%);
    width: calc(var(--r) * 200%); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
    container-type: inline-size; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.nvd-bola:active { cursor: grabbing; }

/* La web del cliente, como una pantalla pequeña clavada en la nieve */
.nvd-web {
    position: absolute; left: 50%; top: 57%; width: 60%;
    transform: translate(-50%, -50%) perspective(700px) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
    transition: transform .3s ease-out; border-radius: 1.6cqw; overflow: hidden; background: #111;
    box-shadow: 0 0 9cqw rgba(255, 214, 130, .32), 0 4cqw 7cqw rgba(0, 0, 0, .65);
}
.navidad--sereno .nvd-web { box-shadow: 0 0 9cqw rgba(255, 240, 215, .2), 0 4cqw 7cqw rgba(0, 0, 0, .65); }
.nvd-web__barra { display: flex; align-items: center; gap: .9cqw; height: 3.2cqw; padding-inline: 1.4cqw; background: #1c1c1c; }
.nvd-web__barra i { width: 1.1cqw; height: 1.1cqw; border-radius: 50%; background: #555; }
.nvd-web img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; }
.nvd-web--logo { top: 50%; width: 38%; height: auto; background: none; box-shadow: none; border-radius: 0; overflow: visible; filter: drop-shadow(0 0 5cqw rgba(255, 214, 130, .35)); }

.nvd-nieve { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

/* Los reflejos del propio cristal de la foto, puestos otra vez encima de la web:
   es la misma imagen, colocada en el mismo sitio, sumando solo sus partes claras. */
.nvd-cristal {
    position: absolute; width: calc(100% / (2 * var(--r))); aspect-ratio: 1;
    left: calc(-100% * (var(--cx) - var(--r)) / (2 * var(--r))); top: calc(-100% * (var(--cy) - var(--r)) / (2 * var(--r)));
    background: var(--foto) center / cover no-repeat; mix-blend-mode: screen; opacity: .42; pointer-events: none;
}

/* ---------- Texto ---------- */
.nvd-texto { max-width: 520px; }
.nvd-texto__logo { display: block; width: 120px; height: auto; margin-bottom: clamp(22px, 4vw, 44px); opacity: .9; }
.nvd-texto h1 { margin: 0 0 22px; font-size: clamp(2.2rem, 4.6vw, 4rem); font-weight: 300; line-height: 1.08; letter-spacing: -.02em; }
.nvd-texto h1 strong { font-weight: 800; color: var(--acento); }
.navidad--sereno .nvd-texto h1 strong { color: #f1e6cf; }
.nvd-texto__mensaje { margin: 0 0 18px; font-size: clamp(1.02rem, 1.4vw, 1.2rem); color: rgba(255, 255, 255, .82); }
.nvd-texto__firma { margin: 0 0 34px; font-weight: 500; color: rgba(255, 255, 255, .6); }
.nvd-texto__acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.nvd-boton {
    font: inherit; font-weight: 500; line-height: 1; padding: 16px 30px; border-radius: 999px; border: 0; cursor: pointer;
    background: var(--acento); color: #141414; transition: transform .3s cubic-bezier(.2, .8, .2, 1), filter .25s;
}
.navidad--sereno .nvd-boton { background: #f1e6cf; }
.nvd-boton:hover { transform: translateY(-2px); filter: brightness(.95); }
.nvd-boton:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.nvd-texto__pista { font-size: .88rem; color: rgba(255, 255, 255, .5); }
.nvd-texto__web { margin: 30px 0 0; font-size: .82rem; color: rgba(255, 255, 255, .38); }

/* ---------- Móvil: la bola arriba, el texto debajo ---------- */
@media (max-width: 860px) {
    .navidad__marco { grid-template-columns: 1fr; align-content: start; gap: 4px; padding: 0 0 36px; }
    .nvd-escena { justify-self: center; width: min(100%, 62vh); width: min(100%, 62svh); }
    .nvd-texto { padding-inline: 22px; margin-inline: auto; }
    .nvd-texto__logo { width: 96px; margin-bottom: 18px; }
    .nvd-texto h1 { margin-bottom: 16px; }
    .nvd-texto__firma { margin-bottom: 24px; }
}

/* ---------- Movimiento reducido: bola quieta, sin botón de agitar ---------- */
@media (prefers-reduced-motion: reduce) {
    .nvd-escena.agitando { animation: none; }
    .nvd-web { transition: none; }
    .nvd-texto__acciones { display: none; }
}

/* ---------- La bola en la portada del sitio (includes/bloque-navidad.php) ---------- */
.seccion.nvd-portada { background: #060606; padding-block: clamp(18px, 3vw, 44px); overflow: hidden; }
.nvd-portada__marco { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: clamp(12px, 4vw, 64px); }
.nvd-portada .nvd-escena { width: min(100%, 580px); justify-self: center; }
.nvd-portada .nvd-bola { touch-action: pan-y; }   /* en la portada el dedo tiene que poder seguir bajando */
.nvd-portada__acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 30px; }
.nvd-portada__pista { font-size: .88rem; color: rgba(255, 255, 255, .5); }
@media (max-width: 860px) {
    .seccion.nvd-portada { padding-block: 0 44px; }
    .nvd-portada__marco { grid-template-columns: 1fr; gap: 0; }
    .nvd-portada .nvd-escena { width: min(100%, 440px); }
}
@media (prefers-reduced-motion: reduce) {
    .nvd-portada__acciones { display: none; }
}
