:root {
    --bg: #081b29;
    --second-bg: #112e42;
    --main: #00abf0;
    --text: #ededed;
}

.light-mode {
    --bg: #f4f7f6;
    --second-bg: #ffffff;
    --text: #1a1a1a;
    --main: #0070f3;
}

* { margin: 0; padding: 0; box-sizing: border-box; text-decoration: none; border: none; scroll-behavior: smooth; font-family: 'Poppins', sans-serif; }

body { background: var(--bg); color: var(--text); overflow-x: hidden; transition: 0.5s; }

/* Navbar */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 10%; background: var(--bg); position: fixed; width: 100%; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: 0.5s; }
.logo { font-size: 26px; font-weight: 800; color: var(--text); }
.logo span { color: var(--main); }
.nav-links { display: flex; list-style: none; gap: 30px; }
.nav-links a { color: var(--text); transition: 0.3s; font-weight: 500; }
.nav-links a:hover { color: var(--main); }
.nav-btns { display: flex; align-items: center; gap: 15px; }
.theme-btn { background: none; color: var(--text); font-size: 20px; cursor: pointer; transition: 0.3s; }
.cv-btn { background: var(--main); color: #fff; padding: 8px 20px; border-radius: 5px; font-weight: 600; }

/* Tech Stack */
.tech-stack {
    margin: 20px 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 25px;
    flex-wrap: nowrap;
}

.tech-stack i,
.pbi-logo {
    font-size: 40px;
    width: 40px;
    height: 40px;
    transition: 0.3s;
    cursor: pointer;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.1));
}

.tech-stack i:hover,
.pbi-logo:hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 0 12px var(--main));
}

/* Hero Section */
.hero { height: 100vh; display: flex; align-items: center; padding: 0 10%; gap: 50px; }
.hero-content h1 { font-size: 56px; margin: 10px 0; color: var(--text); }

.role {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    margin-bottom: 20px;
}

.typing-container {
    display: inline-flex;
    align-items: center;
    width: max-content;
}

.typing-text { 
    color: var(--main); 
    font-weight: 700; 
    display: inline-block; 
    overflow: hidden; 
    white-space: nowrap; 
    border-right: 3px solid var(--main); 
    width: 0; 
    animation: typing 3.5s steps(20) forwards, blink 0.7s infinite; 
}

/* About Me Section */
.about-me-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 50px 10%;
    gap: 50px;
    background: var(--bg);
}

.about-text { flex: 1; }

.section-title-alt {
    font-size: 45px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text);
}

.section-title-alt span { display: block; }

.about-text p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text);
    max-width: 500px;
}

/* Strengths Box */
.strengths-box {
    flex: 1;
    background: linear-gradient(135deg, #b8ffd1 0%, #a2c2ff 100%);
    padding: 40px;
    border-radius: 30px;
    color: #1a1a1a;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.strengths-box h3 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
}

.strengths-box ul { list-style: none; }

.strengths-box ul li {
    font-size: 18px;
    margin: 12px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.strengths-box ul li::before {
    content: '•';
    margin-right: 15px;
    font-size: 25px;
}

/* Profile Image */
.hero-img { position: relative; display: flex; justify-content: center; align-items: center; }
.img-box { position: relative; width: 380px; height: 380px; display: flex; justify-content: center; align-items: center; }
.img-box::before { content: ''; position: absolute; width: 105%; height: 105%; border: 2px dashed var(--main); border-radius: 50%; animation: rotateRing 12s linear infinite; }

/* ✅ FIXED: Uses scale and exact percentage offsets to pull your hair right to the border boundary */
.img-box img { 
    width: 90%; 
    height: 90%; 
    object-fit: cover; 
    object-position: center 15%; 
    transform: scale(1.05);
    border-radius: 50%; 
    border: 5px solid var(--main); 
    z-index: 2; 
    
    filter: drop-shadow(0 0 15px var(--main)); 
}

.shape-1, .shape-2 { position: absolute; background: var(--main); border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; z-index: 1; filter: blur(40px); opacity: 0.3; animation: morph 8s linear infinite; }
.shape-1 { width: 300px; height: 300px; top: -10px; left: -10px; }
.shape-2 { width: 250px; height: 250px; bottom: -10px; right: -10px; background: #fff; animation-delay: -4s; }

/* Animations */
@keyframes typing { from { width: 0; } to { width: 100%; } }
@keyframes blink { 50% { border-color: transparent; } }
@keyframes rotateRing { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes morph { 0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; } 50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; } }

/* Stats & Sections */
.stats { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 60px; padding: 40px 10%; background: var(--second-bg); text-align: center; }
.stat-item h2 { color: var(--main); font-size: 45px; }
.section-title { text-align: center; font-size: 40px; margin: 30px 0; color: var(--text); }
.about, .certs { padding: 25px 10%; }
.timeline-item, .cert-card { background: var(--second-bg); padding: 25px; border-radius: 15px; border-left: 5px solid var(--main); transition: 0.3s; margin-bottom: 20px; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.cert-card { text-align: center; border: 1px solid rgba(0,171,240,0.1); }
.cert-card:hover { transform: translateY(-10px); box-shadow: 0 0 20px var(--main); }
.view-btn-small { background: var(--main); color: #fff; padding: 10px 20px; border-radius: 5px; display: inline-block; margin-top: 15px; font-weight: 600; }

/* Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); }
.modal-content { background: var(--second-bg); margin: 15% auto; padding: 30px; border: 2px solid var(--main); width: 90%; max-width: 450px; border-radius: 15px; text-align: center; position: relative; color: var(--text); }
.close-btn { position: absolute; right: 20px; top: 10px; font-size: 30px; cursor: pointer; color: var(--text); }
.contact-details { text-align: left; margin-top: 20px; padding: 0 15px; word-wrap: break-word; }
.contact-details p { margin: 15px 0; font-size: 18px; }
.contact-details i { color: var(--main); margin-right: 15px; }

/* Social Icons */
.social-icons { margin: 25px 0; }
.social-icons a { border: 2px solid var(--main); border-radius: 50%; width: 45px; height: 45px; display: inline-flex; justify-content: center; align-items: center; color: var(--main); margin-right: 15px; transition: 0.3s; position: relative; }
.social-icons a:hover { background: var(--main); color: #fff; box-shadow: 0 0 15px var(--main); }
.social-icons a::after { content: attr(title); position: absolute; bottom: -35px; left: 50%; transform: translateX(-50%); background: var(--main); color: #fff; padding: 5px 12px; border-radius: 5px; font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.social-icons a:hover::after { opacity: 1; }
.btn { padding: 12px 25px; border-radius: 8px; font-weight: 600; display: inline-block; cursor: pointer; transition: 0.3s; }
.btn.primary { background: var(--main); color: #fff; margin-right: 15px; }
.btn.secondary { border: 2px solid var(--main); color: var(--main); }
.footer { text-align: center; padding: 40px; border-top: 1px solid var(--second-bg); color: var(--text); }

/* Projects Page */
.projects-page { 
    padding: 140px 10% 80px; 
    background: var(--bg);
    min-height: 100vh;
}

.projects-page .section-title {
    margin-bottom: 80px;
    font-size: 48px;
}

.projects-page .section-title span {
    color: var(--main);
}

.projects-wrapper {
    display: flex;
    flex-direction: column;
    gap: 100px;
    padding-bottom: 40px;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 80px;
}

.project-card.reverse { direction: rtl; }
.project-card.reverse > * { direction: ltr; }

.project-image {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    height: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 171, 240, 0.15);
    transition: 0.4s ease;
}

.project-image:hover {
    box-shadow: 0 30px 80px rgba(0, 171, 240, 0.3);
    transform: translateY(-5px);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: 0.5s ease;
}

.project-image:hover img {
    transform: scale(1.05);
    filter: brightness(0.9);
}

.image-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 171, 240, 0.1);
    display: flex;
    align-items: flex-end;
    padding: 30px;
    opacity: 0;
    transition: 0.4s ease;
}

.project-image:hover .image-overlay { opacity: 1; }

.project-number {
    font-size: 60px;
    font-weight: 800;
    color: var(--main);
    opacity: 0.2;
}

.project-content { padding: 0; }

.project-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0;
    line-height: 1.3;
    order: -1;
}

.project-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
    margin-top: 15px;
}

.tag {
    background: rgba(0, 171, 240, 0.1);
    color: var(--main);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(0, 171, 240, 0.2);
    transition: 0.3s ease;
}

.tag:hover {
    background: rgba(0, 171, 240, 0.2);
    border-color: var(--main);
}

.project-description { margin-bottom: 30px; max-width: 100%; }

.project-description p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 12px;
    opacity: 0.9;
}

.project-description p:last-child { margin-bottom: 0; }

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--main), #00d4ff);
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 171, 240, 0.2);
}

.project-link:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 25px rgba(0, 171, 240, 0.4);
}

.project-link i { transition: 0.3s ease; }
.project-link:hover i { transform: translateX(3px); }

/* Mobile Responsive */
@media (max-width: 768px) {
    .navbar { padding: 15px 5%; justify-content: space-between; }
    .nav-links { display: none; }
    .logo { margin-right: 20px; }
    .nav-btns { margin-left: auto; padding-right: 10px; gap: 20px; }
    .theme-btn { padding: 5px; }

    .hero { flex-direction: column-reverse; text-align: center; padding: 120px 5% 50px; height: auto; }
    .hero-content h1 { font-size: 36px; }
    .tech-stack { overflow-x: auto; justify-content: center; padding-bottom: 10px; }
    .role, .about-me-container { flex-direction: column; text-align: center; justify-content: center; }
    .about-text p { margin: 0 auto 20px; }
    .img-box { width: 280px; height: 280px; margin: 0 auto; }

    .about-me-container { padding: 30px 5%; }
    .stats { padding: 25px 5%; }
    .about, .certs { padding: 20px 5%; }
    .section-title { margin: 20px 0; }

    .projects-page { padding: 120px 5% 50px; }
    .projects-page .section-title { font-size: 32px; margin-bottom: 50px; }
    .projects-wrapper { gap: 60px; }
    .project-card { flex-direction: column; gap: 30px; margin-bottom: 20px; }
    .project-card.reverse { direction: ltr; }
    .project-image { height: 280px; }
    .project-title { font-size: 24px; order: -1; }
    .project-content { padding: 15px; }
    .project-description p { font-size: 14px; }
}

/* Laptop/Large Screen Responsive */
@media (min-width: 1024px) {
    .projects-page { padding: 140px 12% 80px; }
    .projects-page .section-title { margin-bottom: 80px; font-size: 52px; }
    .projects-wrapper { gap: 120px; }
    .project-card { flex-direction: column; gap: 50px; align-items: stretch; }
    .project-image { height: 520px; }
    .project-content { padding: 40px 0; max-width: 100%; }
    .project-title { font-size: 40px; margin-bottom: 30px; order: -1; }
    .project-description p { font-size: 15px; line-height: 1.7; margin-bottom: 12px; }
}