:root {
  /* Dark Mode Defaults */
  --primary-color: #007bff;
  --bg-color: #0a0a0c;
  --text-color: #e0e0e0;
  --secondary-text: #a0a0a0;
  --accent-color: #3b82f6;
  --card-bg: #121215;
  /* Fully opaque to prevent render bugs */
  --border-color: rgba(255, 255, 255, 0.08);
  --hover-bg: rgba(255, 255, 255, 0.03);
  --font-family: "Outfit", sans-serif;

  /* Professional Accent Colors */
  --accent-glow: rgba(59, 130, 246, 0.4);
  --primary-glow: rgba(0, 123, 255, 0.4);

  --card-shadow: 0 10px 50px -10px rgba(0, 0, 0, 0.7);
}

body.light-mode {
  --bg-color: #f5f7fa;
  --text-color: #1a1a1b;
  --secondary-text: #4a5568;
  --card-bg: #ffffff;
  /* Fully opaque */
  --border-color: rgba(0, 0, 0, 0.08);
  --hover-bg: rgba(0, 0, 0, 0.03);
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);

  /* Soften neons for light mode if needed, but keeping them vibrant as requested */
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  /* Offset for sticky header */
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  overflow-x: hidden;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Nav Bar - Fix Background and Visibility */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 70px;
  z-index: 10000;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease;
  transform: translate3d(0, 0, 0);
  /* Hardware acceleration */
  -webkit-transform: translate3d(0, 0, 0);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: nowrap;
}

.logo {
  flex-shrink: 0;
  margin-right: 1.5rem;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

.logo {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 800;
  text-decoration: none;
  color: var(--text-color);
  transition: transform 0.3s ease;
}

body.dark-mode .logo {
  background: linear-gradient(90deg, var(--text-color), var(--secondary-text));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo:hover {
  transform: scale(1.1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-shrink: 0;
}

.nav-links a {
  color: var(--secondary-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  margin-left: 2rem;
  transition:
    color 0.3s ease,
    text-shadow 0.3s ease;
}

.nav-links a:hover {
  color: var(--text-color);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#theme-toggle {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

#theme-toggle:hover {
  transform: rotate(15deg);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.nav-right button,
.nav-right .nav-links {
  flex-shrink: 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1001;
  /* Above nav-bar, below mobile-nav */
}

.mobile-menu-btn:hover {
  border-color: var(--accent-color);
  background: var(--card-bg);
}

/* Mobile Nav Drawer */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  background: var(--card-bg);
  z-index: 2000;
  padding: 80px 40px;
  transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.mobile-nav.open {
  right: 0;
}

.mobile-close-btn {
  position: absolute;
  top: 25px;
  right: 9%;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mobile-nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  transition: color 0.3s ease;
}

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

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Hero Section - CENTERED COMPACT */
header#hero {
  min-height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 140px;
  padding-bottom: 50px;
  text-align: center;
}

.hero-content {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 800px;
}

.hero-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  overflow: hidden;
  /* Prevent animation from causing horizontal scroll */
  padding: 20px 0;
}

.neon-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  border: 1px solid currentColor;
}

.neon-badge.cyan {
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.hero-text h1 {
  font-size: clamp(2.5rem, 10vw, 4rem);
  line-height: 1.1;
  margin-bottom: 2rem;
  font-weight: 800;
  display: flex;
  justify-content: center;
  gap: 0.2em;
  flex-wrap: wrap;
}

#hero-name span {
  display: inline-block;
  will-change: transform, opacity;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.cta-button {
  padding: 1.2rem 2.8rem;
  border-radius: 3.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid transparent;
}

.cta-button.secondary {
  background: transparent;
  border: 1px solid var(--text-color);
  color: var(--text-color);
}

.cta-button:hover {
  transform: translateY(-5px) scale(1.05);
}

.cta-button.secondary:hover {
  background: #000000;
  color: #ffffff;
  border-color: #ffffff;
}

/* Light Mode Overrides for CTA Buttons */
body.light-mode .cta-button.secondary:hover {
  background: #1a1a1b;
  color: #ffffff;
  border-color: #1a1a1b;
}

/* Profile Image - RECTANGULAR WITH ROUNDED CORNERS */
.profile-img-container {
  flex: 0 0 280px;
  height: 350px;
  width: 280px;
  position: relative;
  border-radius: 2rem;
  margin: 0 auto;
}

.profile-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2rem;
  position: relative;
  z-index: 2;
  border: 2px solid var(--border-color);
}

.img-glow {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  border-radius: 2.2rem;
  filter: blur(15px);
  opacity: 0.3;
  z-index: 1;
}

/* Sections Styling - CENTERED COMPACT VERSION */
.sections-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-bottom: 3rem;
  align-items: center;
}

.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 2.5rem 3rem;
  border-radius: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: all 0.4s ease;
  width: 100%;
  max-width: 900px;
}

/* Highlight Borders for Cards */
.section-card:hover {
  border-color: var(--accent-color);
  box-shadow: 0 0 30px -5px rgba(59, 130, 246, 0.15);
}

/* Keep headings and text readable within cards */
.section-card h2,
.section-card h3,
.section-card h4,
.section-card p,
.section-card li {
  color: var(--text-color);
}

.section-card .section-header h2 {
  color: var(--text-color);
  display: inline-block;
}

body.dark-mode .section-card .section-header h2 {
  background: linear-gradient(135deg, var(--text-color), var(--secondary-text));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-header {
  margin-bottom: 2rem;
  /* Reduced from 4rem */
}

.section-header h2 {
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  margin-bottom: 0.8rem;
  font-weight: 800;
}

.section-header p {
  color: var(--secondary-text);
  font-size: 1.1rem;
  max-width: 800px;
}

/* Experience List - COMPACT */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.exp-card {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

.exp-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.exp-company {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.exp-header h3 {
  font-size: clamp(1.3rem, 5vw, 2rem);
}

.exp-period {
  color: var(--secondary-text);
  font-weight: 500;
}

.exp-list {
  list-style: none;
}

.exp-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1rem;
  color: var(--secondary-text);
  font-size: 1.05rem;
}

.exp-list li::before {
  content: "⚡";
  position: absolute;
  left: 0;
  font-size: 0.8rem;
}

/* Skills Grid - VERTICAL COMPACT */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skill-category {
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 1.2rem;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.skill-category h4 {
  margin-bottom: 0;
  font-size: 1rem;
  width: 200px;
  /* Fixed width for alignment */
  max-width: 100%;
  flex-shrink: 0;
  color: var(--accent-color);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-tag {
  padding: 0.45rem 1rem;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.8rem;
  font-size: 0.85rem;
  color: var(--secondary-text);
  transition: all 0.3s ease;
}

.skill-tag:hover {
  border-color: var(--accent-color);
  color: var(--text-color);
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-3px);
}

/* Education & Achievements - COMPACT */
.edu-item {
  margin-bottom: 2rem;
  /* Reduced from 4rem */
}

.edu-item h3 {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.edu-meta {
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.edu-desc {
  color: var(--secondary-text);
  font-size: 0.95rem;
}

.achievement-list {
  list-style: none;
}

.achievement-list li {
  padding: 2rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease;
}

.achievement-list li:hover {
  transform: translateX(10px);
  border-color: var(--accent-color);
}

.ach-icon {
  font-size: 1.5rem;
  margin-top: 0.2rem;
}

.ach-text {
  flex: 1;
  font-size: 1.05rem;
}

.ach-link {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.3s ease;
}

.ach-link:hover {
  gap: 0.8rem;
  text-decoration: underline;
}

/* Links & Profiles */
.profiles-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 2.5rem;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  transition: all 0.3s ease;
}

.profile-btn:hover {
  border-color: var(--accent-color);
  transform: scale(1.05);
  background: var(--text-color);
  color: var(--bg-color);
}

/* Footer & Social - COMPACT */
footer {
  padding: 4rem 0 3rem;
  /* Reduced from 10rem top */
}

.copyright {
  color: var(--secondary-text);
  font-size: 0.9rem;
  opacity: 0.7;
}

body.light-mode .copyright {
  color: var(--text-color);
  opacity: 0.6;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.social-links a {
  font-size: 2rem;
  /* Reduced from 2.5rem */
  color: var(--secondary-text);
  transition: all 0.3s ease;
}

.social-links a:hover {
  color: var(--text-color);
  transform: translateY(-8px);
}

/* Reveal Animation - SNAPPY & STABLE */
[data-reveal] {
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
  /* Hardware acceleration */
}

[data-reveal].active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
    gap: 4rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .two-col-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .profile-img-container {
    flex: 0 0 320px;
    height: 320px;
  }
}

@media (max-width: 768px) {
  .section-card {
    padding: 2rem 1.5rem;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .nav-right {
    gap: 0.8rem;
  }

  .skill-category {
    gap: 1rem;
  }

  .skill-category h4 {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .exp-header {
    flex-direction: column;
  }

  .exp-period {
    margin-top: 0.2rem;
    font-size: 0.9rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .nav-bar {
    height: 65px;
  }

  .nav-content {
    width: 94%;
  }

  .nav-right {
    gap: 0.4rem;
  }

  .logo {
    font-size: 1.3rem;
    margin-right: 0.3rem;
  }

  #theme-toggle,
  .mobile-menu-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    flex-shrink: 0;
    margin: 0;
  }

  .hero-text h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .profile-img-container {
    width: 220px;
    height: 280px;
  }

  .hero-content {
    gap: 1.5rem;
  }
}