/* --- Global Styles & Variables --- */
:root {
  --primary-color: #00bfa5; 
  --primary-color-darker: #00a790;
  --background-color: #121212;
  --surface-color: #1e1e1e;
  --font-color: #e0e0e0;
  --font-color-muted: #a0a0a0;
  --border-color: #333;
  --shadow-color: rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background-color);
  color: var(--font-color);
  line-height: 1.75; /* Increased line-height for body text */
  padding-top: 80px; /* Space for fixed navbar */
  font-size: 16.5px; /* Slightly increased base font size */
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 2.5rem; /* Increased side padding for container */
}

h1, h2, h3, h4 {
  line-height: 1.3;
  color: #fff;
  font-weight: 500;
}

h1 { font-size: 3rem; margin-bottom: 1rem; }
h2 { 
  font-size: 2.5rem; 
  margin-bottom: 3rem; 
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: inline-block;
}
h3 { font-size: 1.4rem; color: var(--primary-color); }

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

a:hover {
  color: var(--primary-color-darker);
}

p {
  margin-bottom: 1rem;
  max-width: 70ch; /* Improves readability */
}
p.subtitle {
    font-size: 1.2rem;
    color: var(--font-color-muted);
    font-weight: 400;
}

/* --- Navbar --- */
.navbar {
  background-color: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

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

.navbar .logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

.navbar .nav-links {
  display: flex;
  list-style: none;
}

.navbar .nav-links li a {
  padding: 0.5rem 1rem;
  color: var(--font-color);
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease, transform 0.3s ease; /* Added transform transition */
}

.navbar .nav-links li a.active,
.navbar .nav-links li a:hover {
  color: var(--primary-color);
  transform: scale(1.05); /* Subtle scale effect on hover/active */
}

.navbar .nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    transition: width 0.3s ease, background-color 0.3s ease; /* Added background-color transition */
}

.navbar .nav-links li a:hover::after,
.navbar .nav-links li a.active::after {
    width: 60%;
    background-color: var(--primary-color-darker); /* Darken underline on hover */
}

.social-links a {
  color: var(--font-color-muted);
  font-size: 1.3rem;
  margin-left: 1.2rem;
  transition: color 0.3s ease, transform 0.3s ease;
}
.social-links a:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* --- Hero Section (Homepage) --- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  padding: 4rem 2rem;
  min-height: 85vh;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
    background: linear-gradient(90deg, var(--primary-color), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.hero-img {
  flex-basis: 350px;
  flex-shrink: 0;
}
.hero-img img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface-color);
  box-shadow: 0 0 25px var(--primary-color), 0 0 50px var(--shadow-color);
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background-color: var(--primary-color);
  color: #111;
  border: 2px solid var(--primary-color);
  border-radius: 50px;
  font-weight: 700;
  margin-right: 1rem;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.btn:hover {
  background-color: var(--primary-color-darker);
  border-color: var(--primary-color-darker);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 191, 165, 0.3);
  color: #111;
}

/* --- Sections --- */
.section {
  padding: 6rem 0;
  margin-bottom: 2rem; /* Added margin between sections */
}
.section-light {
  background-color: var(--surface-color);
  padding: 6rem 2.5rem; /* Ensure padding is consistent with container */
}

/* --- Project/Experience Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem; /* Increased gap between cards */
}

.card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px; /* Slightly increased border-radius */
  padding: 2.5rem; /* Increased padding */
  box-shadow: 0 5px 15px var(--shadow-color); /* Adjusted shadow */
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease; /* Slightly adjusted transition */
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-10px) scale(1.02); /* Added subtle scale effect */
  box-shadow: 0 12px 30px rgba(0, 191, 165, 0.25); /* More prominent shadow with primary color hint */
  border-color: var(--primary-color);
}

.card h3 {
  margin-bottom: 1rem;
}

.card .tags {
    margin-bottom: 1rem;
}

.card .tag {
    display: inline-block;
    background-color: #333;
    color: var(--font-color-muted);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.2rem;
}

.card-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.card-footer a {
    margin-right: 1.5rem;
    font-weight: 500;
}
.card-footer i {
    margin-right: 0.5rem;
}

/* --- Resume Page --- */
.resume-section {
    margin-bottom: 4rem;
}

.resume-section h2 i {
    margin-right: 1rem;
    color: var(--primary-color);
}

.skills-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}
.skills-list li {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}
.skills-list li:hover {
    background-color: var(--primary-color);
    color: #111;
    border-color: var(--primary-color);
}
.resume-section h4 {
    color: var(--font-color-muted);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

/* Timeline for Experience/Education */
.timeline {
    position: relative;
    padding-left: 3rem; 
    border-left: 2px solid var(--border-color);
}
.timeline-entry {
    position: relative;
    margin-bottom: 3rem;
}
.timeline-entry:last-child {
    margin-bottom: 0;
}
.timeline-entry::before {
    content: '';
    position: absolute;
    left: -3.7rem;
    top: 5px;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid var(--background-color);
}

.timeline-entry h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #fff;
}
.timeline-entry .company {
    font-weight: 600;
    color: var(--font-color);
    font-size: 1.1rem;
}
.timeline-entry .date {
    color: var(--font-color-muted);
    font-style: italic;
    margin-bottom: 1rem;
}
.timeline-entry ul {
    list-style: none;
    padding-left: 0;
}
.timeline-entry ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}
.timeline-entry ul li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
    line-height: 1;
}

/* --- Scroll Animations --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 3rem 0;
  margin-top: 4rem;
  background-color: var(--surface-color);
}
footer .social-links a {
    font-size: 1.8rem;
    margin: 0 1rem;
}
footer p {
    margin-top: 1.5rem;
    color: var(--font-color-muted);
}

/* --- Hamburger Menu --- */
.hamburger-menu {
    display: none; /* Hidden by default, shown on mobile - REMOVED !important */
    background: none;
    border: none;
    color: var(--font-color);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001; /* Ensure it's above other navbar items if overlap occurs */
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .hero {
        padding: 3rem 2rem;
    }
    .hero-text h1 {
        font-size: 2.5rem;
    }
    h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    body {
        /* Adjusted padding-top to match typical collapsed navbar height */
        /* The .navbar itself has 1rem top/bottom padding, logo is 1.6rem font. */
        /* Approx height = 1rem + 1.6rem + 1rem = 3.6rem. If 1rem = 16.5px, then ~59.4px. Rounded to 60px. */
        padding-top: 60px; /* REMOVED !important */
    }

    .navbar .container {
        /* Ensure .navbar .container does NOT become flex-direction: column here. */
        /* It should remain row to keep logo and hamburger side-by-side. */
        flex-direction: row !important; /* REINSTATED !important */
        align-items: center !important; /* REINSTATED !important */
        /* justify-content: space-between; from desktop is also fine. */
    }

    .hamburger-menu {
        display: block; /* Show hamburger */
        order: 3; /* Ensure hamburger is typically on the right of nav links if they were visible */
    }

    .navbar .nav-links {
        display: none; /* Hide nav links by default on mobile - REMOVED !important */
        order: 4; /* After hamburger if it was part of the flex row */

        /* Styles for when it becomes active (dropdown) */
        flex-direction: column;
        width: 100%;
        background-color: var(--surface-color);
        position: absolute;
        top: 100%; /* Position below the navbar (relative to .navbar's bottom) */
        left: 0;
        padding: 0; /* Remove padding from ul itself, apply to li a */
        border-top: 1px solid var(--border-color);
        box-shadow: 0 4px 10px var(--shadow-color);
        z-index: 1000; /* Ensure dropdown is above other content */
    }

    .navbar .nav-links.nav-active {
        display: flex; /* Show when active */
    }

    .navbar .nav-links li {
        width: 100%;
        text-align: left; /* Align text to the left for typical dropdown feel */
        margin-bottom: 0;
    }

    .navbar .nav-links li a {
        display: block;
        padding: 0.9rem 1.5rem; /* Padding for tappable area */
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        font-size: 0.95rem; /* Slightly adjust font size for mobile menu */
        color: var(--font-color); /* Ensure default color is applied */
    }

    .navbar .nav-links li:last-child a {
        border-bottom: none;
    }

    .navbar .nav-links li a.active,
    .navbar .nav-links li a:hover {
        background-color: var(--primary-color);
        color: #111;
        transform: scale(1);
    }

    .navbar .nav-links li a.active::after, /* Remove desktop underline artifacts */
    .navbar .nav-links li a:hover::after {
        width: 0;
        height: 0;
    }

    .navbar .social-links {
        /* Hide social links that were part of the desktop row */
        display: none; /* REMOVED !important */
    }
    /* If social links need to be in the mobile menu, they should be part of the .nav-links ul in HTML */
    /* or handled separately by JS and styled similarly to .nav-links.nav-active */

    /* Previous styles that caused full stacking of .navbar .container are removed or overridden. */
    /* E.g., .navbar .container { flex-direction: column; align-items: flex-start; } is NOT used. */

    .hero {
        flex-direction: column;
        text-align: center;
        min-height: auto;
        padding: 3rem 1.5rem;
    }
    .hero-img {
        margin-top: 2rem;
        max-width: 300px; /* Control image size on mobile */
    }
    .hero-text h1 {
        font-size: 2.2rem;
    }
    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    .container {
        padding: 0 1.5rem; /* Adjust container padding for smaller screens */
    }
    .section, .section-light {
        padding: 4rem 1.5rem;
    }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.8rem; margin-bottom: 2rem; }

    .card-grid {
        grid-template-columns: 1fr; /* Stack cards on mobile */
        gap: 2rem;
    }
    .card {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15.5px; /* Slightly smaller base font for very small screens */
    }
    .hero-text h1 {
        font-size: 2rem;
    }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.6rem; }
    .btn {
        display: block; /* Make buttons full width for easier tapping */
        margin-right: 0;
        margin-bottom: 1rem;
    }
    .btn:last-of-type {
        margin-bottom: 0;
    }
    footer .social-links a {
        font-size: 1.6rem;
        margin: 0 0.8rem;
    }
}