/* ============================================================
   project.css — Feuille de style des pages projets /projets/*
   Palette et typographie alignées sur site/style.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0a;
  --bg-card:   #111111;
  --bg-hover:  #1a1a1a;
  --blue:      #2563eb;
  --blue-h:    #3b82f6;
  --blue-dim:  rgba(37,99,235,0.12);
  --blue-glow: rgba(37,99,235,0.35);
  --white:     #ffffff;
  --grey:      #888888;
  --grey-lt:   #aaaaaa;
  --border:    #1f1f1f;
  --border-lt: #2a2a2a;
  --radius:    16px;
  --nav-h:     68px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  color: var(--blue-h);
  background: rgba(255,255,255,0.04);
  padding: 1px 6px;
  border-radius: 5px;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--blue); border-radius: 3px; }

/* ---------- Curseur personnalisé (point bleu) ---------- */
#cursor {
  position: fixed; top: 0; left: 0;
  width: 10px; height: 10px;
  background: var(--blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transition: transform 0.15s ease, opacity 0.3s;
  transform: translate(-50%, -50%);
}

/* Sur écrans tactiles, on rétablit le curseur natif et on masque le point. */
@media (hover: none) {
  body { cursor: auto; }
  #cursor { display: none !important; }
  body .hamburger { cursor: pointer; }
}

.container { max-width: 980px; margin: 0 auto; padding: 0 24px; }

/* ---------- Navigation (barre fixe + menu mobile) ---------- */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(10,10,10,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px;
  z-index: 1000;
  transition: box-shadow 0.3s;
}
#navbar.scrolled { box-shadow: 0 4px 40px rgba(0,0,0,0.5); }

.nav-brand { font-size: 1.1rem; font-weight: 900; letter-spacing: -0.02em; }
.nav-brand span { color: var(--blue); }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: none; padding: 6px; background: none; border: none; }
.hamburger span { width: 22px; height: 2px; background: var(--white); border-radius: 2px; transition: all 0.3s; display: block; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  font-size: 0.82rem; font-weight: 500;
  color: var(--grey); transition: color 0.2s;
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
}
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; transition: color 0.2s; }
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1.5px; background: var(--blue);
  transition: width 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--white); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.mobile-menu {
  display: none; position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: rgba(10,10,10,0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 24px 48px; flex-direction: column; gap: 18px;
  z-index: 999;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 0.95rem; font-weight: 500; color: var(--grey); padding: 8px 0; border-bottom: 1px solid var(--border); transition: color 0.2s; display: inline-flex; align-items: center; gap: 10px; }
.mobile-menu a:hover { color: var(--blue); }
#navbar.scrolled {
  background: rgba(8,8,8,0.96);
  backdrop-filter: blur(28px);
}

/* Navigation mobile : marque + hamburger, liens dans .mobile-menu */
@media (max-width: 768px) {
  #navbar { padding: 0 24px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 360px) {
  .nav-brand { font-size: 1rem; }
}

/* ---------- Header / hero ---------- */
.pj-hero {
  padding: calc(var(--nav-h) + 40px) 0 48px;
  border-bottom: 1px solid var(--border);
}
.pj-hero-top { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.pj-hero-logo {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 18px;
  background: rgba(37,99,235,0.08);
  border: 1px solid var(--border-lt);
  display: flex; align-items: center; justify-content: center;
}
.pj-hero-logo img { width: 42px; height: 42px; }
.pj-eyebrow {
  font-size: 0.7rem; font-weight: 700; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.14em;
  margin-bottom: 8px;
}
.pj-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
}
.pj-subtitle { color: var(--grey-lt); font-size: 1.05rem; margin-top: 18px; max-width: 720px; }

.pj-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px;
}
.pj-chip {
  font-size: 0.7rem; font-weight: 500;
  padding: 5px 13px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-lt);
  border-radius: 100px; color: var(--grey-lt);
  font-family: 'JetBrains Mono', monospace;
}
.pj-hero-actions { margin-top: 32px; display: flex; gap: 12px; }
.pj-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--blue); color: #fff; border: none;
  border-radius: 100px; padding: 12px 24px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.pj-btn svg { width: 14px; height: 14px; }
.pj-btn:hover { background: var(--blue-h); }
.pj-btn--ghost { background: transparent; border: 1px solid var(--border-lt); color: var(--white); }
.pj-btn--ghost:hover { border-color: var(--blue); color: var(--blue-h); background: transparent; }
.pj-center { text-align: center; margin-top: 16px; }

/* ---------- Sommaire ---------- */
.pj-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 24px 0 8px;
}
.pj-toc-title { font-size: 0.72rem; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; }
.pj-toc ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 20px; }
.pj-toc a { color: var(--grey-lt); font-size: 0.86rem; transition: color 0.2s; }
.pj-toc a:hover { color: var(--blue-h); }
.pj-toc-num {
  color: var(--blue);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  margin-right: 8px;
}

/* ---------- Sections ---------- */
.pj-section { padding: 52px 0; border-bottom: 1px solid var(--border); }
.pj-section:last-of-type { border-bottom: none; }

.pj-h2 {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em;
  margin-bottom: 8px; display: flex; align-items: center; gap: 12px;
}
.pj-h2 .num { color: var(--blue); font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; font-weight: 500; }
.pj-lead { color: var(--grey-lt); margin-bottom: 26px; font-size: 0.98rem; }

.pj-h3 { font-size: 1.05rem; font-weight: 600; margin: 28px 0 12px; }
.pj-h3:first-child { margin-top: 0; }

.pj-h4 { font-size: 0.95rem; font-weight: 700; margin: 20px 0 6px; }
.pj-h5 { font-size: 0.85rem; font-weight: 600; margin: 16px 0 6px; color: var(--grey-lt); }

/* ---------- Bloc "Fichiers sources" (preuves) ---------- */
.pj-sources {
  background: var(--bg-card);
  border: 1px dashed var(--border-lt);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 24px 0;
}
.pj-sources-lead { color: var(--grey-lt); font-size: 0.88rem; margin-bottom: 14px; }
.pj-sources-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.pj-sources-btns .pj-btn { padding: 9px 16px; font-size: 0.8rem; }
.pj-sources-btns .pj-btn svg { width: 13px; height: 13px; }

.pj-section p { color: var(--white); font-size: 0.95rem; }
.pj-section p + p { margin-top: 12px; }

.pj-list { margin: 14px 0 0 2px; }
.pj-list li {
  position: relative; padding-left: 22px;
  color: #c9c9c9; font-size: 0.93rem; margin-bottom: 8px;
}
.pj-list li::before {
  content: '→'; position: absolute; left: 0; top: 0;
  color: var(--blue); font-size: 0.85rem;
}

/* ---------- Diagrammes ---------- */
.pj-diagram {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 18px 0;
}
.pj-diagram pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; line-height: 1.55;
  color: var(--grey-lt);
  white-space: pre;
}
.pj-figcaption { font-size: 0.75rem; color: var(--grey); margin-top: 8px; }

/* ---------- Tables ---------- */
.pj-table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: 12px; }
.pj-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 560px; }
.pj-table th {
  text-align: left; padding: 12px 16px;
  background: var(--bg-card); color: var(--grey);
  font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-lt);
}
.pj-table td {
  padding: 11px 16px; color: #c9c9c9;
  border-bottom: 1px solid var(--border);
}
.pj-table tr:last-child td { border-bottom: none; }
.pj-table td:first-child { color: var(--white); font-weight: 600; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }

/* ---------- Cards / callouts ---------- */
.pj-callout {
  border-left: 3px solid var(--blue);
  background: var(--blue-dim);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 20px 0;
  color: #c9c9c9; font-size: 0.9rem;
}

.pj-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 18px 0; }
.pj-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.pj-card h3, .pj-card h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 10px; }
.pj-card p { font-size: 0.85rem; color: var(--grey-lt); }

/* ---------- Image ---------- */
.pj-figure { margin: 24px 0; }
.pj-figure img {
  width: 100%; border-radius: 12px;
  border: 1px solid var(--border-lt);
}
.pj-figure--small img { width: 75%; margin: 0 auto; }
.pj-figure--verysmall img { width: 50%; margin: 0 auto; }
.pj-figure figcaption { font-size: 0.78rem; color: var(--grey); margin-top: 10px; text-align: center; }
.pj-figure img { cursor: zoom-in; transition: opacity 0.2s; }
.pj-figure img:hover { opacity: 0.85; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: none; align-items: center; justify-content: center;
  padding: 32px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.65);
  cursor: default;
}
.lb-close {
  position: absolute; top: 20px; right: 28px;
  font-size: 2.2rem; line-height: 1; color: var(--grey-lt);
  cursor: pointer; transition: color 0.2s;
}
.lb-close:hover { color: var(--white); }

/* ---------- JSON Viewer Modal ---------- */
.json-modal {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.9);
  display: none; align-items: center; justify-content: center;
  padding: 32px;
}
.json-modal.open { display: flex; }
.json-modal-box {
  width: min(1000px, 100%);
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.json-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--grey-lt);
}
.json-modal-close { font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--grey-lt); transition: color 0.2s; }
.json-modal-close:hover { color: var(--white); }
.json-modal-pre {
  margin: 0; padding: 20px 22px; overflow: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; line-height: 1.5; color: var(--grey-lt);
  white-space: pre;
}

/* ---------- Footer (identique à la page d'accueil) ---------- */
footer {
  background: linear-gradient(180deg, var(--bg-card) 0%, #080808 100%);
  border-top: 1px solid var(--border);
  padding: 32px 48px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 16px;
  position: relative;
}
footer::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 40%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,0.5), transparent);
}
.footer-brand { grid-column: 1; grid-row: 1; font-size: 0.95rem; font-weight: 700; }
.footer-brand span { color: var(--blue); }
.footer-legal {
  grid-column: 2; grid-row: 1;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
  font-size: 0.78rem; font-family: 'Inter', sans-serif; text-align: center;
}
.footer-legal a { color: var(--grey-lt); transition: color 0.2s; }
.footer-legal a:hover { color: var(--blue-h); }
.footer-legal a + a::before { content: '|'; color: var(--blue); margin: 0 12px; }

@media (max-width: 768px) {
  footer { padding: 28px 24px; grid-template-columns: 1fr; text-align: center; }
  .footer-brand, .footer-legal { grid-column: 1; grid-row: auto; }
  .footer-brand { order: 1; }
  .footer-legal { order: 2; justify-content: center; text-align: center; }
}

/* ---------- Focus clavier visible ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue-h); outline-offset: 3px;
}

/* ---------- Sélecteur de langue ---------- */
.lang-toggle {
  display: flex; align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 5px;
  gap: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.lang-toggle:hover {
  box-shadow: 0 8px 32px var(--blue-glow);
  border-color: rgba(37,99,235,0.35);
}
.lang-globe {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--blue-h);
  flex-shrink: 0;
  margin-left: 4px;
}
.lang-divider {
  width: 1px; height: 18px;
  background: var(--border);
  flex-shrink: 0;
}
.lang-btn {
  padding: 6px 14px;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--grey-lt);
  border: none; cursor: pointer;
  border-radius: 40px;
  transition: all 0.25s;
  font-family: inherit;
  display: flex; align-items: center; gap: 6px;
}
.lang-btn svg { flex-shrink: 0; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.lang-btn.active {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 14px var(--blue-glow);
}
.lang-btn:hover:not(.active) {
  color: var(--white);
  background: var(--blue-dim);
}

/* Variante intégrée à la barre de navigation (desktop) et au menu mobile.
   Non fixe, sans ombre flottante ; ne concerne pas les autres pages (.lang-toggle seul). */
.lang-toggle.lang-toggle--inline {
  position: static;
  box-shadow: none;
  padding: 3px;
  gap: 2px;
  z-index: auto;
  flex-shrink: 0;
}
.lang-toggle.lang-toggle--inline:hover { box-shadow: none; }
.lang-toggle.lang-toggle--inline .lang-globe { width: 24px; height: 24px; margin-left: 4px; }
.lang-toggle.lang-toggle--inline .lang-globe svg { width: 14px; height: 14px; }
.lang-toggle.lang-toggle--inline .lang-divider { height: 14px; }
.lang-toggle.lang-toggle--inline .lang-btn { padding: 4px 9px; font-size: 0.66rem; gap: 5px; }
.lang-toggle.lang-toggle--inline .lang-btn svg { width: 16px; height: 11px; }
.nav-lang { display: flex; align-items: center; }
.mobile-menu .lang-toggle.lang-toggle--inline { align-self: flex-start; margin-top: 6px; }
/* Tablette / petit desktop : 9 liens + sélecteur ne tiennent plus avec gap 26px */
@media (min-width: 769px) and (max-width: 1360px) {
  #navbar { padding: 0 40px; }
  .nav-links { gap: 16px; }
  .nav-links a { white-space: nowrap; }
  .nav-links .nav-icon { display: none; }
  .lang-toggle.lang-toggle--inline .lang-btn { padding: 4px 8px; }
}
@media (min-width: 769px) and (max-width: 1000px) {
  #navbar { padding: 0 24px; }
  .nav-links { gap: 8px; }
  .nav-links a { font-size: 0.8rem; }
  .lang-toggle.lang-toggle--inline .lang-globe { display: none; }
  .lang-toggle.lang-toggle--inline .lang-divider { display: none; }
  .lang-toggle.lang-toggle--inline .lang-btn { padding: 4px 6px; }
}
@media (min-width: 769px) and (max-width: 860px) {
  #navbar { padding: 0 16px; }
  .nav-links { gap: 4px; }
  .nav-links a { font-size: 0.74rem; }
}

/* ---------- Responsive mobile/tablette ---------- */
@media (max-width: 768px) {
  .pj-hero { padding: calc(var(--nav-h) + 32px) 0 40px; }
  .pj-hero-top { gap: 14px; }
  .pj-hero-logo { width: 56px; height: 56px; border-radius: 14px; }
  .pj-hero-logo img { width: 32px; height: 32px; }
  .pj-title { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .pj-subtitle { font-size: 0.95rem; }
  .pj-toc ul { grid-template-columns: 1fr; }
  .pj-grid-2 { grid-template-columns: 1fr; }
  .pj-section { padding: 40px 0; }
  .pj-figure--small img, .pj-figure--verysmall img { width: 100%; }
  .pj-table { min-width: 460px; }
}
@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .pj-hero-top { flex-direction: column; align-items: flex-start; }
  .pj-hero-actions { flex-direction: column; }
  .pj-hero-actions .pj-btn { justify-content: center; }
  .pj-sources { padding: 16px; }
  .pj-sources-btns { flex-direction: column; }
  .pj-sources-btns .pj-btn { justify-content: center; }
  .pj-toc { padding: 18px; }
  .pj-diagram pre { font-size: 0.7rem; }
  .pj-table { min-width: 380px; font-size: 0.78rem; }
}

/* ---------- Sélecteur de langue — démo inline (non fixe, non interactif) ---------- */
.lang-toggle.lang-toggle--demo {
  position: static;
  margin: 20px auto;
  width: fit-content;
}
.lang-toggle--demo .lang-btn { cursor: default; }
