:root {
    --bg-dark: #f8f9fa;
    --card-bg: #ffffff;
    --card-border: #e9ecef;
    --text-main: #212529;
    --text-muted: #6c757d;
    --primary: #0056b3;
    --primary-hover: #004494;
    --secondary: #495057;
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* Dark Mode Fallbacks */
body.dark-theme {
    --bg-dark: #121212;
    --card-bg: #1a1a1a;
    --card-border: #2b2b2b;
    --text-main: #e0e0e0;
    --text-muted: #9aa0a6;
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography Refinements */
h1, h2, h3, h4, h5, h6, .logo {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

p {
    margin-bottom: 1.25rem;
}

p:last-child {
    margin-bottom: 0;
}

.highlight {
    color: var(--primary);
}

.text-muted {
    color: var(--text-muted);
}

/* Base Panel & Shadows */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

/* Interactive Hover States */
a.glass-panel,
article.glass-panel,
.project-card.glass-panel {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

a.glass-panel:hover,
article.glass-panel:hover,
.project-card.glass-panel:hover {
    box-shadow: var(--shadow-md);
    border-color: #dee2e6;
    transform: translateY(-4px);
}

/* Header Navbar */
.navbar {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--card-border);
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--transition);
}

body.dark-theme .navbar {
    background: rgba(18, 18, 18, 0.95);
}

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

.logo {
    font-size: 1.45rem;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary);
}

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

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

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Nav underline hover effect */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}
.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

/* Hero Flow */
.hero {
    margin-top: 6rem;
    padding: 4rem 1.5rem;
    text-align: center;
}

.hero h1 {
    font-size: 3.8rem;
    margin-bottom: 1.25rem;
    letter-spacing: -1.5px;
}

.hero h2 {
    font-size: 1.35rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.15rem;
    max-width: 650px;
    margin: 0 auto 3rem auto;
    color: var(--text-muted);
}

/* Smooth Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 86, 179, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--text-muted);
}

.btn-secondary:hover {
    background: var(--card-bg);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-small {
    padding: 0.65rem 1.4rem;
    font-size: 0.9rem;
}

.cta-group {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Spacing Rhythm */
.page-content {
    margin-top: 5rem;
    margin-bottom: 6rem;
}

.page-title {
    font-size: 2.8rem;
    margin-bottom: 3.5rem;
    text-align: center;
    letter-spacing: -1px;
}

/* Grids */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1FR;
    gap: 3rem;
    align-items: start;
}

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

/* Project Cards */
.project-image-placeholder {
    height: 180px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    border-bottom: 1px solid var(--card-border);
    border-radius: 12px 12px 0 0;
    transition: background var(--transition);
}

a.glass-panel:hover .project-image-placeholder,
article.glass-panel:hover .project-image-placeholder {
    background: #e9ecef;
}

body.dark-theme .project-image-placeholder {
    background: #222;
}
body.dark-theme a.glass-panel:hover .project-image-placeholder {
    background: #2a2a2a;
}

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

.mt-3 {
    margin-top: auto;
}

/* Tags */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.skill-tag {
    background: var(--bg-dark);
    color: var(--secondary);
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--card-border);
    transition: background var(--transition), color var(--transition);
}

.skill-tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

input, textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.1);
}

/* Minimal Smooth Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1, .hero h2, .hero p, .cta-group,
.page-title, .glass-panel, .contact-details {
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    will-change: transform, opacity;
}

/* Animation Staggering for Flow */
.hero h1 { animation-delay: 0.1s; }
.hero h2 { animation-delay: 0.2s; }
.hero p { animation-delay: 0.3s; }
.cta-group { animation-delay: 0.4s; }

.page-title { animation-delay: 0.1s; }
.about-grid > *:nth-child(1) { animation-delay: 0.2s; }
.about-grid > *:nth-child(2) { animation-delay: 0.3s; }

.projects-grid > *:nth-child(1) { animation-delay: 0.2s; }
.projects-grid > *:nth-child(2) { animation-delay: 0.3s; }
.projects-grid > *:nth-child(3) { animation-delay: 0.4s; }

/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
}
.hamburger span {
    width: 25px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
}

/* Responsive */
@media(max-width: 768px) {
    .nav-links {
        display: none;
    }
    .hamburger {
        display: flex;
    }
    .hero {
        margin-top: 3rem;
        padding: 3rem 1rem;
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    .hero h2 {
        font-size: 1.25rem;
    }
    .hero p {
        font-size: 1.1rem;
    }
    .cta-group {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }
    .cta-group .btn {
        width: 100%;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
    .page-title {
        font-size: 2.4rem;
        margin-bottom: 2.5rem;
    }
    .glass-panel {
        padding: 2rem;
    }
}
