/* ====== General Reset ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
  transition: background 0.4s, color 0.4s;
}

.dark {
  background: #1c1c1c;
  color: #f5f5f5;
}

/* ====== Navbar ====== */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

header nav {
  display: flex;
  flex-wrap: wrap; /* auto-wrap on smaller screens */
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 5vw;
}

.logo {
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: #0077ff;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  list-style: none;
}

nav ul li a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  transition: color 0.3s;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
}

nav ul li a:hover {
  color: #0077ff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

#theme-toggle {
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
}

.btn {
  padding: 0.4rem 0.8rem;
  background: #0077ff;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s, transform 0.2s;
  font-size: clamp(0.8rem, 1.8vw, 1rem);
}

.btn:hover {
  background: #005cd1;
  transform: scale(1.05);
}

/* ====== Sections ====== */
section {
  padding: 6vh 5vw;
  max-width: 1200px;
  margin: auto;
}

section h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin-bottom: 1.5rem;
  position: relative;
}

section h2::after {
  content: "";
  width: 60px;
  height: 4px;
  background: #0077ff;
  position: absolute;
  left: 0;
  bottom: -8px;
  border-radius: 2px;
}

/* ====== Hero ====== */
.hero {
  text-align: center;
  padding-top: 8vh;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
}

.highlight {
  color: #0077ff;
}

.hero p {
  margin: 0.5rem 0;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
}

/* ====== Card Style ====== */
.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.dark .card {
  background: rgba(40, 40, 40, 0.85);
}

/* ====== Timeline ====== */
.timeline .card {
  border-left: 4px solid #0077ff;
  padding-left: 1rem;
}

/* ====== Projects ====== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: rgba(255, 255, 255, 0.9);
  padding: 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.project-card h3 {
  margin-bottom: 0.5rem;
  color: #0077ff;
  font-size: clamp(1rem, 2vw, 1.3rem);
}

.tags {
  margin: 0.5rem 0;
}

.tags span {
  display: inline-block;
  background: #e8f0fe;
  color: #0077ff;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin: 0.2rem;
  font-size: clamp(0.7rem, 1.6vw, 0.85rem);
}

.dark .tags span {
  background: #333;
  color: #80bfff;
}

/* ====== Certificates ====== */
.certs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.badge {
  background: #0077ff;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  transition: background 0.3s;
}

.badge:hover {
  background: #005cd1;
}

/* ====== Contact ====== */
#contact form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 600px;
  margin: auto;
}

#contact input, 
#contact textarea {
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

#contact button {
  align-self: flex-start;
}

/* ====== Footer ====== */
footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
  background: #0077ff;
  color: white;
  font-size: clamp(0.8rem, 2vw, 1rem);
}

/* ====== Modal ====== */
#modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  animation: pop 0.3s ease;
}

.dark .modal-content {
  background: #2a2a2a;
  color: white;
}

#close-modal {
  float: right;
  font-size: 1.5rem;
  cursor: pointer;
}

@keyframes pop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ====== Animations ====== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}