/* CSS Custom Properties for consistent theming */
:root {
  --primary-color: #3b82f6; /* Blue-500 */
  --primary-dark: #2563eb;  /* Blue-600 */
  --secondary-color: #10b981; /* Green-500 */
  --accent-color: #f59e0b; /* Amber-500 */

  --text-primary: #1f2937; /* Gray-800 */
  --text-secondary: #4b5563; /* Gray-600 */
  --text-light: #9ca3af; /* Gray-400 */

  --bg-primary: #ffffff; /* White */
  --bg-secondary: #f9fafb; /* Gray-50 */
  
  --border-color: #e5e7eb; /* Gray-200 */

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));

  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --border-radius: 0.75rem; /* 12px */
  --border-radius-lg: 1rem; /* 16px */
  --border-radius-full: 9999px;

  --font-family-primary: 'Inter', sans-serif;
  --font-family-mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Adjust for fixed header height */
}

body {
  font-family: var(--font-family-primary);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
  overflow: hidden;
}

/* Animation containers */
.hero-text, .hero-image, .section-header, .about-text, .highlight-item, .timeline-item, .skill-card, .project-card {
  transition: opacity 0.8s ease, transform 0.8s ease;
  transform: translateY(20px);
}

.animate-in {
  opacity: 1 !important;
  transform: translateY(0);
}

/* Header & Navigation */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.header.scrolled {
  box-shadow: var(--shadow-md);
  border-bottom-color: var(--border-color);
}

.header.hidden {
  transform: translateY(-100%);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.nav-brand h1 {
  font-size: 1.5rem;
  font-weight: 800;
}

.nav-brand h1 a {
  text-decoration: none;
  color: var(--text-primary);
}

.nav-title {
  display: none; /* Hide for a cleaner look, can be re-enabled */
}

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

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-full);
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

/* Resume button in navbar */
.nav-cta {
  background: var(--primary-color);
  color: white !important;
}

.nav-cta:hover {
  background: var(--primary-dark);
  color: white !important;
}

.nav-progress {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.1s linear;
}

.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 2000;
}

.mobile-nav-toggle span {
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 10px;
  transition: all 0.3s ease-in-out;
  transform-origin: center;
}

.mobile-nav-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}
.mobile-nav-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 2rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-title .highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 550px;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}
.stat-label {
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius-full);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-base);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--primary-color);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--border-color);
  transform: translateY(-2px);
}

.hero-social { display: flex; gap: 1.5rem; }
.social-link {
  color: var(--text-secondary);
  font-size: 1.5rem;
  transition: var(--transition-fast);
}
.social-link:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

.hero-image { display: flex; justify-content: center; align-items: center; }
.image-container { position: relative; width: 350px; height: 350px; }
.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-primary);
  box-shadow: var(--shadow-xl);
}
.image-glow {
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    background: var(--gradient-primary);
    border-radius: 50%;
    filter: blur(40px);
    transform: translate(-50%, -50%);
    opacity: 0.4;
    z-index: -1;
}

.image-overlay {
    position: absolute;
    bottom: 20px; left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-full);
    display: flex; align-items: center; gap: 0.5rem;
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    font-weight: 600;
}

.status-dot {
    width: 10px; height: 10px;
    background: var(--secondary-color);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.scroll-indicator { display: none; } /* Simplified design, can be re-enabled */

/* General Section Styling */
.section { padding: 5rem 2rem; }
.section:nth-of-type(odd) { background-color: var(--bg-secondary); }
.section-header { text-align: center; margin-bottom: 4rem; max-width: 700px; margin-left: auto; margin-right: auto; }
.section-title { font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 0.5rem; }
.section-subtitle { font-size: 1.125rem; color: var(--text-secondary); }

/* --- REFACTORED Timeline Section --- */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--border-color);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    padding: 1.5rem 2rem;
    position: relative;
    margin-bottom: 3rem;
    width: calc(50% - 2rem);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.timeline-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.timeline-item:nth-child(odd) {
    left: 0;
    clear: both;
}

.timeline-item:nth-child(even) {
    left: calc(50% + 2rem);
    clear: both;
}

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

.timeline-item:nth-child(odd)::after {
    right: -31px;
}

.timeline-item:nth-child(even)::after {
    left: -31px;
}

.timeline-title { font-size: 1.25rem; font-weight: 700; }
.timeline-subtitle { color: var(--primary-color); font-weight: 600; margin-bottom: 0.5rem; }
.timeline-date { font-size: 0.875rem; color: var(--text-light); margin-bottom: 1rem; }
.timeline-content ul { padding-left: 1.25rem; color: var(--text-secondary); }
.timeline-content li { margin-bottom: 0.5rem; }


/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}
.skill-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition-base);
}
.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}
.skill-card i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.skill-card span { font-weight: 600; }

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto;
}
.project-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.project-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.project-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.project-description { color: var(--text-secondary); margin-bottom: 1rem; flex-grow: 1; }
.project-links { display: flex; gap: 1rem; }
.project-link { text-decoration: none; color: var(--primary-color); font-weight: 600; }
.project-link:hover { text-decoration: underline; }

/* Contact Section */
.contact { text-align: center; }
.contact .btn-large { padding: 1rem 2.5rem; font-size: 1.125rem; }

/* Footer */
.footer { background: var(--bg-secondary); padding: 3rem 2rem; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1rem; margin-bottom: 2rem; }
.footer-link { color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.footer-link:hover { color: var(--primary-color); }
.footer-bottom { font-size: 0.875rem; color: var(--text-light); }

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    width: 3rem; height: 3rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.4s ease;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); transform: scale(1.1); }

/* --- MEDIA QUERIES for Responsiveness --- */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-image {
        order: -1;
        margin-bottom: 3rem;
    }
    .hero-actions, .hero-social, .hero-stats {
        justify-content: center;
    }
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .nav { padding: 1rem 1.5rem; }

    /* --- REFACTORED Mobile Menu --- */
    .mobile-nav-toggle { display: flex; }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* Start off-screen */
        width: min(75vw, 320px); /* ADJUSTED: Smaller width */
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        box-shadow: -10px 0px 30px -15px rgba(0,0,0,0.1);
    }
    .nav-links.active {
        right: 0;
    }
    .nav-link {
        font-size: 1.25rem;
    }

    /* --- REFACTORED Timeline for Mobile --- */
    .timeline::before {
        left: 20px; /* Move line to the left */
        transform: translateX(0);
    }
    .timeline-item {
        width: 100%; /* Full width */
        padding-left: 3rem; /* Space for line and dot */
        margin-bottom: 2rem;
    }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0; /* Align all items to the left */
        margin-left: 0;
        margin-right: 0;
    }
    .timeline-item::after {
        left: 11px; /* Position dot on the line */
    }

    .hero-stats {
      flex-direction: column;
      gap: 1.5rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    .btn {
        width: 100%;
        max-width: 320px;
    }

    .section {
        padding: 4rem 1.5rem;
    }
}