/* =======================================================
   GLOBAL RESET
======================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

/* ==============================================
 BACKGROUND  
 ================================================ */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition:
    background-image 0.3s ease,
    opacity 0.3s ease;
  opacity: 0.6;
  pointer-events: none;
}

/* Dark mode */
html[data-theme="dark"] body::before {
  background-image: url("/images/background-dark.jpg");
}

/* Light mode */
html[data-theme="light"] body::before {
  background-image: url("/images/background-light.jpg");
}

/* =======================================================
   ICONS
======================================================= */
.icon {
  width: 20px;
  height: 20px;
  transition: filter 0.3s ease;
  filter: grayscale(1) brightness(1.2);
}

.icon-dark {
  display: none;
}

/* Mode sombre */
html[data-theme="dark"] .icon-dark {
  display: inline-block;
}
html[data-theme="dark"] .icon-light {
  display: none;
}

/* Mode clair */
html[data-theme="light"] .icon-light {
  display: inline-block;
}
html[data-theme="light"] .icon-dark {
  display: none;
}
html[data-theme="light"] .icon-moon {
  display: none;
}

.toggle-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
}

/* Monochrome light mode switch */

html[data-theme="dark"] .icon-revert {
  filter: invert(1);
}

/* Exception */

html[data-theme="dark"] .icon-moon {
  filter: invert(1);
}

html[data-theme="light"] .icon-moon {
  display: none;
}

/* =======================================================
   THEMES
======================================================= */
html[data-theme="dark"] {
  background-color: #1b1b1b;
  color: #fff;
}

html[data-theme="light"] {
  background-color: #a0a0a0;
  color: #111;
}

/* =======================================================
   BUTTONS
======================================================= */
button,
.download-btn {
  padding: 0.9rem 1.8rem;
  border-radius: 50px;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.download-btn {
  display: block;
  margin: auto;
  width: fit-content;
  text-decoration: none;
}

button:not(.carousel-btn):hover,
.download-btn:hover {
  transform: translateY(-2px);
}

.carousel-btn {
  cursor: pointer;
}

html[data-theme="dark"] button,
html[data-theme="dark"] .download-btn {
  background: #fff;
  color: #111;
}

html[data-theme="dark"] button:hover,
html[data-theme="dark"] .download-btn:hover {
  background: #e4e4e4;
}

html[data-theme="light"] button,
html[data-theme="light"] .download-btn {
  background: #111;
  color: #fff;
}

html[data-theme="light"] button:hover,
html[data-theme="light"] .download-btn:hover {
  background: #333;
}

/* =======================================================
   NAVBAR
======================================================= */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.3);
  z-index: 1000;
  pointer-events: auto;
}

.navbar * {
  pointer-events: auto;
}

html[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.7);
}

.nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}

.nav-center {
  display: flex;
  gap: 2rem;
}

.nav-center a {
  position: relative;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  padding-bottom: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.nav-center a:hover,
.nav-center a.active {
  opacity: 1;
}

.nav-center a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: #4f8cff;
  border-radius: 2px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

@media (max-width: 768px) {
  .nav-center {
    display: none;
  }

  .navbar {
    padding: 0 1rem;
  }
}

/* =======================================================
   TOGGLE (THEME & LANG)
======================================================= */
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 22px;
  cursor: pointer;
  user-select: none;
  font-size: 0.75rem;
}

.toggle-track {
  position: relative;
  width: 44px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.3s ease;
}

html[data-theme="light"] .toggle-track {
  background: rgba(0, 0, 0, 0.2);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition:
    transform 0.25s ease,
    background 0.25s ease;
}

.toggle[data-state="dark"] .toggle-thumb,
.toggle[data-state="en"] .toggle-thumb {
  transform: translateX(22px);
}

html[data-theme="light"] .toggle-thumb {
  background: #111;
}

.toggle-label {
  width: 24px;
  text-align: center;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.toggle[data-state="light"] .left,
.toggle[data-state="fr"] .left {
  opacity: 1;
}

.toggle[data-state="dark"] .right,
.toggle[data-state="en"] .right {
  opacity: 1;
}

/* =======================================================
   HERO SECTION
======================================================= */
.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 100px 10%;
  gap: 5rem;
}

.profile-column {
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-photo img {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
}

.content-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 600px;
  text-align: left;
  gap: 2rem;
}

.hero-name {
  font-size: 4.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;

  color: #1e3a8a;

  background: linear-gradient(90deg, #1e3a8a, #00cfff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text {
  font-size: 1.35rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.buttons-block {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
    padding: 120px 5% 80px 5%;
  }

  .content-column {
    align-items: center;
    text-align: center;
  }

  .profile-photo img {
    width: 220px;
    height: 220px;
  }

  .hero-name {
    font-size: 2.5rem;
  }

  .hero-text {
    font-size: 1.05rem;
  }

  .buttons-block {
    justify-content: center;
  }
}

/* =======================================================
   SECTIONS
======================================================= */
.section {
  min-height: 100vh;
  padding: 120px 10%;
  scroll-margin-top: 80px;
  text-align: center;
}

.section h2 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 4rem;

  color: #4f8cff;

  background: linear-gradient(90deg, #4f8cff, #81d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#projects {
  min-height: 60vh;
  padding: 80px 10%;
}

html[data-theme="dark"] .hero-name,
html[data-theme="dark"] .section h2 {
  color: #1e3a8a; /* FALLBACK */
  background: linear-gradient(90deg, #4f8cff, #81d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="light"] .hero-name,
html[data-theme="light"] .section h2 {
  color: #111; /* FALLBACK */
  background: linear-gradient(90deg, #555, #111);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 768px) {
  .section {
    padding: 100px 6%;
  }

  #skills {
    padding: 100px 6%;
  }

  .section h2 {
    font-size: 2rem;
    margin-bottom: 2.5rem;
  }
}

/* ================= SKILLS ================= */
#skills {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 120px 10%;
  min-height: 60vh;
  text-align: center;
}

#skills h2 {
  margin-bottom: 4rem;
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
}

html[data-theme="light"] #skills h2 {
  color: #111;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6.5rem;
  margin-bottom: 4rem;
}

.skill-block {
  background-color: rgba(79, 140, 255, 0.1);
  color: #fff;
  font-weight: 600;
  font-size: 1.2rem;
  padding: 2rem 2.5rem;
  border-radius: 12px;
  text-align: left;
  min-width: 200px;
  max-width: 280px;
  transition:
    transform 0.25s ease,
    background 0.25s ease;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.skill-block ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.skill-block li {
  display: flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 550;
  gap: 0.5rem;
}

.skill-block:hover {
  transform: translateY(-3px);
  background-color: rgba(79, 140, 255, 0.2);
}

.download-btn {
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.25s ease;
  cursor: pointer;
  margin-top: 2rem;
}

html[data-theme="dark"] .skill-block {
  background-color: rgba(79, 140, 255, 0.1);
  color: #fff;
}

html[data-theme="dark"] .skill-block:hover {
  background-color: rgba(79, 140, 255, 0.2);
}

html[data-theme="light"] .skill-block {
  background-color: rgba(79, 140, 255, 0.15);
  color: #111;
}

html[data-theme="light"] .skill-block:hover {
  background-color: rgba(79, 140, 255, 0.25);
}

@media (max-width: 768px) {
  .skills-grid {
    flex-direction: column;
    gap: 2rem;
  }

  .skill-block {
    width: 100%;
    max-width: 100%;
  }
}

/* ================== PROJECTS ================== */

.carousel {
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 3rem auto;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}

.slide {
  min-width: 100%;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 1rem;
}

.prev {
  left: 10px;
}
.next {
  right: 10px;
}

.dots {
  text-align: center;
  margin-top: 1rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 5px;
  background: gray;
  border-radius: 50%;
  cursor: pointer;
}

.dot.active {
  background: white;
}

/* ===== OVERLAY SLIDE ===== */

.slide {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.slide-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  border-radius: 1rem;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  text-align: center;
  padding: 2rem;
  gap: 0.5rem;

  opacity: 0;
  transition: opacity 0.3s ease;
}

.slide-overlay h4 {
  font-size: 1.2rem;
  margin-top: 1rem;
}

.slide-overlay p {
  font-size: 0.9rem;
  max-width: 500px;
  line-height: 1.5;
}

.slide-btn {
  margin-top: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s ease;
  margin-bottom: 1rem;
}

html[data-theme="dark"] .slide-btn {
  background: #fff;
  color: #111;
}

html[data-theme="dark"] .slide-btn:hover {
  background: #e4e4e4;
}

html[data-theme="light"] .slide-btn {
  background: #111;
  color: #fff;
}

html[data-theme="light"] .slide-btn:hover {
  background: #333;
}

.slide:hover .slide-overlay {
  opacity: 1;
}

@media (max-width: 768px) {
  .slide-overlay {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .carousel {
    max-width: 100%;
  }

  .slide-img {
    height: 200px;
  }
}

/* ================== FOOTER ================== */
.footer {
  text-align: center;
  padding: 80px 10%;
  background: rgba(0, 0, 0, 0.1);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer p {
  margin: 1rem 0;
  line-height: 1.8;
}

html[data-theme="light"] .footer {
  color: #111;
  background: rgba(255, 255, 255, 0.1);
}

.footer-text {
  margin: 0.8rem 0;
}

.footer-link {
  color: inherit;
  text-decoration: underline;
  transition: color 0.25s ease;
}

.footer a.footer-link {
  color: inherit;
  text-decoration: underline;
}

.footer-link:hover {
  color: #4f8cff; /* accent couleur DA */
}
