/* =========================================
   1. VARIABLES & THEME SETUP
   ========================================= */
:root {
  /* Color Palette - Dark Mode (Default) */
  --bg-body: #0f1115;
  --bg-overlay: rgba(15, 17, 21, 0.8); /* Strong overlay for readability */
  --bg-surface: rgba(22, 27, 34, 0.6); /* Glassmorphism */
  --bg-surface-hover: rgba(33, 38, 45, 0.7);
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --accent-primary: #58a6ff;
  --accent-hover: #79c0ff;
  --border-color: rgba(48, 54, 61, 0.5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);

  /* Typography */
  --font-main: "Inter", system-ui, -apple-system, sans-serif;
  --font-heading: "Poppins", system-ui, -apple-system, sans-serif;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container-width: 1200px;
  --header-height: 80px;
  --section-spacing: 120px;
}

[data-theme="light"] {
  /* For light mode, we might want to hide the background image or use a lighter overlay */
  --bg-body: #ffffff;
  --bg-overlay: rgba(255, 255, 255, 0.8);
  --bg-surface: rgba(246, 248, 250, 0.7);
  --bg-surface-hover: rgba(243, 244, 246, 0.8);
  --text-primary: #24292f;
  --text-secondary: #57606a;
  --accent-primary: #0969da;
  --accent-hover: #218bff;
  --border-color: rgba(208, 215, 222, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* =========================================
   2. RESET & BASE STYLES
   ========================================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-body);
  /* Setup Background Image */
  background-image: url("../images/pngtree-illustration-of-a-3d-render-showcasing-a-concept-of-web-ui-picture-image_13289194.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Parallax-like effect */
  background-repeat: no-repeat;

  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: color var(--transition-smooth);
  -webkit-font-smoothing: antialiased;
  position: relative;
  z-index: 0;
}

/* Global Overlay to ensure text readability on top of image */
body::before {
  content: "";
  position: fixed; /* Fixed so it covers viewport even on scroll */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-overlay);
  z-index: -1;
  pointer-events: none;
  transition: background-color var(--transition-smooth);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-align: center;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* =========================================
   3. UTILITIES & LAYOUT
   ========================================= */
.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.section {
  padding: var(--section-spacing) 0;
}

.grid {
  display: grid;
  gap: 2rem;
}

.flex {
  display: flex;
  gap: 1rem;
}

.text-center {
  text-align: center;
}
.text-accent {
  color: var(--accent-primary);
}

/* Buttons with Glassmorphism */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
  margin-top: 1.5rem;
  backdrop-filter: blur(4px);
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(88, 166, 255, 0.2);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
}

.btn-outline {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(88, 166, 255, 0.05);
}

.btn-outline:hover {
  background-color: rgba(88, 166, 255, 0.15);
  transform: translateY(-2px);
}

/* Section Headers */
.section-header {
  margin-bottom: 4rem;
  text-align: center;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  display: block;
  font-weight: 600;
}

/* =========================================
   4. NAVIGATION
   ========================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(
    15,
    17,
    21,
    0.7
  ); /* More transparent for modern feel */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--transition-fast);
}

[data-theme="light"] .navbar {
  background-color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar.scrolled {
  background-color: rgba(15, 17, 21, 0.95);
  border-bottom-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  text-align: left;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 10px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 10px;
  width: 0;
  height: 2px;
  background-color: var(--accent-primary);
  transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: calc(100% - 20px);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 12px;
  border-radius: 50%;
  transition: background-color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu */
.hamburger {
  display: none;
  cursor: pointer;
  padding: 10px;
}

/* =========================================
   5. SECTIONS
   ========================================= */

/* Hero - Centered */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--header-height);
  position: relative;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-greeting {
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem); /* Slightly larger for impact */
  margin-bottom: 1rem;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.5); /* subtle text shadow for readbility */
}

.hero-accent {
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--accent-primary);
  font-weight: 400;
  display: block;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--text-primary); /* Brighter for hero */
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 700;
  opacity: 0.9;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* About - Centered */
.about-grid {
  grid-template-columns: 1fr;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about-text p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.about-stats {
  display: flex;
  gap: 3rem;
  margin-top: 2rem;
  justify-content: center;
}

.stat-item h3 {
  font-size: 2.5rem;
  color: var(--accent-primary);
  margin-bottom: 0px;
  text-align: center;
}

.stat-item p {
  font-size: 0.9rem;
  margin: 0;
  text-align: center;
}

/* Skills Cards - Glassmorphism */
.skills-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  justify-content: center;
}

.skill-category {
  background-color: var(--bg-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2.5rem 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.skill-category:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg);
}

.skill-category h3 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.skill-tag {
  background-color: var(--bg-surface-hover);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.skill-category:hover .skill-tag {
  border-color: rgba(88, 166, 255, 0.3);
  color: var(--text-primary);
}

/* Projects Cards - Glassmorphism */
.projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.project-card {
  background-color: var(--bg-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all var(--transition-smooth);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.project-content {
  padding: 2.5rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.project-tech span {
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-family: monospace;
  background: rgba(88, 166, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
}

.project-desc {
  font-size: 1rem;
  margin-bottom: auto;
}

.project-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.project-link-icon {
  font-size: 1.4rem;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 50%;
  background: transparent;
  transition: all var(--transition-fast);
}

.project-link-icon:hover {
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Experience */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.timeline::after {
  display: none;
}
.timeline-item::after {
  display: none;
}

.timeline-item {
  padding: 0 0 2rem 0;
  position: relative;
  background-color: inherit;
  width: 100%;
}

.timeline-content {
  background-color: var(--bg-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: border-color var(--transition-fast);
}

.timeline-item:hover .timeline-content {
  border-color: var(--accent-primary);
}

.timeline-date {
  color: var(--accent-primary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

/* Contact */
.contact-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-email {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 2rem 0;
  display: block;
  word-break: break-all;
  transition: color var(--transition-fast);
}

.contact-email:hover {
  color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(88, 166, 255, 0.3);
}

/* Footer */
footer {
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  text-align: center;
  background-color: rgba(15, 17, 21, 0.8);
  backdrop-filter: blur(10px);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.social-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

.social-link {
  font-size: 1.6rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  padding: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
}

.social-link:hover {
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

/* =========================================
   6. ANIMATIONS
   ========================================= */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-delay-1 {
  transition-delay: 0.1s;
}
.stagger-delay-2 {
  transition-delay: 0.2s;
}
.stagger-delay-3 {
  transition-delay: 0.3s;
}

/* =========================================
   7. MEDIA QUERIES
   ========================================= */
@media (max-width: 768px) {
  :root {
    --section-spacing: 80px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: rgba(
      22,
      27,
      34,
      0.98
    ); /* Less transparent on mobile for legibility */
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    gap: 1.5rem;
    text-align: center;
  }

  .nav-links.active {
    display: flex;
    animation: slideDown 0.3s ease-out forwards;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .hamburger {
    display: block;
    font-size: 1.5rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .container {
    width: 100%;
    padding: 0 16px;
  }

  /* On mobile, sometimes background images don't scale well fixed. 
       We can either keep it or use scroll. */
  body {
    background-attachment: scroll;
  }
}
