/* ========================================
   Hero Section - CRT TV Effect
   ======================================== */

.section--hero {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--negro-crt);
    overflow: hidden;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, var(--negro-crt) 70%);
    z-index: 2;
    pointer-events: none;
}

/* --- CRT Frame --- */
.hero__crt-frame {
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    width: min(90vw, 800px);
    aspect-ratio: 4 / 3;
    background: #1a1a1a;
    border-radius: 20px;
    padding: 20px;
    box-shadow:
        0 0 0 3px #333,
        0 0 0 6px #222,
        0 0 60px rgba(51, 255, 102, 0.05),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.hero__screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Static Noise --- */
.hero__static {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    animation: staticMove 0.1s steps(5) infinite;
    mix-blend-mode: overlay;
}

.hero__static.active {
    opacity: 0.8;
}

@keyframes staticMove {
    0% { background-position: 0 0; }
    20% { background-position: -50px -30px; }
    40% { background-position: 30px -60px; }
    60% { background-position: -60px 50px; }
    80% { background-position: 50px 20px; }
    100% { background-position: -20px -40px; }
}

/* --- Scanlines --- */
.hero__scanlines {
    position: absolute;
    inset: 20px;
    border-radius: 12px;
    pointer-events: none;
    z-index: 5;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    opacity: 0.6;
}

/* --- Content --- */
.hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--space-md);
    opacity: 0;
}

.hero__content.visible {
    opacity: 1;
}

.hero__date-counter {
    margin-bottom: var(--space-md);
}

.counter__year {
    font-family: var(--font-vcr);
    font-size: clamp(4rem, 15vw, 12rem);
    color: var(--verde-fosforo);
    text-shadow:
        0 0 20px rgba(51, 255, 102, 0.5),
        0 0 40px rgba(51, 255, 102, 0.3),
        0 0 80px rgba(51, 255, 102, 0.1);
    display: block;
    line-height: 1;
}

.hero__title {
    color: var(--blanco-crudo);
    margin-bottom: var(--space-xs);
    text-shadow: 0 0 30px rgba(245, 240, 232, 0.3);
}

.hero__subtitle {
    font-family: var(--font-vcr);
    font-size: clamp(1rem, 3vw, 1.8rem);
    color: var(--ambar-calido);
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
}

.hero__tagline {
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--gris-estatica);
    font-style: italic;
}

/* --- Glitch Effect (continuous, every ~3s) --- */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 1s infinite;
    color: var(--rojo-espana);
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

.glitch::after {
    animation: glitch-2 1s infinite;
    color: var(--azul-win98);
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
    0%, 85% { opacity: 0; transform: translate(0); }
    86% { opacity: 0.8; transform: translate(-3px, 2px); }
    88% { opacity: 0.8; transform: translate(3px, -2px); }
    90% { opacity: 0.8; transform: translate(-2px, -3px); }
    92% { opacity: 0.8; transform: translate(4px, 1px); }
    94% { opacity: 0; transform: translate(0); }
    100% { opacity: 0; transform: translate(0); }
}

@keyframes glitch-2 {
    0%, 87% { opacity: 0; transform: translate(0); }
    88% { opacity: 0.8; transform: translate(3px, -2px); }
    90% { opacity: 0.8; transform: translate(-4px, 2px); }
    92% { opacity: 0.8; transform: translate(2px, 3px); }
    94% { opacity: 0.8; transform: translate(-3px, -1px); }
    96% { opacity: 0; transform: translate(0); }
    100% { opacity: 0; transform: translate(0); }
}

/* --- Scroll Prompt --- */
.hero__scroll-prompt {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-ui);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s;
}

.hero__scroll-prompt.visible {
    opacity: 1;
}

.hero__scroll-text {
    font-family: var(--font-vcr);
    font-size: 0.75rem;
    color: var(--gris-estatica);
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: var(--space-xs);
}

.hero__scroll-arrow {
    width: 24px;
    height: 24px;
    margin: 0 auto;
    color: var(--verde-fosforo);
    animation: scrollBounce 2s ease-in-out infinite;
}

.hero__scroll-arrow svg {
    width: 100%;
    height: 100%;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(8px); opacity: 0.5; }
}

/* --- CRT Power On/Off --- */
.hero__screen.power-on {
    animation: crtPowerOn 0.5s ease-out forwards;
}

@keyframes crtPowerOn {
    0% {
        filter: brightness(0);
        transform: scaleY(0.005) scaleX(0.5);
    }
    30% {
        filter: brightness(5);
        transform: scaleY(0.005) scaleX(1);
    }
    50% {
        filter: brightness(3);
        transform: scaleY(1) scaleX(1);
    }
    100% {
        filter: brightness(1);
        transform: scaleY(1) scaleX(1);
    }
}
