/* --- MODERN PORTFOLIO STYLES (BOXY THEME w/ FINAL MODIFICATIONS) --- */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --accent: #06b6d4;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
}

/* --- MODERN HEADER --- */
.modern-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-image {
    width: 48px;
    height: 48px;
    border-radius: 50%; /* Circular */
    object-fit: cover;
    border: 2px solid var(--primary);
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.1);
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
}

   .logo-text p {
        font-size: 0.8rem; /* Reduced font size to fit better */
        white-space: nowrap; /* Prevents wrapping */
        overflow: hidden; /* Hides any overflow */
        text-overflow: ellipsis; /* Adds "..." if text is still too long */
        max-width: 180px; /* Constrains the width to prevent pushing layout */
    }
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-item a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: relative;
}

.nav-item a:hover,
.nav-item a.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.contact-btn {
    background: var(--primary);
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.contact-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* --- HERO SECTION --- */
/* MODIFICATION: Keyframes for background animation */
@keyframes scroll-background {
    from { background-position: 0 0; }
    to { background-position: -40px -40px; }
}

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    background-color: var(--bg-secondary);
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),
        linear-gradient(to right, rgba(37, 99, 235, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    /* MODIFICATION: Apply animation */
    animation: scroll-background 2s linear infinite;
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    opacity: 1;
    transform: none;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-family: 'Space Grotesk', sans-serif;
}

.hero-gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary {
    background: rgb(2, 161, 2);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: green;
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transform: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.hero-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    z-index: 1;
}

.floating-element {
    display: none;
}

/* --- SECTIONS --- */
.section {
    padding: 6rem 0;
    opacity: 1;
}

.section-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-family: 'Space Grotesk', sans-serif;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* --- FIX for Hero Image Stretching --- */
.about-image .profile-image {
    max-width: 320px; /* Prevents the image from being too large on mobile */
    height: auto;     /* This is the key: it maintains the aspect ratio */
    margin: 0 auto;   /* Ensures the image is centered within its container */
}
.profile-image:hover {
    transform: scale(1.02);
}

/* --- GENERAL TIMELINE STYLES --- */
.experience-timeline { }

.timeline-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%; /* Circular */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 48px;
    width: 2px;
    height: calc(100% - 24px);
    background: var(--border);
    z-index: 1;
}

.timeline-content {
    flex: 1;
    padding-top: 0.5rem;
}

.timeline-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.timeline-content .company {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.timeline-content .duration {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* --- SKILLS SECTION --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.skill-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.skill-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
}

.skill-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.skill-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- PROJECTS SECTION --- */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 0;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ================================================================= */
/* ============= START: UPDATED PROJECT CARD STYLES ================ */
/* ================================================================= */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 2rem;
}

.project-card {
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    background: var(--text-primary);
    position: relative;
    aspect-ratio: 4 / 4;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card.hide {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    pointer-events: none; /* Prevents interaction with hidden cards */
}

/* MODIFICATION: Add white background for PNG images */
.project-card:has(img[src$=".png"]) {
    background: var(--bg-primary);
}

.project-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.project-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card-content-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover .project-card-content-wrapper {
    opacity: 1;
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-card-body {
    display: none;
}

.project-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.project-category {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0.5rem 0 1.5rem 0;
}

.project-card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-link {
    padding: 0.7rem 1.8rem;
    font-weight: 600;
    border-radius: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease;
}

.project-link.details {
    background-color: #d8e6cb;
    color: var(--text-primary);
}
.project-link.details:hover {
    background-color: #c9dcb9;
}

.project-link.live {
    background-color: var(--primary);
    color: white;
}
.project-link.live:hover {
    background-color: var(--primary-dark);
}

/* ================================================================= */
/* ============== END: UPDATED PROJECT CARD STYLES ================= */
/* ================================================================= */


/* --- FOOTER --- */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content { display: grid; grid-template-columns: 2fr 3fr; gap: 3rem; margin-bottom: 3rem; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.footer-brand h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; font-family: 'Space Grotesk', sans-serif; }
.footer-brand p { color: #94a3b8; line-height: 1.6; margin-bottom: 1.5rem; }
.social-links { display: flex; gap: 1rem; }
.social-link { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.1); border-radius: 0; display: flex; align-items: center; justify-content: center; color: white; text-decoration: none; transition: all 0.3s ease; }
.social-link:hover { background: var(--primary); transform: translateY(-2px); }
.footer-section h4 { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 0.75rem; }
.footer-section a { color: #94a3b8; text-decoration: none; transition: color 0.3s ease; }
.footer-section a:hover { color: white; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 2rem; text-align: center; color: #94a3b8; }

/* --- MOBILE MENU STYLES --- */
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--text-primary); cursor: pointer; padding: 0.5rem; border-radius: var(--radius-md); transition: all 0.3s ease; }
.mobile-menu-btn:hover { background: rgba(37, 99, 235, 0.1); color: var(--primary); }

/* ======== CSS FOR "ABOUT ME" SECTION (NO IMAGE) =========== */
.about-details-grid-compact {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 3rem;
    align-items: start;
    max-width: 1000px;
    margin: 4rem auto 0;
}

.about-stats-card-compact {
    position: sticky;
    top: 120px;
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.about-stats-card-compact .stat-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.about-stats-card-compact .stat-item:hover {
    transform: scale(1.05);
    background: var(--bg-primary);
    box-shadow: var(--shadow-lg);
}

#about .section-header {
    margin-bottom: 0;
}

/* ======= CSS FOR UPGRADED "GET IN TOUCH" SECTION ======== */
.contact-section {
    position: relative;
    overflow: hidden;
    background-color: #f8fafc;
}

.contact-bg-gradient {
    position: absolute;
    top: -20%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1), transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.contact-grid-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    position: relative;
    z-index: 2;
}

.contact-info-modern .section-title,
.contact-info-modern .section-description {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
}

.contact-info-modern .section-title {
    font-size: 2.25rem;
}

.contact-item-list {
    margin: 2rem 0;
}

.contact-item-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
}
.contact-item-modern a, .contact-item-modern span {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}
.contact-item-modern a:hover {
    color: var(--primary);
}

.contact-icon-modern {
    color: var(--primary);
    font-size: 1.2rem;
}

#social-links-contact {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

#social-links-contact .social-link {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}
#social-links-contact .social-link:hover {
    background: var(--primary);
    color: white;
}

.contact-form-modern {
    padding: 0;
}

.contact-form-modern .form-label {
    display: none;
}

.contact-form-modern .form-group {
    margin-bottom: 1.5rem;
}

.contact-form-modern .form-input,
.contact-form-modern .form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--bg-secondary);
    transition: all 0.3s ease;
}

.contact-form-modern .form-input:focus,
.contact-form-modern .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: var(--bg-primary);
}

.contact-form-modern .form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* =========== ELEGANT ANIMATION CLASSES ================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========== STYLES FOR IMAGE VIEWER MODAL ============== */
.image-viewer-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
    overflow: auto;
}

.image-viewer-modal .modal-content {
    max-width: 90%;
    max-height: 80vh;
    display: block;
    margin: auto;
    animation-name: zoom;
    animation-duration: 0.4s;
}

@keyframes zoom {
    from {transform: scale(0.8)}
    to {transform: scale(1)}
}

.image-viewer-modal .close-viewer-btn {
    position: absolute;
    top: 25px;
    right: 45px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.image-viewer-modal .close-viewer-btn:hover,
.image-viewer-modal .close-viewer-btn:focus {
    color: #bbb;
    text-decoration: none;
}

.image-viewer-modal .prev-viewer-btn,
.image-viewer-modal .next-viewer-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    border-radius: 0;
}

.image-viewer-modal .prev-viewer-btn { left: 20px; }
.image-viewer-modal .next-viewer-btn { right: 20px; }

.image-viewer-modal .prev-viewer-btn:hover,
.image-viewer-modal .next-viewer-btn:hover {
    background-color: rgba(0,0,0,0.6);
}

.image-viewer-modal .image-counter {
    margin-top: 15px;
    color: #ccc;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
}

/* ======== STYLES FOR PROJECT DETAILS PAGE UI ======== */
.project-details-body {
    background-color: var(--bg-secondary);
}

.project-details-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.project-detail-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.main-content {
   background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.5rem;
    padding: 0;
    font-size: 0.95rem;
}

.project-main-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.project-long-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.gallery-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-image-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-image-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.gallery-image-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}


.project-sidebar .sidebar-card {
    position: sticky;
    top: 100px;
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.sidebar-image {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.sidebar-info-item {
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.sidebar-info-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.sidebar-info-item span {
    color: var(--text-secondary);
    text-transform: capitalize;
}
.tech-stack-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 500;
}

#project-nav-container {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
}
.project-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    background-color: var(--bg-secondary); 
}
.nav-link:not(.disabled):hover {
    border-color: var(--primary);
    background-color: var(--bg-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.nav-link.next {
    text-align: right;
    justify-content: flex-end;
}
.nav-link i {
    font-size: 1.75rem;
    color: var(--primary);
}
.nav-link span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    display: block;
}
.nav-link h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}
.nav-link.disabled {
    opacity: 0;
    pointer-events: none;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
    .hero-container { grid-template-columns: 1fr; gap: 2rem; }
    .hero-content { text-align: center; order: 2; }
    .hero-visual { order: 1; }
    .hero-content h1 { font-size: 2.5rem; }
    .section-title { font-size: 2rem; }
    .project-detail-grid { grid-template-columns: 1fr; }
    .project-sidebar { order: -1; }
    .project-sidebar .sidebar-card { position: static; margin-bottom: 2rem; }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .nav-menu { position: fixed; top: 70px; left: 0; width: 100%; background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); flex-direction: column; gap: 0; padding: 1rem 0; transform: translateY(-100%); opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 999; }
    .nav-menu.active { transform: translateY(0); opacity: 1; visibility: visible; }
    .nav-item { width: 100%; text-align: center; }
    .nav-item a { display: block; padding: 1rem 2rem; border-radius: 0; border-bottom: 1px solid rgba(226, 232, 240, 0.5); }
    .nav-item:last-child a { border-bottom: none; }
    .contact-btn { margin: 1rem 2rem 0 !important; text-align: center !important; border-radius: var(--radius-lg) !important; border-bottom: none !important; }
    .header-container { padding: 0 1rem; height: 70px; }
    html { scroll-padding-top: 70px; }
    .section { padding: 4rem 0; }
    .section-container { padding: 0 1rem; }
    .hero-section { padding-top: 70px; min-height: auto; padding-bottom: 4rem; }
    .hero-content h1 { font-size: 2rem; }
    .hero-description { font-size: 1.125rem; }

    /* FIX 4: Header Subtitle Text Overflow */
    .logo-text p {
        font-size: 0.8rem; /* Reduced font size to fit better */
        white-space: nowrap; /* Prevents wrapping */
        overflow: hidden; /* Hides any overflow */
        text-overflow: ellipsis; /* Adds "..." if text is still too long */
        max-width: 180px; /* Constrains the width to prevent pushing layout */
    }
    
    .hero-buttons {
        flex-wrap: nowrap;
        justify-content: center;
    }
    .hero-buttons .btn-primary,
    .hero-buttons .contact-btn {
        flex: 1;
        padding: 0.875rem 1rem !important;
        font-size: 0.9rem;
        justify-content: center;
        white-space: nowrap;
    }

    .skills-grid { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.75rem; }
   .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

    /* FIX 1: Project Filter Buttons Not in One Row */
    .project-filters {
        gap: 0.5rem;
        flex-wrap: wrap; /* Allows buttons to wrap to the next line */
        justify-content: center; /* Centers the buttons */
    }

    .filter-btn { padding: 0.625rem 1rem; font-size: 0.875rem; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .footer-brand { margin-bottom: 2rem; }
    .social-links { justify-content: center; }

    /* FIX 3: Social Links Overflow in Contact Section */
    #social-links-contact {
        flex-wrap: wrap; /* Allows icons to wrap */
        justify-content: flex-start; /* Aligns icons to the start */
    }

    .footer-links { text-align: left; }
    .about-details-grid-compact { grid-template-columns: 1fr; }
    .about-stats-card-compact { position: static; order: -1; }

    /* FIX 3: Contact Form Container Overflow */
    .contact-grid-modern {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1.5rem; /* Adjusted padding slightly */
    }

    .contact-info-modern .section-title { font-size: 1.75rem; }
    .project-details-container, .project-nav { padding: 2rem 1rem; }
    .main-content { padding: 1.5rem; }
    .project-main-title { font-size: 2rem; }
    .project-nav { grid-template-columns: 1fr; }
    .nav-link.disabled { display: none; }

    .project-card-content-wrapper {
        opacity: 1;
        background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 1%, rgba(15, 23, 42, 0.6) 15%, transparent 45%);
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-start;
        text-align: left;
    }

    .project-card-footer {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.4s ease;
        flex-direction: row;
    }
    
    .project-card:hover .project-card-footer {
        max-height: 100px;
        opacity: 1;
        margin-top: 1rem;
    }

    .project-title { font-size: 1.1rem; }
    .project-category { font-size: 0.7rem; letter-spacing: 1px; margin-bottom: 0; }
    
    /* FIX 2: Project Card Live Button Overflowing */
    .project-link {
        padding: 0.5rem 0.8rem; /* Reduced horizontal padding */
        font-size: 0.8rem;
        border-radius: 0;
    }

    .project-link.details { background: rgba(255, 255, 255, 0.1); color: white; }
    .project-link.details:hover { background: rgba(255, 255, 255, 0.2); }
}
@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.75rem; }
    .section-title { font-size: 1.75rem; }
    
    /* MODIFICATION: Remove old full-width button styles */
    .btn-primary, .btn-secondary { width: auto; justify-content: center; }
    .hero-buttons { flex-direction: row; width: auto; }

    .stat-item { padding: 0.75rem; }
    .stat-number { font-size: 1.5rem; }
    .timeline-item { margin-bottom: 1.5rem; }
    .timeline-icon { width: 40px; height: 40px; font-size: 1rem; }
    .timeline-item:not(:last-child)::before { left: 19px; }
    .skills-grid { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
    .skill-card { padding: 1rem 0.75rem; }
    .skill-icon img { width: 28px; height: 28px; }
    .skill-name { font-size: 0.75rem; }
}

@media (min-width: 801px) {
    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- Hero Entrance Animation --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animation to hero content with a stagger effect */
.hero-content h1,
.hero-content .hero-description,
.hero-content .hero-buttons,
.hero-visual {
    /* Hide them initially */
    opacity: 0; 
    /* This tells the animation to stay in its final state */
    animation-fill-mode: forwards; 
    animation-name: fadeInUp;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger the animation delays */
.hero-content .hero-description {
    animation-delay: 0.2s;
}
.hero-content .hero-buttons {
    animation-delay: 0.4s;
}
.hero-visual {
    animation-delay: 0.3s;
}
/* --- Tactile Filter Button Press --- */
.filter-btn:active {
    transform: scale(0.95);
}
/* --- Custom Cursor --- */

.cursor-dot,
.cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    background-color: rgba(37, 99, 235, 0.2);
    transition-duration: 0.3s;
}

/* Style for when hovering over links/buttons */
.cursor-hover {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: rgba(37, 99, 235, 0.3);
}
/* --- Animated Gradient Button --- */
  .hero-buttons .btn-primary,
    .hero-buttons .contact-btn {
        flex: 1;
        padding: 0.875rem 1rem !important;
        font-size: 0.9rem;
        justify-content: center;
        white-space: nowrap;
    }

.hero-buttons .contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.hero-buttons .contact-btn:hover::before {
    left: 100%; /* Animate the shine across the button */
}

/* --- Grayscale for Arattai Icon ONLY --- */
.social-link.arattai-icon img {
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.social-link.arattai-icon:hover img {
    filter: grayscale(0%);
}

.hero-buttons .contact-btn:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}
/* --- Custom Social Icon Images --- */
.social-link.arattai-icon {
    /* Remove the Font Awesome font styles */
    font-size: 0; 
}

.social-link.arattai-icon img {
    width: 20px;  /* Adjust size as needed */
    height: 20px; /* Adjust size as needed */
    vertical-align: middle; /* Helps with alignment */
}


/* --- Tools Section --- */
.tools-grid {
    display: grid;
    /* This creates a responsive grid that will fit as many cards as possible per row */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    /* Uses the same border-radius variable as the rest of your site (which is 0) */
    border-radius: var(--radius-lg); 
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.tool-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1);
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
}

.tool-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- Responsive Styles for Tools Section --- */
@media (max-width: 768px) {
    .tools-grid {
        /* Create a 3-column grid on mobile */
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem; /* Reduce the gap between cards */
    }

    .tool-card {
        /* Adjust padding for a more compact look */
        padding: 1.5rem 0.5rem;
    }

    .tool-icon {
        /* Make the icon slightly smaller */
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .tool-title {
        /* Make the title font smaller to prevent awkward wrapping */
        font-size: 0.85rem;
        font-weight: 500;
    }

    /* This is the key part: it hides the description paragraph on mobile */
    .tool-card .tool-desc {
        display: none;
    }
}

/* --- Blogs Section --- */
.blogs-scroll-container {
    overflow-x: auto; /* Enables horizontal scrolling */
    padding: 1rem 0 1.5rem 0; /* Adds space for the scrollbar */
    /* Hides the scrollbar visually in Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-tertiary);
}

/* Custom scrollbar for WebKit browsers (Chrome, Safari) */
.blogs-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.blogs-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.blogs-scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
}

.blogs-scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-dark);
}

.blogs-grid {
    display: flex; /* Aligns cards in a row */
    gap: 1.5rem; /* Space between cards */
    width: max-content; /* Allows the container to expand horizontally */
}

.blog-card {
    display: block;
    flex: 0 0 320px; /* Prevents cards from shrinking, sets a fixed width */
    width: 320px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.blog-image-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.blog-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-image {
    transform: scale(1.05);
}

.blog-content {
    padding: 1.5rem;
}

.blog-category {
    display: inline-block;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.blog-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    /* Truncate long titles to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    /* Truncate long excerpts to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-read-more {
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.blog-card:hover .blog-read-more {
    gap: 0.75rem;
}


/* --- Blog Post Page Specific Styles --- */
.blog-post-body {
    background-color: var(--bg-secondary);
}

.blog-post-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: none; /* A solid header looks better for reading */
}


.back-to-home-btn {
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem;
    /* Vertically align the text and icon */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.blog-post-container {
    max-width: 800px; /* Optimal width for readability */
    margin: 4rem auto;
    padding: 0 1rem;
}

.blog-article {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 3rem 4rem;
    box-shadow: var(--shadow-lg);
}

.article-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.article-meta .blog-category {
    margin-bottom: 0;
}

.article-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.article-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 1rem;
}

.featured-image-wrapper {
    margin: 2rem 0;
    width: 100%;
}

.featured-image-wrapper img {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.featured-image-wrapper figcaption {
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.75rem;
}

/* Typography for the article content */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    margin: 2.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.article-content h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
}

.article-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem 0;
}

.article-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
}

.article-content a:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.article-content ul, .article-content ol {
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-left: 0;
}

.article-content pre {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow-x: auto;
    font-size: 0.9em;
}

.article-content code {
    font-family: 'Menlo', 'Consolas', monospace;
    background-color: rgba(0,0,0,0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.article-content pre code {
    background: none;
    padding: 0;
}

/* Responsive Styles for Blog Post Page */
@media (max-width: 768px) {
    .blog-article {
        padding: 1.5rem;
    }
    .article-title {
        font-size: 2rem;
    }
    .article-subtitle {
        font-size: 1.1rem;
    }
}
/* --- FIX: Project Details Sidebar Image Stretch --- */
/* --- FIX 2: Project Details Sidebar Image (Fit, No Cropping) --- */
.project-sidebar .sidebar-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* This is the correct property: it fits the whole image inside the container */
    object-fit: contain;
    /* Optional: Add a subtle background to the container for non-square images */
    background-color: #f8fafc; /* Matches your --bg-secondary color */
    border: 1px solid var(--border);
    padding: 0.5rem; /* Optional: Adds a little padding around the contained image */
}


/* =======================
   Testimonials Section (Updated)
   ======================= */

.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 800px; /* Controls the max width of the card */
    margin: 2rem auto 0; /* Centers the card */
}

.testimonial-card {
    background: #ffffff;
    /* CHANGED: Reduced from 16px to 12px for a sharper look, matching other site elements */
    border-radius: 12px; 
    padding: 2.5rem;
    /* CHANGED: Adjusted shadow to be more subtle */
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.testimonial-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.testimonial-profile {
    flex-shrink: 0;
}

.testimonial-image {
    width: 80px;  /* Slightly reduced size for better balance */
    height: 80px;
    border-radius: 50%; /* This remains circular as requested */
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.testimonial-content {
    text-align: left;
}

.testimonial-review {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
    font-style: italic;
    position: relative;
    padding-left: 1rem; /* Added padding to better contain the text */
}

/* Optional: Decorative quote marks, now more subtle */
.testimonial-review::before {
    content: '“';
    font-family: 'Georgia', serif;
    font-size: 3.5rem;
    color: var(--primary-color-light);
    position: absolute;
    left: -1.5rem;
    top: -1rem;
    opacity: 0.7;
    line-height: 1;
}


.testimonial-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.testimonial-company {
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .testimonial-card-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .testimonial-content {
        text-align: center;
    }
    
    .testimonial-review::before {
        /* Hide the large quote on mobile to save space */
        content: ''; 
    }

    .testimonial-review {
        padding-left: 0;
    }

    .testimonial-card {
        padding: 2rem;
    }
}