/* === Modern Portfolio Styles === */
:root {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --text: #1e1e2f;
  --text-light: #5a5a72;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --radius: 10px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --text: #e4e4f0;
  --text-light: #a0a0b8;
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --border: #2d2d44;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.5);
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* --- Header (Glassmorphism on scroll) --- */
header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.8rem 2rem;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] header {
  background: rgba(15, 15, 26, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

header.scrolled {
  box-shadow: var(--shadow-lg);
  background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] header.scrolled {
  background: rgba(15, 15, 26, 0.9);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  z-index: 110; /* above overlay */
}
.logo:hover {
  color: var(--primary);
}

/* Desktop navigation */
nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: border var(--transition), color var(--transition);
  white-space: nowrap;
}
nav a:hover,
nav a.nav-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Controls (lang & theme) */
.controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  z-index: 110; /* above overlay */
}

button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}
button:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- Hamburger (hidden on desktop) --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  z-index: 120; /* on top of everything */
}

.hamburger-line {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--text);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Hamburger animation (X shape) */
.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* --- Mobile Menu Overlay --- */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 100;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .mobile-menu-overlay {
  background: rgba(15, 15, 26, 0.97);
}

.mobile-menu-overlay.active {
  display: flex;
  opacity: 1;
}

/* Links inside overlay */
.mobile-menu-overlay a {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.2px;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.mobile-menu-overlay a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* New: elegant separator between links and controls */
.mobile-separator {
  width: 60px;
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0.5rem auto; /* centers it */
  opacity: 0.7;
}

/* Controls inside overlay (lang/theme) */
.mobile-controls {
  display: none;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* --- Hero --- */
.hero {
  padding: 4rem 1.5rem 2rem;
  text-align: center;
}

.hero-content {
  max-width: 600px;
  margin: 0 auto;
}

.hero-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--primary);
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
  font-weight: 400;
  margin-bottom: 1.5rem;
}

/* Hero links (LinkedIn, GitHub, LeetCode) */
.hero-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.hero-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-light);
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all var(--transition);
}

.hero-links a:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

/* --- Main Sections --- */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.section {
  margin-bottom: 4rem;
}

.section h2 {
  font-size: 1.9rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  color: var(--text);
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--primary);
  margin-top: 0.4rem;
  border-radius: 2px;
}

/* --- About --- */
#about p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 700px;
  line-height: 1.7;
}

/* --- Skills --- */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skill-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.skill-badge:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* --- Degrees --- */
#degrees-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

#degrees-list li {
  background: var(--surface);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

/* --- Projects (expandable list) --- */
.project-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.project-item:hover {
  box-shadow: var(--shadow);
}

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

.project-left {
  flex: 1;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.project-short {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 0;
}

.project-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  flex-shrink: 0;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.tech-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  white-space: nowrap;
}

.expand-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition);
}

.expand-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.expand-icon {
  font-size: 0.7rem;
  transition: transform var(--transition);
}

.project-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  animation: fadeSlideIn 0.25s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Contact (clean, plain text) --- */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
}

.contact-value {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 2rem;
}

/* --- Active nav link --- */
.nav-active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

/* --- Scroll reveal animations --- */
.reveal-hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --- Back to Top Button --- */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 20;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* ── Responsive (max‑width 768px) ── */
@media (max-width: 768px) {
  header {
    padding: 0.6rem 1rem;
  }

  .logo {
    font-size: 1.1rem;
  }

  .hamburger {
    display: flex;
  }

  #main-nav {
    display: none;
  }

  .controls {
    display: none;
  }

  .mobile-nav {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
  }

  .mobile-controls {
    display: flex;
  }

  .hero {
    padding: 3rem 1.2rem 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-links a {
    font-size: 0.8rem;
  }

  .section {
    margin-bottom: 2.5rem;
  }

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

  #about p {
    font-size: 1rem;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-right {
    align-items: flex-start;
    width: 100%;
  }

  .project-tech {
    justify-content: flex-start;
  }

  .expand-btn {
    align-self: flex-start;
  }

  #back-to-top {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    bottom: 1.5rem;
    right: 1.5rem;
  }
}