:root {
  --width: 1300px;
  --color-primary: #0066ff;
  --color-bg: #f6f8fa;
  --color-text: #10192f;
  --color-card: #fff;
  --color-accent: #0066ff;
  --color-accent2: #00ffe0;
  --color-footer: #f1f2f6;
  --shadow: 0 4px 20px 0 #0066ff14;
  --radius: 16px;
  --transition: all 0.25s cubic-bezier(.44,-.2,0,1.57);
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
}
.nav-container {
  height: 85px;
  display: flex; align-items: center; justify-content: center;
  width: 100vw; z-index: 1000;
  background: transparent;
  position: fixed; top: 0; left: 0;
}
.nav {
  width: var(--width) !important;
  margin: 0 auto; padding: 0 10px;
  height: 70px; display: flex;
  align-items: center; justify-content: space-between;
  background: var(--color-card);
  border-radius: 48px; box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  z-index: 1001;
}
.nav-part { display: flex; align-items: center; }
.nav-left .user { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-left .avatar { width: 36px; height: 36px; border-radius: 50%; }
.nav-left .title { font-size: 1.2rem; font-weight: 700; color: var(--color-primary); }
.nav-center ul { display: flex; list-style: none; gap: 10px; margin: 0; }
.nav-center ul li a {
  color: var(--color-text); text-decoration: none; padding: 6px 12px;
  border-radius: 12px; font-weight: 600; font-size: 1rem; transition: var(--transition);
}
.nav-center ul li a:hover, .nav-center ul li a:focus { background: #e6f0ff; color: var(--color-primary); }
.nav-right { gap: 16px; }
.nav-right .icon { width: 28px; height: 28px; color: var(--color-primary); display: flex; align-items: center; transition: opacity .2s; }
.nav-right .icon:hover { opacity: 0.7; }

@media (max-width: 900px) {
  .nav { width: 98vw; }
  .nav-center { display: none; }
}
.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 600px;
  background: linear-gradient(120deg, var(--color-primary), #00aaff 60%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#bg-gradient {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0;
}
.hero-content {
  position: relative; z-index: 1; color: #fff;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-width: 700px; margin: 0 auto; gap: 24px;
  animation: fadeIn 1.2s cubic-bezier(.44,-.2,0,1.57);
}
.availability {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.14); padding: 5px 18px; border-radius: 24px;
  box-shadow: 0 2px 12px #0066ff0d;
}
.availability-symbol {
  width: 12px; height: 12px; background: #00ff73; /*#00ff73*/
  border-radius: 50%; box-shadow: 0 0 0 4px #00ff7311; animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{box-shadow:0 0 0 4px #00ff7311;} 50%{box-shadow:0 0 0 10px #00ff7322;} }
.hero-title { font-size: 2.4rem; font-weight: 800; margin-top: 10px; }
.hero-title span { font-weight: 500; color: #e6faff; }
.hero-desc { font-size: 1.1rem; color: #e2f6ff; }
.hero-btns { display: flex; gap: 16px; margin-top: 8px; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 40px;
  background: var(--color-card); color: var(--color-primary);
  border: none; font-weight: 700; font-size: 1rem;
  text-decoration: none; box-shadow: var(--shadow); transition: var(--transition);
}
.button.filled { background: var(--color-primary); color: #fff; }
.button:hover { background: #0057c2; color: #fff; transform: translateY(-3px) scale(1.04); }
.invite { margin-top: 28px; color: #b3f0ff; display: flex; flex-direction: column; align-items: center; opacity: 0.88; animation: fadeIn 2s; }
.invite i { margin-bottom: 4px; }
@keyframes fadeIn { from{opacity:0;transform:translateY(30px);} to{opacity:1;transform:none;} }

.section { width: 100%; max-width: var(--width); margin: 0 auto; padding: 80px 2vw 40px; }
.section-title h2 { font-size: 2.1rem; margin-bottom: 12px; font-weight: 800; color: var(--color-primary);}
.section-title p { color: #3d475e; font-size: 1.12rem; }

.section-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px,1fr)); gap: 32px; margin-top: 40px; }
.section-card {
  background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative;
  transition: var(--transition);
}
.section-card-date { position: absolute; left: 24px; top: -14px; background: var(--color-primary); color: #fff; font-size: 0.93rem; border-radius: 14px; padding: 3px 15px; font-weight: 700;}
.section-card-title h3 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.section-card-title span { color: #2273ff; font-size: 0.96rem; font-weight: 600; }
.section-card-content p { color: #444d62; font-size: 0.97rem; margin: 0; }

.projects-timeline { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; margin-top: 36px;}
.project-example {
  background: var(--color-card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; text-align: center;
  min-width: 240px; max-width: 330px; flex: 1 1 220px; display: flex; flex-direction: column; align-items: center; transition: var(--transition);
  animation: fadeIn 1s cubic-bezier(.44,-.2,0,1.57);
}
.project-example:hover { transform: translateY(-8px) scale(1.04); box-shadow: 0 8px 32px #0066ff22; }
.project-date { font-size: 0.93rem; background: #e5f1ff; color: var(--color-primary); border-radius: 16px; padding: 3px 10px; margin-bottom: 8px;}
.project-title { font-size: 1.15rem; font-weight: 700; color: var(--color-primary);}
.project-text { color: #3c445b; font-size: 0.97rem; margin-bottom: 9px;}
.project-image { width: 100%; border-radius: 8px; margin: 6px 0 0 0; object-fit: cover; box-shadow: 0 1px 10px #0066ff12; }

.skills-chips { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px;}
.chip {
  background: #e6f0ff; color: var(--color-primary); font-weight: 700;
  border-radius: 40px; padding: 8px 24px; font-size: 1rem;
  box-shadow: 0 2px 10px #0066ff0b; display: flex; align-items: center; gap: 8px;
  transition: var(--transition);
}
.chip:hover { background: var(--color-primary); color: #fff; }

.contact-content { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 18px; }
.mail-text { margin-top: 4px; color: #2273ff; font-size: 1.04rem; }

.footer { background: var(--color-footer); margin-top: 70px; padding: 40px 0;}
.footer-content { max-width: var(--width); margin: 0 auto; display: flex; justify-content: space-between; gap: 32px; align-items: center; }
.footer-info p { color: #444d62; }
.socials { display: flex; gap: 18px; margin-top: 14px;}
.social { display: flex; align-items: center; gap: 6px; color: var(--color-primary); text-decoration: none; font-weight: 700; font-size: 1.03rem; }
.social:hover { text-decoration: underline; }
.footer-copyright p { color: #3c445b; font-size: 0.96rem;}

@media (max-width: 900px) {
  .section, .footer-content { max-width: 98vw; }
  .footer-content { flex-direction: column; align-items: flex-start; gap: 14px;}
  .nav { width: 97vw;}
}
@media (max-width: 600px) {
  /* Anti overflow général */
  html, body {
    font-size: 15px;
    max-width: 100vw;
    overflow-x: hidden;
  }
  :root { --width: 100%; }

  body { padding-bottom: 80px; }

  /* NavBar */
  .nav-container {
    height: 54px;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .nav {
    height: 46px;
    border-radius: 16px;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    font-size: 0.98rem;
    padding: 0 8px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    gap: 0 !important;
    overflow-x: hidden !important;
  }
  .nav-part, .nav-left, .nav-right {
    min-width: 0 !important;
    flex-shrink: 1 !important;
  }
  .nav-left .title {
    font-size: 1rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 60vw;
  }
  .nav-left .avatar { width: 28px; height: 28px; }
  .nav-right { gap: 8px !important; }
  .nav-right .icon { width: 22px; height: 22px; }

  /* NavCenter désactivé (déjà fait plus haut) */

  /* Hero section */
  .hero {
    min-height: 420px;
    height: auto;
    padding: 32px 0 0 0;
    flex-direction: column;
  }
  .hero-content {
    max-width: 99vw;
    gap: 14px;
    padding: 0 2vw;
  }
  .hero-title { font-size: 1.45rem; }
  .hero-desc { font-size: 1.02rem; }
  .hero-btns { flex-direction: column; gap: 8px; width: 100%; align-items: stretch; }
  .button, .button.filled { width: 100%; min-width: 0; justify-content: center; padding: 10px 0; font-size: 1rem; }

  /* Section */
  .section { padding: 34px 2vw 24px 2vw; }

  /* Cartes */
  .section-cards { grid-template-columns: 1fr; gap: 14px; }
  .section-card { padding: 14px; }
  .section-card-date { left: 14px; top: -12px; font-size: 0.83rem; padding: 2px 10px; }

  /* Timeline projets */
  .projects-timeline { flex-direction: column; gap: 12px; }
  .project-example { min-width: 0; max-width: 99vw; padding: 12px; }
  .project-title { font-size: 1rem; }
  .project-date { font-size: 0.85rem; padding: 2px 8px; }
  .project-image { border-radius: 6px; margin-top: 5px; }

  /* Skills */
  .skills-chips { gap: 8px; margin-top: 18px; }
  .chip { padding: 7px 12px; font-size: 0.97rem; }

  /* Contact */
  .contact-content { gap: 10px; }
  .mail-text { font-size: 1rem; }

  /* Footer */
  .footer { padding: 20px 0; }
  .footer-content { flex-direction: column; gap: 10px; align-items: flex-start; padding: 0 2vw;}
  .footer-info p, .footer-copyright p { font-size: 0.93rem; }
  .socials { gap: 10px; }

  /* Pour éviter l’overflow horizontal partout */
  * { box-sizing: border-box; }
}

.section-card-title.with-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-card-title .company-logo {
  height: 40px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
}




#scrollTopBtn {
  position: fixed;
  bottom: 38px;
  right: 38px;
  z-index: 999;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 12px #0066ff26;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  transform: translateY(32px);
}
#scrollTopBtn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#scrollTopBtn:focus {
  outline: 3px solid #00ffe0;
}

/* MODE SOMBRE TOTALEMENT CORRIGÉ */
body.dark {
  --color-bg: #161c24;
  --color-card: #192a32;
  --color-text: #f4f5fa;
  --color-primary: #5db2ff;
  --color-footer: #141a22;
  --shadow: 0 4px 24px 0 #222c4c66;
}

/* Fond et textes principaux */
body.dark .section-card, 
body.dark .project-example, 
body.dark .chip, 
body.dark .nav, 
body.dark .footer {
  background: var(--color-card) !important;
  color: var(--color-text) !important;
}

/* Titres principaux */
body.dark .section-title h2,
body.dark .project-title,
body.dark .section-card-title h3,
body.dark .skills-group h3 {
  color: #fff !important;
}

/* Sous-titres (établissements, chips, sous-sections) */
body.dark .section-card-title span,
body.dark .section-card-date,
body.dark .mail-text,
body.dark .chip {
  color: #79c1ff !important;
}

/* Descriptions et petits textes */
body.dark .section-card-content p,
body.dark .project-text,
body.dark .skills-note,
body.dark .about-content p,
body.dark .footer-info p,
body.dark .project-date {
  color: #b7d2fa !important;
}

/* Correction cards/hover */
body.dark .section-card-date {
  background: #3194ff !important;
  color: #fff !important;
}
body.dark .chip {
  background: #22344e !important;
  color: #5db2ff !important;
}
body.dark .project-example {
  background: #22344e !important; /* plus lumineux, + différenciation */
  box-shadow: 0 8px 32px #0e203833 !important;
}

body.dark .project-title {
  color: #fff !important;
  font-weight: 800 !important;
}

body.dark .project-date {
  background: #386fff !important;
  color: #eaf6ff !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 6px #00193344;
}

body.dark .project-text {
  color: #bdd8fa !important;
  font-size: 1.05rem;
  font-weight: 500;
}

body.dark .project-image {
  background: #18263c !important;
  border-radius: 8px;
  box-shadow: 0 2px 16px #00193333;
  padding: 2px;
}

body.dark .section-title h2,
body.dark .project-title {
  color: #fff !important;
}

/* OPTIONNEL : Séparateur sous le titre principal */
body.dark .section-title h2 {
  border-bottom: none;
  padding-bottom: 3px;
  margin-bottom: 8px;
}

body.dark .section-title p {
  color: #9ab2d6 !important; /* Bleu clair doux, bien lisible sur fond sombre */
  font-weight: 500;
}

/* Scroll top bouton en dark */
body.dark #scrollTopBtn {
  background: var(--color-primary);
  color: #fff;
}

/* Bouton thème navbar : flat et harmonieux */
#theme-toggle {
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  color: var(--color-primary);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  margin-left: 8px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
#theme-toggle:hover, #theme-toggle:focus {
  background: #e6f0ff;
  color: var(--color-primary);
}
body.dark #theme-toggle:hover, body.dark #theme-toggle:focus {
  background: #223f68;
  color: var(--color-primary);
}

body.dark .footer-copyright p {
  color: #eaf6ff !important;
}

.project-text a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s;
}

.project-text a:hover {
  text-decoration: underline;
}

/* Amélioration du rendu en mode sombre */
body.dark .project-text a {
  color: #78baff; /* bleu clair lisible */
}

body.dark .project-text a:hover {
  color: #a7d3ff;
}

.footer-info a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-info a:hover {
  text-decoration: underline;
}

body.dark .footer-info a {
  color: #78baff;
}
