:root {
    /* Dark Theme (Default) */
    --accent-gold: #D4AF37;
    --bg-charcoal: #1a1a1a;
    --bg-surface: #262626;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --border-color: #333333;

    /* Light Theme */
    --bg-light: #f5f5f5;
    --bg-surface-light: #ffffff;
    --text-primary-light: #222222;
    --text-secondary-light: #555555;
    --border-color-light: #e0e0e0;
}

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

html {
    scroll-behavior: smooth;
    /* Firefox scrollbar styling */
    scrollbar-color: var(--bg-surface) var(--bg-charcoal);
    scrollbar-width: thin;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-charcoal);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* --- Light Mode Styles --- */
body.light-mode {
    background-color: var(--bg-light);
    color: var(--text-primary-light);
    /* Firefox scrollbar for light mode */
    scrollbar-color: #dcdcdc var(--bg-light);
}

/* Webkit scrollbar for light mode */
body.light-mode ::-webkit-scrollbar-track { background: var(--bg-light); }
body.light-mode ::-webkit-scrollbar-thumb { background: #dcdcdc; }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: var(--accent-gold); }


body.light-mode .header.scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border-color-light);
}

body.light-mode .logo {
    color: var(--text-primary-light);
}

body.light-mode .nav-link {
    color: var(--text-secondary-light);
}

body.light-mode .nav-link:hover,
body.light-mode .nav-link.active {
    color: var(--text-primary-light);
}

body.light-mode .hero-content .description {
    color: var(--text-secondary-light);
}

body.light-mode .btn:hover {
    color: var(--bg-light);
}

body.light-mode .section-divider {
    border-bottom: 1px solid var(--border-color-light);
}

body.light-mode .section-header p {
    color: var(--text-secondary-light);
}

body.light-mode .subsection-header {
    border-bottom: 1px solid var(--border-color-light);
}

body.light-mode .about-content p,
body.light-mode .contact-item {
    color: var(--text-secondary-light);
}

body.light-mode .about-content strong {
    color: var(--text-primary-light);
}

body.light-mode .timeline {
    border-left: 2px solid var(--border-color-light);
}

body.light-mode .timeline-item::before {
    background: var(--bg-surface-light);
    border: 2px solid var(--border-color-light);
}

body.light-mode .timeline-item:hover::before {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}

body.light-mode .timeline-title a {
    color: var(--text-primary-light);
}

/* This is the new rule that fixes the publication link hover color */
body.light-mode .timeline-title a:hover {
    color: var(--accent-gold);
}

body.light-mode .timeline-meta,
body.light-mode .timeline-description,
body.light-mode .card-subtitle,
body.light-mode .card-description,
body.light-mode .skill-tag {
    color: var(--text-secondary-light);
}

body.light-mode .card {
    background: var(--bg-surface-light);
}

body.light-mode .skill-tag {
    background: var(--bg-light);
}

body.light-mode .footer {
    color: var(--text-secondary-light);
}

body.light-mode .footer-socials a {
    color: var(--text-secondary-light);
}

body.light-mode .footer-socials a:hover {
    color: var(--accent-gold);
}

body.light-mode .footer p a {
    color: var(--text-primary-light);
    border-bottom: 1px dotted var(--text-secondary-light);
}

/* --- Base Typography & Links --- */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.3;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--text-primary);
}
body.light-mode a:hover {
    color: var(--text-primary-light);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.2rem 0;
    z-index: 1000;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.header.scrolled {
    background-color: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text-primary);
}
.logo span { color: var(--accent-gold); }

.nav-menu { list-style: none; display: flex; gap: 2rem; align-items: center;}
.nav-link {
    color: var(--text-secondary);
    font-weight: 700;
    transition: color 0.3s;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}
.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-gold);
}

/* --- Theme Toggle Switch --- */
.theme-switcher {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}
.theme-switcher:hover {
    color: var(--accent-gold);
}
.theme-switcher .fa-sun {
    display: none;
}
body.light-mode .theme-switcher .fa-sun {
    display: block;
}
body.light-mode .theme-switcher .fa-moon {
    display: none;
}


/* --- Hero Section --- */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 100px 0 4rem 0;
}
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    align-items: center;
    gap: 3rem;
    width: 100%;
}
.hero-content .greeting {
    color: var(--accent-gold);
    font-weight: 700;
    margin-bottom: 1rem;
}
.hero-content h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    margin-bottom: 1.5rem;
}
.hero-content h1 span { color: var(--accent-gold); }
.hero-content .description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
  	text-align: justify;
}
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-image img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.4s ease-in-out;
}
.hero-image img:hover { filter: grayscale(0%); }

.btn {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    border-radius: 4px;
    font-weight: 700;
    transition: background-color 0.3s, color 0.3s;
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    background: transparent;
}
.btn:hover {
    background-color: var(--accent-gold);
    color: var(--bg-charcoal);
}

/* Add this to styles.css */
.hero-buttons {
    display: flex;
    gap: 1rem; /* Space between buttons */
    flex-wrap: wrap; /* Allows stacking on mobile */
    margin-top: 2rem;
}

/* Optional: Ensures buttons don't stretch too wide on mobile */
.hero-buttons .btn {
    text-align: center;
}

/* --- General Section & Content Styling --- */
.section {
    padding: 5rem 0;
}
.section-divider {
    border-bottom: 1px solid var(--border-color);
}
.section-header {
    margin-bottom: 3rem;
}
.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.section-header p {
    max-width: 600px;
    color: var(--text-secondary);
}
.subsection-header {
    font-size: 1.8rem;
    margin-top: 4rem;
    margin-bottom: 2.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* --- About Section --- */
.about-content p {
    color: var(--text-secondary);
  	font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: justify;
}
.about-content p:last-of-type {
    margin-bottom: 0;
}
.about-content strong {
    color: var(--text-primary);
    font-weight: 700;
}
.contact-info {
    margin-top: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.contact-item {
    color: var(--text-secondary);
}
.contact-item span {
    color: var(--accent-gold);
    font-weight: 700;
}

.contact-info-link {
    color: var(--text-secondary);
    border-bottom: 1px dotted var(--text-secondary);
}

.contact-info-link:hover {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

/* --- Timeline (Education & Research) --- */
.timeline {
    position: relative;
    padding-left: 40px;
    border-left: 2px solid var(--border-color);
}
.timeline-item {
    position: relative;
    padding-bottom: 3rem;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -49px;
    top: 5px;
    width: 15px;
    height: 15px;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    transition: background-color 0.3s, border-color 0.3s;
}
.timeline-item:hover::before {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}
.timeline-content { padding-left: 2rem; }
.timeline-date {
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}
.timeline-title { font-size: 1.5rem; margin-bottom: 0.25rem; }
.timeline-title a { color: var(--text-primary); }
.timeline-title a:hover { color: var(--accent-gold); }
.timeline-meta, .timeline-description { color: var(--text-secondary); }

/* --- Cards (Skills & Achievements) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-items: stretch;
}
.card {
    background: var(--bg-surface);
    padding: 2rem;
    border-top: 4px solid transparent;
    transition: transform 0.1s ease, border-color 0.3s, background-color 0.3s;
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
}
.card:hover { border-top-color: var(--accent-gold); }
.card-icon { font-size: 2rem; color: var(--accent-gold); margin-bottom: 1rem; }
.card-title { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card-subtitle {
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-size: 0.9rem;
}
.card-description { color: var(--text-secondary); }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.skill-tag {
    background: var(--bg-charcoal);
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: background-color 0.3s, color 0.3s;
}

/* --- Footer & Back to Top --- */
.back-to-top {
    position: fixed;
    bottom: 2rem; right: 2rem;
    background-color: var(--accent-gold);
    color: var(--bg-charcoal);
    width: 50px; height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-5px); color: var(--bg-charcoal); }

.footer {
    padding:1.5rem 0 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.footer-socials a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: color 0.3s, transform 0.3s;
    border-bottom: none;
}
.footer-socials a:hover {
    color: var(--accent-gold);
    transform: translateY(-3px);
}
.footer p a {
    color: var(--text-primary);
    border-bottom: 1px dotted var(--text-secondary);
}
.footer p a:hover {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

/* --- Utilities & Customizations --- */
::selection { background-color: var(--accent-gold); color: var(--bg-charcoal); }
::-moz-selection { background-color: var(--accent-gold); color: var(--bg-charcoal); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-charcoal); }
::-webkit-scrollbar-thumb { background: var(--bg-surface); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-gold); }

/* --- View Transition API for Theme Switch --- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  /* Make the circle originate from the click position */
  clip-path: circle(0% at var(--x) var(--y));
  /* Animate the circle to cover the whole screen */
  animation: clip-reveal 0.5s ease-in-out forwards;
}

@keyframes clip-reveal {
  to {
    clip-path: circle(150% at var(--x) var(--y));
  }
}