/* --- Variables --- */
:root {
    --color-bg: #000000;
    --color-bg-alt: #0a0a0a;
    --color-primary: #61524f; /* New based on user request */
    --color-primary-hover: #7d6a66;
    --color-text-main: #ffffff;
    --color-text-sec: #dadada;
    --color-border: #333333;
    
    --font-main: 'Outfit', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --spacing-section: 5rem;
    --glow: 0 0 10px rgba(97, 82, 79, 0.3);
    --glow: 0 0 10px rgba(119, 0, 0, 0.3);
}

body.light-mode {
    --color-bg: #ffffff;
    --color-bg-alt: #fafafa;
    --color-primary: #e2d1c3; /* As requested */
    --color-primary-hover: #d4c0b0;
    --color-text-main: #333333; /* Dark text for contrast */
    --color-text-sec: #555555;
    --color-border: #e0e0e0;
}

/* Light Mode Specific Overrides */
body.light-mode {
    background: #ffffff;
    background-image: none;
}

body.light-mode .navbar {
    background-color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

body.light-mode .img-box {
    border-color: var(--color-primary); /* Beige border */
    box-shadow: 0 5px 20px rgba(0,0,0,0.1); 
}

body.light-mode .project-card:hover,
body.light-mode .card:hover,
body.light-mode .social-links a:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

body.light-mode h1 {
    background: linear-gradient(to right, #333, #8c7b70); /* Darker gradient for text */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    background-image: none;
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    background: linear-gradient(to right, var(--color-text-main), var(--color-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    /* Fixed Alignment */
    display: block;
    margin-left: auto;
    margin-right: auto;
}

h2.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

p {
    color: var(--color-text-sec);
    margin-bottom: 1rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: 30px; /* More modern radius */
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(45deg, var(--color-primary), var(--color-primary-hover));
    color: var(--color-text-main);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.btn-outline {
    border-color: var(--color-primary);
    color: var(--color-text-main);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--color-text-sec);
    color: var(--color-text-sec);
    border-radius: 30px;
}

.btn-secondary:hover {
    border-color: var(--color-text-main);
    color: var(--color-text-main);
    background-color: rgba(255,255,255,0.05);
}

.btn-link {
    padding: 0;
    color: var(--color-primary);
    background: none;
    font-size: 0.9rem;
    border-radius: 0;
}

.btn-link:hover {
    text-decoration: underline;
    color: var(--color-primary-hover);
}

.center-btn {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.2rem 0;
    background-color: rgba(0, 0, 0, 0.85); /* Slightly more transparent */
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 1000;
    transition: var(--transition);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-text-main);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-sec);
    position: relative;
    padding: 8px 10px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-primary);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--color-text-main);
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--color-text-main);
    transition: var(--transition);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    padding-top: 100px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    /* Dynamic background */
    /* background: radial-gradient(circle at 70% 20%, rgba(119, 0, 0, 0.15), transparent 60%),
                radial-gradient(circle at 30% 80%, rgba(119, 0, 0, 0.1), transparent 50%),
                #000000; */
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-text {
    flex: 1;
    text-align: left;
}

.hero-text p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.img-box {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-primary);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    animation: float 6s ease-in-out infinite;
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start;
}

/* --- Sections Common --- */
.section {
    padding: var(--spacing-section) 0;
}

.section-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
}

/* --- Education & Training (Timeline / Cards) --- */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    border-left: 2px solid var(--color-primary);
    padding-left: 2rem;
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 5px;
    width: 15px;
    height: 15px;
    background-color: var(--color-primary);
    border-radius: 50%;
    border: 3px solid var(--color-bg);
}

.timeline-content h3 {
    margin-bottom: 0.2rem;
    color: var(--color-text-main);
}

.timeline-content .date {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 1px;
}

.timeline-content .description {
    font-size: 0.95rem;
}

.timeline-content ul.description,
.card ul.description,
.project-info ul.description {
    list-style: disc;
    padding-left: 1.2rem;
    margin-top: 0.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--color-bg-alt);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.card .institution {
    margin-bottom: 1rem;
    font-style: italic;
    color: var(--color-text-sec);
}

/* --- Skills --- */
.skills-wrapper {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.skill-category {
    margin-bottom: 3rem; /* Add spacing between categories */
}

.skill-category h3 {
    margin-bottom: 2rem;
    color: var(--color-text-sec);
    font-size: 1.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.skill-tags span {
    padding: 0.6rem 1.4rem;
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.skill-tags span:hover {
    border-color: var(--color-primary);
    color: var(--color-text-main);
    background-color: rgba(119, 0, 0, 0.15);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* --- Projects --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background-color: var(--color-bg-alt);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.project-info {
    padding: 2.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-size: 1.6rem;
    color: var(--color-text-main);
    margin-bottom: 0.8rem;
}

.project-info p {
    font-size: 1rem;
    flex-grow: 1;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0 0 2rem 0;
}

.tech-stack span {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: var(--color-text-sec);
    border: 1px solid transparent;
}

.tech-stack span:hover {
    border-color: rgba(255,255,255,0.2);
    background-color: rgba(255,255,255,0.1);
}

.project-links {
    display: flex;
    gap: 1rem;
}

/* --- Contact --- */
.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-links a {
    font-size: 1.8rem;
    color: var(--color-text-sec);
    transition: var(--transition);
    padding: 0;
    background-color: var(--color-bg-alt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: 1px solid var(--color-border);
}

.social-links a:hover {
    color: var(--color-text-main);
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-5px) rotate(10deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* --- Footer --- */
footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
    margin-top: 5rem;
    color: var(--color-text-sec);
    font-size: 0.9rem;
    background-color: var(--color-bg-alt);
}

/* --- Contact Form --- */
.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-sec);
    font-size: 0.95rem;
    font-weight: 500;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-main);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1); /* Uses primary color rgb roughly */
}

/* Auto-fill style fix */
.contact-form input:-webkit-autofill,
.contact-form input:-webkit-autofill:hover, 
.contact-form input:-webkit-autofill:focus, 
.contact-form input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0.1) inset !important;
    -webkit-text-fill-color: var(--color-text-main) !important;
}

.message-result.success {
    color: #4caf50;
}
.message-result.error {
    color: #f44336;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    filter: blur(5px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fade-up {
    transform: translateY(40px);
}

.fade-left {
    transform: translateX(-40px);
}

.animate-on-scroll.show {
    opacity: 1;
    filter: blur(0);
    transform: translate(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* --- Media Queries --- */
@media (max-width: 900px) {
    .hero-content {
        flex-direction: column-reverse; /* Text on top on mobile? Or image on top? Reverse usually puts text on bottom if column. Defaults to column: Top->Bottom. Let's do column-reverse so image is top? Or standard column. Let's do standard column for mobile: image first? or text first? Common is text first or image first. Let's do column-reverse to put image above for mobile? or Text below. */
        /* Actually commonly on mobile: Image Top, Text Bottom. Order: image, text. 
           HTML order is Text, Image. So column-reverse makes Image (2) go top, Text (1) go bottom. */
        flex-direction: column-reverse; 
        gap: 2rem;
        text-align: center;
    }

    .hero-text {
        text-align: center;
    }
    
    .hero-text p {
        margin-left: auto;
        margin-right: auto;
    }

    .cta-buttons {
        justify-content: center;
    }

    .img-box {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2.section-title { font-size: 2rem; }
    
    .nav-links {
        display: none; 
        position: fixed; /* Fixed for full screen overlay effect */
        top: 70px; /* Navbar height */
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--color-bg);
        flex-direction: column;
        justify-content: center;
        padding: 2rem;
        border-top: 1px solid var(--color-border);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .hamburger {
        display: flex;
    }

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

/* Specific override for Projects Page to limit to 2 columns */
@media (min-width: 769px) {
    .projects-grid.limit-two-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}