:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --border-primary: #30363d;
  --border-secondary: #3d444d;
  --fg-default: #f0f6fc;
  --fg-muted: #8b949e;
  --fg-subtle: #6e7681;
  --accent-blue: #2f81f7;
  --accent-green: #3fb950;
  --accent-red: #f85149;
  --btn-bg: #238636;
  --btn-bg-hover: #2ea043;
  --btn-border: rgba(240, 246, 252, 0.1);
  --radius-md: 6px;
  --radius-lg: 8px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--fg-default);
  font-family: var(--font-sans);
  line-height: 1.5;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 2rem;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    backdrop-filter 0.2s ease;
}

.navbar.scrolled {
  background-color: rgba(22, 27, 34, 0.95);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--border-secondary);
}

.logo-fallback {
  font-size: 1.5rem;
  color: var(--accent-blue);
  background: var(--bg-tertiary);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  color: var(--fg-default);
  border-bottom-color: var(--accent-blue);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger div {
  width: 22px;
  height: 2px;
  background-color: var(--fg-muted);
  transition: 0.2s;
}

/* Layout */
.app-wrapper {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
}

/* Sidebar */
.sidebar {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 1.2rem 0;
  height: fit-content;
  position: sticky;
  top: 82px;
}

.sidebar-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-subtle);
  padding: 0 1rem 0.8rem;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.2rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-nav a i {
  width: 1.2rem;
  color: var(--fg-subtle);
  font-size: 1rem;
}

.sidebar-nav a:hover {
  background-color: var(--bg-tertiary);
  color: var(--fg-default);
}

.sidebar-nav a.active-sidebar {
  background-color: var(--bg-tertiary);
  border-left-color: var(--accent-blue);
  color: var(--fg-default);
  font-weight: 600;
}

/* Hero */
.main-content {
  min-width: 0;
}

.hero-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero-text {
  flex: 1 1 300px;
}

.hero-text h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--fg-default);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.hero-text h1 span {
  color: var(--accent-blue);
}

.hero-text p {
  color: var(--fg-muted);
  margin-bottom: 1.8rem;
  max-width: 500px;
  font-size: 1.05rem;
}

.hero-photo {
  flex: 0 0 160px;
  display: flex;
  justify-content: center;
}

.hero-photo img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-tertiary);
  box-shadow: 0 0 0 1px var(--border-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border-primary);
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-primary {
  background-color: var(--btn-bg);
  color: white;
  border-color: var(--btn-border);
}

.btn-primary:hover {
  background-color: var(--btn-bg-hover);
}

/* Sections */
.section-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 2.5rem;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--fg-default);
  margin-bottom: 0.25rem;
}

.section-subtitle {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-blue);
}

/* Timelines and Cards Customization */
.timeline-item-dark {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-primary);
}

.timeline-item-dark:last-child {
  border-bottom: none;
}

.timeline-date-dark {
  font-size: 0.85rem;
  color: var(--accent-blue);
  font-weight: 600;
}

.timeline-item-dark h3 {
  margin: 0.3rem 0;
  color: var(--fg-default);
}

.timeline-item-dark p {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.timeline-item-dark ul {
  padding-left: 1.2rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.timeline-item-dark li {
  margin-bottom: 0.3rem;
}

.research-card-dark {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.research-card-dark h3 {
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
}

.research-card-dark p {
  color: var(--fg-default);
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}

.research-card-dark ul {
  padding-left: 1.2rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.research-card-dark li {
  margin-bottom: 0.4rem;
}

.skills-container-dark {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skills-container-dark span {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--fg-default);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
}

.contact-info-dark p {
  color: var(--fg-muted);
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
}

.contact-info-dark a {
  color: var(--accent-blue);
  text-decoration: none;
}

.contact-info-dark a:hover {
  text-decoration: underline;
}

/* Footer & Back to top */
.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  padding: 2rem 2rem 1.2rem;
  margin-top: 3rem;
  text-align: center;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer-social a {
  color: var(--fg-muted);
  font-size: 1.4rem;
  transition: color 0.2s, transform 0.2s;
}

.footer-social a:hover {
  color: var(--accent-blue);
  transform: translateY(-3px);
}

.footer-bottom {
  font-size: 0.8rem;
  color: var(--fg-subtle);
  border-top: 1px solid var(--border-primary);
  padding-top: 1.2rem;
}

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--bg-secondary);
  color: var(--fg-muted);
  border: 1px solid var(--border-primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.15s;
  text-decoration: none;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--bg-tertiary);
  color: var(--fg-default);
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile-only elements */
.mobile-only {
  display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .app-wrapper {
    grid-template-columns: 1fr;
    padding: 0 1.5rem;
  }

  .sidebar {
    display: none;
  }

  .hero-card {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .mobile-only {
    display: inline-block;
  }

  .hero-text {
    text-align: center;
  }

  .hero-text > div {
    justify-content: center;
  }

  .navbar {
    padding: 0.6rem 1.5rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    right: 1rem;
    background: var(--bg-secondary);
    flex-direction: column;
    width: 200px;
    padding: 1.2rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    gap: 0.8rem;
  }

  .nav-links.active {
    display: flex;
  }

  .hamburger {
    display: flex;
  }
}

/* contact form */
.contact-form {
  max-width: 700px;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.form-group {
  flex: 1 1 200px;
}

.form-input,
.form-textarea {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--fg-default);
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  transition: border 0.15s, box-shadow 0.1s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.2);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-status {
  margin-top: 1rem;
  font-weight: 500;
}