/* --- Professional Design Tokens --- */
/* --- Professional Design Tokens (Default Dark Mode) --- */
:root {
    --bg-color: #090d16;
    --card-bg: #111827;
    --card-hover-bg: #1f293d;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-subtle: #6b7280;
    
    /* Professional Gradient Accents */
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    --accent-solid: #3b82f6;
    --accent-light: rgba(59, 130, 246, 0.1);
    
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    --max-width: 1200px;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Adaptive Light Mode Overrides --- */
@media (prefers-color-scheme: light) {
    :root {
        --bg-color: #f8fafc;
        --card-bg: #ffffff;
        --card-hover-bg: #f1f5f9;
        --text-main: #0f172a;
        --text-muted: #475569;
        --text-subtle: #94a3b8;
        
        /* Softer light-mode gradients */
        --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
        --accent-solid: #2563eb;
        --accent-light: rgba(37, 99, 235, 0.08);
        
        --border-color: rgba(15, 23, 42, 0.08);
        --border-hover: rgba(15, 23, 42, 0.16);
    }
    
    /* Subtle touch-up for header backdrop on light backgrounds */
    header {
        background-color: rgba(248, 250, 252, 0.8) !important;
    }

    /* Adjust project text explicitly on hover for better light mode contrast */
    .project-card:hover .project-link {
        color: var(--accent-solid) !important;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    /* Smooth transition when the system switches modes */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.container {
    width: 90%;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* --- Refined Navigation --- */
header {
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(9, 13, 22, 0.8);
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-transform: lowercase;
}

.logo span {
    color: #3b82f6;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

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

/* --- Premium Hero Section --- */
#hero {
    padding: 10rem 0 8rem 0;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 750px;
}

#hero h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.04em;
}

.highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.description {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 620px;
}

/* Polished Call-to-Actions */
.cta-buttons {
    display: flex;
    gap: 1.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* --- Professional Credentials Layer --- */
.credential-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Subtle label for the row's context */
.credential-row::before {
    content: "Credentials & Certifications:";
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-subtle);
    width: 100%;
    margin-bottom: -0.25rem;
}

.credential-item {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem; /* Space between the image and the text */
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem 0.5rem 0.75rem; /* Slightly less padding on the left to balance the image */
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.credential-item img {
    height: 120px; /* Slightly adjusted to balance beautifully with text */
    width: auto;
    object-fit: contain;
    filter: grayscale(20%) opacity(85%);
    transition: var(--transition-smooth);
}

.credential-item span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    white-space: nowrap; /* Keeps the label cleanly on one line */
}

/* Elegant Micro-interactions on Hover */
.credential-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.credential-item:hover img {
    filter: grayscale(0%) opacity(100%);
}

.credential-item:hover span {
    color: var(--text-main);
}

/* Light Mode Overrides for Crisp Rendering */
@media (prefers-color-scheme: light) {
    .credential-item {
        background-color: #ffffff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    }
    .credential-item:hover {
        background-color: #f8fafc;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    }
}

/* --- Clean Projects Grid --- */
#projects {
    padding: 6rem 0 10rem 0;
    border-top: 1px solid var(--border-color);
}

#projects h2 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 3rem;
}

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

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.project-card:hover {
    transform: translateY(-4px);
    background-color: var(--card-hover-bg);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.project-card h3 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.project-card p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    flex-grow: 1;
}

/* Data Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.tags span {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Subtle change to the language tag color */
.tags span:first-child {
    background-color: var(--accent-light);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.2);
}

.project-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition-smooth);
}

.project-link i {
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.project-card:hover .project-link {
    color: #60a5fa;
}

.project-card:hover .project-link i {
    transform: translateX(4px);
}

/* --- Executive Footer --- */
footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    color: var(--text-subtle);
    font-size: 0.9rem;
}

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

.social-links {
    display: flex;
    gap: 1.75rem;
}

.social-links a {
    color: var(--text-subtle);
    font-size: 1.2rem;
    transition: var(--transition-smooth);
}

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

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    #hero h1 {
        font-size: 2.75rem;
    }
    
    #hero {
        padding: 6rem 0 4rem 0;
    }

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

    .footer-content {
        flex-direction: column-reverse;
        gap: 1.5rem;
        text-align: center;
    }
}