/* --- CSS Reset & Variables --- */
:root {
  --primary-color: #2563eb; /* blue-600 */
  --primary-hover: #1d4ed8; /* blue-700 */
  --bg-color: #ffffff;
  --text-main: #111827; /* gray-900 */
  --text-muted: #4b5563; /* gray-600 */
  --text-light: #9ca3af; /* gray-400 */
  --bg-light: #f9fafb; /* gray-50 */
  --border-color: #e5e7eb; /* gray-200 */
  
  --font-sans: 'Inter', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --transition: all 0.3s ease;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Typography --- */
.text-center { text-align: center; }
.text-primary { color: var(--primary-color); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-mono { font-family: var(--font-mono); }

.section-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .section-title { font-size: 36px; }
}

.section-title-underline {
  height: 4px;
  width: 80px;
  background-color: var(--primary-color);
  margin-bottom: 24px;
}
.section-title-underline.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 672px;
  margin: 0 auto 48px;
}

/* --- Layout Utilities --- */
.py-24 { padding-top: 96px; padding-bottom: 96px; }
.mb-8 { margin-bottom: 32px; }
.mb-12 { margin-bottom: 48px; }
.mb-16 { margin-bottom: 64px; }
.mt-4 { margin-top: 16px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.hidden { display: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.not-sr-only {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

@media (min-width: 640px) {
  .sm\:not-sr-only {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
  .sm\:sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
  }
  .sm\:hidden { display: none; }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- Navbar --- */
#modern-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: var(--transition);
  padding: 24px 0;
  background-color: transparent;
}
#modern-navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

/* --- Buttons & Badges --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: white;
  font-weight: 500;
  border-radius: 8px;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #dbeafe; /* blue-100 */
  color: #1d4ed8; /* blue-700 */
  border: 1px solid #bfdbfe; /* blue-200 */
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 14px;
}
.badge-ping {
  position: relative;
  display: flex;
  width: 8px;
  height: 8px;
}
.badge-ping .ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #60a5fa; /* blue-400 */
  opacity: 0.75;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.badge-ping .dot {
  position: relative;
  display: inline-flex;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-color);
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* --- Hero Section --- */
.hero-section {
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background: linear-gradient(to bottom right, #eff6ff, #eef2ff); /* blue-50 to indigo-50 */
}
.hero-pattern {
  background-image: radial-gradient(circle at 2px 2px, var(--primary-color) 1px, transparent 0);
  background-size: 40px 40px;
  opacity: 0.1;
}
.hero-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
}
@media (min-width: 768px) { .hero-title { font-size: 48px; } }
@media (min-width: 1024px) { .hero-title { font-size: 64px; } }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 672px;
  margin: 48px auto 0;
  padding-top: 48px;
  border-top: 1px solid var(--border-color);
}
.hero-stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.hero-stat-label {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.floating-icon {
  position: absolute;
  background: white;
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  display: none;
}
@media (min-width: 1024px) {
  .floating-icon { display: block; }
}
.bounce-subtle { animation: bounce-subtle 3s ease-in-out infinite; }
.delay-75 { animation-delay: 0.75s; }
.delay-150 { animation-delay: 1.5s; }

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(-5%); }
  50% { transform: translateY(5%); }
}

/* --- Cards (Tech Stack & Projects) --- */
.card {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  transition: var(--transition);
}
.card:hover {
  border-color: #60a5fa; /* blue-400 */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.card-icon-wrapper {
  display: inline-flex;
  padding: 12px;
  background-color: #eff6ff; /* blue-50 */
  border-radius: 8px;
  margin-bottom: 16px;
  transition: var(--transition);
}
.card:hover .card-icon-wrapper {
  background-color: #dbeafe; /* blue-100 */
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}
.card-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Project Card specifically */
.project-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
.project-card-image {
  height: 192px;
  position: relative;
  overflow: hidden;
}
.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.project-card:hover .project-card-image img {
  transform: scale(1.1);
}
.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}
.project-card-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(37, 99, 235, 0);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-card:hover .project-card-hover-overlay {
  background: rgba(37, 99, 235, 0.3);
}
.project-card-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #1d4ed8;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(16px);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-card:hover .project-card-btn {
  opacity: 1;
  transform: translateY(0);
}
.project-card-tags {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.project-card-tag {
  background: rgba(255, 255, 255, 0.9);
  color: #1d4ed8;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
}
.project-card-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* --- Filter Pills --- */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}
.filter-btn {
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-muted);
}
.filter-btn:hover {
  border-color: #60a5fa;
}
.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* --- Experience Timeline --- */
.timeline-container {
  position: relative;
}
.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 32px;
  width: 2px;
  background-color: var(--border-color);
}
@media (min-width: 768px) {
  .timeline-container::before { left: 50%; }
}
.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 48px;
}
@media (min-width: 768px) {
  .timeline-item { flex-direction: row; align-items: center; }
  .timeline-item:nth-child(even) { flex-direction: row-reverse; }
}
.timeline-dot {
  position: absolute;
  left: 32px;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: 4px solid white;
  z-index: 10;
}
@media (min-width: 768px) {
  .timeline-dot { left: 50%; }
}
.timeline-content {
  width: 100%;
  padding-left: 64px;
}
@media (min-width: 768px) {
  .timeline-content { width: 50%; padding-left: 0; padding-right: 32px; }
  .timeline-item:nth-child(even) .timeline-content { padding-left: 32px; padding-right: 0; text-align: left; }
  .timeline-item:nth-child(odd) .timeline-content { text-align: right; }
}

/* --- Dark Section (Currently Learning) --- */
.section-dark {
  background-color: #111827; /* gray-900 */
  color: white;
}
.card-dark {
  background-color: rgba(31, 41, 55, 0.5); /* gray-800 with opacity */
  border: 1px solid rgba(55, 65, 81, 0.5);
  backdrop-filter: blur(8px);
  padding: 24px;
  border-radius: 16px;
  transition: var(--transition);
}
.card-dark:hover {
  background-color: rgba(31, 41, 55, 1);
}

/* --- Animations --- */
[data-animate] {
  opacity: 0;
}
[data-animate="fade-up"] {
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate="fade-left"] {
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate="fade-right"] {
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate].animated {
  opacity: 1;
  transform: translate(0, 0);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: white;
  border-radius: 24px;
  width: 100%;
  max-width: 896px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.open .modal-content {
  transform: scale(1) translateY(0);
}
.modal-body {
  overflow-y: auto;
  flex: 1;
}

#back-to-top.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
