* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a472a;
    --primary-light: #2d5a3d;
    --accent: #8fbc8f;
    --dark: #0a0f0d;
    --dark-card: #141a16;
    --text: #e8f0e8;
    --text-dim: #9fb09f;
    --border: rgba(143, 188, 143, 0.2);
    --glow: rgba(143, 188, 143, 0.4);
}

body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    background: var(--dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Tactical Grid Background */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(143, 188, 143, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(143, 188, 143, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 0;
    background: transparent;
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 15px var(--glow));
    transition: height 0.4s ease, filter 0.3s ease, opacity 0.4s ease;
    opacity: 0; /* Hide by default */
}

.header-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--glow);
    opacity: 0;
    transition: opacity 0.4s ease;
}

header.scrolled {
    background: rgba(10, 15, 13, 0.85);
    backdrop-filter: blur(12px);
    padding: 0.75rem 0;
    border-bottom-color: var(--border);
}

header.scrolled .logo {
    height: 40px; /* Make it slightly smaller when scrolled */
    opacity: 1; /* Show when scrolled */
}

header.scrolled .header-title {
    opacity: 1; /* Show when scrolled */
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.mobile-nav-icon {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 22px;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1002;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-open .hamburger-line:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
.nav-open .hamburger-line:nth-child(2) { opacity: 0; }
.nav-open .hamburger-line:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 5% 2rem;
    position: relative;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%); /* Re-centers the full-width element */
    width: 100vw;
    height: 100%;
    overflow: hidden;
    z-index: -2;
}

.hero-video-bg video {
    /* This ensures the video covers the full area of its container */
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dark overlay to ensure text is readable over the video */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 13, 0.7); /* Dark overlay */
    z-index: -1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
    opacity: 0.3;
    animation: pulse 4s ease-in-out infinite;
}

.hero-logo-large {
    width: clamp(150px, 25vw, 220px);
    height: auto;
    margin-bottom: -2.5rem; /* Adjust margin to position text correctly */
    filter: drop-shadow(0 0 20px var(--glow));
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
    animation: fadeInUpLogo 0.8s ease forwards;
    transform: translateY(-3rem); /* Nudge the logo up without affecting text flow */
}

@keyframes zoomIn {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.5;
    }
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--text);
    text-shadow: 0 0 25px var(--glow);
    animation: fadeInUp 1s ease;
    letter-spacing: 3px;
}

.hero .tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--text-dim);
    max-width: 700px;
    margin-bottom: 1rem;    
    animation: fadeInUp 1s ease 0.2s; /* Staggered animation */
    animation-fill-mode: backwards; /* Ensures it's invisible before animation starts */
}

.hero .subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--accent);
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease 0.4s; /* Staggered animation */
    animation-fill-mode: backwards;
    font-style: italic;
}

/* Custom animation for the hero logo to prevent layout jump */
@keyframes fadeInUpLogo {
    from {
        opacity: 0;
        transform: translateY(calc(-3rem + 40px));
    }
    to {
        opacity: 1;
        transform: translateY(-3rem);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 1s ease 0.6s; /* Staggered animation */
    animation-fill-mode: backwards;
}

.btn {
    padding: 1rem 2.5rem;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: -1;
}

.btn:hover::before {
    left: 0;
}

.btn:hover {
    color: var(--dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--glow);
}

.btn-primary {
    background: var(--accent);
    color: var(--dark);
}

.btn-primary::before {
    background: var(--dark);
}

.btn-primary:hover {
    color: var(--accent);
}

/* Sections */
section {
    padding: 5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

h2 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 3rem;
    text-align: center;
    color: var(--accent);
    position: relative;
    padding-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* Why Section */
.why-section {
    background: var(--dark-card);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid var(--border);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.why-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
    opacity: 0.1;
}

.why-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-dim);
    position: relative;
    z-index: 1;
}

/* Server Status */
.server-status {
    background: var(--dark-card);
    padding: 2.5rem;
    border-radius: 15px;
    border: 1px solid var(--border);
    text-align: center;
    margin: 3rem 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--primary);
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.status-dot {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    animation: statusPulse 2s infinite;
    box-shadow: 0 0 10px var(--accent);
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

.server-name {
    color: var(--accent);
    font-size: 1.5rem;
    margin-top: 1rem;
    font-weight: 700;
}

.server-name a {
    color: inherit;
    text-decoration: none;
    transition: text-shadow 0.3s ease;
}

.server-name a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px var(--glow);
}

.server-info {
    color: var(--text-dim);
    margin-top: 0.5rem;
}

.server-video-container {
    margin-top: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    /* Prevent clicks on the video so it acts as a background element */
    pointer-events: none;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, transparent, var(--accent), transparent);
}

.timeline-item {
    display: flex;
    justify-content: center;
    margin: 4rem 0;
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-box {
    margin-right: auto;
    margin-left: 0;
}

.timeline-item:nth-child(even) .timeline-box {
    margin-left: auto;
    margin-right: 0;
}

.timeline-box {
    background: var(--dark-card);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border);
    max-width: 45%;
    position: relative;
    transition: all 0.3s ease;
}

.timeline-image {
    width: 100%;
    border-radius: 10px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    opacity: 0.8;
    transition: opacity 0.3s ease, filter 0.3s ease;
    background-color: var(--dark); /* Fallback for broken images */
}

.timeline-box:hover .timeline-image {
    opacity: 1;
    filter: brightness(1.1);
}

/* Special styling for transparent logos in the timeline */
.timeline-image.timeline-logo {
    object-fit: contain; /* Fit logo without cropping */
    background-color: transparent; /* No background for transparency */
    border: none; /* Remove border for a cleaner look */
    width: auto;
    max-height: 60px;
    margin-bottom: 1.5rem;
    opacity: 1; /* Make logo fully visible */
    /* The DHQLAX logo has its own shadow, so no filter is needed here */
}

/* Style for broken images */
.timeline-image:error {
    line-height: 10; /* Vertically center alt text */
}

.timeline-box:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--glow);
}

.timeline-year {
    color: var(--accent);
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.8rem;
    font-family: 'Courier New', monospace;
}

.timeline-title {
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.timeline-desc {
    color: var(--text-dim);
    line-height: 1.7;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background: var(--accent);
    border-radius: 50%;
    border: 5px solid var(--dark);
    box-shadow: 0 0 20px var(--glow);
    z-index: 10;
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin-top: 1.5rem;
    border-radius: 10px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Members Grid */
.members-section h3 {
    text-align: center;
    color: var(--text-dim);
    margin-bottom: 3rem;
    font-size: 1.2rem;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.member-card {
    background: var(--dark-card);
    padding: 1.8rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.member-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--glow);
}

.member-name {
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.member-role {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.admin-badge {
    display: inline-block;
    background: var(--primary);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    margin-top: 0.3rem;
    font-weight: 600;
}

/* COD MW2 Style Glitch Animation */
.glitch {
    position: relative;
    color: var(--text);
    text-shadow: 0 0 15px var(--glow);
    display: inline-block; /* Ensures overflow:hidden works correctly */
    margin-bottom: 1.5rem;
    overflow: hidden; /* This will clip the pseudo-elements */
    animation: glitch-main 5s infinite linear;
}

.glitch::after,
.glitch::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 50%; /* Center the pseudo-elements */
    transform: translateX(-50%); /* Fine-tune centering */
    width: 100%;
    height: 100%;
    background: var(--dark);
    overflow: hidden;
    clip-path: inset(0);
}

.glitch::before {
    transform: translate(calc(-50% - 2px)); /* Adjust position with transform */
    text-shadow: 2px 0 var(--accent);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    transform: translate(calc(-50% + 2px)); /* Adjust position with transform */
    text-shadow: -2px 0 var(--primary-light);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

/* Remove the default underline from the glitch h2 */
.glitch.glitch::after {
    background: none; /* Overrides the h2::after rule */
}

@keyframes glitch-main {
    2%, 64% { transform: translate(2px, 0) skew(0deg); }
    65% { transform: translate(-2px, 0) skew(0deg); }
    66% { transform: translate(0, 0) skew(5deg); }
}

@keyframes glitch-anim-1 {
    0%, 100% { clip-path: inset(45% 0 56% 0); }
    25% { clip-path: inset(5% 0 90% 0); }
    50% { clip-path: inset(25% 0 50% 0); }
    75% { clip-path: inset(60% 0 10% 0); }
}

@keyframes glitch-anim-2 {
    0%, 100% { clip-path: inset(90% 0 5% 0); }
    25% { clip-path: inset(40% 0 30% 0); }
    50% { clip-path: inset(80% 0 10% 0); }
    75% { clip-path: inset(10% 0 85% 0); }
}

/* Social Links */
.social-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
}

.contact-column {
    text-align: center;
}

.enlistment-card {
    background: var(--dark-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 2rem;
    text-align: left;
}

.enlistment-card h3 {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.enlistment-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.enlistment-card li span {
    font-weight: 600;
    color: var(--accent);
    margin-right: 0.5rem;
}

.social-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

.social-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    background: var(--dark-card);
}

.social-icon img {
    width: 28px;
    height: 28px;
    /* Make the SVG white to match the accent color */
    filter: brightness(0) invert(1) sepia(1) saturate(10000%) hue-rotate(80deg);
    transition: filter 0.3s ease;
}

.social-icon:hover {
    background: var(--accent);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 5px 20px var(--glow);
}

.social-icon:hover img {
    /* On hover, change the icon color to dark */
    filter: brightness(0) saturate(100%) invert(6%) sepia(10%) saturate(1000%) hue-rotate(80deg);
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 5%;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    background: var(--dark-card);
}

footer p {
    margin: 0.5rem 0;
}

.footer-legacy {
    color: var(--accent);
    margin-top: 1.5rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 968px) {
    .mobile-nav-icon {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(10, 15, 13, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 1001;
    }

    .nav-links.nav-open {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 2rem;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
    }

    .nav-links.nav-open a {
        opacity: 1;
        transform: translateY(0);
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-box {
        max-width: calc(100% - 80px);
        margin-left: 80px !important;
        margin-right: 0 !important;
    }

    .timeline-marker {
        left: 30px;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
    }

    .btn {
        width: 100%;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    section {
        padding: 3rem 5%;
    }

    .members-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* Scroll Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
/* Discord Widget */
#discord-widget {
    background: var(--dark-card);
    padding: 2.5rem;
    border-radius: 15px;
    border: 1px solid var(--border);
    text-align: center;
    margin: 3rem 0;
}

#discord-widget h3 {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

#discord-members {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.discord-member {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.discord-member .status-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}