/* General Body and Typography */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: #1a1a1a; /* Dark shade background */
    color: #e0e0e0; /* Adjust text color for dark background */
    scroll-behavior: smooth;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
}

/* Header and Navigation */
header {
    background: rgba(51, 51, 51, 0.8); /* Semi-transparent background */
    backdrop-filter: blur(10px); /* Liquid glass effect */
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    color: #fff;
    padding-top: 5px; /* Further reduced padding */
    min-height: 70px;
    border-bottom: rgba(119, 170, 255, 0.5) 3px solid; /* Semi-transparent border */
    position: fixed; /* Make header fixed */
    top: 0;
    width: 100%;
    z-index: 1000; /* Ensure header is above other content */
}

header nav {
    display: flex;
    justify-content: center; /* Center the logo */
    align-items: center;
    padding: 0 20px;
}

#nav-logo {
    height: 40px; /* Further decreased size */
    width: auto;
    display: block;
}

#nav-buttons {
    position: fixed; /* Make them fixed */
    top: 45px; /* Position just below the header (approx. header height) */
    left: 0;
    width: 100%; /* Span full width */
    display: flex;
    justify-content: center; /* Center the buttons */
    gap: 15px;
    z-index: 1001; /* Ensure buttons are above other content */
    background: rgba(255, 255, 255, 0.1); /* Semi-transparent background for the container */
    backdrop-filter: blur(10px); /* Liquid glass effect */
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    border-radius: 0; /* Remove border-radius for full width */
    padding: 10px 0; /* Adjust padding for full width */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2); /* Prominent shadow */
    border: none; /* Remove border */
}

.capsule-button {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1); /* More transparent background */
    backdrop-filter: blur(10px); /* Liquid glass effect */
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    transition: background 0.3s ease;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3); /* Light border */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

.capsule-button:hover {
    background: rgba(255, 255, 255, 0.2); /* Slightly less transparent on hover */
}

/* Video Intro Section */
#video-intro {
    position: fixed; /* Keep it fixed to stay on top */
    top: 0;
    left: 0;
    width: 100%; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000; /* Ensure full screen is black */
    z-index: 9999; /* Ensure it's on top of other content */
    opacity: 1; /* Ensure it starts visible */
    transition: opacity 1s ease-out, visibility 1s ease-out; /* Smooth fade out */
}

#intro-video {
    position: absolute; /* Position within the full-screen #video-intro */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the video */
    width: 80vw; /* 80% of viewport width */
    height: 60vh; /* 60% of viewport height */
    max-width: 900px; /* Maximum width */
    max-height: 600px; /* Maximum height */
    object-fit: contain; /* Ensure the entire video is visible, letterboxing if necessary */
    z-index: 0;
    border-radius: 15px; /* Rounded corners for the video itself */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* Prominent shadow */
}

.video-intro-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none; /* Prevent interaction with hidden element */
}

/* Main Content Sections */
main {
    padding-top: 90px; /* Space for fixed header and nav buttons */
    padding-bottom: 20px; /* Keep existing padding-bottom */
}

section {
    padding: 40px 20px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3); /* Semi-transparent dark background */
    backdrop-filter: blur(10px); /* Liquid glass effect */
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255, 255, 255, 0.1); /* Lighter border for contrast */
}

section h2 {
    font-family: 'Playfair Display', serif;
    color: #f0f0f0; /* Lighter color for dark background */
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    position: relative;
}

section h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #77aaff;
}

/* About Section */
#about p {
    text-align: justify;
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.project-item {
    background: rgba(0, 0, 0, 0.2); /* Semi-transparent dark background */
    backdrop-filter: blur(5px); /* Liquid glass effect */
    -webkit-backdrop-filter: blur(5px); /* Safari support */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1); /* Refined shadow */
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1); /* Lighter border for contrast */
}

.project-item:hover {
    transform: translateY(-5px);
}

.project-item h3 {
    color: #aaccff; /* Lighter color for dark background */
    margin-bottom: 10px;
}

.project-item a {
    display: inline-block;
    margin-top: 15px;
    background: #333;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.project-item a:hover {
    background: #555;
}

/* Contact Form */
#contact form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

#contact label {
    font-weight: bold;
    margin-bottom: 5px;
}

#contact input[type="text"],
#contact input[type="email"],
#contact textarea {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3); /* Light border */
    border-radius: 5px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.1); /* Semi-transparent background */
    backdrop-filter: blur(5px); /* Liquid glass effect */
    -webkit-backdrop-filter: blur(5px); /* Safari support */
    color: #fff; /* Adjust text color for better contrast */
}

#contact textarea {
    min-height: 100px;
    resize: vertical;
}

#contact button {
    background: rgba(119, 170, 255, 0.7); /* Semi-transparent background */
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background 0.3s ease;
}

#contact button:hover {
    background: #5588dd;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #333;
    color: #fff;
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header nav {
        flex-direction: column;
        text-align: center;
    }

    #nav-logo {
        height: 25vh; /* Increased size for mobile using vh unit */
        width: 50vw; /* Increased width for mobile using vw unit */
    }

    #nav-buttons {
        top: calc(5px + 25vh); /* Position below dynamic header height */
        margin-top: 0px; /* Adjust margin for mobile */
        gap: 10px; /* Adjust gap for mobile */
    }

    .capsule-button {
        margin: 5px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    section {
        padding: 20px;
    }

    main {
        padding-top: calc(5px + 25vh + 45px); /* Adjusted padding for mobile */
    }
}

/* Style for the new section image */
.section-image {
    display: block; /* Make it a block element */
    margin: 0 auto 20px auto; /* Center horizontally, add margin below */
    max-width: 100%; /* Ensure it doesn't overflow its container */
    height: auto; /* Maintain aspect ratio */
    border-radius: 8px; /* Slightly rounded corners */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Subtle shadow */
}

/* Adjust text flow around the floated image */
#about p {
    /* Ensure text wraps around the image */
    overflow: hidden; /* Clear float issues if any */
}

/* Additional Responsive Design for smaller screens */
@media (max-width: 480px) {
    header nav {
        padding: 0 10px;
    }

    #nav-buttons {
        gap: 8px;
        padding-bottom: 10px;
    }

    .capsule-button {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    section {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    section h2 {
        font-size: 2em;
        margin-bottom: 20px;
    }

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

    .project-item {
        padding: 15px;
    }

    #contact form {
        max-width: 100%;
        padding: 0 15px;
    }
}

/* Styles for the header and nav buttons when hidden */
.hidden-nav {
    transform: translateY(-100%);
    opacity: 0;
}

header, #nav-buttons {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}
