@media screen and (max-width: 1400px) {
    .profile-content {
        gap: 2rem;
    }
    
    .profile-title {
        font-size: 2.5rem;
        display: block;
    }
    
    .typing-text {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
    }
    
    .about-containers {
        flex-wrap: wrap;
    }
}

@media screen and (max-width: 1200px) {
    #desktop-nav {
        display: none;
    }

    #hamburger-nav {
        display: flex;
    }

    /* Remove custom top margin that misaligned title/content spacing */
    #experience, .experience-details-container {
        margin-top: 0;
    }
    
    /* Experience section tablet adjustments */
    .experience-details-container::before {
        left: 18px;
    }
    
    .company-details {
        margin-left: 45px;
    }

    .profile-content {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    .profile-text {
        max-width: 100%;
    }
    
    .profile-title {
        font-size: 2.2rem;
    }
    
    .social-icons {
        justify-content: center;
    }

    .section-container {
        display: block;
    }

    .arrow {
        display: none;
    }

    section, .section-container {
        height: fit-content;
    }

    section {
        margin: 0 5%;
    }

    .section__pic-container {
        width: 275px;
        height: 275px;
        margin: 0 auto 2rem;
    }

    .about-containers {
        margin-top: 0;
    }

    .menu-links a {
        font-size: 1rem;
    }
}

@media screen and (max-width: 600px) {
    #contact {
        min-height: 60vh;
    }
    
    .contact-text p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .contact-btn {
        padding: 0.7rem 1.8rem;
        font-size: 0.9rem;
    }
    
    .education-cards {
        padding: 1rem 0.5rem;
        max-width: 400px;
    }
    
    .education-card {
        padding: 1.5rem;
    }
    
    .institution {
        font-size: 1.1rem;
    }
    
    .degree {
        font-size: 0.9rem;
    }
    
    .duration {
        font-size: 0.8rem;
    }
    
    #profile {
        padding-top: calc(1rem + var(--nav-height));
    }
    
    .profile-title {
        font-size: 1.8rem;
        display: block;
        text-align: center;
    }
    
    .typing-text {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
    }
    
    .profile-description {
        font-size: 1rem;
    }
    
    .neon-border {
        width: 280px;
        height: 280px;
    }
    
    .social-icons {
        gap: 1rem;
    }

    #about {
        height: auto;
        margin-bottom: 0;
    }
    
    /* Experience section mobile adjustments */
    .experience-details-container::before {
        left: 15px;
    }
    
    .company-details {
        margin-left: 35px;
        padding: 1.2rem;
        padding-top: 1rem; /* Reduced space at top for stacked title/company */
        margin-bottom: 1rem !important; /* Reduced gap between experience items */
    }
    
    .company-details::before {
        left: -26px;
        top: 45px; /* Adjusted for mobile */
        width: 10px;
        height: 10px;
    }
    
    .section__text__p4 {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        position: static; /* Remove absolute positioning */
        margin-top: 0.2rem; /* Reduced spacing above the date */
        margin-bottom: 1rem; /* Add spacing below the date */
        align-self: flex-start; /* Align to the left */
    }
    
    .position-company {
        padding-right: 0; /* No need for right padding anymore */
        flex-direction: row; /* Keep title and company on same line */
        flex-wrap: wrap; /* Allow wrapping if needed */
        align-items: center; /* Center items vertically */
        gap: 0.3rem; /* Add small gap between elements */
    }
    
    .position-company .section__text__p3 {
        margin-bottom: 0; /* Remove bottom margin */
        font-size: 0.9rem; /* Slightly smaller font size on mobile */
        line-height: 1.3; /* Tighter line height for better spacing */
    }
    
    .position-company .separator {
        margin: 0 0.2rem; /* Smaller margin on mobile */
        font-size: 0.8rem; /* Even smaller font for separator */
    }
    
    .section__text__p3 {
        font-size: 1rem;
    }
    
    .tech-stack {
        gap: 0.3rem;
    }
    
    .tech-stack li {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    article {
        font-size: 1rem;
    }

    .about-containers, .btn-container, .contact-info-upper-container {
        flex-wrap: wrap;
    }

    .contact-info-container {
        margin: 0;
    }

    .contact-info-container p, .nav-links li a {
        font-size: 1rem;
    }

    .experience-sub-title {
        font-size: 1.25rem;
    }

    .logo, .hamburger-text-logo {
        font-size: 1.25rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .section__pic-container {
        width: auto;
        height: 46vw;
        justify-content: center;
    }

    .section__text__p2 {
        font-size: 1.25rem;
    }

    .title {
        font-size: 2rem;
    }

    .text-container {
        text-align: justify;
    }
    
    .text-container p {
        font-size: 0.9rem; /* Smaller font size for job descriptions on mobile */
        line-height: 1.5; /* Better readability on mobile */
    }
    
    .project-points li {
        font-size: 0.9rem; /* Match job description font size for consistency */
        line-height: 1.5; /* Better readability on mobile */
    }
    
    /* Skills section responsive */
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Education section responsive */
    .education-cards {
        gap: 1.5rem;
    }
}

@media screen and (max-width: 768px) {
    .skills-row {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
    
    .skills-grid-container {
        gap: 4rem;
    }
    
    .text-container p {
        font-size: 0.95rem; /* Slightly larger font size for tablet */
        line-height: 1.5;
    }
    
    .project-points li {
        font-size: 0.95rem; /* Match job description font size for consistency */
        line-height: 1.5;
    }
    
    .education-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
        max-width: 500px;
    }

    /* Projects: match technical skills vertical spacing on mobile */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
        grid-auto-rows: auto;
    }
}

@media screen and (max-width: 480px) {
    .skills-container {
        padding: 0 0.5rem;
    }
    
    .skills-category {
        padding: 1rem;
    }
    
    .skills-header {
        margin-bottom: 1rem;
    }
    
    .skills-title {
        font-size: 1.2rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .skill-icon {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .skill-name {
        font-size: 0.7rem;
    }
    /* Projects container padding aligns with skills */
    .projects-container {
        padding: 0 0.5rem;
    }

    .project-card {
        padding: 1rem; /* Match skills small padding */
        border-radius: 10px;
    }
}