/* Font Face - Dot Matrix */
@font-face {
    font-family: 'DotMatrix';
    src: url('DOTMATRI.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background-color: #000;
    font-family: 'DotMatrix', monospace;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 100vh;
}


/* Image Flash Overlay */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: none;
    /* Gradient mask - fade to black at bottom third */
    mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 50%,
        transparent 70%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 50%,
        transparent 70%
    );
}

.image-overlay.flash {
    opacity: 0.8;
    animation: image-glitch 0.15s steps(1) infinite;
}

/* Pixelation Effect */
.image-overlay.pixelated {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    background-size: 10% 10%;
    filter: blur(0.5px) contrast(1.2);
}

.image-overlay.pixelated-heavy {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    background-size: 5% 5%;
    filter: blur(0.3px) contrast(1.5);
}

/* Image Glitch Animation - RGB Split + Jitter + Tears */
@keyframes image-glitch {
    0% {
        transform: translate(0, 0);
        filter: none;
        clip-path: inset(0 0 0 0);
    }
    10% {
        transform: translate(-5px, 2px);
        filter: hue-rotate(90deg) saturate(1.5);
        clip-path: inset(10% 0 30% 0);
    }
    20% {
        transform: translate(3px, -1px);
        filter: none;
        clip-path: inset(0 0 0 0);
    }
    30% {
        transform: translate(0, 0);
        filter: hue-rotate(-90deg) saturate(2);
        clip-path: inset(40% 0 20% 0);
    }
    40% {
        transform: translate(-3px, 0);
        filter: none;
        clip-path: inset(0 0 0 0);
    }
    50% {
        transform: translate(5px, 3px);
        filter: hue-rotate(180deg);
        clip-path: inset(60% 0 10% 0);
    }
    60% {
        transform: translate(0, -2px);
        filter: none;
        clip-path: inset(0 0 0 0);
    }
    70% {
        transform: translate(-2px, 1px);
        filter: saturate(3) brightness(1.2);
        clip-path: inset(25% 0 45% 0);
    }
    80% {
        transform: translate(4px, 0);
        filter: none;
        clip-path: inset(0 0 0 0);
    }
    90% {
        transform: translate(0, 2px);
        filter: hue-rotate(45deg);
        clip-path: inset(70% 0 5% 0);
    }
    100% {
        transform: translate(0, 0);
        filter: none;
        clip-path: inset(0 0 0 0);
    }
}

/* RGB Split Pseudo Elements for Image */
.image-overlay::before,
.image-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    background-size: cover;
    background-position: center;
    opacity: 0;
    pointer-events: none;
    mask-image: inherit;
    -webkit-mask-image: inherit;
}

.image-overlay.flash::before {
    opacity: 0.5;
    transform: translate(-4px, 0);
    filter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='r'%3E%3CfeColorMatrix values='1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3C/svg%3E#r");
    mix-blend-mode: screen;
    animation: rgb-shift-red 0.2s steps(1) infinite;
}

.image-overlay.flash::after {
    opacity: 0.5;
    transform: translate(4px, 0);
    filter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='b'%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3C/svg%3E#b");
    mix-blend-mode: screen;
    animation: rgb-shift-blue 0.2s steps(1) infinite;
}

@keyframes rgb-shift-red {
    0%, 100% { transform: translate(-4px, 0); }
    25% { transform: translate(-6px, 2px); }
    50% { transform: translate(-3px, -1px); }
    75% { transform: translate(-5px, 1px); }
}

@keyframes rgb-shift-blue {
    0%, 100% { transform: translate(4px, 0); }
    25% { transform: translate(5px, -2px); }
    50% { transform: translate(3px, 1px); }
    75% { transform: translate(6px, -1px); }
}

/* Horizontal Tear Effect */
.image-overlay.flash.tearing {
    animation: image-tear 0.1s steps(1) forwards;
}

@keyframes image-tear {
    0% { clip-path: inset(0 0 0 0); }
    20% { clip-path: polygon(0 0, 100% 0, 100% 20%, 95% 20%, 95% 25%, 100% 25%, 100% 100%, 0 100%); }
    40% { clip-path: polygon(0 0, 100% 0, 100% 40%, 5% 40%, 5% 45%, 100% 45%, 100% 100%, 0 100%); }
    60% { clip-path: polygon(0 0, 100% 0, 100% 60%, 90% 60%, 90% 65%, 100% 65%, 100% 100%, 0 100%); }
    80% { clip-path: polygon(0 0, 100% 0, 100% 30%, 10% 30%, 10% 35%, 100% 35%, 100% 100%, 0 100%); }
    100% { clip-path: inset(0 0 0 0); }
}

/* Main Container */
.container {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px;
    padding-bottom: 10vh;
    width: 100%;
}

.content {
    position: relative;
}

/* Glitch Text Base */
.glitch-text {
    position: relative;
    color: #fff;
    letter-spacing: 3px;
}

h1.glitch-text {
    font-size: clamp(1.5rem, 5vw, 3rem);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.subtitle.glitch-text {
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: 40px;
    text-transform: lowercase;
}

/* Text stays still - no movement animations */

/* Signup Form */
.signup-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.email-input {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    font-family: 'DotMatrix', monospace;
    font-size: clamp(0.8rem, 2vw, 1rem);
    padding: 12px 20px;
    width: 100%;
    max-width: 300px;
    text-align: center;
    letter-spacing: 2px;
    outline: none;
    transition: box-shadow 0.3s ease;
}

.email-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

.email-input:focus {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.notify-btn {
    background: #fff;
    color: #000;
    border: none;
    font-family: 'DotMatrix', monospace;
    font-size: clamp(0.8rem, 2vw, 1rem);
    padding: 12px 30px;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notify-btn:hover {
    background: #000;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    outline: 1px solid #fff;
}

/* Confirmation Message */
.confirmation {
    display: none;
    text-align: center;
}

.confirmation.show {
    display: block;
}

.confirmation-text {
    font-family: 'DotMatrix', monospace;
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #fff;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* Error Message - Glitchy Style */
.error-message {
    display: none;
    font-family: 'DotMatrix', monospace;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    color: #ff3333;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    min-height: 1.2em;
}

.error-message.show {
    display: block;
    animation: error-glitch 0.3s steps(1) forwards;
}

@keyframes error-glitch {
    0% { opacity: 0; transform: translateX(-5px); }
    20% { opacity: 1; transform: translateX(3px); }
    40% { opacity: 0.8; transform: translateX(-2px); }
    60% { opacity: 1; transform: translateX(2px); }
    80% { opacity: 0.9; transform: translateX(-1px); }
    100% { opacity: 1; transform: translateX(0); }
}

.email-input.invalid {
    border-color: #ff3333;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

/* Screen Flicker Effect */
@keyframes screen-flicker {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.98;
    }
}

body {
    animation: screen-flicker 0.1s infinite;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .signup-form {
        width: 100%;
        padding: 0 20px;
    }

    .email-input {
        max-width: 100%;
    }

    /* Fix zoomed-in images on mobile */
    .image-overlay {
        background-size: contain;
        background-repeat: no-repeat;
    }
}
