/* Basic Reset & Body Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Roboto', sans-serif;
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scrollbar caused by marquee/glitch */

    /* Pixel Grid Background (Keep as before) */
    --bg-color: #1a1510;
    --grid-color: #2c241c;
    --grid-size: 20px;
    --line-thickness: 1px;

    background-color: var(--bg-color);
    background-image:
        repeating-linear-gradient(to right, var(--grid-color) 0, var(--grid-color) var(--line-thickness), transparent var(--line-thickness), transparent var(--grid-size)),
        repeating-linear-gradient(to bottom, var(--grid-color) 0, var(--grid-color) var(--line-thickness), transparent var(--line-thickness), transparent var(--grid-size));
    background-size: var(--grid-size) var(--grid-size);
}

/* Main Container Styling */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    text-align: center;
}

/* --- Logo Glitch Effect --- */
.logo-container {
    position: relative; /* Needed for absolute positioning of pseudo-elements */
    display: inline-block; /* Fit container to image size */
    margin-bottom: 40px; /* Increased space below logo */
    /* Apply glitch animation to children */
    animation: glitch-container-shake 2s infinite linear; /* Optional subtle shake */
}

.logo {
    display: block; /* Prevents extra space below image */
    max-width: 250px;
    width: 80%;
    height: auto;
    position: relative; /* Ensure logo stays above pseudo-elements if needed */
    z-index: 1; /* Keep logo on top */
    /* filter: brightness(1.5); */ /* Optional: Keep if logo needs brightening */
}

/* Keyframes for the container shake (optional subtle movement) */
@keyframes glitch-container-shake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-1px); }
  20% { transform: translateX(1px); }
  30% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  50% { transform: translateX(-1px); }
  60% { transform: translateX(1px); }
  70% { transform: translateX(0); }
}


/* Glitch pseudo-elements */
.logo-container::before,
.logo-container::after {
    content: ''; /* Crucial for pseudo-elements */
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('Stress Release - Logo + Text.png.jpg'); /* Use the same image */
    background-size: cover; /* Ensure background covers the area */
    background-position: center;
    opacity: 0.8;
    overflow: hidden; /* Clip the pseudo-elements */
    z-index: 0; /* Place behind the main logo */
}

/* Glitch animation for ::before */
.logo-container::before {
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
    /* filter: brightness(1.5); */ /* Apply filter here too if used */
}

/* Glitch animation for ::after */
.logo-container::after {
    animation: glitch-anim-2 1.5s infinite linear alternate-reverse;
     /* filter: brightness(1.5); */ /* Apply filter here too if used */
}

/* Keyframes for Glitch Effect 1 (::before) */
@keyframes glitch-anim-1 {
    0% { clip-path: inset(3% 0 94% 0); transform: translate(-3px, -1px); }
    20% { clip-path: inset(87% 0 1% 0); transform: translate(2px, 2px); }
    40% { clip-path: inset(45% 0 45% 0); transform: translate(-2px, -1px); }
    60% { clip-path: inset(90% 0 5% 0); transform: translate(3px, 1px); }
    80% { clip-path: inset(25% 0 60% 0); transform: translate(-1px, 2px); }
    100% { clip-path: inset(55% 0 33% 0); transform: translate(1px, -2px); }
}

/* Keyframes for Glitch Effect 2 (::after) */
@keyframes glitch-anim-2 {
    0% { clip-path: inset(78% 0 15% 0); transform: translate(3px, 1px); }
    20% { clip-path: inset(5% 0 80% 0); transform: translate(-1px, -2px); }
    40% { clip-path: inset(40% 0 40% 0); transform: translate(2px, 1px); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(-3px, -1px); }
    80% { clip-path: inset(15% 0 70% 0); transform: translate(1px, 2px); }
    100% { clip-path: inset(60% 0 30% 0); transform: translate(-1px, -1px); }
}
/* --- End Logo Glitch --- */


/* --- Running Text Marquee --- */
.marquee-container {
    width: 100vw; /* Take full viewport width */
    overflow: hidden; /* Hide text outside container */
    background-color: rgba(0, 0, 0, 0.2); /* Optional subtle background for marquee */
    padding: 10px 0; /* Add some vertical padding */
    margin-bottom: 15px; /* Space below marquee */
}

.headline.running-text {
    display: inline-block; /* Allow transform to work */
    white-space: nowrap; /* Prevent text wrapping */
    padding-left: 100%; /* Start text off-screen to the right */
    font-size: 2em;
    font-weight: 100;
    color: #f5f5f5;

    /* Apply the marquee animation to the H1 itself now */
    animation: marquee-anim 15s linear infinite; /* name duration timing function iteration */
}

/* Adjust the inner span if needed, but animation is on H1 now */
/*
.headline.running-text span {
    display: inline-block;
}
*/

@keyframes marquee-anim {
    0% {
        transform: translateX(0%); /* Text starts fully off-screen right (due to padding-left) */
    }
    100% {
        transform: translateX(-100%); /* Move text fully across to the left */
    }
}
/* --- End Running Text Marquee --- */


/* --- OPTIONAL STYLES (Adjusted for Dark Theme & Uncomment if using corresponding HTML) --- */
/* Keep optional styles from previous version, ensure colors match dark theme */
/* Example: Tagline color */
/*
.tagline {
    font-size: 1.1em;
    color: #bbbbbb;
    margin-bottom: 30px;
}
*/
/* (Keep other optional styles as needed) */

/* --- End Optional Styles --- */

/* Media Query for smaller screens */
@media (max-width: 600px) {
    .logo {
        max-width: 200px;
    }
    .headline.running-text {
        font-size: 2em; /* Slightly smaller marquee text */
        animation-duration: 12s; /* Faster scroll on mobile */
    }
}