/* --- CSS VARIABLES --- */
:root {
    --primary: #1a365d; /* Deep Navy */
    --primary-light: #2c5282;
    --secondary: #718096; /* Slate Gray */
    --bg: #ffffff;
    --text: #2d3748;
    --text-muted: #4a5568;
    --card-bg: #f7fafc;
    --border: #e2e8f0;
    --accent: #3182ce;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- DARK MODE VARIABLES --- */
[data-theme="dark"] {
    --bg: #1a202c;
    --text: #e2e8f0;
    --text-muted: #a0aec0;
    --card-bg: #2d3748;
    --border: #4a5568;
    --primary: #63b3ed;
    --primary-light: #90cdf4;
}

/* --- RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

ul {
    list-style: none;
}

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

section {
    padding: 5rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 2.25rem;
    margin-bottom: 3rem;
    position: relative;
    color: var(--primary);
    font-weight: 700;
}

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

/* --- HEADER --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: var(--transition);
}

header.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

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

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

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

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: var(--card-bg);
}

/* --- HERO --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at top right, rgba(26, 54, 93, 0.05), transparent),
                radial-gradient(circle at bottom left, rgba(26, 54, 93, 0.05), transparent);
    opacity: 1;
    transform: none;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(26, 54, 93, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(26, 54, 93, 0.3);
    background-color: var(--primary-light);
}

/* --- ABOUT --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: start;
}

.profile-img-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.profile-img-container img {
    width: 100%;
    display: block;
    filter: grayscale(20%);
    transition: var(--transition);
}

.profile-img-container:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.bio-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.education-list {
    margin-top: 2rem;
}

.edu-item {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--primary);
}

.edu-item h4 {
    font-size: 1.1rem;
    color: var(--primary);
}

.edu-item span {
    font-size: 0.9rem;
    color: var(--secondary);
}

/* --- RESEARCH --- */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.research-card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.research-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.research-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.research-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- TEACHING --- */
.teaching-table-container {
    overflow-x: auto;
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

tr:last-child td {
    border-bottom: none;
}

/* --- EXPERIENCE --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--border);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background-color: var(--bg);
    border: 4px solid var(--primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left { left: 0; }
.right { left: 50%; }

.right::after { left: -8px; }

.timeline-content {
    padding: 1.5rem;
    background-color: var(--card-bg);
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.timeline-content h3 {
    font-size: 1.1rem;
    color: var(--primary);
}

.timeline-content span {
    color: var(--secondary);
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* --- CONTACT --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.contact-link:hover {
    color: var(--primary);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input, textarea {
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    transition: var(--transition);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

/* --- FOOTER --- */
footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--secondary);
    font-size: 0.9rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .hero-content h1 { font-size: 3rem; }
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .profile-img-container { max-width: 400px; margin: 0 auto; }
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item::after { left: 23px; }
    .right { left: 0%; }
}

@media (max-width: 600px) {
    .nav-links { display: none; }
    .hero-content h1 { font-size: 2.5rem; }
    .section-title { font-size: 1.75rem; }
}
