/* ============ VARIABLES ============ */
:root {
  --primary: #6d28d9;
  --primary-light: #8b5cf6;
  --primary-soft: #ede9fe;
  --dark: #14101f;
  --dark-2: #1e1730;
  --heading: #1e1730;
  --text: #5b5570;
  --text-light: #8b86a0;
  --bg: #faf9fd;
  --bg-alt: #f5f2fc;
  --card: #ffffff;
  --card-hover-border: #ddd0ff;
  --header-bg: rgba(255, 255, 255, 0.85);
  --border: #e9e5f5;
  --gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 55%, #c084fc 100%);
  --shadow-sm: 0 4px 16px rgba(109, 40, 217, 0.08);
  --shadow-md: 0 12px 40px rgba(109, 40, 217, 0.12);
  --radius: 16px;
  --font-heading: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
}

[data-theme="dark"] {
  --primary: #a78bfa;
  --primary-light: #c4b5fd;
  --primary-soft: #2b2145;
  --heading: #f3f0fa;
  --text: #a9a3bd;
  --text-light: #857fa0;
  --bg: #0e0b16;
  --bg-alt: #14101f;
  --card: #1a1527;
  --card-hover-border: #4c3a80;
  --header-bg: rgba(20, 16, 31, 0.85);
  --border: #2a2340;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { width: min(1140px, 92%); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-heading); color: var(--heading); line-height: 1.25; }

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.text-gradient-light {
  background: linear-gradient(135deg, #c4b5fd, #e9d5ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============ PRELOADER ============ */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: grid; place-content: center; justify-items: center; gap: 22px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; }
.preloader-mark {
  width: 66px; height: 66px; border-radius: 20px;
  background: var(--gradient); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem;
  animation: markPop 1.4s ease-in-out infinite;
}
@keyframes markPop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.preloader-bar { width: 130px; height: 3px; border-radius: 99px; background: var(--border); overflow: hidden; }
.preloader-bar span { display: block; width: 40%; height: 100%; border-radius: 99px; background: var(--gradient); animation: barSlide 1.1s ease-in-out infinite; }
@keyframes barSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }

/* ============ REVEAL ============ */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.36s; }

/* ============ BOUTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; font-family: var(--font-body);
  border: none; cursor: pointer; transition: all 0.3s ease;
}
.btn i { transition: transform 0.3s ease; }
.btn:hover i { transform: translateX(4px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(124, 58, 237, 0.45); }
.btn-outline { background: transparent; color: var(--heading); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-3px); }
.btn-light { background: #fff; color: #6d28d9; }
.btn-light:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25); }

/* ============ HEADER ============ */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 18px 0; transition: all 0.3s ease; }
.header.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm); padding: 12px 0;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 700; color: var(--heading); }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--gradient); color: #fff;
  display: grid; place-items: center; font-size: 0.9rem; font-weight: 800;
}
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 8px 13px; border-radius: 999px; font-size: 0.9rem; font-weight: 500; color: var(--text); transition: all 0.25s ease; }
.nav-link:hover { color: var(--primary); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.nav-cta { background: var(--dark); color: #fff !important; margin-left: 8px; padding: 10px 20px; }
[data-theme="dark"] .nav-cta { background: var(--gradient); }
.nav-cta:hover { background: var(--primary); }
[data-theme="dark"] .nav-cta:hover { opacity: 0.88; }

.nav-right { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  border: none; cursor: pointer; font-size: 0.95rem;
  display: grid; place-items: center; transition: all 0.3s ease;
}
.theme-toggle:hover { transform: rotate(-18deg) scale(1.08); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { width: 26px; height: 2.5px; background: var(--heading); border-radius: 2px; transition: all 0.3s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.nav-overlay {
  position: fixed; inset: 0; z-index: 98;
  background: rgba(20, 16, 31, 0.45); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: all 0.35s ease;
}
.nav-overlay.show { opacity: 1; visibility: visible; }

/* ============ HERO ============ */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 130px 0 80px; overflow: hidden; }
.hero-bg-shape { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; pointer-events: none; }
[data-theme="dark"] .hero-bg-shape { opacity: 0.22; }
.shape-1 { width: 480px; height: 480px; background: #ddd0ff; top: -120px; right: -100px; }
.shape-2 { width: 360px; height: 360px; background: #f3e8ff; bottom: -80px; left: -120px; }
[data-theme="dark"] .shape-1 { background: #7c3aed; }
[data-theme="dark"] .shape-2 { background: #a855f7; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; position: relative; }

.hero-title { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 800; margin-bottom: 14px; }
.hero-role { font-family: var(--font-heading); font-size: clamp(1.05rem, 2.3vw, 1.45rem); font-weight: 600; color: var(--heading); margin-bottom: 18px; min-height: 1.6em; }
.typed { color: var(--primary); }
.cursor { color: var(--primary); animation: blink 0.9s infinite; font-weight: 400; }
@keyframes blink { 50% { opacity: 0; } }
.hero-desc { max-width: 490px; margin-bottom: 32px; font-size: 1.02rem; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-socials { display: flex; align-items: center; gap: 14px; }
.socials-label { font-size: 0.85rem; color: var(--text-light); }
.socials-line { width: 40px; height: 1.5px; background: var(--border); }
.hero-socials a {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 1.5px solid var(--border);
  color: var(--text); font-size: 1rem; transition: all 0.3s ease;
}
.hero-socials a:hover { background: var(--gradient); color: #fff; border-color: transparent; transform: translateY(-4px); }

.hero-visual { display: flex; justify-content: center; }
.portrait-blob { position: relative; width: min(370px, 100%); aspect-ratio: 1; display: grid; place-items: center; }
.portrait-blob::before {
  content: ''; position: absolute; inset: 0;
  background: var(--gradient);
  border-radius: 58% 42% 44% 56% / 52% 48% 52% 48%;
  animation: morph 9s ease-in-out infinite;
}
@keyframes morph {
  0%,100% { border-radius: 58% 42% 44% 56% / 52% 48% 52% 48%; }
  50% { border-radius: 44% 56% 58% 42% / 46% 54% 46% 54%; }
}
.portrait-img {
  position: relative; z-index: 1;
  width: 74%; height: auto; aspect-ratio: 1;
  object-fit: cover; object-position: center 18%;
  border-radius: 50%;
  border: 7px solid var(--card);
  box-shadow: 0 18px 44px rgba(20, 16, 31, 0.22);
}

.float-card {
  position: absolute; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  background: var(--card); padding: 12px 18px; border-radius: 14px;
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
  animation: floaty 4s ease-in-out infinite;
}
.float-card i { color: var(--primary); font-size: 1.2rem; }
.float-card strong { display: block; font-family: var(--font-heading); font-size: 0.92rem; color: var(--heading); line-height: 1.2; }
.float-card span { font-size: 0.75rem; color: var(--text-light); }
.card-exp { top: 6%; left: -6%; }
.card-proj { bottom: 8%; right: -8%; animation-delay: 2s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--text-light); font-size: 1.1rem;
  animation: floaty 2.5s ease-in-out infinite;
}

/* ============ STATS ============ */
.stats { background: var(--dark); padding: 38px 0; }
[data-theme="dark"] .stats { background: #191327; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat-num, .stat-suffix { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 700; color: #fff; }
.stat-suffix { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.05rem; margin-left: 4px; }
.stat p { color: #9d97b5; font-size: 0.82rem; margin-top: 2px; }

/* ============ SECTIONS ============ */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; margin-bottom: 44px; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }

/* ============ À PROPOS ============ */
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 64px; align-items: center; }
.about-visual { position: relative; }
.about-img {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: center 15%;
  border-radius: 24px; border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.about-badge {
  position: absolute; bottom: -22px; right: -18px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 16px 22px; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 12px;
}
.about-badge strong { font-family: var(--font-heading); font-size: 2rem; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.about-badge span { font-size: 0.78rem; color: var(--text-light); line-height: 1.4; }
.about-content h3 { font-size: 1.45rem; margin-bottom: 18px; }
.about-content > p { margin-bottom: 16px; }
.about-content > p strong { color: var(--heading); font-weight: 600; }
.about-content .btn { margin-top: 12px; }

/* ============ SERVICES ============ */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card {
  background: var(--card); border-radius: var(--radius); padding: 32px 26px;
  border: 1.5px solid var(--border); transition: all 0.35s ease;
}
.service-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); border-color: var(--card-hover-border); }
.service-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 1.35rem;
  margin-bottom: 20px; transition: all 0.35s ease;
}
.service-card:hover .service-icon { background: var(--gradient); color: #fff; }
.service-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.service-card p { font-size: 0.9rem; }

/* ============ PARCOURS (grille + voir plus) ============ */
.section-sub { max-width: 560px; margin: 12px auto 0; font-size: 0.92rem; color: var(--text-light); }

.xp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.xp-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px 20px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.xp-card:hover { border-color: var(--card-hover-border); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.xp-card.xp-hidden { display: none; }

.xp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.xp-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 1.05rem;
  transition: all 0.3s ease;
}
.xp-card:hover .xp-icon { background: var(--gradient); color: #fff; }
.xp-date {
  font-size: 0.73rem; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.xp-todo { background: #fef3c7; color: #b45309; }
[data-theme="dark"] .xp-todo { background: #37260a; color: #fcd34d; }

.xp-role { font-size: 1rem; font-weight: 600; line-height: 1.35; margin-bottom: 5px; }
.xp-org { font-size: 0.86rem; font-weight: 500; color: var(--primary); margin-bottom: 14px; }

.xp-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 0.83rem; font-weight: 600;
  color: var(--text-light); transition: color 0.25s ease;
}
.xp-toggle:hover { color: var(--primary); }
.xp-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.xp-toggle i { font-size: 0.7rem; transition: transform 0.35s ease; }
.xp-card.open .xp-toggle { color: var(--primary); }
.xp-card.open .xp-toggle i { transform: rotate(180deg); }

.xp-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.38s cubic-bezier(0.22, 1, 0.36, 1); }
.xp-card.open .xp-body { grid-template-rows: 1fr; }
.xp-body-inner { overflow: hidden; }
.xp-body-inner ul { display: grid; gap: 7px; padding-top: 16px; }
.xp-body-inner li { position: relative; padding-left: 18px; font-size: 0.87rem; }
.xp-body-inner li::before {
  content: ''; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--card-hover-border);
}

.xp-more { text-align: center; margin-top: 32px; }
.xp-more .btn i { transition: transform 0.35s ease; }
.xp-more .btn:hover i { transform: none; }
.xp-more .btn.open i { transform: rotate(180deg); }

/* ============ COMPÉTENCES ============ */
.skills-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: start; }
.col-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin-bottom: 18px; }
.col-title i { color: var(--primary); font-size: 1rem; }
.skills-col > .col-title:not(:first-child) { margin-top: 36px; }
.tag-cloud {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.cloud-tools { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.tag {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1.5px solid var(--border);
  color: var(--heading); font-size: 0.87rem; font-weight: 500;
  padding: 11px 16px; border-radius: 10px;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.tag::before {
  content: ''; flex-shrink: 0;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
}
.tag:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.tag-tool::before { display: none; }
.tag-tool i { color: var(--primary); font-size: 0.9rem; width: 16px; text-align: center; flex-shrink: 0; }

.lang-list { display: grid; gap: 18px; }
.lang-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.lang-head span { font-weight: 500; color: var(--heading); font-size: 0.94rem; }
.lang-head strong { font-family: var(--font-heading); color: var(--primary); font-size: 0.85rem; }
.skill-bar { height: 8px; border-radius: 999px; background: var(--primary-soft); overflow: hidden; }
.skill-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--gradient); transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1); }

/* ============ FORMATIONS ============ */
.edu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.edu-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 26px 22px;
  transition: all 0.3s ease;
}
.edu-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--card-hover-border); }
.edu-year {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
  padding: 4px 13px; border-radius: 999px; margin-bottom: 12px;
}
.edu-card h3 { font-size: 0.98rem; margin-bottom: 8px; }
.edu-school { font-size: 0.84rem; color: var(--text-light); }

/* ============ RÉFÉRENCES ============ */
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.trust-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; transition: all 0.35s ease;
}
.trust-card:hover { transform: translateY(-6px); border-color: var(--card-hover-border); box-shadow: var(--shadow-md); }

.trust-logo {
  width: 100%; height: 76px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 12px;
  padding: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.trust-logo img {
  width: auto; height: auto;
  max-width: 100%; max-height: 56px;
  object-fit: contain;
  transition: transform 0.35s ease;
}
.trust-card:hover .trust-logo img { transform: scale(1.07); }

/* Logo livré avec son propre fond plein : la tuile prend la même couleur
   (via --logo-bg), ce qui laisse l'image occuper toute la hauteur sans couture */
.trust-logo-dark {
  background: var(--logo-bg, #171b2b);
  border-color: var(--logo-bg, #171b2b);
  padding: 0;
}
.trust-logo-dark img { max-height: 74px; }

.trust-logo-icon {
  background: var(--primary-soft); border-color: transparent;
  color: var(--primary); font-size: 1.5rem;
  transition: all 0.35s ease;
}
.trust-card:hover .trust-logo-icon { background: var(--gradient); color: #fff; }

.trust-name { font-size: 0.86rem; font-weight: 500; color: var(--heading); line-height: 1.4; }

/* ============ CONTACT ============ */
.contact-section { background: var(--dark); position: relative; overflow: hidden; }
[data-theme="dark"] .contact-section { background: #191327; }
.contact-section::before {
  content: ''; position: absolute; width: 500px; height: 500px;
  background: rgba(124, 58, 237, 0.25); border-radius: 50%;
  filter: blur(120px); top: -150px; right: -150px;
}
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 60px; position: relative; }
.contact-info .section-title { color: #fff; }
.contact-info > p { color: #b3adc9; margin: 18px 0 34px; }
.contact-list { display: grid; gap: 20px; margin-bottom: 34px; }
.contact-list li { display: flex; align-items: center; gap: 16px; }
.contact-list i {
  flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.08); color: #c4b5fd;
  display: grid; place-items: center; font-size: 1.05rem;
}
.contact-list span { display: block; font-size: 0.8rem; color: #8d87a5; }
.contact-list strong { color: #fff; font-weight: 500; font-size: 0.95rem; }
.contact-list a:hover strong { color: #c4b5fd; }
.contact-socials { display: flex; gap: 12px; }
.contact-socials a {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08); color: #d6d0e8;
  transition: all 0.3s ease;
}
.contact-socials a:hover { background: var(--gradient); color: #fff; transform: translateY(-4px); }

.contact-form {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px; padding: 36px;
  display: grid; gap: 16px; align-content: start;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 15px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px; color: #fff;
  font-family: var(--font-body); font-size: 0.93rem;
  transition: border-color 0.3s ease; resize: vertical;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: #8d87a5; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: #a78bfa; }
.contact-form input.invalid, .contact-form textarea.invalid { border-color: #f87171; }
/* Piege a robots : invisible et hors du flux, jamais atteint par un humain */
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.contact-form .btn { justify-content: center; }
.contact-form .btn:disabled { opacity: 0.6; cursor: wait; }
.form-status { font-size: 0.88rem; color: #86efac; text-align: center; min-height: 1.2em; margin: 0; }
.form-status.error { color: #fca5a5; }

/* ============ FOOTER ============ */
.footer { background: var(--dark-2); padding: 20px; }
[data-theme="dark"] .footer { background: #120e1d; }
.footer-line {
  text-align: center; color: #8d87a5;
  font-size: 0.83rem; line-height: 1.8; margin: 0;
}
.footer-line a { color: #c4b5fd; font-weight: 500; transition: color 0.3s ease; }
.footer-line a:hover { color: #fff; text-decoration: underline; }

/* ============ BACK TO TOP ============ */
.back-top {
  position: fixed; bottom: 26px; right: 26px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gradient); color: #fff; border: none;
  font-size: 1rem; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { transform: translateY(-4px); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .nav-link { padding: 8px 10px; font-size: 0.85rem; }
}

@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 60px; }
  .hero-content { display: flex; flex-direction: column; align-items: center; }
  .hero-actions, .hero-socials { justify-content: center; }
  .card-exp { left: 0; }
  .card-proj { right: 0; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 56px; }
  .about-visual { max-width: 380px; margin-inline: auto; }
  .skills-layout { grid-template-columns: 1fr; gap: 40px; }
  .edu-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 950px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; top: 0; right: -100%;
    width: min(320px, 82vw); height: 100vh;
    background: var(--card); box-shadow: -12px 0 40px rgba(20, 16, 31, 0.2);
    flex-direction: column; align-items: flex-start;
    padding: 96px 32px 32px; gap: 6px;
    transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 99; overflow-y: auto;
  }
  .nav-menu.open { right: 0; }
  .nav-menu li { width: 100%; }
  .nav-link { display: block; padding: 13px 16px; font-size: 1rem; }
  .nav-cta { margin: 14px 0 0; text-align: center; }
  .nav-right { position: relative; z-index: 100; }
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .section { padding: 80px 0; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .xp-grid { grid-template-columns: 1fr; gap: 16px; }
  .xp-card { padding: 20px 20px 18px; }
}

@media (max-width: 520px) {
  .services-grid, .edu-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { justify-content: center; width: 100%; }
  .float-card { padding: 9px 13px; }
  .float-card strong { font-size: 0.8rem; }
  .contact-form { padding: 26px 20px; }
  .logo-text { font-size: 0.95rem; }
  .contact-list strong { font-size: 0.88rem; }
}

/* ============ OPTIMISATIONS MOBILE ============ */
@media (max-width: 768px) {
  /* Respiration : le hero ne force plus une pleine hauteur d'écran */
  .hero { min-height: auto; padding: 104px 0 56px; }
  .hero-grid { gap: 44px; }
  .scroll-hint { display: none; }
  .section { padding: 48px 0; }
  .section-head { margin-bottom: 28px; }
  .stats { padding: 32px 0; }

  /* Cibles tactiles : 44px minimum */
  .theme-toggle { width: 44px; height: 44px; }
  .nav-toggle { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0; }
  .hero-socials a { width: 44px; height: 44px; }
  .contact-socials a { width: 46px; height: 46px; }
  .xp-toggle { min-height: 44px; padding: 12px 0 2px; }
  .contact-list a { display: inline-flex; align-items: center; min-height: 44px; }
  .nav-logo { min-height: 44px; }

  /* Compétences : une colonne franche plutôt qu'un escalier */
  .tag-cloud, .cloud-tools { grid-template-columns: 1fr; gap: 8px; }
  .tag { padding: 12px 16px; }

  /* Portrait un peu plus compact */
  .portrait-blob { width: min(300px, 82vw); }
  .float-card { padding: 10px 14px; }

  .footer { padding: 18px 20px; }
}

@media (max-width: 400px) {
  .cloud-tools { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { gap: 22px; }
  .stat-num, .stat-suffix { font-size: 1.55rem; }
  .stat-suffix { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
