:root {
  /* Light Theme */
  --bg-color: #fafafa;
  --text-color: #1a1a1a;
  --text-secondary: #666;
  --accent-color: #2563eb;
  --accent-light: rgba(37, 99, 235, 0.1);
  --card-bg: #ffffff;
  --border-color: #e5e5e5;
  --nav-height: 60px;
  --timeline-line-color: #d4d4d8;
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --text-color: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent-color: #38bdf8;
  --accent-light: rgba(56, 189, 248, 0.1);
  --card-bg: #1e293b;
  --border-color: #334155;
  --timeline-line-color: #475569;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: all 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

ul {
  list-style: none;
}

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

/* --- Header --- */
header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(var(--bg-color), 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  display: none;
}

/* Hidden on mobile mostly, or small */
@media(min-width: 768px) {
  .logo {
    display: block;
  }
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-socials {
  display: flex;
  gap: 10px;
}

.header-socials a {
  color: var(--text-secondary);
}

.header-socials a:hover {
  color: var(--accent-color);
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.icon-btn:hover {
  color: var(--accent-color);
}

/* --- Layout --- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 60px 0;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 30px;
  font-weight: 700;
}

/* --- Hero --- */
#hero {
  padding-top: calc(var(--nav-height) + 60px);
  text-align: center;
}

.hero-text h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  line-height: 1.2;
}

.hero-text h2 {
  font-size: 1.2rem;
  color: var(--accent-color);
  margin-bottom: 15px;
  font-weight: 500;
}

.hero-text p {
  max-width: 600px;
  margin: 0 auto 20px;
  color: var(--text-secondary);
}

/* --- Skills Cloud --- */
.skills-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.skill-pill {
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.skill-pill:hover,
.skill-pill.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* --- Vertical Timeline --- */
.timeline-vertical {
  position: relative;
  padding: 20px 0;
}

/* Vertical Line */
.timeline-vertical::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--timeline-line-color);
  transform: translateX(-50%);
}

.timeline-entry {
  position: relative;
  margin-bottom: 40px;
  width: 50%;
  padding: 0 30px;
}

.timeline-entry:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline-entry:nth-child(even) {
  left: 50%;
  text-align: left;
}

/* Dot */
.timeline-dot {
  position: absolute;
  top: 5px;
  width: 14px;
  height: 14px;
  background: var(--bg-color);
  border: 3px solid var(--accent-color);
  border-radius: 50%;
  z-index: 2;
}

.timeline-entry:nth-child(odd) .timeline-dot {
  right: -7px;
}

.timeline-entry:nth-child(even) .timeline-dot {
  left: -7px;
}

/* Content */
.timeline-date {
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.timeline-role {
  font-size: 0.95rem;
  color: var(--text-color);
  font-weight: 500;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.timeline-entry.highlight .timeline-dot {
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
}

.timeline-entry.highlight .timeline-title {
  color: var(--accent-color);
}

/* --- Project Cards --- */
.projects-list {
  display: grid;
  gap: 40px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  transition: transform 0.2s;
}

@media(min-width: 768px) {
  .project-card {
    grid-template-columns: 300px 1fr;
  }
}

.project-image {
  background: #eee;
  height: 200px;
  width: 100%;
}

@media(min-width: 768px) {
  .project-image {
    height: auto;
  }
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
}

.project-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.project-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.project-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  background: var(--border-color);
  padding: 3px 8px;
  border-radius: 4px;
  height: fit-content;
}

.project-desc {
  margin-bottom: 15px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag-chip {
  font-size: 0.75rem;
  background: var(--accent-light);
  color: var(--accent-color);
  padding: 3px 8px;
  border-radius: 5px;
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Filter Message */
.filter-message {
  margin-bottom: 20px;
  color: var(--accent-color);
  font-weight: 500;
  display: none;
}

.filter-message.visible {
  display: block;
}

.clear-filter-btn {
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  color: var(--text-color);
  margin-left: 10px;
  font-size: 0.85rem;
}

/* --- Footer --- */
footer {
  padding: 40px 0;
  text-align: center;
  color: var(--text-secondary);
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-socials a svg {
  width: 24px;
  height: 24px;
}

/* --- Modals --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
}

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

/* Mobile Timeline Adjustments */
@media(max-width: 768px) {
  .timeline-vertical::before {
    left: 20px;
  }

  .timeline-entry {
    width: 100%;
    padding-left: 50px;
    padding-right: 10px;
    text-align: left !important;
  }

  .timeline-entry:nth-child(even) {
    left: 0;
  }

  .timeline-entry:nth-child(odd) .timeline-dot,
  .timeline-entry:nth-child(even) .timeline-dot {
    left: 13px;
    right: auto;
  }

  .header-container {
    padding: 0 15px;
  }

  .nav-links {
    display: none;
  }

  /* Hide text nav on mobile, emphasize icons */
}

/* Utility */
.hidden {
  display: none !important;
}/* ... Previous CSS ... */

/* --- Category Filters --- */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    position: sticky;
    top: calc(var(--nav-height) + 20px);
    z-index: 900;
    padding: 10px 0;
    background: linear-gradient(180deg, var(--bg-color) 80%, transparent);
}

.cat-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cat-btn:hover,
.cat-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* --- Certificate Timeline Specifics --- */
.cert-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-ongoing {
    background: #fef9c3;
    color: #854d0e;
    animation: pulse 2s infinite;
}

.status-future {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px dashed #9ca3af;
}

.timeline-entry.future .timeline-dot {
    background: transparent;
    border-style: dashed;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* Dark mode adjustments for badges */
[data-theme="dark"] .status-completed {
    background: #052e16;
    color: #4ade80;
}

[data-theme="dark"] .status-ongoing {
    background: #422006;
    color: #fde047;
}

[data-theme="dark"] .status-future {
    background: #1f2937;
    color: #d1d5db;
    border-color: #4b5563;
}
/* ... Previous CSS ... */

/* Profile Photo */
.hero-photo {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.hero-photo img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card-bg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

@media(min-width: 768px) {
    .hero-photo {
        margin-top: 0;
        margin-left: 40px;
    }

    .hero-content {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: left;
    }

    .hero-text {
        flex: 1;
    }
}
/* ... Previous CSS ... */

/* --- Image Fitting Fixes --- */
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures image covers area without distortion */
    object-position: center;
}

.cert-image {
    width: 100%;
    height: 200px;
    /* Fixed height for consistency */
    object-fit: contain;
    /* Certificates often have text, contain is better to show full cert */
    background-color: var(--card-bg);
    /* Background if aspect ratio doesn't match */
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.hero-photo img {
    object-fit: cover;
}

/* Specific fix for project cards to ensure image container has height */
.project-image {
    min-height: 200px;
    overflow: hidden;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .cert-image {
        height: auto;
        min-height: 150px;
    }
}
/* ... Previous CSS ... */

/* --- Image Fitting Fixes V2 (No Zoom/Crops) --- */

/* For Project Images: Show full image, don't crop */
.project-image {
    height: auto;
    /* Let height adjust to image */
    max-height: 300px;
    /* Cap it so it doesn't dominate */
    background: #f8f9fa;
    /* Light background for padding areas */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Ensure full image is visible */
}

/* For Certificates: Already set to contain, but reinforcing */
.cert-image {
    object-fit: contain;
    background-color: transparent;
}

/* Profile Photo: Keep as cover for circular crop */
.hero-photo img {
    object-fit: cover;
}
