/* Reset and base styles */
* {
  box-sizing: border-box;
}

*:focus {
  outline: none;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 calc(var(--grid) * 3);
}

/* Floating Navigation */
.floating-nav {
  position: sticky;
  top: calc(var(--grid) * 3);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: calc(var(--grid) * 3) auto 0;
  max-width: 900px;
  padding: 0 calc(var(--grid) * 3);
}

.nav-container {
  position: relative;
  background: var(--white);
  border-radius: var(--r-pill);
  padding: calc(var(--grid) * 1) calc(var(--grid) * 2);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
}

.nav-labels {
  display: flex;
  align-items: center;
  gap: calc(var(--grid) * 5);
  position: relative;
  z-index: 2;
}

.nav-label {
  text-decoration: none;
  color: var(--blue);
  font-weight: var(--weight-semibold);
  font-size: 18px;
  line-height: 22px;
  padding: calc(var(--grid) * 1.75) calc(var(--grid) * 3);
  border-radius: var(--r-pill);
  transition: color var(--transition-duration) var(--transition-smooth);
  white-space: nowrap;
}

.nav-label.active {
  color: var(--white);
}

.nav-label:focus {
  outline: none;
}

.nav-pill {
  position: absolute;
  background: var(--blue);
  border-radius: var(--r-pill);
  height: calc(var(--grid) * 5.5);
  transition: transform var(--transition-duration) var(--transition-smooth),
              width var(--transition-duration) var(--transition-smooth);
  z-index: 1;
  left: 0;
  top: 50%;
  transform: translateX(0) translateY(-50%);
}

.contact-button {
  background: var(--orange);
  color: var(--white);
  text-decoration: none;
  padding: calc(var(--grid) * 2.75) calc(var(--grid) * 3.75); /* Reduced by ~2px in each dimension */
  border-radius: var(--r-pill);
  font-size: 18px;
  line-height: 22px;
  font-weight: var(--weight-semibold);
  transition: all var(--transition-duration) var(--transition-smooth);
  white-space: nowrap;
}

.contact-button:focus {
  outline: none;
}

.contact-button.contact-active {
  background: var(--white);
  color: var(--orange);
  border: 2px solid var(--orange);
}

/* Header */
.header {
  padding: calc(var(--grid) * 10) 0 calc(var(--grid) * 8);
  text-align: center;
}

.logo {
  width: 300px;
  height: 300px;
  margin: 0 auto calc(var(--grid) * 6);
  display: block;
}

.header-text h1 {
  font-size: 40px;
  line-height: 48px;
  margin-bottom: calc(var(--grid) * 3);
  font-weight: var(--weight-semibold);
}

.header-text p {
  font-size: 19px;
  line-height: 23px;
  color: var(--gray);
  max-width: 1000px;
  margin: 0 auto;
  white-space: nowrap;
}

/* Main sections */
.main {
  padding-bottom: 0; /* Remove bottom padding */
}

.section {
  margin-bottom: calc(var(--grid) * 12);
  scroll-margin-top: calc(var(--grid) * 15);
}

.section:last-child {
  margin-bottom: 0; /* Remove margin from last section */
}

.section:first-child {
  margin-top: calc(var(--grid) * 8);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--grid) * 6);
  margin-bottom: calc(var(--grid) * 8);
}

.separator {
  height: 2px;
  background: #767676;
  border-radius: var(--r-pill);
  flex: 1;
  max-width: 500px;
}

/* Competences Section */
.competences-grid {
  /* Masonry-style layout using multi-columns */
  column-count: 2;
  column-gap: calc(var(--grid) * 4);
  margin-bottom: calc(var(--grid) * 8);
}

.competence-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: calc(var(--grid) * 4);
  /* Make cards behave as blocks inside columns */
  display: inline-block;
  width: 100%;
  margin: 0 0 calc(var(--grid) * 4);
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
}

.competence-title {
  font-size: 20px;
  line-height: 24px;
  font-weight: var(--weight-bold);
  margin-bottom: calc(var(--grid) * 3);
  text-align: center;
}

.dev-subtitle {
  font-size: 12px;
  line-height: 15px;
  color: var(--black);
  opacity: 0.5;
  font-style: italic;
  font-weight: var(--weight-light);
  text-align: center;
  margin-top: calc(var(--grid) * -2);
  margin-bottom: calc(var(--grid) * 3);
}

.skill-item {
  position: relative;
  margin-bottom: calc(var(--grid) * 4);
}

.skill-item:last-child {
  margin-bottom: 0;
}

.skill-header {
  display: flex;
  align-items: center;
  gap: calc(var(--grid) * 2);
  margin-bottom: calc(var(--grid) * 1);
}

.skill-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.skill-name {
  font-size: 20px;
  line-height: 24px;
  font-weight: var(--weight-regular);
}

.skill-bar {
  position: relative;
  margin-bottom: calc(var(--grid) * 1);
}

.skill-track {
  height: 5px;
  background: var(--track);
  border-radius: var(--r-pill);
  width: 100%;
}

.skill-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 5px;
  border-radius: var(--r-pill);
  transition: width 1s ease-out;
  width: 0;
}

.skill-fill.is-red {
  background: var(--red);
}

.skill-fill.is-orange {
  background: var(--orange);
}

.skill-fill.is-green {
  background: var(--green);
}

.sub-skills {
  margin-top: calc(var(--grid) * 2);
  margin-left: calc(var(--grid) * 4);
}

.sub-skill {
  display: flex;
  align-items: center;
  gap: calc(var(--grid) * 2);
  margin-bottom: calc(var(--grid) * 2.5); /* Increased spacing between sub-skills */
}

.sub-skill span {
  font-size: 14px; /* Reduced for better alignment with bars */
  line-height: 18px;
  min-width: 110px; /* Further reduced to improve alignment */
  text-align: left;
  flex-shrink: 0; /* Prevent text from shrinking */
  transform: translateY(-2px); /* Shift text down by 2px to align with bars */
}

.sub-skill-bar {
  flex: 1;
  position: relative; /* For badge positioning */
}

.sub-skill-bar .skill-track {
  height: 3px;
}

.sub-skill-bar .skill-fill {
  height: 3px;
}

.skill-note {
  font-size: 16px;
  line-height: 20px;
  color: var(--black);
  font-style: italic;
  font-weight: var(--weight-light);
  margin-top: calc(var(--grid) * 1);
}

/* Badge En cours */
.badge-en-cours {
  position: static;
  display: inline-block;
  margin-top: calc(var(--grid) * 1);
}

.badge-en-cours img {
  width: auto;
  height: 18px;
}

.badge-en-cours--small img {
  height: 14px;
}

.badge-en-cours--attached {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 0);
  margin-top: 0;
}

/* Project Section */
.year-section {
  margin-bottom: calc(var(--grid) * 8);
}

.year-title {
  font-size: 40px;
  line-height: 48px;
  font-weight: var(--weight-semibold);
  text-align: left;
  margin-bottom: calc(var(--grid) * 4);
  padding-left: calc(var(--grid) * 3);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: calc(var(--grid) * 3);
  justify-items: center;
}

.project-card {
  background: var(--white);
  border-radius: calc(var(--r-lg) * 0.7); /* Reduced from --r-xl (60px) to ~28px */
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
}

/* Project Gallery Styles */
.project-gallery {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--r-lg) * 0.7); /* Match project-card radius */
}

.gallery-images {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.project-title-overlay {
  position: absolute;
  bottom: calc(var(--grid) * 4); /* Position above indicators */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  padding: calc(var(--grid) * 1) calc(var(--grid) * 2);
  border-radius: calc(var(--grid) * 2);
  font-weight: var(--weight-semibold);
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
  z-index: 2;
  backdrop-filter: blur(4px);
}

/* Gallery Indicators */
.gallery-indicators {
  position: absolute;
  bottom: calc(var(--grid) * 1);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: calc(var(--grid) * 1);
  z-index: 3;
}

.gallery-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.gallery-indicator.active {
  background: var(--white);
}

.gallery-indicator:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Hover Overlay Styles */
.project-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--grid) * 3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(2px);
}

.project-gallery:hover .project-hover-overlay {
  opacity: 1;
  visibility: visible;
}

.project-gallery:hover .gallery-images {
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.project-hover-title {
  font-size: 20px;
  font-weight: var(--weight-bold);
  line-height: 24px;
  margin: 0 0 calc(var(--grid) * 2) 0;
  color: var(--white);
}

.project-hover-description {
  font-size: 14px;
  font-weight: var(--weight-normal);
  line-height: 18px;
  margin: 0 0 calc(var(--grid) * 2) 0;
  color: rgba(255, 255, 255, 0.9);
  max-width: 90%;
}

.project-zoom-icon {
  width: 24px;
  height: 24px;
  opacity: 0.8;
  filter: brightness(0) invert(1); /* Make SVG white */
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.project-zoom-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Lightbox Styles */
.project-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: lightboxFadeIn 0.3s ease;
  --lb-info-h: 18vh; /* height of bottom info panel */
  overflow-y: auto; /* Allow scrolling to access close button */
  -webkit-overflow-scrolling: touch;
}

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  min-height: calc(100vh + var(--lb-info-h) + 160px); /* More space to ensure full visibility */
  display: flex;
  flex-direction: column; /* stack image then info */
  align-items: center;
  justify-content: center; /* Center the image in available space */
  padding: 120px 0 calc(var(--lb-info-h) + 60px); /* More top/bottom padding for better centering */
}

.lightbox-image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 90vw;
  max-height: calc(100vh - var(--lb-info-h) - 200px); /* Reduced max height to ensure full visibility */
  object-fit: contain;
  border-radius: calc(var(--grid) * 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 60px; /* More margin to ensure separation */
}

/* Navigation Arrows */
.lightbox-nav {
  position: fixed; /* Fixed position relative to viewport */
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  backdrop-filter: blur(4px);
  z-index: 1001; /* Above lightbox content */
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 40px; /* Fixed distance from left edge */
  transform: translateY(-50%) rotate(180deg); /* Point left */
}

.lightbox-next {
  right: 40px; /* Fixed distance from right edge */
  transform: translateY(-50%); /* Point right (no rotation) */
}

.lightbox-prev:hover {
  transform: translateY(-50%) rotate(180deg) scale(1.1);
}

.lightbox-next:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

/* Close Button */
.lightbox-close {
  position: fixed; /* Fixed position to always be accessible */
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.3s ease;
  backdrop-filter: blur(4px);
  z-index: 1001; /* Above lightbox content */
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Image Counter */
.lightbox-counter {
  position: absolute;
  bottom: 16px; /* on top of image area */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: calc(var(--grid) * 1) calc(var(--grid) * 2);
  border-radius: calc(var(--grid) * 2);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  backdrop-filter: blur(4px);
}

/* Bottom info panel (title + description) */
.lightbox-info {
  position: fixed; /* Fixed position at bottom of screen */
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 95vw; /* Take full available width regardless of image width */
  max-width: 1200px; /* Reasonable max width for readability */
  height: var(--lb-info-h);
  max-height: var(--lb-info-h);
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.85); /* Slightly more opaque for better readability */
  color: white;
  border-radius: calc(var(--grid) * 2) calc(var(--grid) * 2) 0 0; /* Rounded top corners only */
  padding: calc(var(--grid) * 3);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.35);
  -webkit-overflow-scrolling: touch;
  z-index: 1001; /* Above lightbox content */
}

.lightbox-info h3 {
  margin: 0 0 calc(var(--grid) * 2) 0;
  font-size: 18px;
  line-height: 22px;
  font-weight: var(--weight-bold);
}

.lightbox-info p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: rgba(255,255,255,0.9);
  white-space: pre-wrap;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }
  
  .lightbox-prev {
    left: 30px; /* Reduced distance on tablet */
  }
  
  .lightbox-next {
    right: 30px; /* Reduced distance on tablet */
  }
  
  .lightbox-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .lightbox-counter {
    bottom: 12px;
  }
  
  .project-lightbox {
    --lb-info-h: 22vh;
  }
  
  .lightbox-image {
    max-width: 95vw;
    max-height: calc(100vh - var(--lb-info-h) - 150px); /* More conservative for tablet */
    margin-bottom: 40px;
  }
}

@media (max-width: 480px) {
  .lightbox-nav {
    width: 35px;
    height: 35px;
    backdrop-filter: none;
    background: rgba(0, 0, 0, 0.6);
  }
  
  .lightbox-prev {
    left: 15px; /* Close to edge on mobile */
  }
  
  .lightbox-next {
    right: 15px; /* Close to edge on mobile */
  }
  
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    font-size: 18px;
    backdrop-filter: none;
    background: rgba(0, 0, 0, 0.6);
  }
  
  .lightbox-counter {
    bottom: 8px;
    backdrop-filter: none;
  }
  
  .project-lightbox {
    --lb-info-h: 26vh;
  }
  
  .lightbox-image {
    max-width: 95vw;
    max-height: calc(100vh - var(--lb-info-h) - 120px); /* More conservative for mobile */
    margin-bottom: 30px;
  }
}

/* Fallback for projects without images */
.project-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: calc(var(--grid) * 6);
}

.project-placeholder svg {
  width: 134px;
  height: 133px;
}

/* Parcours card container */
.parcours-content {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: calc(var(--grid) * 6);
  max-width: 1400px;
  margin: 0 auto;
}

/* Timeline Section */
.timeline {
  position: relative;
  margin-left: calc(var(--grid) * 8);
  padding-left: calc(var(--grid) * 6);
}

.timeline-line {
  position: absolute;
  left: 0; /* base position inside parcours-content padding */
  top: 0;
  bottom: 0;
  width: 3px;
  background: #D9D9D9;
  border-radius: 3px;
}

.timeline-item {
  position: relative;
  margin-bottom: calc(var(--grid) * 6);
}

/* Center dot on the vertical line (line is 3px, dot is 18px) */
.timeline-dot {
  position: absolute;
  left: -46px; /* center of the 3px line */
  top: calc(var(--grid) * 3);
  width: 18px;
  height: 18px;
  background: var(--white);
  border: 3px solid var(--blue);
  border-radius: 50%;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}

.timeline-card {
  background: var(--bg);
  border-radius: 30px;
  padding: calc(var(--grid) * 3);
  max-width: 521px;
}

.timeline-date {
  font-size: 16px;
  line-height: 20px;
  font-weight: var(--weight-semibold);
  color: var(--black);
  margin-bottom: calc(var(--grid) * 1);
}

.timeline-card h4 {
  font-size: 16px;
  line-height: 20px;
  font-weight: var(--weight-semibold);
  color: var(--black);
  margin-bottom: calc(var(--grid) * 1);
}

.timeline-location {
  font-size: 13px;
  line-height: 16px;
  color: var(--gray);
  margin-bottom: calc(var(--grid) * 2);
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--grid) * 1);
  padding: calc(var(--grid) * 1) calc(var(--grid) * 1.5);
  border-radius: 10px;
  font-size: 12px;
  line-height: 15px;
  font-weight: var(--weight-semibold);
}

.timeline-badge.mention {
  background: rgba(0, 96, 255, 0.14);
  color: var(--blue);
}

.timeline-badge.en-cours {
  background: rgba(45, 219, 118, 0.14);
  color: var(--green);
  font-weight: var(--weight-regular);
}

.badge-dot {
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
}

/* Objectif Section */
.objectif-content {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: calc(var(--grid) * 6);
  max-width: 1400px;
  margin: 0 auto;
}

.objectif-subtitle {
  font-size: 30px;
  line-height: 36px;
  font-weight: var(--weight-medium);
  margin-bottom: calc(var(--grid) * 2);
}

.objectif-description {
  font-size: 18px;
  line-height: 22px;
  color: var(--gray);
  margin-bottom: calc(var(--grid) * 4);
}

.objectif-badges {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--grid) * 2);
  margin-bottom: calc(var(--grid) * 6);
}

.objectif-badge {
  background: rgba(0, 96, 255, 0.14);
  color: var(--blue);
  padding: calc(var(--grid) * 1.5) calc(var(--grid) * 2);
  border-radius: 10px;
  font-size: 12px;
  line-height: 15px;
  font-weight: var(--weight-semibold);
  text-align: center;
}

.objectif-text {
  font-size: 18px;
  line-height: 22px;
}

.objectif-text p {
  margin-bottom: calc(var(--grid) * 3);
}

.objectif-text p:last-child {
  margin-bottom: 0;
}

/* Contact Section */
#contact .section-header {
  margin-bottom: calc(var(--grid) * 4); /* Reduce margin to bring email block up */
}

.contact-content {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: calc(var(--grid) * 6);
  max-width: 1400px; /* Same as objectif-content */
  margin: 0 auto;
}

.contact-email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--grid) * 2);
  font-size: 20px;
  line-height: 24px;
  font-weight: var(--weight-medium);
  color: var(--black);
  margin: 0; /* Remove margin to center perfectly in block */
}

.contact-email strong {
  font-weight: var(--weight-bold); /* Bold for "Email:" */
}

.contact-email .email-address {
  color: var(--blue);
  font-weight: var(--weight-semibold); /* Semi-bold for email address */
}

.copy-email-btn {
  background: var(--orange);
  border: none;
  border-radius: calc(var(--r-lg) * 0.5);
  padding: calc(var(--grid) * 1.5);
  cursor: pointer;
  color: var(--white);
  transition: all var(--transition-duration) var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.copy-email-btn:hover {
  background: #e56b00;
  transform: scale(1.05);
}

.copy-email-btn:focus {
  outline: none;
  background: #e56b00;
}

.copy-email-btn:active {
  transform: scale(0.95);
}

.contact-copyright {
  text-align: center;
  font-size: 20px;
  line-height: 24px;
  font-weight: var(--weight-medium);
  color: #767676;
  margin-top: calc(var(--grid) * 3);
  margin-bottom: 0; /* Ensure no bottom margin */
  padding-bottom: calc(var(--grid) * 2); /* Small bottom padding for visual breathing room */
}

/* Copy feedback message */
.copy-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--green);
  color: var(--white);
  padding: calc(var(--grid) * 2) calc(var(--grid) * 3);
  border-radius: var(--r-lg);
  font-size: 16px;
  line-height: 20px;
  font-weight: var(--weight-semibold);
  z-index: 1000;
  animation: copyFeedback 2s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: calc(var(--grid) * 1.5);
}

.copy-feedback .checkmark-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  filter: brightness(0) invert(1); /* Make icon white */
}

@keyframes copyFeedback {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  20%, 80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

/* Responsive Design */
@media (max-width: 1400px) {
  .competences-grid {
    column-count: 1;
  }
  
  .project-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 calc(var(--grid) * 2);
  }
  
  .floating-nav {
    /* Keep horizontal layout like PC but smaller */
    flex-direction: row;
    justify-content: center; /* Center everything first */
    align-items: center;
    gap: calc(var(--grid) * 1.25); /* Slightly reduced gap */
    padding: calc(var(--grid) * 1.25); /* Reduced padding */
    max-width: 92vw; /* Smaller to prevent cutting */
    margin: 0 auto;
    height: calc(var(--grid) * 7.5); /* Increased to accommodate larger contact button */
  }
  
  .nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-right: calc(var(--grid) * 1.25); /* Reduced space before contact button */
  }
  
  .nav-labels {
    gap: calc(var(--grid) * 0.75); /* Tighter spacing to fit better */
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
  }
  
  .nav-label {
    font-size: 11px;
    line-height: 1.2;
    padding: calc(var(--grid) * 1) calc(var(--grid) * 1.5); /* Reduced padding for smaller pill */
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: var(--r-pill);
    height: calc(var(--grid) * 4); /* Reduced height */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: calc(var(--grid) * 6); /* Reduced minimum width */
  }
  
  .nav-pill {
    display: block;
    height: calc(var(--grid) * 4); /* Match reduced label height */
    border-radius: var(--r-pill);
    top: 50%;
    transform: translateX(0) translateY(-50%);
  }
  
  .contact-button {
    font-size: 11px;
    line-height: 1.2;
    padding: calc(var(--grid) * 2) calc(var(--grid) * 2.5); /* Increased padding to match container height */
    flex-shrink: 0;
    border-radius: var(--r-pill);
    height: calc(var(--grid) * 5); /* Increased height to match container */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: calc(var(--grid) * 8);
    box-sizing: border-box; /* Ensure padding doesn't cause overflow */
  }
  
  .logo {
    width: 250px;
    height: 250px;
  }
  
  .header-text h1 {
    font-size: 32px;
    line-height: 40px;
  }
  
  .header-text p {
    font-size: 18px;
    line-height: 24px;
    white-space: normal;
  }
  
  .section-title {
    font-size: 32px;
    line-height: 40px;
  }
  
  .year-title {
    font-size: 32px;
    line-height: 40px;
    padding-left: calc(var(--grid) * 2);
  }
  
  .timeline {
    margin-left: calc(var(--grid) * 4);
    padding-left: calc(var(--grid) * 4);
  }
  
  .timeline-dot {
    left: -34px; /* Adjusted for mobile timeline positioning */
  }
  
  .objectif-badges {
    flex-direction: column;
    align-items: stretch;
  }
  
  .objectif-badge {
    text-align: left;
  }

  /* Parcours section mobile font reductions */
  .timeline-date {
    font-size: 12px;
    line-height: 16px;
  }
  
  .timeline-card h4 {
    font-size: 12px;
    line-height: 16px;
  }
  
  .timeline-location {
    font-size: 10px;
    line-height: 13px;
  }
  
  .timeline-card p {
    font-size: 12px;
    line-height: 16px;
  }
  
  .timeline-badge {
    font-size: 11px;
    line-height: 14px;
    padding: calc(var(--grid) * 0.75) calc(var(--grid) * 1.5);
  }

  /* Objectifs section mobile font reductions */
  .objectif-subtitle {
    font-size: 14px;
    line-height: 18px;
  }
  
  .objectif-description {
    font-size: 13px;
    line-height: 17px;
  }
  
  .objectif-text {
    font-size: 13px;
    line-height: 17px;
  }
  
  .objectif-badge {
    font-size: 12px;
    line-height: 16px;
    padding: calc(var(--grid) * 1) calc(var(--grid) * 2);
  }

  /* Contact section mobile font reductions */
  .contact-email {
    font-size: 14px;
    line-height: 18px;
    gap: calc(var(--grid) * 1.5);
  }
  
  .copy-email-btn {
    padding: calc(var(--grid) * 1.25);
  }
  
  .contact-copyright {
    font-size: 14px;
    line-height: 18px;
  }
  
  .copy-feedback {
    font-size: 14px;
    line-height: 18px;
    padding: calc(var(--grid) * 1.5) calc(var(--grid) * 2);
  }
  
  .copy-feedback .checkmark-icon {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .floating-nav {
    gap: calc(var(--grid) * 0.75); /* Tighter spacing for small screens */
    padding: calc(var(--grid) * 1);
    max-width: 96vw; /* Smaller to prevent cutting on very small screens */
    height: calc(var(--grid) * 6.5); /* Increased to accommodate larger contact button */
  }
  
  .nav-container {
    margin-right: calc(var(--grid) * 0.75); /* Tighter spacing */
  }
  
  .nav-labels {
    gap: calc(var(--grid) * 0.5); /* Very tight spacing */
  }
  
  .nav-label {
    font-size: 9px;
    line-height: 1.1;
    padding: calc(var(--grid) * 0.75) calc(var(--grid) * 1); /* Reduced padding for smaller pill */
    border-radius: var(--r-pill);
    height: calc(var(--grid) * 3); /* Reduced height */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: calc(var(--grid) * 5); /* Reduced minimum width */
  }
  
  .nav-pill {
    height: calc(var(--grid) * 3); /* Match reduced label height */
    border-radius: var(--r-pill);
  }
  
  .contact-button {
    font-size: 9px;
    line-height: 1.1;
    padding: calc(var(--grid) * 1.75) calc(var(--grid) * 2); /* Increased padding to match container */
    border-radius: var(--r-pill);
    height: calc(var(--grid) * 4); /* Increased height to match container proportion */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: calc(var(--grid) * 7);
    box-sizing: border-box; /* Ensure padding doesn't cause overflow */
  }
  
  .project-grid {
    grid-template-columns: 1fr;
  }
  
  .project-card {
    max-width: 100%;
  }
  
  .timeline-dot {
    left: -31px; /* Consistent mobile positioning */
  }

  /* Additional mobile font reductions for very small screens */
  /* Parcours section */
  .timeline-date {
    font-size: 10px;
    line-height: 14px;
  }
  
  .timeline-card h4 {
    font-size: 10px;
    line-height: 14px;
  }
  
  .timeline-location {
    font-size: 9px;
    line-height: 12px;
  }
  
  .timeline-card p {
    font-size: 10px;
    line-height: 14px;
  }
  
  .timeline-badge {
    font-size: 9px;
    line-height: 12px;
    padding: calc(var(--grid) * 0.5) calc(var(--grid) * 1.25);
  }

  /* Objectifs section */
  .objectif-subtitle {
    font-size: 12px;
    line-height: 16px;
  }
  
  .objectif-description {
    font-size: 11px;
    line-height: 15px;
  }
  
  .objectif-text {
    font-size: 11px;
    line-height: 15px;
  }
  
  .objectif-badge {
    font-size: 10px;
    line-height: 14px;
    padding: calc(var(--grid) * 0.75) calc(var(--grid) * 1.5);
  }

  /* Contact section */
  .contact-email {
    font-size: 10px; /* Smaller to prevent line break */
    line-height: 14px;
    gap: calc(var(--grid) * 1);
    flex-direction: row; /* Keep horizontal layout */
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap; /* Prevent wrapping */
  }
  
  .contact-email .email-address {
    white-space: nowrap; /* Prevent email from breaking */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis if still too long */
    max-width: 60vw; /* Limit email width to leave space for button */
  }
  
  .copy-email-btn {
    padding: calc(var(--grid) * 1);
  }
  
  .contact-copyright {
    font-size: 12px;
    line-height: 16px;
  }
  
  .copy-feedback {
    font-size: 12px;
    line-height: 16px;
    padding: calc(var(--grid) * 1.25) calc(var(--grid) * 1.5);
  }
  
  .copy-feedback .checkmark-icon {
    width: 14px;
    height: 14px;
  }
}

/* Animation delays for skill bars */
.skill-fill {
  animation-delay: 0.2s;
}

.sub-skill:nth-child(2) .skill-fill {
  animation-delay: 0.4s;
}

.sub-skill:nth-child(3) .skill-fill {
  animation-delay: 0.6s;
}

.sub-skill:nth-child(4) .skill-fill {
  animation-delay: 0.8s;
}

.sub-skill:nth-child(5) .skill-fill {
  animation-delay: 1s;
}

/* Attached badge below bar */
.skill-bar.with-badge {
  margin-bottom: 0; /* No extra margin for bars with badges */
}

.skill-bar .badge-en-cours--attached {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 0);
}

.badge-en-cours--small.badge-en-cours--attached {
  top: 100%;
  transform: translate(-50%, 0px);
  margin-top: 0;
}
