body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #343a40;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image: url('cybersecurity-bg.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(248, 249, 250, 0.85);
    z-index: -2;
}

header {
    background-color: rgba(33, 37, 41, 0.9);
    color: #fff;
    padding: 2em 1em; /* Reduced vertical padding, added horizontal */
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

header h1 {
    font-size: 2.5em; /* Smaller font size for mobile */
    margin-bottom: 0.3em;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0.5em 0 0; /* Reduced top margin */
    text-align: center; /* Center navigation on mobile */
}

nav ul li {
    display: block; /* Stack links on mobile */
    margin: 0.75em 0; /* Increased vertical margin for spacing */
}

nav a {
    color: #adb5bd;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease, transform 0.3s ease-in-out;
}

nav a:hover {
    color: #fff;
    transform: scale(1.05);
}

.profile-image-container {
    width: 120px; /* Smaller profile image */
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 25px auto; /* Adjust margins */
    border: 5px solid #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    display: block;
    animation: pulse 2s infinite alternate;
}

.profile-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

section {
    padding: 40px 20px; /* Reduced horizontal padding */
    margin: 20px auto; /* Reduced vertical margin */
    background-color: #fff;
    border-radius: 10px; /* Slightly less rounded */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    max-width: 95%; /* Adjust max width for mobile */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

h2 {
    color: #212529;
    border-bottom: 3px solid #007bff; /* Thinner border */
    padding-bottom: 0.6em;
    margin-bottom: 1.5em;
    font-size: 2em; /* Smaller heading */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

section::after {
    content: '';
    display: block;
    width: 80%; /* Wider divider on mobile */
    height: 1.5px; /* Thinner divider */
    background: linear-gradient(to right, rgba(0, 123, 255, 0.2), #007bff, rgba(0, 123, 255, 0.2));
    margin: 2.5em auto 0; /* Adjust margins */
    opacity: 0;
    transform: scaleX(0);
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
}

section.visible::after {
    transform: scaleX(1);
    opacity: 1;
}

/* About Section */
#about {
    padding-top: 30px;
}

#about p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 1em;
}

#about ul li {
    margin-bottom: 0.5em;
    font-weight: bold;
    color: #495057;
    font-size: 1em; /* Adjust font size */
}

#about i {
    margin-right: 0.4em;
    font-size: 0.9em;
}

/* Skills Section */
#skills ul > li {
    margin-bottom: 1.5em; /* Add spacing between skill categories */
}

#skills ul > li > strong {
    display: block;
    margin-bottom: 0.5em;
    font-size: 1.1em;
}

#skills ul > li > ul {
    padding-left: 20px;
}

#skills ul > li > ul > li {
    display: block; /* Stack skills on mobile */
    align-items: flex-start; /* Align items to the start */
    margin-bottom: 0.6em;
}

#skills ul > li > ul > li span {
    flex-grow: 1;
    margin-left: 0.5em; /* Adjust spacing for stacked layout */
    font-size: 1em;
}

#skills ul > li > ul > li i {
    margin-right: 0.4em;
    font-size: 0.9em;
}

#skills ul > li > ul > li::before {
    height: 8px; /* Smaller skill bar */
    border-radius: 4px;
    margin-right: 0.5em;
    flex-grow: 1;
}

/* Projects Section */
#projects {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 20px;
}

.project {
    padding: 20px;
    margin-bottom: 15px;
}

.project h3 {
    font-size: 1.4em;
    margin-bottom: 0.8em;
}

.project p {
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 1em;
}

.project ul {
    padding-left: 15px;
    font-size: 0.95em;
}

.project i {
    margin-right: 0.4em;
    font-size: 0.9em;
}

/* Contact Section */
#contact {
    text-align: center;
}

#contact p {
    font-size: 1.1em;
    margin-bottom: 1.2em;
}

#contact a {
    font-size: 1.1em;
}

#contact i {
    margin-right: 0.4em;
    font-size: 1.1em;
}

/* Footer Section */
footer {
    text-align: center;
    padding: 1.5em 0; /* Reduced padding */
    font-size: 0.9em; /* Smaller font size */
}

/* Media Query for larger tablets and desktops */
@media (min-width: 769px) {
    header {
        padding: 2.5em 0;
    }

    header h1 {
        font-size: 3.2em;
        margin-bottom: 0.5em;
        letter-spacing: 1.5px;
    }

    nav ul {
        text-align: center;
        margin-top: 1em;
    }

    nav ul li {
        display: inline;
        margin: 0 2em;
    }

    .profile-image-container {
        width: 160px;
        height: 160px;
        margin: 40px auto;
    }

    section {
        padding: 60px;
        margin: 30px auto;
        border-radius: 15px;
        max-width: 1080px;
    }

    h2 {
        font-size: 2.8em;
        padding-bottom: 0.8em;
        margin-bottom: 2em;
    }

    section::after {
        width: 60%;
        height: 2px;
        margin: 3em auto 0;
    }

    #skills ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Two columns on larger screens */
        gap: 20px;
    }

    #skills ul > li {
        margin-bottom: 0;
    }

    #skills ul > li > ul {
        padding-left: 0;
    }

    #skills ul > li > ul > li {
        display: flex;
        align-items: center;
        margin-bottom: 0.75em;
    }

    #skills ul > li > ul > li span {
        margin-left: 0;
    }

    #skills ul > li > ul > li::before {
        height: 12px;
        border-radius: 6px;
        margin-right: 15px;
        flex-grow: 2;
    }

    #projects {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); /* Two columns on larger screens */
        gap: 30px;
    }

    #about p {
        font-size: 1.2em;
    }

    #about ul li {
        font-size: 1.1em;
    }

    #about i,
    #skills ul > li > ul > li i,
    #projects i,
    #contact i {
        font-size: 1.1em;
        margin-right: 0.5em;
    }

    footer {
        font-size: 1em;
        padding: 2.5em 0;
    }
}