/* =========================================
   GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --bg-color: #050505;
    --text-main: #A9A9A9;
    --neon-cyan: #00E5FF;
    --alert-red: #FF003C;
    --font-head: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* =========================================
   BASE COMPONENTS & TYPOGRAPHY
   ========================================= */
.scanlines {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    z-index: 100; pointer-events: none;
}

.cyber-section { padding: 5rem 10%; }
.section-title { font-family: var(--font-head); color: #fff; margin-bottom: 3rem; border-left: 5px solid var(--neon-cyan); padding-left: 15px; }

.cyber-btn {
    display: inline-block; padding: 15px 30px; background: transparent;
    color: var(--neon-cyan); font-family: var(--font-head); text-decoration: none;
    border: 1px solid var(--neon-cyan); cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: 0.3s ease;
}
.cyber-btn:hover { background: var(--neon-cyan); color: var(--bg-color); box-shadow: 0 0 15px var(--neon-cyan); }

.cyber-card {
    background: rgba(20, 20, 20, 0.8); border: 1px solid #333; padding: 2rem;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
    transition: 0.3s ease; position: relative;
}
.cyber-card:hover { border-color: var(--neon-cyan); box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.1); }
.cyber-card h3, .cyber-card h4 { font-family: var(--font-head); color: #fff; margin-bottom: 15px; }

.dossier-grid, .contact-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }

/* Timeline & Lists */
.exp-list { list-style: none; }
.exp-list li { margin-bottom: 1.5rem; padding-left: 1rem; border-left: 2px solid #333; }
.exp-list .date { color: var(--neon-cyan); font-size: 0.9rem; font-family: var(--font-head); }

.alert-card { border-color: var(--alert-red); margin-top: 2rem; }
.alert-card h4 { color: var(--alert-red); }

/* Intel/Blog Log */
.log-entry { margin-bottom: 1rem; border-bottom: 1px dashed #333; padding-bottom: 0.5rem; transition: transform 0.3s ease, padding-left 0.3s ease; }
.log-entry .log-date { color: var(--neon-cyan); font-family: var(--font-head); margin-right: 15px; }
.log-entry a { color: var(--text-main); text-decoration: none; font-size: 1.1rem; }
.log-entry a:hover { color: #fff; }
.log-entry:hover { transform: translateX(10px); border-left: 2px solid var(--neon-cyan); padding-left: 15px; background: rgba(0, 229, 255, 0.05); }

/* Forms */
.cyber-form { display: flex; flex-direction: column; gap: 1.5rem; }
.cyber-form input, .cyber-form textarea { background: transparent; border: none; border-bottom: 1px solid #333; color: var(--neon-cyan); font-family: var(--font-head); padding: 10px; font-size: 1rem; }
.cyber-form input:focus, .cyber-form textarea:focus { outline: none; border-bottom-color: var(--neon-cyan); }

/* =========================================
   HERO & IMAGE STYLING
   ========================================= */
.hero {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; height: 90vh;
    align-items: center; padding: 0 10%; position: relative; overflow: hidden; z-index: 1;
}

.cyber-grid {
    position: absolute; bottom: -50%; left: -50%; width: 200%; height: 200%;
    background-image: linear-gradient(rgba(0, 229, 255, 0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 229, 255, 0.3) 1px, transparent 1px);
    background-size: 40px 40px; transform: perspective(500px) rotateX(60deg);
    animation: grid-move 5s linear infinite; z-index: -1;
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 60%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 60%);
}

.terminal-container { background: rgba(5, 5, 5, 0.7); padding: 2rem; border-left: 3px solid var(--neon-cyan); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.glitch-text { font-family: var(--font-head); font-size: 3rem; color: #fff; margin-bottom: 10px; position: relative; }
.neon-text { font-family: var(--font-head); color: var(--neon-cyan); font-size: 2rem; height: 2.5rem; margin-bottom: 20px; }
.subtitle { font-size: 1.2rem; margin-bottom: 40px; }

.hero-image-container {
    position: relative; width: 100%; max-width: 500px;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    border: 2px solid var(--neon-cyan); box-shadow: 0 0 30px rgba(0, 229, 255, 0.3), inset 0 0 20px rgba(0, 229, 255, 0.5);
    background: rgba(0, 229, 255, 0.05); transition: box-shadow 0.3s ease;
}
.hero-image-container:hover { box-shadow: 0 0 50px rgba(0, 229, 255, 0.6), inset 0 0 30px rgba(0, 229, 255, 0.7); }
.hero-image-container:hover .cyber-img, .project-card:hover .project-img { filter: grayscale(0%) contrast(110%) brightness(100%); }

.cyber-img, .project-img { width: 100%; height: auto; display: block; filter: grayscale(80%) contrast(120%) brightness(80%); transition: filter 0.4s ease; }
.img-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 229, 255, 0.15); mix-blend-mode: overlay; pointer-events: none; }

.project-img { height: 200px; object-fit: cover; border-bottom: 2px solid #333; }
.project-card { padding: 0; overflow: hidden; }
.project-card .card-content { padding: 1.5rem; }

/* =========================================
   ANIMATIONS
   ========================================= */
.reveal { opacity: 0; transform: translateY(50px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

.floating { animation: float 6s ease-in-out infinite; }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0px); } }
@keyframes grid-move { 0% { transform: perspective(500px) rotateX(60deg) translateY(0); } 100% { transform: perspective(500px) rotateX(60deg) translateY(40px); } }

.glitch-text::before, .glitch-text::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color); }
.glitch-text::before { left: 2px; text-shadow: -2px 0 var(--alert-red); clip: rect(24px, 550px, 90px, 0); animation: glitch-anim-2 3s infinite linear alternate-reverse; }
.glitch-text::after { left: -2px; text-shadow: -2px 0 var(--neon-cyan); clip: rect(85px, 550px, 140px, 0); animation: glitch-anim 2.5s infinite linear alternate-reverse; }
@keyframes glitch-anim { 0% { clip: rect(11px, 9999px, 80px, 0); transform: skew(0.3deg); } 20% { clip: rect(65px, 9999px, 14px, 0); transform: skew(0.1deg); } 40% { clip: rect(104px, 9999px, 95px, 0); transform: skew(0.5deg); } 60% { clip: rect(13px, 9999px, 42px, 0); transform: skew(0.2deg); } 80% { clip: rect(89px, 9999px, 23px, 0); transform: skew(0.4deg); } 100% { clip: rect(53px, 9999px, 72px, 0); transform: skew(0.1deg); } }

.glitch-hover:hover { animation: card-glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite; }
@keyframes card-glitch { 0% { transform: translate(0) } 20% { transform: translate(-2px, 2px) } 40% { transform: translate(-2px, -2px) } 60% { transform: translate(2px, 2px) } 80% { transform: translate(2px, -2px) } 100% { transform: translate(0) } }

.blinking-cursor { color: var(--neon-cyan); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.loading-text { color: var(--neon-cyan); font-family: var(--font-head); letter-spacing: 2px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 0.4; } 50% { opacity: 1; text-shadow: 0 0 10px var(--neon-cyan); } 100% { opacity: 0.4; } }

/* =========================================
   BULLETPROOF NAVIGATION & MOBILE
   ========================================= */

/* Desktop Base */
.cyber-nav {
    display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 5%;
    background: rgba(5, 5, 5, 0.95); border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    position: sticky; top: 0; z-index: 999; backdrop-filter: blur(10px);
}
.logo { color: var(--neon-cyan); font-family: var(--font-head); font-weight: 700; text-shadow: 0 0 5px var(--neon-cyan); font-size: 1.2rem; }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a { font-family: var(--font-head); color: var(--text-main); text-decoration: none; transition: 0.3s; }
.nav-links a:hover { color: var(--neon-cyan); text-shadow: 0 0 8px var(--neon-cyan); }
.menu-toggle { display: none; } /* Hidden on desktop */

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; height: auto; text-align: center; padding: 6rem 5% 3rem 5%; gap: 3rem; }
    .terminal-container { border-left: none; border-top: 3px solid var(--neon-cyan); padding: 2rem 1rem; }
    .hero-image-container { margin: 0 auto; }
    .dossier-grid, .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .cyber-section, .arsenal-section { padding: 3rem 5%; }
    .glitch-text { font-size: 2.5rem; }
    
    /* Bulletproof Mobile Dropdown */
    .menu-toggle { display: block; z-index: 1000; }
    .menu-btn { padding: 8px 15px; font-size: 1.2rem; }
    
    .nav-links {
        position: absolute; top: 100%; left: 0; width: 100%;
        background: rgba(10, 10, 10, 0.98); flex-direction: column; align-items: center; margin: 0;
        max-height: 0; overflow: hidden; padding: 0; transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out; border-bottom: 0px solid var(--neon-cyan);
    }
    .nav-links li { margin: 1.5rem 0; width: 100%; text-align: center; }
    .nav-links.active { max-height: 400px; padding: 2rem 0; border-bottom: 2px solid var(--neon-cyan); box-shadow: 0 15px 25px rgba(0, 0, 0, 0.8); }
}

@media (max-width: 480px) {
    .glitch-text { font-size: 2rem; }
    .neon-text { font-size: 1.2rem; height: auto; min-height: 2.5rem; }
    .subtitle { font-size: 1rem; }
    .section-title { font-size: 1.5rem; }
    .cyber-btn { display: block; width: 100%; text-align: center; box-sizing: border-box; }
}

/* =========================================
   SKILL TAGS (TECHNICAL QUALIFICATIONS)
   ========================================= */
.skill-tags { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-top: 15px; 
}

.skill-tags span {
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #fff;
    padding: 6px 12px;
    font-family: var(--font-head);
    font-size: 0.85rem;
    letter-spacing: 1px;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    transition: all 0.3s ease;
    cursor: default;
}

.skill-tags span:hover {
    background: var(--neon-cyan);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.8);
    border-color: var(--neon-cyan);
}

/* =========================================
   9. SYSTEM BOOT PRELOADER
   ========================================= */

/* Lock scrolling while booting */
body.loading {
    overflow: hidden;
    height: 100vh;
}

#cyber-preloader {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: var(--bg-color);
    z-index: 999999; /* Highest priority on screen */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s cubic-bezier(0.5, 0, 0, 1), visibility 0.6s;
}

/* The class JS will add to hide the preloader */
#cyber-preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    width: 90%;
    max-width: 600px;
}

.terminal-header {
    color: #fff;
    font-family: var(--font-head);
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
    letter-spacing: 2px;
}

.boot-logs {
    font-family: 'Rajdhani', monospace;
    color: var(--text-main);
    height: 140px;
    overflow: hidden;
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.boot-logs p {
    margin: 2px 0;
    opacity: 0;
    animation: type-line 0.1s ease-out forwards;
}

@keyframes type-line {
    to { opacity: 1; }
}

.progress-wrapper {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
}

.bracket {
    color: var(--alert-red);
    font-family: var(--font-head);
    font-weight: bold;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: rgba(0, 229, 255, 0.05);
    margin: 0 15px;
    position: relative;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

#cyber-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--neon-cyan);
    box-shadow: 0 0 15px var(--neon-cyan);
    transition: width 0.1s linear;
}