/* ================= BASE ================= */
body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  background: #f3f3f3;
  color: #222;
  overflow-x: hidden;
}
html {
  scroll-behavior: smooth;
}
h1, h2, h3, h4 {
  line-height: 1.3;
}
p {
  line-height: 1.6;
}

/* ================= NAVBAR ================= */
.navbar {
  background-color: #f5f5f5;
  padding: 1rem 0;
  position: relative;
}
.navbar::after {
  content: '';
  display: block;
  width: 90%;
  height: 1px;
  background-color: #ddd;
  margin: 0 auto;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.avatar img {
  width: 25px;
  height: 25px;
  cursor: pointer;
}
.name-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.my-name {
  font-weight: 700;
  color: #000;
}
.title {
  font-weight: 400;
  font-size: 0.9rem;
  color: #374151;
}
.nav-links {
  display: flex;
  align-items: center;
}
.nav-links ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: #000;
  font-weight: 400;
  transition: color 0.3s ease, letter-spacing 0.3s ease;
}
.nav-links a:hover {
  color: #2563eb;
  letter-spacing: 0.5px;
}
.close-btn {
  font-size: 2rem;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  position: fixed;
  top: 1rem;
  right: 1.2rem;
  opacity: 0;
  transform: rotate(0deg) scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1100;
}
.nav-links.active .close-btn {
  opacity: 1;
  transform: rotate(90deg) scale(1);
}
.hamburger {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
}

/* ================= HERO ================= */
.projects-hero {
  text-align: center;
  padding: 3rem 1rem;
  background: #fff;
}
.projects-hero h1 {
  font-size: 2.2rem;
  margin-bottom: .6rem;
}
.projects-hero p {
  color: #555;
  font-size: 1.05rem;
}

/* ================= FILTER BUTTONS ================= */
.filter-buttons {
  text-align: center;
  margin: 1.5rem 0;
}
.filter-buttons button {
  margin: 0 .5rem;
  padding: .6rem 1.2rem;
  border: none;
  border-radius: 20px;
  background: #e0e0e0;
  cursor: pointer;
  transition: all .3s;
}
.filter-buttons button.active,
.filter-buttons button:hover {
  background: #00897b;
  color: #fff;
}
.filter-buttons button:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ================= PROJECT CARDS ================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.project-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  transition: transform .3s, box-shadow .3s;
  display: block;
}
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0,0,0,.12);
}
.project-card h3 {
  margin: 0 0 .5rem;
}
.project-card p {
  color: #444;
  font-size: .95rem;
}
.project-card p a {
  text-decoration: none;
}
.project-card p a:hover {
  color: rgb(0, 64, 0);
}
.badge {
  display: inline-block;
  margin: .3rem 0 1rem;
  padding: .25rem .6rem;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
}
.badge.tech { background: #2563eb; }
.badge.academic { background: #00897b; }
.tags span {
  display: inline-block;
  margin: .3rem .3rem 0 0;
  padding: .3rem .6rem;
  background: #eee;
  border-radius: 5px;
  font-size: .8rem;
  transition: background .3s;
}
.tags span:hover {
  background: #ddd;
  cursor: default;
}
.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: .5rem 1rem;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: .9rem;
  transition: background .3s;
}
.btn:hover {
  background: black;
  color: white;
}

/* ================= FOOTER ================= */
.footer {
  background-color: #f5f5f5;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  color: #374151;
  position: relative;
}
.footer::before {
  content: '';
  display: block;
  width: 90%;
  height: 1px;
  background-color: #ddd;
  margin: 0 auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}
.footer-section {
  flex: 1;
  min-width: 200px;
}
.footer h4 {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #000;
}
.footer a {
  text-decoration: none;
  color: #444;
  transition: color 0.3s ease, letter-spacing 0.3s ease;
}
.footer a:hover {
  color: #2563eb;
  letter-spacing: 0.5px;
}
.footer .copyright {
  text-align: right;
}

/* ================= MEDIA QUERIES ================= */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: #f5f5f5;
    flex-direction: column;
    padding-top: 3rem;
    transition: left 0.4s ease;
    border-right: 1px solid #ddd;
    z-index: 1001;
  }
  .nav-links.active { left: 0; }
  .nav-links ul {
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    margin-top: 2rem;
  }
  .nav-links a { font-size: 1.1rem; }
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
  }
  .overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
  .hamburger { display: block; }
}
@media (max-width: 768px) {
  @keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
  }
  .nav-links li { opacity: 0; }
  .nav-links.active li { animation: slideIn 0.4s forwards; }
  .nav-links.active li:nth-child(1) { animation-delay: 0.1s; }
  .nav-links.active li:nth-child(2) { animation-delay: 0.2s; }
  .nav-links.active li:nth-child(3) { animation-delay: 0.3s; }
  .nav-links.active li:nth-child(4) { animation-delay: 0.4s; }
}
@media (max-width: 768px) {
  .projects-hero { padding: 2rem 1rem; }
  .projects-hero h1 { font-size: 1.8rem; }
  .projects-hero p { font-size: 0.95rem; }
}
@media (max-width: 480px) {
  .projects-hero h1 { font-size: 1.6rem; }
  .projects-hero p { font-size: 0.85rem; }
}
@media (max-width: 768px) {
  .projects-grid { padding: 1.5rem 1rem; gap: 1rem; }
  .project-card { padding: 1.2rem; }
}
@media (max-width: 480px) {
  .project-card { padding: 1rem; font-size: 0.9rem; }
  .project-card h3 { font-size: 1.1rem; }
  .btn { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
}
@media (max-width: 600px) {
  .filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .filter-buttons button {
    flex: 1 1 auto;
    min-width: 100px;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
}
@media (max-width: 992px) {
  .nav-links ul { gap: 1rem; }
  .my-name { font-size: 1rem; }
  .title { font-size: 0.8rem; }
}
@media (max-width: 768px) {
  .footer-container { flex-direction: column; text-align: center; }
  .footer .copyright { text-align: center; margin-top: 1rem; }
}
@media (max-width: 480px) {
  .footer { font-size: 0.8rem; }
  .footer h4 { font-size: 1rem; }
}
