/* General Styles */
:root {
  --bg-color: #d5e5f7; /* Light Blue */
  --text-color: #2c3e50; /* Dark Blue-Gray */
  --accent-color: #3498db; /* Standard Blue */
  --heading-font: 'Merriweather', serif;
  --body-font: 'Inter', sans-serif;
  --border-color: #d0dce7; /* A slightly darker shade of the bg for borders */
}

[data-theme="dark"] {
  --bg-color: #2c3e50; /* Dark Blue-Gray */
  --text-color: #ecf0f1; /* Light Gray */
  --border-color: #3b5266; /* A slightly lighter shade of the dark bg for borders */
}

body {
  font-family: var(--body-font);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 5rem 2rem 2rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  color: var(--text-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  transition: background-color 0.3s, border-color 0.3s;
}

header .name {
  font-family: var(--heading-font);
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
}

header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

header nav a {
  font-weight: 500;
}

/* Hamburger Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle .bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--text-color);
  transition: all 0.3s ease-in-out;
}


/* Dark Mode Toggle */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

.theme-switch {
  display: inline-block;
  height: 34px;
  position: relative;
  width: 60px;
}

.theme-switch input {
  display:none;
}

.slider {
  background-color: var(--accent-color);
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: #fff; /* White handle for light mode */
  transition: .4s;
  transform: rotate(0deg);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="%23000000"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>');
  background-repeat: no-repeat;
  background-position: center;
}

input:checked + .slider:before {
  transform: translateX(26px) rotate(360deg);
  background-color: var(--bg-color); /* Dark blue handle for dark mode */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23ecf0f1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>');
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}


/* Custom Content Tags */
.pub, .exp {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.pub strong, .exp strong {
    color: var(--text-color);
}

/* Project Cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: box-shadow 0.3s, transform 0.3s, opacity 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.project-card strong {
  font-family: var(--heading-font);
  font-size: 1.2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.project-card.hidden {
  display: none;
}

.show-more-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: var(--body-font);
  font-weight: 500;
  cursor: pointer;
  margin: 2rem auto 0;
  display: block;
  transition: background-color 0.3s, transform 0.2s;
}

.show-more-btn:hover {
  background-color: var(--text-color);
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  header .name {
    font-size: 1.2rem;
  }

  header nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 250px;
    background-color: var(--bg-color);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 2rem;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    transform: translateX(100%);
    visibility: hidden;
    opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s;
  }

  header nav.is-active {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
  }

  .menu-toggle {
    display: block;
  }

  .menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

