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

:root {
  --bg-light: #f4f4f5;
  --bg-dark: #1a1a1a;
  --text-light: #1f2937;
  --text-dark: #e5e7eb;
  --accent: #6366f1;
  --card-light: #ffffff;
  --card-dark: #2a2a2a;
  --border-light: #e5e7eb;
  --border-dark: #333;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-light);
  line-height: 1.6;
  scroll-behavior: smooth;
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
  background-color: var(--bg-dark);
  color: var(--text-dark);
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 0;
}

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  margin: 60px auto;
  width: 80%;
}

/* Header */
.site-header {
  background-color: var(--card-light);
  padding: 80px 0;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.3s ease;
}

body.dark-mode .site-header {
  background-color: var(--card-dark);
  border-color: var(--border-dark);
}

.site-header h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-light);
}

body.dark-mode .site-header h1 {
  color: var(--text-dark);
}

.site-header p {
  font-size: 1.2rem;
  color: #6b7280;
  margin-top: 10px;
}

body.dark-mode .site-header p {
  color: #d1d5db;
}

/* Section Titles */
h2 {
  position: relative;
  display: inline-block;
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--text-light);
}

body.dark-mode h2 {
  color: var(--text-dark);
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 40px;
  height: 4px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

h2:hover::after {
  width: 80px;
}

/* Navigation */
.site-nav {
  background-color: var(--card-light);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.3s ease;
}

body.dark-mode .site-nav {
  background-color: var(--card-dark);
  border-color: var(--border-dark);
}

.site-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 15px 0;
}

.site-nav li {
  margin: 0 20px;
}

.site-nav a {
  color: var(--text-light);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

body.dark-mode .site-nav a {
  color: var(--text-dark);
}

.site-nav a:hover {
  color: var(--accent);
}

/* Section Reveal Animation */
.section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Skills */
ul.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  list-style: none;
  padding-left: 0;
}

/* Education Section */
.education-section {
  padding-top: 40px;
}

.education-entry {
  margin-bottom: 20px;
}

.education-entry h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.education-entry p {
  font-size: 1rem;
  color: #6b7280;
}

/* Project Grid (shared by panels and cards) */
.project-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Panel Items */
.project {
  background-color: var(--card-light);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, background 0.3s ease;
}

body.dark-mode .project {
  background-color: var(--card-dark);
}

.project:hover {
  transform: translateY(-5px);
}

.project img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* Clickable Cards */
.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background-color: var(--card-light);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, background 0.3s ease;
  overflow: hidden;
}

body.dark-mode .project-card {
  background-color: var(--card-dark);
}

.project-card:hover {
  transform: translateY(-5px);
}

/* Uniform Card Images */
.project-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 12px 12px 0 0;
  margin-bottom: 16px;
}

.project-card h3,
.project-card h4,
.project-card p {
  margin: 0.5rem 1rem 1rem;
  color: var(--text-light);
}

body.dark-mode .project-card h3,
body.dark-mode .project-card h4,
body.dark-mode .project-card p {
  color: var(--text-dark);
}

/* Detailed Panels */
.project-panel {
  display: none;
  padding: 30px 0;
}

.project-panel.active {
  display: block;
  animation: fadeIn 0.4s ease-in;
}

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

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1rem;
  width: 2px;
  height: 100%;
  background-color: var(--accent-color, #6366f1);
  transform: scaleY(0);
  transform-origin: top;
  animation: growLine 1.2s ease-out forwards;
}

@keyframes growLine {
  to {
    transform: scaleY(1);
  }
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 2rem;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0.3rem;
  top: 0.5rem;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--accent-color, #6366f1);
  border-radius: 50%;
  border: 2px solid white;
  z-index: 2;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.site-footer {
  background-color: var(--card-light);
  color: #6b7280;
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--border-light);
  transition: background 0.3s ease;
}

body.dark-mode .site-footer {
  background-color: var(--card-dark);
  color: #d1d5db;
  border-color: var(--border-dark);
}

/* Animate on Scroll */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Dark Mode Toggle */
.toggle-dark {
  float: right;
  margin: 20px 20px 0 0;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-dark:hover {
  background: #4f46e5;
}

/* Return to Top Button */
#toTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  z-index: 1000;
  transition: background 0.3s ease;
}

#toTop:hover {
  background: #4f46e5;
}

/* Glass Effect for Old .project */
.project:hover {
  transform: perspective(800px) rotateX(2deg) rotateY(2deg);
}

.project {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .project {
  background: rgba(42, 42, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
/* ensure all cards transition their opacity */
.project-card {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* when you add .dimmed to a card, it fades out */
.project-card.dimmed {
  opacity: 0.4;
}

/* an explicit .selected class keeps the clicked card at full opacity */
.project-card.selected {
  opacity: 1;
}
.linkedin-link {
  display: inline-block;
  margin-top: 1rem;
}

.linkedin-logo {
  width: 40px;
  height: 40px;
  transition: opacity 0.3s ease;
}

.linkedin-link:hover .linkedin-logo {
  opacity: 0.7;
}
