/* ============================================================
   Clima — overlay de lluvia para todo el sitio
   ============================================================ */

.clima-lluvia {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 50;
    opacity: 0;
    transition: opacity .7s ease;
}
.clima-lluvia.is-on { opacity: 1; }

.clima-lluvia .gota {
    position: absolute;
    top: -40px;
    width: 1.5px;
    height: 18px;
    background: linear-gradient(to bottom, rgba(220, 235, 255, 0), rgba(220, 235, 255, .75));
    border-radius: 999px;
    animation-name: clima-cae;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    will-change: transform;
}

@keyframes clima-cae {
    from { transform: translate3d(0, -20vh, 0); }
    to   { transform: translate3d(-6vw, 110vh, 0); }
}

/* Halo gris frío encima de todo cuando llueve */
.clima-lluvia::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(800px 600px at 50% -10%, rgba(80, 100, 130, .25), transparent 60%),
        linear-gradient(180deg, rgba(20, 30, 45, .12), rgba(20, 30, 45, .05));
    pointer-events: none;
}

/* ===== Tormenta fuerte ===== */
.clima-lluvia.fuerte::before {
    background:
        radial-gradient(900px 700px at 50% -10%, rgba(60, 80, 110, .5), transparent 60%),
        linear-gradient(180deg, rgba(15, 22, 35, .35), rgba(15, 22, 35, .18));
}
.clima-lluvia.fuerte .gota {
    width: 2px;
    background: linear-gradient(to bottom, rgba(220, 235, 255, 0), rgba(220, 235, 255, .95));
    animation-name: clima-cae-fuerte;
}
@keyframes clima-cae-fuerte {
    from { transform: translate3d(0, -20vh, 0); }
    to   { transform: translate3d(-12vw, 110vh, 0); }
}

/* ===== Capa FX (gotas con colisión + splash) ===== */
.clima-fx {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 52;
}
.clima-fx .gota-fx {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 16px;
    background: linear-gradient(to bottom, rgba(220, 235, 255, 0), rgba(220, 235, 255, .95));
    border-radius: 999px;
    will-change: transform;
}
.clima-fx.fuerte .gota-fx {
    width: 2.5px;
    height: 20px;
}
.clima-fx .salpicada {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 4px;
    background: rgba(220, 235, 255, .9);
    border-radius: 50%;
    will-change: transform, opacity;
    box-shadow: 0 0 4px rgba(220, 235, 255, .35);
}
.clima-fx.fuerte .salpicada {
    width: 5px;
    height: 5px;
}

/* ===== Relámpago ===== */
.clima-rayo {
    position: fixed;
    inset: 0;
    background: #fff;
    pointer-events: none;
    z-index: 51;
    opacity: 0;
    mix-blend-mode: screen;
    animation: clima-rayo 420ms ease-out forwards;
}
@keyframes clima-rayo {
    0%   { opacity: 0; }
    6%   { opacity: 0.9; }
    14%  { opacity: 0.08; }
    22%  { opacity: 0.78; }
    36%  { opacity: 0.05; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .clima-lluvia, .clima-rayo { display: none; }
}

/* ===== Matrix (lluvia digital, estilo película) ===== */
.clima-matrix {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 49;
    mix-blend-mode: screen;
    opacity: 1;
    transition: opacity .55s ease;
}
.clima-matrix.is-fading { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    .clima-matrix { display: none; }
}

/* ===== Delirio: palabras que giran + respiran ===== */
.delirio-word {
    display: inline-block;
    transform-origin: 50% 55%;
    animation: delirio-cw 4s linear infinite;
    will-change: transform;
}
.delirio-word.ccw {
    animation-name: delirio-ccw;
}
@keyframes delirio-cw {
    0%   { transform: rotate(0deg)   scale(.85); }
    50%  { transform: rotate(180deg) scale(1.18); }
    100% { transform: rotate(360deg) scale(.85); }
}
@keyframes delirio-ccw {
    0%   { transform: rotate(0deg)    scale(.85); }
    50%  { transform: rotate(-180deg) scale(1.18); }
    100% { transform: rotate(-360deg) scale(.85); }
}
@media (prefers-reduced-motion: reduce) {
    .delirio-word { animation: none; }
}

/* ===== Terremoto ===== */
@keyframes tt-body {
    0%, 100% { transform: translate(0, 0); }
    20%      { transform: translate(-1.5px, 1px); }
    40%      { transform: translate(1.5px, -1px); }
    60%      { transform: translate(-1px, -1.5px); }
    80%      { transform: translate(1px, 1.5px); }
}
@keyframes tt-shake-strong {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    20%      { transform: translate(-3px, 2px) rotate(-.5deg); }
    40%      { transform: translate(3px, -2px) rotate(.4deg); }
    60%      { transform: translate(-2px, -3px) rotate(-.3deg); }
    80%      { transform: translate(2px, 3px) rotate(.6deg); }
}
@keyframes tt-shake-mid {
    0%, 100% { transform: translate(0, 0); }
    25%      { transform: translate(-2px, 1px); }
    50%      { transform: translate(2px, -1px); }
    75%      { transform: translate(-1px, -2px); }
}
@keyframes tt-shake-text {
    0%, 100% { transform: translate(0, 0); }
    33%      { transform: translate(-1px, 1px); }
    66%      { transform: translate(1px, -1px); }
}

body.is-terremoto {
    animation: tt-body .13s linear infinite;
}

/* Títulos y bloques grandes — sacudida fuerte y desincronizada */
body.is-terremoto h1,
body.is-terremoto h2,
body.is-terremoto .adv-titulo,
body.is-terremoto .final-banner,
body.is-terremoto .orc-q-text,
body.is-terremoto .orc-r-text {
    animation: tt-shake-strong .09s ease-in-out infinite;
}

/* Cards / paneles — sacudida media */
body.is-terremoto .card,
body.is-terremoto .adv-card,
body.is-terremoto .opt,
body.is-terremoto .orc-card,
body.is-terremoto .opcion-btn,
body.is-terremoto .narrativa,
body.is-terremoto .ticker,
body.is-terremoto .topbar,
body.is-terremoto .footer .signoff,
body.is-terremoto .categoria-item {
    animation: tt-shake-mid .11s ease-in-out infinite;
}

/* Texto corrido — vibración leve */
body.is-terremoto p,
body.is-terremoto .lede,
body.is-terremoto .desc,
body.is-terremoto h3,
body.is-terremoto h4,
body.is-terremoto h5,
body.is-terremoto .orc-tag {
    animation: tt-shake-text .08s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    body.is-terremoto,
    body.is-terremoto * {
        animation: none !important;
    }
}
