/* =========================================================
   SaucedoCode — Tema de temporada: Halloween 🎃
   Solo aplica cuando <html> tiene la clase .halloween
   (la agrega halloween.js del 1 al 31 de octubre).
   ========================================================= */

html.halloween {
    --hw-pumpkin: #FF7A1A;
    --hw-ember: #FFB347;
    --hw-violet: #A855F7;
    --hw-slime: #8BE36B;

    --color-accent: var(--hw-pumpkin);
    --color-gold: var(--hw-ember);
    --grad: linear-gradient(120deg, #7C3AED, #A855F7 45%, #FF7A1A);
    --glow-primary: rgba(255, 122, 26, 0.22);
    --glow-secondary: rgba(168, 85, 247, 0.25);
}

/* Aurora en tonos de calabaza y morado */
html.halloween .blob-1 { background: #4C1D95; }
html.halloween .blob-2 { background: #C2410C; opacity: 0.28; }
html.halloween .blob-3 { background: #6D28D9; }
html.halloween[data-theme="light"] .blob-2 { background: #FDBA74; }

/* Punto del logo: brasa de calabaza */
html.halloween .logo-dot {
    background: none;
    -webkit-text-fill-color: var(--hw-pumpkin);
    color: var(--hw-pumpkin);
    text-shadow: 0 0 12px rgba(255, 122, 26, 0.8);
    animation: hw-flicker 3s infinite;
}

/* Calabaza junto al nombre */
.hw-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2em;
}
.hw-pumpkin {
    display: inline-block;
    font-size: clamp(1.6rem, 4.4vw, 3.3rem);
    line-height: 1;
    opacity: 0;
    filter: drop-shadow(0 0 14px rgba(255, 122, 26, 0.65));
    animation: hw-pop 0.6s ease-out 1s forwards, hw-bob 3.2s ease-in-out 1.6s infinite;
    cursor: pointer;
    user-select: none;
}
.hw-pumpkin:hover { opacity: 1; animation: hw-wiggle 0.5s ease-in-out; }

/* Chip de temporada en el hero */
.hw-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    margin-left: 0.5em;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    font-size: 0.85em;
    color: var(--hw-ember);
    background: rgba(255, 122, 26, 0.12);
    border: 1px solid rgba(255, 122, 26, 0.35);
}

/* Botón primario con brillo de brasa */
html.halloween .btn-primary {
    box-shadow: 0 8px 30px rgba(255, 122, 26, 0.3), 0 0 0 1px rgba(255, 122, 26, 0.25);
}

/* Capa de niebla */
.hw-fog {
    position: fixed;
    inset: auto 0 0 0;
    height: 45vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0.55;
    background:
        radial-gradient(ellipse 60% 40% at 20% 100%, rgba(168, 85, 247, 0.18), transparent 70%),
        radial-gradient(ellipse 50% 35% at 75% 100%, rgba(255, 122, 26, 0.12), transparent 70%),
        radial-gradient(ellipse 80% 30% at 50% 100%, rgba(237, 239, 247, 0.07), transparent 70%);
    background-size: 200% 100%;
    animation: hw-fog 28s linear infinite alternate;
}
html.halloween[data-theme="light"] .hw-fog { opacity: 0.35; }

/* Murciélagos */
.hw-bats {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}
.hw-bat {
    position: absolute;
    left: -60px;
    width: 44px;
    height: 22px;
    color: #1a1026;
    opacity: 0.85;
    animation: hw-fly linear infinite;
}
html.halloween:not([data-theme="light"]) .hw-bat { color: #120a1c; filter: drop-shadow(0 0 4px rgba(255, 122, 26, 0.55)) drop-shadow(0 0 10px rgba(168, 85, 247, 0.35)); }
.hw-bat svg { width: 100%; height: 100%; animation: hw-flap 0.28s ease-in-out infinite alternate; transform-origin: center; }

/* Telaraña en la esquina */
.hw-web {
    position: fixed;
    top: 64px;
    right: 0;
    width: 140px;
    height: 140px;
    pointer-events: none;
    z-index: 2;
    opacity: 0.18;
    color: var(--text);
}

/* Toast de easter egg */
.hw-boo {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(20px);
    padding: 0.7em 1.2em;
    border-radius: 14px;
    background: var(--surface-strong);
    border: 1px solid rgba(255, 122, 26, 0.4);
    color: var(--text);
    font-family: var(--font-display);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    pointer-events: none;
}
.hw-boo.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes hw-fly {
    0%   { transform: translate(0, 0) scale(var(--s, 1)); }
    25%  { transform: translate(28vw, -6vh) scale(var(--s, 1)); }
    50%  { transform: translate(55vw, 4vh) scale(var(--s, 1)); }
    75%  { transform: translate(82vw, -8vh) scale(var(--s, 1)); }
    100% { transform: translate(calc(100vw + 120px), 2vh) scale(var(--s, 1)); }
}
@keyframes hw-flap { from { transform: scaleY(1); } to { transform: scaleY(0.55) translateY(8%); } }
@keyframes hw-pop { from { opacity: 0; transform: scale(0.4) rotate(-30deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes hw-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes hw-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@keyframes hw-flicker { 0%, 100% { opacity: 1; } 45% { opacity: 0.75; } 50% { opacity: 1; } 52% { opacity: 0.6; } 55% { opacity: 1; } }
@keyframes hw-fog { from { background-position: 0% 0; } to { background-position: 100% 0; } }

@media (max-width: 768px) {
    .hw-web { width: 90px; height: 90px; top: 56px; }
    .hw-chip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hw-bats { display: none; }
    .hw-fog, .hw-pumpkin, html.halloween .logo-dot { animation: none; }
    .hw-pumpkin { opacity: 1; }
}
