/* ===== Thème ===== */
:root {
  --bg: #0b0b10;
  --panel: #10131a;
  --text: #e6e6f0;
  --muted: #a6adbb;
  --brand: #7c5cff;
  --brand-2: #00e0b8;
  --accent: #ffcc70;
  --ring: rgba(124,92,255,.35);
  --shadow: 0 10px 30px hsl(240 20% 5% / .35);
  --radius: 16px;
}
.light {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #0b0b10;
  --muted: #4b5565;
  --brand: #6b4bff;
  --brand-2: #00bda1;
  --accent: #ff8a00;
  --ring: rgba(107,75,255,.25);
  --shadow: 0 10px 30px hsl(240 20% 50% / .15);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(158, 67, 201, 0.15), transparent 60%), radial-gradient(900px 450px at 100% 10%, rgba(0,224,184,.1), transparent 60%), var(--bg);
  line-height: 1.6;
  letter-spacing: .2px;
  overflow-x: hidden;
}

body {
  background: radial-gradient(ellipse at top left, rgba(124,92,255,0.25), transparent 60%),
              radial-gradient(ellipse at bottom right, rgba(0,224,184,0.25), transparent 60%),
              #050510; /* fond de base très sombre */
  background-attachment: fixed;
  background-size: cover;
  overflow-x: hidden;
  position: relative;
}

/* Petits points lumineux façon étoiles */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(2px 2px at 20px 30px, white 50%, transparent),
                    radial-gradient(2px 2px at 200px 100px, white 50%, transparent),
                    radial-gradient(1px 1px at 400px 50px, white 50%, transparent),
                    radial-gradient(1px 1px at 600px 300px, white 50%, transparent),
                    radial-gradient(2px 2px at 800px 200px, white 50%, transparent),
                    radial-gradient(1px 1px at 1000px 400px, white 50%, transparent),
                    radial-gradient(1px 1px at 1200px 150px, white 50%, transparent);
  background-repeat: repeat;
  animation: moveStars 200s linear infinite;
  opacity: 0.4;
  z-index: -1;
}

/* Animation très lente du ciel étoilé */
@keyframes moveStars {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 10000px 5000px, 8000px 3000px, 6000px 4000px, 12000px 8000px, 9000px 6000px, 11000px 2000px, 10000px 10000px; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ====== Layout ====== */
.container { width: min(1120px, 92vw); margin: 0 auto; }
header.site-header {
  position: sticky; top: 0; z-index: 99;
  backdrop-filter: saturate(130%) blur(8px);
  background: linear-gradient(180deg, rgba(11,11,16,.8), rgba(11,11,16,.55));
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: .75rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); }
nav ul { list-style: none; display: flex; gap: 1rem; padding: 0; margin: 0; }
nav a { padding: .55rem .8rem; border-radius: 10px; color: var(--muted); font-weight: 600; }
nav a:hover, nav a.active { background: rgba(124,92,255,.12); color: var(--text); }

.btn, button.btn { display: inline-flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); color: var(--text); font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 16px 40px hsl(260 90% 60% / .25); }

.toggle { display: inline-flex; border-radius: 999px; padding: .3rem; border: 1px solid rgba(255,255,255,.1); }
.toggle button { padding: .45rem .8rem; border-radius: 999px; background: transparent; border: 0; color: var(--muted); font-weight: 700; cursor: pointer; }
.toggle button.active { background: rgba(124,92,255,.15); color: var(--text); }

/* ====== Hero ====== */
.hero { position: relative; padding: 8rem 0 6rem; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; }
.kicker { color: var(--brand-2); font-weight: 800; letter-spacing: .28em; text-transform: uppercase; font-size: .8rem; }
h1.display { font-size: clamp(2.5rem, 4vw + 1rem, 4.2rem); line-height: 1.04; margin: .4rem 0 1rem; }
.highlight { background: linear-gradient(90deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1rem, .6vw + .9rem, 1.2rem); color: var(--muted); max-width: 52ch; }
.cta-row { margin-top: 1.5rem; display: flex; gap: .8rem; flex-wrap: wrap; }

.hero-card { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); background: radial-gradient(120% 120% at 80% 10%, rgba(124,92,255,.35), transparent 40%), linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.08); overflow: hidden; box-shadow: var(--shadow); }
    .orb { position: absolute; border-radius: 50%; filter: blur(30px); opacity: .7; }
    .orb.one { width: 240px; height: 240px; left: -40px; top: -40px; background: radial-gradient(circle at 30% 30%, #9cf, transparent 60%), var(--brand); }
    .orb.two { width: 200px; height: 200px; right: -30px; bottom: -30px; background: radial-gradient(circle at 50% 50%, #fea, transparent 60%), var(--accent); }
    .grid-float { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 24px 24px; mask-image: radial-gradient(80% 70% at 50% 50%, #000 60%, transparent 80%); }
    .hero-stat { position: absolute; right: 14px; bottom: 14px; padding: .7rem .9rem; border-radius: 12px; backdrop-filter: blur(8px); background: rgba(16,19,26,.6); border: 1px solid rgba(255,255,255,.08); font-weight: 700; }

/* ====== Sections ====== */
section { padding: 5rem 0; position: relative; }
section .section-title { font-size: clamp(1.6rem, .8vw + 1rem, 2.2rem); margin: 0 0 1rem; }
.section-desc { color: var(--muted); margin-bottom: 2rem; }

/* ====== Filtres projets ====== */
.projects-filter { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filter-btn {
  padding: .5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  transition: all .3s ease;
}
.filter-btn:hover { background: rgba(124,92,255,.2); color: var(--text); }
.filter-btn.active { background: var(--brand); color: #fff; }

/* ====== About ====== */
.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: 2rem; }
.about .card { border: 1px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.stack { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.chip { padding: .45rem .7rem; border-radius: 999px; font-weight: 700; background: rgba(124,92,255,.15); border: 1px solid rgba(255,255,255,.08); }
#apropos .grid-2 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* espace vertical entre les deux cartes */
}

/* ====== Logiciels ====== */
.logiciels-section { padding: 6rem 0; text-align: center; overflow: hidden; }
.logiciels-section .section-desc { color: var(--muted); margin-bottom: 2rem; }
.logiciels-carousel { overflow: hidden; cursor: grab; user-select: none; }
.logiciels-carousel:active { cursor: grabbing; }
.carousel-track { display: flex; gap: 2rem; will-change: transform; }
.logo-card {
  flex: 0 0 180px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.2rem;
  text-align: center;
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}
.logo-card:hover { transform: scale(1.05); }
.logo-card img {
  height: 55px;
  margin-top: .8rem;
  filter: grayscale(20%);
  transition: filter .3s ease;
}
.logo-card:hover img { filter: grayscale(0); }
.logo-card span { display: block; color: var(--muted); font-size: .9rem; margin-top: .5rem; }

/* === CERCLE DE PROGRESSION FIXÉ === */
.circle {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.circle svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  overflow: visible;
}

.circle circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}

.circle circle:first-child {
  stroke: rgba(255, 255, 255, 0.1);
}

.circle .progress {
  stroke: var(--brand);
  transition: stroke-dashoffset 1s ease-out;
}

.circle .percent {
  position: absolute;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  text-align: center;
}

/* Responsive : ne compresse jamais le SVG */



/* ====== Projects ====== */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.project { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255,255,255,.08); background: var(--panel); box-shadow: var(--shadow); transform-style: preserve-3d; }
.project .thumb {
  position: relative;
  aspect-ratio: 16/10;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: .08em;
  color: #fff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  overflow: hidden;
}
.project .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.05));
  z-index: 1;
}
.project .thumb span,
.project .thumb { position: relative; z-index: 2; }
.project .p-body { padding: 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { font-size: .78rem; padding: .3rem .55rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); color: var(--muted); }

/* ====== Timeline ====== */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: .4rem; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--brand), transparent); }
.t-item { position: relative; margin-bottom: 1.2rem; border: 1px solid rgba(255,255,255,.08); background: var(--panel); padding: .9rem 1rem; border-radius: 14px; }
.t-item::before { content: ""; position: absolute; left: -1rem; top: .9rem; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(124,92,255,.25); }

/* ====== Contact ====== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .35rem; }
input, textarea { width: 100%; padding: .9rem 1rem; border-radius: 12px; background: var(--panel); border: 1px solid rgba(255,255,255,.08); color: var(--text); font: inherit; }
textarea { min-height: 140px; resize: vertical; }

footer { padding: 2.2rem 0 3rem; color: var(--muted); text-align: center; border-top: 1px solid rgba(255,255,255,.06); }

/* ====== Responsive ====== */
@media (max-width: 960px) {
  .split, .about { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  /* On ne cache plus le menu car il est géré par le menu latéral */
  .projects-grid { grid-template-columns: 1fr; }
}


/* ====== Form ====== */
.contact-form {
  width: min(600px, 90vw);
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.form-group { display: flex; flex-direction: column; text-align: left; }
.form-group label { font-weight: 600; margin-bottom: .3rem; }
.form-group input, .form-group textarea {
  border: 1px solid rgba(255,255,255,0.15);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: .8rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color .3s ease;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--brand); }
button.btn {
  width: fit-content;
  align-self: flex-end;
  background: var(--brand);
  border: none;
  padding: .8rem 1.6rem;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background .3s ease;
}
button.btn:hover { background: var(--brand-2); }

/* ===== Scroll Down CTA ===== */
.scroll-down-cta {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
  font-size: .9rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  animation: fadeIn 1.6s ease-out 1s forwards;
  opacity: 0;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--muted);
  border-radius: 14px;
  margin-top: 0.5rem;
  position: relative;
}
.mouse .wheel {
  width: 4px;
  height: 6px;
  background: var(--muted);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: wheelMove 1.6s ease-in-out infinite;
}

@keyframes wheelMove {
  0% { opacity: 0; transform: translate(-50%, 0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 10px); }
}
@media (max-width: 1024px) {
  .scroll-down-cta {
    display: none !important;
  }
}
.hero-planet {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  filter: drop-shadow(0 0 40px rgba(124,92,255,0.5));
}
model-viewer {
  border-radius: 50%;
  overflow: hidden;
}

/* ====== Loader Stylé ====== */
#loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #060510 10%, #0b0b10 100%);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loader.hide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 1s ease;
}

/* Nébuleuse dynamique */
.nebula {
  position: absolute;
  width: 200%;
  height: 200%;
  background: radial-gradient(600px at 40% 50%, rgba(124,92,255,0.3), transparent 70%),
              radial-gradient(400px at 60% 40%, rgba(0,224,184,0.25), transparent 80%),
              radial-gradient(500px at 70% 70%, rgba(255,204,112,0.15), transparent 80%);
  animation: rotateNebula 30s linear infinite;
  filter: blur(60px);
  transform-origin: center;
  opacity: 0.9;
}

@keyframes rotateNebula {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Contenu central */
.loader-center {
  position: relative;
  text-align: center;
  color: #fff;
  z-index: 10;
}

.loader-ring {
  width: 90px;
  height: 90px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top: 3px solid var(--brand);
  border-right: 3px solid var(--accent);
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  filter: drop-shadow(0 0 12px var(--brand));
}

.loader-text {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-size: 1rem;
  opacity: 0.8;
}


@media (max-width: 960px) {
  .hero-planet {
    display: none !important;
  }
}



/* ===== Menu Mobile gauche ===== */
.menu-btn {
  display: none;
  position: relative;
  width: 32px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
}
.menu-btn span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--text);
  border-radius: 3px;
  transition: all .35s ease;
}
.menu-btn span:nth-child(1) { top: 0; }
.menu-btn span:nth-child(2) { top: 9px; }
.menu-btn span:nth-child(3) { top: 18px; }

/* Animation croix */
.menu-btn.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 9px;
}
.menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 9px;
}

/* ===== Menu latéral gauche ===== */
@media (max-width: 922px) {
  .menu-btn { display: block; }

  nav ul {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(280px, 80vw);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1.6rem;
    padding: 6rem 2rem;
    background: rgba(11, 11, 16, 0.96);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255,255,255,.08);
    box-shadow: 6px 0 24px rgba(0,0,0,0.4);
    transform: translateX(-100%);
    transition: transform .45s cubic-bezier(.45,0,.1,1);
    z-index: 100;
  }

  nav ul.open { transform: translateX(0); }

  /* Ne pas bouger le sélecteur de langue */
  .toggle {
    position: static;
    border: 1px solid rgba(255,255,255,.1);
    background: transparent;
  }

  /* On aligne bien le container */
  .container.nav {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}
