/* --- Basic Reset & Global Styles --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #0a0f18; /* Dark blue background - kept for high contrast */
    --text-color: #cdd6f4;
    --accent-color: #8450c9; /* Your signature purple */
    --accent-color-hover: #5750c9; /* Your signature blue-purple */
    --card-bg: rgba(28, 35, 51, 0.5);
    --border-color: rgba(132, 80, 201, 0.2); /* Border color derived from your purple */
    --header-font: 'Orbitron', sans-serif;
    --body-font: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Animations --- */
.hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.show {
    opacity: 1;
    transform: translateY(0);
}

/* Delay for staggered animations */
.hidden:nth-child(2) { transition-delay: 200ms; }
.hidden:nth-child(3) { transition-delay: 400ms; }

/* --- Header & Navigation --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 15, 24, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-family: var(--header-font);
    font-size: 1.5rem;
    color: #fff;
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent-color);
}

/* --- Hero Section --- */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(87, 80, 201, 0.15) 0%, rgba(132, 80, 201, 0.1) 30%, rgba(10, 15, 24, 0) 60%);
    transform: translate(-50%, -50%);
    z-index: -1;
}

.hero-content {
    z-index: 1;
}

.hero-content h1 {
    font-family: var(--header-font);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: #fff;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.button {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.button:hover {
    background: var(--accent-color-hover);
    transform: translateY(-3px);
}

/* --- General Section Styling --- */
.section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-family: var(--header-font);
    font-size: 2.5rem;
    color: #fff;
}

.header-line {
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.subtitle {
    text-align: center;
    max-width: 700px;
    margin: -1rem auto 3rem;
    font-size: 1.1rem;
    color: #a6adc8;
}

/* --- About Section --- */
.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}
.about-text { flex: 2; }
.about-image { flex: 1; }
.about-image img {
    width: 100%;
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

/* --- Cards (Mission & Projects) --- */
.mission-cards, .project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 2rem;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.card h4 {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.tags {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tags span {
    background: rgba(137, 180, 250, 0.1);
    color: var(--accent-color);
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Contact Section --- */
.contact-content {
    text-align: center;
}

.contact-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    color: #a6adc8;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    nav ul { display: none; } /* Simple hiding for small screens, can be replaced with a hamburger menu */
    .about-content { flex-direction: column; }
    .hero-content h1 { font-size: 2.5rem; }
}

/* --- Matrix Background Styling --- */
#matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Behind hero content but visible */
}

/* Make sure hero content is on top */
.hero-content {
    position: relative;
    z-index: 1;
}

/* --- CORRECTED General Link Styling --- */
main a:not(.button) {
    position: relative;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

main a:not(.button)::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color-hover);
    transform: scaleX(0);
    transform-origin: bottom left;
    transition: transform 0.3s ease-out;
}

main a:not(.button):hover,
main a:not(.button):focus {
    color: var(--accent-color-hover);
}

main a:not(.button):hover::after,
main a:not(.button):focus::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

main a:not(.button):focus {
    outline: none;
}

/* Fix for slow button hover animation in hero section */
.button:hover {
    transition-delay: 0s !important;
}