/* --- Global Reset and Box-Sizing --- */
*,
*::before,
*::after {
    box-sizing: border-box; /* Ensures padding and border don't affect final element width */
    margin: 0;
    padding: 0;
}

/* General Body Styling */
body {
    background-color: #000000;
    color: #FFFFFF;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 65px; /* Provides space for the nav bar */
    overflow: hidden; /* This will prevent scrollbars from appearing next to our 3D canvas */
    cursor: none;
}

body.is-mobile {
    cursor: auto !important;
}

/* --- Global Cursor Control --- */
/* This ensures our custom cursor is the ONLY one shown on non-mobile */
body:not(.is-mobile) a, 
body:not(.is-mobile) button, 
body:not(.is-mobile) .portfolio-card, 
body:not(.is-mobile) a:hover, 
body:not(.is-mobile) button:hover {
    cursor: none;
}


/* --- Page Content Sections --- */
#page-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 65px); /* Full viewport height minus the nav bar */
}

.content-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.8s ease-in-out;
    pointer-events: none; /* Prevent interaction when hidden */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align content to the top */
    overflow-y: auto; /* Allow scrolling on content pages */
    padding-top: 50px; /* Add some space at the top */
}

.content-section.active {
    opacity: 1; /* Visible when active */
    pointer-events: auto; /* Allow interaction when visible */
}

/* --- Home Section Specifics --- */
#home-content {
    align-items: center; /* Center the home content vertically */
    padding-top: 0; /* No top padding for the home section */
}

#home-content #scene-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Ensures the 3D scene is in the background */
}

/* --- Loading Overlay Styles --- */
#loading-overlay {
    position: fixed; /* Changed to fixed to cover the whole screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Make sure it's on top of everything */
    transition: opacity 0.5s ease; /* Smooth fade-out effect */
}

.loading-text {
    font-size: 2rem;
    color: #FFFFFF;
    letter-spacing: 2px;
}

/* --- Custom Glowing Cursor Styles --- */
#custom-cursor {
    position: fixed; /* Keep it positioned relative to the viewport */
    width: 20px;
    height: 20px;
    border: 2px solid #00aaff;
    border-radius: 50%; /* Make it a circle */
    transform: translate(-50%, -50%); 
    box-shadow: 0 0 15px #00aaff, 0 0 25px #00aaff;
    pointer-events: none; 
    animation: pulse 2s infinite;
    z-index: 1000; 
}

body.is-mobile #custom-cursor {
    display: none !important;
}

/* Define the pulsing animation for the cursor*/
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
}
/* --- Static Logo Styles --- */
#static-logo-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 100px;
    z-index: 50; /* Ensure it's above the 3D scene */
}

#static-logo-container img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* --- Finale Elements (Logo and Slogan) --- */
#finale-logo-container {
    position: fixed;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    z-index: 100;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    pointer-events: none;
}

#finale-logo-container.visible {
    opacity: 1;
    animation: finale-pulse 3s infinite;
}

#finale-logo-container img {
    width: 100%;
    height: auto;
    border-radius: 0px;
    box-shadow: 0 0 10px rgba(0, 100, 255, 0.5), 
                0 0 20px rgba(0, 100, 255, 0.5), 
                0 0 40px rgba(0, 100, 255, 0.5);
}

#main-slogan {
    position: fixed; /* Changed to fixed for reliable centering */
    top: 64%; /* Increased value to push slogan down */
    left: 50%;
    width: 100%;
    opacity: 0;
    transform: translateX(-50%) scale(0.8); /* Center horizontally */
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
    font-size: 3rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5), 0 0 20px rgba(0, 191, 255, 0.3);
    z-index: 100;
}

#main-slogan.visible {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

@keyframes finale-pulse {
    0% {
        box-shadow: 0 0 10px rgba(0, 100, 255, 0.5), 
                    0 0 20px rgba(0, 100, 255, 0.5), 
                    0 0 40px rgba(0, 100, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 150, 255, 0.8), 
                    0 0 40px rgba(0, 150, 255, 0.8), 
                    0 0 80px rgba(0, 150, 255, 0.8);
    }
    100% {
        box-shadow: 0 0 10px rgba(0, 100, 255, 0.5), 
                    0 0 20px rgba(0, 100, 255, 0.5), 
                    0 0 40px rgba(0, 100, 255, 0.5);
    }
}

/* --- Header Navigation (Using Sized Asset) --- */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center; /* Vertically align all items */
    padding: 10px 2%; /* Let padding define the height naturally */
    background-color: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-logo {
    flex-shrink: 0; 
}

.nav-logo img {
    height: 40px; /* Set explicit height for the logo */
    width: auto;
    display: block;
}

.top-nav nav {
    flex-grow: 1; 
    display: flex;
    justify-content: center; 
}

.top-nav nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 40px; 
}

.top-nav nav a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.top-nav nav a:hover {
    color: #00aaff;
}

.nav-cta {
    flex-shrink: 0;
}

.cta-button {
    background-image: linear-gradient(45deg, #007bff, #0056b3);
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.5);
}

/* --- Mission Section Styles --- */
.mission-text-container {
    max-width: 800px;
    text-align: center;
    padding: 40px;
}

.mission-text-container h2, .work-container h2, .contact-container h2 {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #00aaff;
    margin-bottom: 10px;
}

.mission-text-container h1, .work-container h1, .contact-container h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 50px;
}

.mission-text-container h1 span {
    color: #00aaff; /* Highlight color */
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.6);
}

.mission-text-container p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

/* --- Work Section Styles --- */
.work-container {
    width: 100%;
    max-width: 1200px;
    text-align: center;
    padding: 40px 20px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: start; /* Add this line */
}

.portfolio-card {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 25px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* FIX: Subtle lift on hover ONLY */
.portfolio-card:hover {
    transform: translateY(-5px);
}

/* FIX: Full effect for active (clicked) card ONLY */
.portfolio-card.active {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 170, 255, 0.2);
}

.card-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(45deg, rgba(0, 170, 255, 0.1), rgba(0, 86, 179, 0.2));
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.portfolio-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.portfolio-card p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.card-more-info {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, margin-top 0.5s ease-in-out;
}

.card-more-info p {
    color: rgba(255, 255, 255, 0.9);
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.portfolio-card.active .card-more-info {
    max-height: 200px; /* Adjust as needed to fit content */
    margin-top: 15px;
}


/* --- Contact Section Styles --- */
.contact-container {
    width: 100%;
    max-width: 700px;
    text-align: center;
    padding: 40px 20px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00aaff;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.3);
}

.submit-button {
    background-image: linear-gradient(45deg, #007bff, #0056b3);
    color: #FFFFFF;
    padding: 15px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.submit-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.5);
}
