/* ── Reset & base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --accent: #6c8eff;
  --text: #e2e8f0;
  --muted: #8892a4;
  --radius: 12px;
  --max-w: 960px;

  /* couleurs par section */
  --c-research: #6c8eff;
  --c-lifestyle: #4caf82;
  --c-passion:   #f2994a;
  --c-psychiatrie: #a78bfa;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.navbar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.2);
}

.nav-avatar img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ══════════════════════════════
   ① RESEARCH BANNER
══════════════════════════════ */
.banner-research {
  background: linear-gradient(135deg, #111422 0%, #0f1117 100%);
}

.banner-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
}

/* About: two-column layout (text left, photos right) */
.about-content {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.about-text {
  flex: 1 1 380px;
}

.about-photos {
  flex: 0 0 auto;
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.profil-photo {
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
  display: block;
}

.profil-photo--main {
  width: 160px;
  height: 200px;
}

.profil-photo--secondary {
  width: 120px;
  height: 155px;
  opacity: 0.85;
}

@media (max-width: 640px) {
  .about-photos { display: none; }
}

.banner-meta {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-research);
  margin-bottom: 0.75rem;
}

.banner-inner h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.banner-desc {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 1.75rem;
  min-height: 1.5rem; /* espace réservé quand vide */
}

/* Tags technos */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag {
  background: rgba(108, 142, 255, 0.12);
  border: 1px solid rgba(108, 142, 255, 0.3);
  color: var(--c-research);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.banner-body {
  color: var(--muted);
  max-width: 680px;
  min-height: 1.5rem;
}

/* Séparateur bleu entre chaque section */
section + section {
  border-top: 2px solid var(--c-research);
}

/* ══════════════════════════════
   ② – ④ PROJECT SECTIONS
══════════════════════════════ */
.project-section {
}

.project-section.alt {
  background: rgba(255,255,255,0.015);
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

/* label coloré par section */
#lifestyle  .section-label { color: var(--c-lifestyle); }
#passion    .section-label { color: var(--c-passion); }
#psychiatrie .section-label { color: var(--c-psychiatrie); }

#lifestyle   { }
#passion     { }
#psychiatrie { }

.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
  min-height: 1.8rem;
}

.section-intro {
  color: var(--muted);
  max-width: 580px;
  margin-bottom: 2rem;
  min-height: 1.5rem;
}

/* Project cards grid */
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}

#lifestyle  .project-card:hover { border-color: var(--c-lifestyle);  transform: translateY(-3px); }
#passion    .project-card:hover { border-color: var(--c-passion);    transform: translateY(-3px); }
#psychiatrie .project-card:hover{ border-color: var(--c-psychiatrie);transform: translateY(-3px); }

.project-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.project-icon { font-size: 1.5rem; }
.project-logo {
  height: 36px;
  max-width: 120px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.project-card p {
  font-size: 0.875rem;
  color: var(--muted);
  min-height: 1.2rem;
}

/* ══════════════════════════════
   #RESEARCH SECTION
══════════════════════════════ */
#research {
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.research-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}

.research-card:hover {
  transform: translateY(-3px);
  border-color: var(--c-research);
}

.research-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.research-icon { font-size: 1.4rem; }

.research-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.research-card .tags {
  margin-bottom: 0.75rem;
}

.research-card p {
  font-size: 0.875rem;
  color: var(--muted);
  min-height: 1.2rem;
}

/* Toolbar */
.proj-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.proj-toolbar h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

/* Toggle buttons */
.view-toggle {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Views */
.proj-view { display: none; }
.proj-view.active { display: block; }

/* Groups */
.proj-group {
  margin-bottom: 2.5rem;
}

.proj-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

/* ══════════════════════════════
   #PROJECTS SECTION
══════════════════════════════ */
#projects {
}

#projects .section-inner {
  padding-top: 4rem;
}

/* Toolbar */
.proj-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.proj-toolbar h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

/* Toggle buttons */
.view-toggle {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Views */
.proj-view { display: none; }
.proj-view.active { display: block; }

/* Groups */
.proj-group {
  margin-bottom: 2.5rem;
}

.proj-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

/* ══════════════════════════════
   PROJ CARD — footer injected by JS
══════════════════════════════ */
.proj-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.proj-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-current { background: rgba(76,175,130,0.15); color: var(--c-lifestyle); }
.badge-archive { background: rgba(136,146,164,0.15); color: var(--muted); }
.badge-future  { background: rgba(167,139,250,0.15); color: var(--c-psychiatrie); }

.proj-progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.proj-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.6s ease;
}

#lifestyle  .proj-progress-bar { background: var(--c-lifestyle); }
#passion    .proj-progress-bar { background: var(--c-passion); }
#psychiatrie .proj-progress-bar { background: var(--c-psychiatrie); }

.proj-progress-label {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.proj-link {
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
  margin-right: auto;
}

.proj-link:hover { text-decoration: underline; }

.modal-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.modal-link:hover { text-decoration: underline; }

/* ══════════════════════════════
   MODAL OVERLAY
══════════════════════════════ */
.proj-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.proj-modal-overlay.open {
  display: flex;
}

.proj-modal-box {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }

.modal-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.modal-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.modal-meta span {
  font-size: 0.75rem;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  color: var(--muted);
}

.modal-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.25rem 0 0.6rem;
}

/* WHY bars */
.modal-why { display: flex; flex-direction: column; gap: 0.5rem; }

.modal-why-text {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.modal-why-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-why-label {
  font-size: 0.8rem;
  color: var(--muted);
  width: 100px;
  flex-shrink: 0;
}

.modal-why-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.modal-why-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.modal-why-val {
  font-size: 0.8rem;
  color: var(--muted);
  width: 1.5rem;
  text-align: right;
}

/* HOW table */
.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.modal-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--muted);
}

.modal-table td:first-child {
  color: var(--text);
  text-transform: capitalize;
  width: 40%;
}

/* Steps */
.modal-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.875rem;
}

.modal-steps li {
  padding-left: 1.4rem;
  position: relative;
  color: var(--muted);
}

.modal-steps li::before {
  content: '○';
  position: absolute;
  left: 0;
  color: var(--muted);
}

.modal-steps li.done { color: var(--text); }
.modal-steps li.done::before { content: '●'; color: var(--accent); }

.muted { color: var(--muted); font-size: 0.875rem; }

/* ── Footer ── */
footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}
