/* --- BACKGROUND --- */
body { margin: 0; overflow-x: hidden; background-color: #020617; color: #cbd5e1; }
#tsparticles { position: fixed!important; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.content-layer { position: relative; z-index: 10; }

/* --- CARDS --- */
.glass-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.research-card {
    min-width: 280px; /* Safer for smaller phones like iPhone SE */
    width: 85vw;      /* Takes up 85% of screen on mobile */ 
    max-width: 400px; /* Keeps text readable without stretching */
    transition: all 0.3s ease;
    user-select: none; 
}

/* On Desktop, make the cards a bit wider */
@media (min-width: 768px) {
    .research-card {
        width: 45vw;
        max-width: 550px; 
    }
}

.research-card:hover {
    border-color: #10b981;
    box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

/* --- MARQUEE CONTAINER --- */
.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    margin-bottom: 4rem; 
    touch-action: pan-y; 
}

/* --- MARQUEE TRACK --- */
.marquee-track {
    display: flex;
    gap: 1.25rem; /* Smaller 20px gap on mobile */
    width: max-content;
    cursor: grab;
    will-change: transform; 
}

/* Larger 32px gap on desktop */
@media (min-width: 768px) {
    .marquee-track {
        gap: 2rem; 
    }
}

.marquee-track:active {
    cursor: grabbing;
}

/* --- TEXT ANIMATIONS --- */
.fade-color-shift {
    opacity: 0;
    animation: fadeIn 1.8s ease forwards, colorShift 6s ease-in-out infinite;
    background-size: 300% 300%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes colorShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.fade-switch {
    transition: opacity 1s ease-in-out;
}

/* --- FOOTER --- */
.footer-section {
    background-color: #121212;
    color: #ffffff;
    padding: 40px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-left, .footer-right {
    flex: 1 1 400px;
    margin-bottom: 20px;
}

.footer-left {
    display: flex;
    align-items: center;
}

.follow-us-text {
    font-size: 20px;
    font-weight: 500;
    margin-right: 20px;
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icon {
    color: #ffffff;
    font-size: 24px;
    text-decoration: none;
    transition: color 0.3s;
}

.social-icon:hover {
    color: #cccccc;
}

.footer-right h3 {
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 500;
}

.footer-right p {
    font-size: 14px;
    color: #aaaaaa;
    line-height: 1.5;
    margin-bottom: 20px;
}

.footer-right p a {
    color: #aaaaaa;
    text-decoration: underline;
}

.newsletter-form {
    display: flex;
    position: relative;
    max-width: 500px;
}

.newsletter-input {
    flex-grow: 1;
    background-color: #2c2c2c;
    border: none;
    border-radius: 30px;
    padding: 15px 20px;
    color: #ffffff;
    font-size: 16px;
    outline: none;
}

.newsletter-input::placeholder {
    color: #777777;
}

.email-send-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ffffff;
    color: #121212;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
}

.email-send-button:hover {
    background-color: #e0e0e0;
}

.email-send-button i {
    margin-right: 8px;
    font-size: 14px;
}

/* --- RESPONSIVE FOOTER FIX --- */
@media (max-width: 768px) {
    .footer-section {
        flex-direction: column;
        padding: 24px 20px;
        gap: 20px; 
    }

    .footer-left, .footer-right {
        flex: auto;  
        width: 100%;
        margin-bottom: 0;
    }

    .footer-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .social-icons {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .social-icon {
        font-size: 20px;
    }

    .footer-right h3 {
        margin-top: 0; 
    }

    .newsletter-form {
        max-width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .email-send-button {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
    }
    
    .newsletter-input {
        width: 100%;
        box-sizing: border-box;
    }
}

/* --- HIDE SCROLLBAR UTILITY --- */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

/* --- GRAPH TOGGLE ANIMATION --- */
.rotate-180 {
    transform: rotate(180deg);
}

.graph-hidden {
    height: 0 !important;
    opacity: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: none !important;
    pointer-events: none;
}

/* --- SCROLLBAR UTILITIES --- */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 10px;
}

/* --- TERMINAL FIXES --- */
#terminal-input {
    color: #10b981 !important; 
    caret-color: #10b981 !important; 
    background: transparent !important;
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
}

#terminal-overlay input {
    caret-shape: block;
    animation: blink 1s infinite;
}

#terminal-output::-webkit-scrollbar {
    width: 6px;
}
#terminal-output::-webkit-scrollbar-thumb {
    background-color: #334155;
    border-radius: 4px;
}

/* --- TYPING EFFECT CURSOR --- */
.typing-cursor::after {
    content: '▋'; 
    display: inline-block;
    margin-left: 4px;
    animation: blink 1s step-start infinite;
    color: #94a3b8; 
}

/* SHARED BLINK ANIMATION */
@keyframes blink {
    50% { opacity: 0; }
}





/* --- RECENT EDITS --- */
/* --- RAMADAN ENTRANCE EFFECT --- */

/* New Zoom-Out Animation for the Text */
@keyframes ramadanZoomOut {
    0%   { opacity: 0; transform: scale(0.5); }
    15%  { opacity: 1; transform: scale(1); }    /* Fades in and normalizes size */
    40%  { opacity: 1; transform: scale(1.3); }  /* Slow growth while reading */
    90%  { opacity: 0; transform: scale(20); }   /* Rapidly accelerates past the screen */
    100% { opacity: 0; transform: scale(20); }   /* Gone */
}

.animate-ramadan-text {
    /* ease-in makes the zoom start slow and speed up dramatically at the end */
    animation: ramadanZoomOut 7s ease-in forwards;
    transform-origin: center center;
    will-change: transform, opacity;
}

/* Falling Particles (Keep this exactly as it was) */
@keyframes fallAndFade {
    0%   { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.ramadan-particle {
    position: absolute;
    top: -5vh;
    color: #34d399; 
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    animation: fallAndFade linear forwards;
    will-change: transform, opacity; 
}

/* --- EMOJI PARTICLE FIXES --- */
/* Strip mobile system colors from emojis and apply emerald tint */
.emoji-fix {
    display: inline-block;
    filter: grayscale(100%) brightness(1.2) sepia(100%) hue-rotate(110deg) saturate(600%);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Android Emoji", sans-serif;
    line-height: 1;
}


/* --- REVERSE DIFFUSION EFFECT --- */
.diffusion-container {
    position: relative;
    overflow: hidden;
}

.diffusion-layer {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(2, 6, 23, 0.3); /* Matches your slate-950 background */
    backdrop-filter: blur(20px);
    pointer-events: none;
    transition: backdrop-filter 1.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 1.5s ease-out;
}

/* The noise texture overlay */
.diffusion-layer::before {
    content: "";
    position: absolute;
    inset: 0;
    filter: url(#diffusion-noise);
    opacity: 1;
    transition: opacity 1.2s ease-in;
}

/* State when "Denoised" (Inference Complete) */
.denoised .diffusion-layer {
    backdrop-filter: blur(0px);
    opacity: 0;
}

.denoised .diffusion-layer::before {
    opacity: 0;
}