/* --- Color Profile: Deep Defense --- */
:root {
    --bg-color: #111613;       
    --card-bg: #172B23;        
    --primary-green: #2F6542;  
    --text-color: #e0e0e0;     
    --heading-color: #ffffff;  
    --dim-text: #8aaaaa;       
    --glass-border: rgba(47, 101, 66, 0.5); 
    --glow-color: rgba(47, 101, 66, 0.4);   
    --terminal-bg: #0e1210;    
    --terminal-header: #172B23;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    scroll-behavior: smooth;
    position: relative;
}

/* --- Moving Background Grid (الخلفية المتحركة الجديدة) --- */
.moving-background {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(47, 101, 66, 0.07) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(47, 101, 66, 0.07) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    transform: perspective(500px) rotateX(20deg);
    animation: move-grid 20s linear infinite;
    opacity: 0.6;
}

@keyframes move-grid {
    0% { background-position: 0 0; }
    100% { background-position: 0 500px; }
}

/* --- Scanline Overlay (تم تخفيفه جداً لتقليل التشويش) --- */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    /* Opacity reduced from 0.1 to 0.03 for much cleaner look */
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.03) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    z-index: 900;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* --- Navbar --- */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%; 
    border-bottom: 1px solid var(--glass-border);
    position: fixed; width: 100%; background: rgba(17, 22, 19, 0.95);
    backdrop-filter: blur(10px); z-index: 1000;
}
.logo { font-family: 'Fira Code', monospace; font-weight: 700; color: var(--primary-green); filter: brightness(1.5); font-size: 1.1rem; white-space: nowrap; }

.nav-links { list-style: none; display: flex; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--text-color); font-family: 'Fira Code', monospace; font-size: 0.85rem; transition: 0.3s; white-space: nowrap; }
.nav-links a:hover { color: #4da568; text-shadow: 0 0 5px var(--primary-green); }

.btn-contact { border: 1px solid var(--primary-green); padding: 5px 15px; border-radius: 4px; color: #fff !important; background: rgba(47, 101, 66, 0.2); }
.btn-contact:hover { background: var(--primary-green); box-shadow: 0 0 15px var(--glow-color); }

/* --- Hero Section --- */
.hero { 
    min-height: 100vh; 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 80px 10% 0; 
    position: relative; 
}
.content { z-index: 10; max-width: 600px; }

.terminal-text { 
    font-family: 'Fira Code', monospace; 
    color: #5bb57b; 
    margin-bottom: 15px;
    overflow: hidden;
    border-right: .15em solid var(--primary-green);
    white-space: nowrap;
    width: 0;
    animation: typing 3s steps(30, end) forwards, blink-caret .75s step-end infinite;
}
@keyframes typing { from { width: 0 } to { width: 100%; } }
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: var(--primary-green); } }

h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 20px; color: var(--heading-color); }

.glitch-wrapper { display: inline-block; position: relative; }
.glitch { position: relative; color: var(--heading-color); }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.glitch::before { left: 2px; text-shadow: -1px 0 red; clip: rect(44px, 450px, 56px, 0); animation: glitch-anim-1 5s infinite linear alternate-reverse; }
.glitch::after { left: -2px; text-shadow: -1px 0 blue; clip: rect(44px, 450px, 56px, 0); animation: glitch-anim-2 5s infinite linear alternate-reverse; }
@keyframes glitch-anim-1 { 0% { clip: rect(20px, 9999px, 15px, 0); } 20% { clip: rect(50px, 9999px, 80px, 0); } 40% { clip: rect(10px, 9999px, 40px, 0); } 60% { clip: rect(80px, 9999px, 5px, 0); } 80% { clip: rect(30px, 9999px, 60px, 0); } 100% { clip: rect(60px, 9999px, 90px, 0); } }
@keyframes glitch-anim-2 { 0% { clip: rect(60px, 9999px, 10px, 0); } 20% { clip: rect(10px, 9999px, 50px, 0); } 40% { clip: rect(90px, 9999px, 20px, 0); } 60% { clip: rect(15px, 9999px, 80px, 0); } 80% { clip: rect(50px, 9999px, 30px, 0); } 100% { clip: rect(5px, 9999px, 60px, 0); } }

p { font-size: 1.1rem; color: var(--dim-text); margin-bottom: 30px; max-width: 500px; line-height: 1.6; }

.status-indicator { display: inline-flex; align-items: center; gap: 10px; background: var(--card-bg); padding: 8px 16px; border-radius: 20px; font-family: 'Fira Code', monospace; font-size: 0.8rem; border: 1px solid var(--primary-green); margin-bottom: 40px; }
.dot { width: 10px; height: 10px; background-color: var(--primary-green); border-radius: 50%; box-shadow: 0 0 0 0 rgba(47, 101, 66, 0.7); animation: pulse-green 2s infinite; }
@keyframes pulse-green { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(47, 101, 66, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(47, 101, 66, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(47, 101, 66, 0); } }

.btn { padding: 12px 30px; text-decoration: none; font-weight: 600; border-radius: 4px; transition: all 0.3s ease; display: inline-block;}
.primary { background-color: var(--primary-green); color: #fff; border: 1px solid var(--primary-green); }
.primary:hover { background-color: #3e8555; border-color: #3e8555; box-shadow: 0 0 20px rgba(47, 101, 66, 0.4); }
.secondary { border: 1px solid var(--dim-text); color: var(--dim-text); margin-left: 15px; }
.secondary:hover { border-color: #fff; color: #fff; }

.visual-center { position: relative; width: 350px; height: 350px; display: flex; justify-content: center; align-items: center; z-index: 5; }
.outer-circle { width: 100%; height: 100%; border: 2px solid rgba(47, 101, 66, 0.3); border-radius: 50%; position: absolute; animation: spin 15s linear infinite; border-top: 2px solid var(--primary-green); border-bottom: 2px solid var(--primary-green); z-index: 1; }
.inner-circle { width: 90%; height: 90%; border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 2px dashed var(--primary-green); overflow: hidden; position: relative; z-index: 2; padding: 5px; box-shadow: 0 0 30px rgba(47, 101, 66, 0.2); }
.hero-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; filter: contrast(1.1); }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.hidden-section { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.show-section { opacity: 1; transform: translateY(0); }

.section-container { padding: 80px 10%; border-top: 1px solid rgba(47, 101, 66, 0.1); }
.section-title { font-family: 'Fira Code', monospace; font-size: 1.8rem; margin-bottom: 40px; color: var(--heading-color); }
.hash { color: var(--primary-green); }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.bio-text p { margin-bottom: 20px; line-height: 1.6; color: var(--dim-text); }
.bio-text strong { color: #fff; }
.activities-box { background: rgba(23, 43, 35, 0.5); padding: 20px; border-radius: 8px; border: 1px solid var(--glass-border); }
.activity-item { display: flex; gap: 15px; margin-top: 20px; padding-bottom: 20px; border-bottom: 1px dashed var(--glass-border); }
.act-icon { color: var(--primary-green); font-size: 1.5rem; flex-shrink: 0; }
.mini-img { width: 100%; max-width: 400px; border-radius: 6px; margin-top: 15px; border: 1px solid var(--primary-green); opacity: 0.95; transition: 0.3s; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.mini-img:hover { opacity: 1; transform: scale(1.02); }

.log-entry { display: flex; border-left: 2px solid var(--card-bg); margin-bottom: 30px; padding-left: 20px; position: relative; }
.log-entry::before { content: ""; width: 10px; height: 10px; background: var(--bg-color); border: 2px solid var(--primary-green); border-radius: 50%; position: absolute; left: -7px; top: 0; }
.log-date { min-width: 120px; font-family: 'Fira Code', monospace; font-size: 0.85rem; color: #6a8f7b; padding-top: 2px; }
.log-details h3 { color: #fff; margin-bottom: 5px; }
.log-desc { color: #a0a0a0; margin-bottom: 10px; font-size: 0.95rem; }
.tech-list { margin-top: 10px; margin-bottom: 15px; padding-left: 20px; }
.tech-list li { color: #b0c4b1; margin-bottom: 5px; }
.tags span { display: inline-block; background: rgba(47, 101, 66, 0.2); color: #8fcea0; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-family: 'Fira Code', monospace; margin-right: 5px; border: 1px solid rgba(47, 101, 66, 0.3); margin-bottom: 5px;}

.grid-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.gallery-item { background: var(--card-bg); padding: 15px; text-align: center; border: 1px solid var(--glass-border); border-radius: 4px; transition: 0.3s; }
.gallery-item:hover { border-color: var(--primary-green); transform: scale(1.02); }
.course-img { width: 100%; height: auto; border-radius: 4px; margin-bottom: 10px; border: 1px solid rgba(47, 101, 66, 0.3); }
.gallery-item span { font-size: 0.9rem; color: #fff; font-family: 'Fira Code', monospace; display: block; margin-top: 5px; }

.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.cert-card { background: linear-gradient(145deg, var(--card-bg), #0e1210); padding: 30px; border: 1px solid var(--glass-border); text-align: center; border-radius: 8px; }
.cert-icon { font-size: 3rem; margin-bottom: 15px; }
.cert-img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--primary-green); margin: 15px 0; box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.cert-card small { display: block; margin-top: 10px; color: var(--primary-green); font-family: 'Fira Code'; }

.rank-container { display: flex; justify-content: center; align-items: center; }
.rank-card { width: 100%; max-width: 600px; margin: 0 auto; }

.speed-box { display: flex; align-items: center; justify-content: center; gap: 50px; background: #000; padding: 40px; border: 2px solid var(--primary-green); border-radius: 4px; font-family: 'Fira Code', monospace; }
.speed-meter { border: 5px solid var(--primary-green); width: 150px; height: 150px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 0 20px var(--glow-color); flex-shrink: 0; }
.speed-value { font-size: 3rem; font-weight: bold; color: #fff; }
.speed-unit { font-size: 1rem; color: var(--primary-green); }
.challenge-text { margin-top: 15px; color: #ff5f56; font-style: italic; }

.large-proof-img { width: 100%; max-width: 800px; border-radius: 6px; margin-top: 20px; border: 2px solid var(--primary-green); box-shadow: 0 0 20px rgba(47, 101, 66, 0.3); transition: 0.3s; }
.large-proof-img:hover { transform: scale(1.02); box-shadow: 0 0 30px rgba(47, 101, 66, 0.5); }

.map-container { border: 1px solid var(--primary-green); background: #000; padding: 10px; border-radius: 4px; box-shadow: 0 0 30px rgba(47, 101, 66, 0.2); position: relative; }
.map-header { font-family: 'Fira Code', monospace; color: #fff; background: var(--card-bg); padding: 10px; border-bottom: 1px solid var(--primary-green); display: flex; align-items: center; gap: 10px; font-weight: bold; letter-spacing: 1px; }
.blinking-dot { width: 10px; height: 10px; background-color: red; border-radius: 50%; box-shadow: 0 0 10px red; animation: blink-fast 1s infinite; }
@keyframes blink-fast { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }
iframe { display: block; border-radius: 0 0 4px 4px; }

footer { text-align: center; padding: 40px 10%; border-top: 1px solid var(--card-bg); font-family: 'Fira Code', monospace; background: var(--bg-color); }
.contact-links { display: flex; justify-content: center; gap: 20px; margin: 30px 0; flex-wrap: wrap; }
.contact-btn { padding: 10px 20px; border: 1px solid var(--glass-border); color: #fff !important; text-decoration: none; border-radius: 4px; display: flex; align-items: center; gap: 10px; }
.contact-btn:hover { border-color: var(--primary-green); background: rgba(47, 101, 66, 0.2); }
.copyright { color: #555; font-size: 0.8rem; margin-top: 10px; }

@media (max-width: 900px) {
    .hero { flex-direction: column-reverse; justify-content: center; text-align: center; padding-top: 120px; gap: 40px; }
    .content { max-width: 100%; }
    .visual-center { width: 280px; height: 280px; }
    .navbar { flex-direction: column; gap: 15px; padding: 15px; }
    .nav-links { width: 100%; overflow-x: auto; padding-bottom: 5px; justify-content: flex-start; -webkit-overflow-scrolling: touch; }
    h1 { font-size: 2.5rem; }
    .about-grid { grid-template-columns: 1fr; }
    .speed-box { flex-direction: column; text-align: center; }
    .log-entry { flex-direction: column; border-left: none; padding-left: 0; }
    .log-entry::before { display: none; }
    .log-date { margin-bottom: 10px; color: var(--primary-green); border-bottom: 1px solid var(--glass-border); display: inline-block; width: 100%; }
    .btn { width: 100%; margin-bottom: 10px; text-align: center; }
    .secondary { margin-left: 0; }
    .terminal-text { margin: 0 auto 15px; } 
}
