/* General Reset */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background: url('background.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: scroll; /* Changed 'fixed' to 'scroll' for mobile compatibility */
}

/* Header Section */
header {
    text-align: center;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 20px;
}

header h1 {
    font-size: 28px; /* Adjusted for responsiveness */
    margin: 0;
}

header p {
    font-size: 16px; /* Reduced font size for smaller screens */
    margin: 10px 0 0;
}

/* Navbar Section */
nav {
    background-color: #333;
    color: #fff;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    flex-wrap: wrap; /* Added for better wrapping on smaller screens */
}

nav ul li {
    margin: 0 10px; /* Reduced margin for better alignment */
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px; /* Adjusted font size */
}

nav ul li a:hover {
    color: #00bcd4;
}

/* Photo Section */
.photo-section {
    display: flex;
    flex-wrap: wrap; /* Ensures better layout on small screens */
    justify-content: center;
    align-items: center;
    padding: 30px 15px; /* Adjusted padding */
    background: rgba(255, 255, 255, 0.8);
}

.photo-card {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Added for better wrapping */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    max-width: 600px;
}

.photo-card img {
    width: 120px; /* Reduced size for better scaling */
    height: 120px;
    border-radius: 50%;
    margin-right: 15px;
}

.photo-info h1,
.photo-info h3,
.photo-info h2,
.photo-info p {
    margin: 10px 0;
    text-align: center; /* Ensures readability on small screens */
}

/* Projects Section */
.projects-section {
    padding: 30px 15px; /* Adjusted padding */
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.projects-section h1 {
    font-size: 30px; /* Adjusted for scaling */
    margin-bottom: 20px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Adjusted for smaller screens */
    gap: 15px;
}

.project-card {
    background: #fff;
    color: #333;
    padding: 15px; /* Adjusted padding for smaller cards */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Footer Section */
footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 15px;
    font-size: 14px; /* Adjusted for smaller screens */
}

footer a {
    color: #00bcd4;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 24px; /* Smaller font size */
    }

    header p {
        font-size: 14px;
    }

    nav ul li a {
        font-size: 14px; /* Adjusted for mobile screens */
    }

    .photo-card img {
        width: 100px; /* Smaller image size */
        height: 100px;
        margin-right: 10px;
    }

    .projects-section h1 {
        font-size: 24px;
    }

    .project-card {
        padding: 10px; /* Reduced padding */
    }

    footer {
        font-size: 12px; /* Smaller footer text */
    }
}

@media (max-width: 480px) {
    nav ul li {
        margin: 0 5px; /* Reduced margin for very small screens */
    }

    .photo-card {
        flex-direction: column; /* Stack content vertically */
        text-align: center;
    }

    .photo-card img {
        margin: 0 0 10px 0; /* Center the image */
    }

    .projects-section h1 {
        font-size: 20px; /* Further reduced font size */
    }
}
