@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap");

:root {
  --bg-color: #0f1014;
  --text-color: #e0e0e0;
  --accent-color: #3b82f6;
  --card-bg: #1a1c23;
  --hover-bg: #252832;
  --modal-overlay: rgba(0, 0, 0, 0.85);
}

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

body {
  font-family: "Outfit", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header / Bio */
header {
  margin-bottom: 60px;
  animation: fadeIn 1s ease-out;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.profile-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  /* Improvements for downscaling quality */
  image-rendering: auto;
  image-rendering: high-quality;
  transform: translateZ(0); /* Force GPU to help with anti-aliasing */
  box-shadow: 0 0 1px rgba(0,0,0,0.1); /* Softens edges */
  backface-visibility: hidden; /* Another trick for smoother rendering */
}

.bio-text {
  font-size: 1.1rem;
  color: #a0a0a0;
  max-width: 800px;
  margin-bottom: 2rem;
}

.principles {
  margin-top: 2rem;
}

.principle-item {
  margin-bottom: 1rem;
}

.principle-title {
  font-weight: 600;
  color: #fff;
}

/* Latest Experience */
.latest-section {
  margin-bottom: 60px;
  padding: 20px;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.latest-info h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.cv-button {
  text-decoration: none;
  background: var(--accent-color);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s, background 0.2s;
}

.cv-button:hover {
  transform: translateY(-2px);
  background: #2563eb;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.project-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid transparent;
}

.project-card:hover {
  transform: scale(1.05);
  border-color: var(--accent-color);
  background: var(--hover-bg);
}

.project-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  display: block; /* Placeholder for image */
}

.project-card img.project-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

.project-title {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Extracurriculars */
.extra-section-wrapper {
  border-top: 1px solid #333;
  padding-top: 40px;
}

.extra-section {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.extra-item {
  flex: 1;
  min-width: 300px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--bg-color);
  padding: 30px;
  border-radius: 16px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid #333;
  animation: slideUp 0.3s ease-out;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
}

.close-modal:hover {
  color: #fff;
}

.modal-body video {
  width: 100%;
  border-radius: 8px;
  margin: 15px 0;
}

.modal-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 15px 0;
}

.badge {
  display: inline-block;
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-right: 5px;
  text-decoration: none;
}

.badge:hover {
  background: #444;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Timeline for CV */
.timeline-container {
  position: relative;
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
}

/* Vertical Line */
.timeline-container::after {
  content: "";
  position: absolute;
  width: 2px;
  background-color: #333;
  top: 0;
  bottom: 0;
  left: 50%; /* Center line */
  margin-left: -1px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
  box-sizing: border-box;
  animation: slideIn 0.5s ease-out forwards;
  opacity: 0; /* Start hidden for animation */
}

/* Left side items */
.timeline-item.left {
  left: 0;
  text-align: right;
}

/* Right side items */
.timeline-item.right {
  left: 50%;
}

/* Dots */
.timeline-item::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  right: -8px;
  background-color: var(--card-bg);
  border: 4px solid var(--accent-color);
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

.timeline-item.right::after {
  left: -8px;
}

.timeline-content {
  padding: 20px;
  background-color: var(--card-bg);
  border-radius: 8px;
  border: 1px solid #333;
  position: relative;
  transition: transform 0.3s;
}

.timeline-content:hover {
  transform: scale(1.02);
  border-color: var(--accent-color);
}

.timeline-date {
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

/* Responsive Timeline */
@media screen and (max-width: 600px) {
  .timeline-container::after {
    left: 31px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .timeline-item::after {
    left: 21px; /* Adjust dot position */
  }

  .timeline-item.left {
    left: 0;
    text-align: left;
  }
  .timeline-item.right {
    left: 0%;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
