* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Special Gothic Expanded One', sans-serif;
    text-shadow: 0 0 10px rgba(156, 85, 236, 0.5);  /* Default glow for all text */
    scroll-behavior: smooth;
}
.special-gothic-expanded-one-regular {
    font-family: "Special Gothic Expanded One", sans-serif;
    font-weight: 400;
    font-style: normal;
}

body {
    background-color: #07000f;
    color: #ffffff;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 80px;
    padding-bottom: 70px;
    box-sizing: border-box;
    min-height: 100vh;
    overflow-y: auto;
}

.section {
    display: none;
    opacity: 0;
    box-sizing: border-box;
}

#home.section.active {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: calc(100vh - 80px - 70px); /* Adjust if nav/footer height changes */
    width: 100%;
    height: 100vh; /* Full viewport height */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: transparent; /* Or your desired background for home */
    z-index: 5 !important; /* Ensure it's above other content if necessary, but below top-menu */
    padding: 0; /* Reset padding for fullscreen effect */
    margin: 0; /* Reset margin for fullscreen effect */
    border-radius: 0; /* Reset border-radius for fullscreen effect */
    opacity: 1; /* Ensure visible */
    visibility: visible; /* Ensure visible */
    transform: translateY(0); /* Reset any transform from inactive state if needed */
}

.section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.section.active h2 {
    margin-bottom: 2rem;
}

.about-content {
    background: rgba(15, 5, 30, 0.85);
    backdrop-filter: blur(8px);
    padding: 2rem;
    margin: 1rem auto;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(156, 85, 236, 0.15);
    line-height: 1.7;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.about-content p {
    color: #d1c4e9;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    text-shadow: 0 0 4px rgba(200, 160, 255, 0.2);
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
    line-height: 1.7;
    padding-left: 1.5rem;
    border-left: 3px solid rgba(156, 85, 236, 0.25);
    position: relative;
    transition: border-left-color 0.3s ease, transform 0.3s ease;
}

.about-content p:hover {
    border-left-color: rgba(196, 181, 253, 0.8);
    transform: translateX(5px);
}

/* REMOVING Enhanced first letter for the very first paragraph */
/*
.about-content p:first-of-type::first-letter {
    font-size: 3em; 
    float: left;
    line-height: 0.8; 
    padding-right: 0.15em;
    padding-top: 0.05em; 
    margin-bottom: -0.1em; 
    color: #b388ff; 
    font-family: 'Special Gothic Expanded One', sans-serif; 
    text-shadow: 0 0 10px rgba(179, 136, 255, 0.5); 
}
*/

.about-content p:last-child {
    margin-bottom: 0;
}

h1 {
    font-size: 5rem;
    margin-bottom: 1rem;
    color: #9c55ec;
    transition: all 0.3s ease;
    text-decoration: none;
    text-shadow: 0 0 5px rgba(156, 85, 236, 0.4);
    white-space: nowrap;
    text-align: center;
}

h1:hover {
    color: #b388ff;
    text-shadow: 0 0 8px rgba(156, 85, 236, 0.5), 0 0 15px rgba(156, 85, 236, 0.3);
}

h2 {
    font-size: 2.8rem;
    margin-bottom: 2.5rem;
    color: #8c4ac2;
    text-align: center;
    text-shadow: 0 0 10px rgba(140, 74, 194, 0.6);
}

.top-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    z-index: 100;
    background-color: rgba(7, 0, 15, 0.8);
    backdrop-filter: blur(5px);
}

.top-menu ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
}

.top-menu a {
    color: #a37fd9;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.top-menu a:hover, .top-menu a.active-nav-link {
    color: #c4b5fd;
    text-shadow: 0 0 15px rgba(196, 181, 253, 0.7);
}

.social-links {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    text-align: center;
    background-color: rgba(7, 0, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    border-top: 1px solid rgba(156, 85, 236, 0.15);
}

.social-links a {
    color: #a37fd9;
    font-size: 1.3rem;
    margin: 0 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    text-shadow: 0 0 15px rgba(156, 85, 236, 0.7);
}

.social-links a:hover {
    color: #9c55ec;
    text-shadow: 0 0 20px rgba(156, 85, 236, 0.8);
}

.project-grid, .contact-grid {
    display: grid; /* Reverted: Grids are displayed by default, visibility controlled by parent .section */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    width: 100%;
    max-width: 1300px; /* Ensure this doesn't exceed .content width or cause overflow */
    justify-items: center; /* Centers grid items if they don't fill the track */
    align-items: stretch; /* Stretches items to fill the cell in the cross axis */
    padding: 1rem; /* Padding within the grid container */
}

.project-card, .contact-card {
    display: flex; /* Reverted: Cards are flex by default, visibility controlled by parent .section */
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%; /* Makes cards take full width of their grid cell */
    max-width: 340px; /* Max width of a card */
    min-height: 160px; /* Minimum height */
    height: 100%; /* Attempt to make all cards in a row the same height if align-items: stretch is on grid */
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    background: rgba(126, 84, 179, 0.13);
    border: 2px solid rgba(156, 85, 236, 0.18);
    border-radius: 18px;
    box-shadow: 0 4px 32px 0 rgba(156, 85, 236, 0.10);
    padding: 2.5rem 2rem; /* Padding inside the card */
    gap: 0.7rem; /* Gap between items inside the card (icon, h3, p) */
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    position: relative; /* For stacking context or pseudo-elements if any */
    overflow: hidden; /* If content might overflow card boundaries */
    justify-content: flex-start; /* Aligns items to the start of the flex container */
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.project-card:visited, .contact-card:visited {
    color: inherit; /* Ensures visited links don't change text color if not intended */
}

.project-card:hover, .contact-card:hover {
    background: rgba(156, 85, 236, 0.18); /* Slightly more opaque/different background on hover */
    box-shadow: 0 8px 40px 0 rgba(156, 85, 236, 0.18); /* Enhanced shadow on hover */
    transform: translateY(-8px) scale(1.03); /* Lift and slightly scale card on hover */
}

.project-card h3, .contact-card h3 {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: #b388ff;
    margin-top: 0.5rem; /* Added to give some space above h3 if icon is small or absent */
}

.project-card p, .contact-card p {
    font-size: 0.95rem;
    color: #d1c4e9;
    opacity: 0.9; /* Slightly see-through text for softer look */
    margin: 0; /* Remove default paragraph margins if card padding/gap handles spacing */
}

.contact-card .contact-icon {
    margin-bottom: 0.8rem; /* Space below the icon, above the h3 */
    color: #c4b5fd; /* Default color for SVG stroke/fill if not set inline and using currentColor */
}

.contact-card .contact-icon svg {
    width: 32px !important; /* Force size for contact icons */
    height: 32px !important; /* Force size for contact icons */
    transition: transform 0.3s ease; /* Smooth transition for hover effects on SVG */
}

/* New styles for project icon container and SVG */
.project-icon-container {
    width: 100%; /* Ensure container takes width for centering */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem; /* Space below icon container */
}

.project-icon-container svg {
    width: 40px; /* Slightly larger for project icons */
    height: 40px;
    stroke: #b388ff; /* Assuming SVGs use stroke for color, adjust if fill is used */
    /* fill: none; /* If SVGs have fill and you only want stroke, or fill with currentColor */
    /* transition: stroke 0.3s ease, transform 0.3s ease; /* If hover effect on SVG directly */
}

/* Optional: Hover effect for icons */
.project-card:hover .project-icon-container svg {
    stroke: #c4b5fd; /* Change color on hover */
    transform: scale(1.1); /* Slightly enlarge icon on hover */
}

@media (max-width: 768px) {
    h1 {
        font-size: 3.5rem;
        white-space: normal; /* Allow h1 to wrap on smaller screens */
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    .content {
        padding-top: 70px; /* Adjust for potentially smaller nav */
        padding-bottom: 60px; /* Adjust for potentially smaller footer/social links */
    }
    
    .section.active { /* Ensure active sections on mobile also have padding */
        padding: 1.5rem; /* Consistent padding for active sections */
        min-height: calc(100vh - 70px - 60px - 3rem); /* Adjust min-height calculation if needed */
    }
    
    #home.section.active { /* Specific adjustments for home section on mobile */
        min-height: calc(100vh - 70px - 60px); /* Full available height */
        padding: 1rem; /* Add some padding if content might touch edges */
    }
    
    .top-menu ul {
        gap: 1.5rem; /* Reduce gap between nav items */
    }
    
    .top-menu a {
        font-size: 1rem; /* Smaller font for nav items */
    }
    
    .project-grid, .contact-grid {
        grid-template-columns: 1fr; /* Stack cards vertically */
        gap: 1.5rem; /* Reduce gap between cards */
    }
    
    .project-card, .contact-card {
        padding: 1.5rem; /* Reduce padding inside cards */
        min-height: 140px; /* Adjust min-height for smaller cards */
    }
    
    .project-card h3, .contact-card h3 {
        font-size: 1.4rem; /* Smaller headings in cards */
    }
    
    .project-card p, .contact-card p {
        font-size: 0.9rem; /* Smaller text in cards */
    }
    
    .about-content {
        padding: 1.5rem; /* Adjust padding for about content */
        font-size: 0.95rem; /* Adjust base font size for about content */
    }
    
    .about-content p {
        font-size: 1rem; /* Slightly larger paragraph font if base is too small */
    }
}

/* Aggressive hiding for #contact when NOT active, to combat Chrome rendering quirk */
#contact:not(.active) {
    position: fixed !important;
    top: -200vh !important;
    left: -200vw !important;
    visibility: hidden !important;
    z-index: -1000 !important;
    overflow: hidden !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    /* display: none; is already on .section, but re-asserting just in case for specificity */
    display: none !important; 
}
