/* =====================================================================
   Portfolio Ugo Roccamatisi : feuille de styles
   Style Google (Material 3) : Google Sans, cartes gris bleuté,
   grands arrondis, boutons pilule. Tailwind (tailwind.css) ne sert plus
   qu'aux grilles et à l'affichage conditionnel (hidden, md:flex...).
   ===================================================================== */

:root {
  --text: #1f1f1f;
  --muted: #444746;
  --subtle: #5e5e5e;
  --primary: #0b57d0;
  --primary-hover: #0842a0;
  --tonal: #d3e3fd;
  --on-tonal: #041e49;
  --surface: #f0f4f9;
  --surface-hi: #e9eef6;
  --outline: #c4c7c5;
  --line: #dde3ea;
  --green: #146c2e;
  --green-soft: #e6f4ea;
  --wrap: 72rem;
}

/* Couleurs par domaine de projet (catégorie et chiffre de résultat)
   aero = bleu, ia = vert, signal = rouge, optim = jaune, stats = violet */
[data-domain="aero"]   { --d-ink: #0b57d0; --d-tone: #d3e3fd; --d-on: #041e49; }
[data-domain="ia"]     { --d-ink: #146c2e; --d-tone: #c4eed0; --d-on: #072711; }
[data-domain="signal"] { --d-ink: #b3261e; --d-tone: #ffdad6; --d-on: #410e0b; }
[data-domain="optim"]  { --d-ink: #8a5a00; --d-tone: #ffdf99; --d-on: #2b1700; }
[data-domain="stats"]  { --d-ink: #6750a4; --d-tone: #eaddff; --d-on: #21005d; }

/* ---------- Base ---------- */
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: "Google Sans", "Roboto", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--tonal); }
section[id] { scroll-margin-top: 72px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- En-tête ---------- */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 40; background: #fff; transition: transform 0.3s; }
.site-header.hidden-up { transform: translateY(-100%); }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.875rem; padding-bottom: 0.875rem; }
.brand { color: var(--text); font-size: 1.15rem; font-weight: 500; }
.main-nav { align-items: center; gap: 0.25rem; }
.main-nav a { padding: 0.5rem 1rem; border-radius: 999px; color: var(--muted); font-size: 0.9rem; font-weight: 500; transition: background 0.15s, color 0.15s; }
.main-nav a:hover { background: var(--surface); color: var(--primary); }
.main-nav a.is-active { background: var(--tonal); color: var(--on-tonal); }
.lang-switch { font-size: 0.875rem; font-weight: 600; color: #a1a1aa; }
.lang-btn { padding: 0 0.25rem; color: #a1a1aa; }
.lang-btn.is-active { color: var(--primary); }
.menu-toggle { width: 40px; height: 40px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.menu-toggle span { display: block; width: 100%; height: 2px; margin: 4px 0; border-radius: 999px; background: var(--text); transition: transform 0.2s, opacity 0.2s; }
.menu-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobile-nav { padding: 0.35rem 1.25rem 1rem; border-top: 1px solid var(--line); background: #fff; }
.mobile-nav a { display: block; padding: 0.78rem 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; font-weight: 500; }
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a.is-active { color: var(--primary); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border-radius: 999px; font-weight: 500; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.btn-ico { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { border: 1px solid var(--outline); color: var(--primary); }
.btn-outline:hover { background: var(--surface); }

/* ---------- Hero : texte à gauche, courbe de température à droite ---------- */
.hero { padding: 8.5rem 0 4.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 3rem; align-items: center; }
.hero-eyebrow { margin-bottom: 1rem; color: var(--primary); font-size: 1rem; font-weight: 500; }
.hero-title { margin-bottom: 1.1rem; color: var(--text); font-size: clamp(2.6rem, 4.8vw, 4rem); font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }
.hero-tagline { max-width: 34rem; margin-bottom: 1rem; color: var(--text); font-size: clamp(1.15rem, 1.9vw, 1.45rem); line-height: 1.4; }
.hero-proof { max-width: 34rem; margin-bottom: 2.2rem; color: var(--muted); font-size: 0.98rem; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Mosaïque de projets : 4 tuiles de largeurs décalées, chacune ouvre l'étude de cas */
.hero-mosaic { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: 210px 200px; gap: 0.75rem; }
.tile { position: relative; display: block; padding: 8px; overflow: hidden; border-radius: 28px; background: var(--surface); transition: background 0.2s ease; }
.tile:hover { background: var(--surface-hi); }
.tile:focus-visible { outline: 3px solid rgba(11,87,208,0.35); outline-offset: 3px; }
.t1 { grid-column: 1 / 7; }
.t2 { grid-column: 7 / 11; }
.t3 { grid-column: 1 / 6; }
.t4 { grid-column: 6 / 11; }
.tile-img { display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 20px; background: #fff; }
.tile-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(.2,.7,.2,1); }
.tile-img.fit-contain img { object-fit: contain; padding: 0.5rem 0.5rem 2.6rem; }
.tile:hover .tile-img img { transform: scale(1.04); }
.tile-label { position: absolute; left: 18px; bottom: 18px; padding: 0.35rem 0.8rem; border-radius: 999px; background: rgba(255,255,255,0.94); box-shadow: 0 1px 2px rgba(0,0,0,0.12); color: var(--text); font-size: 0.8rem; font-weight: 500; transition: background 0.2s, color 0.2s; }
.tile:hover .tile-label { background: var(--primary); color: #fff; }

/* Apparition des tuiles au chargement, l'une après l'autre */
@keyframes tileIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.js .tile { animation: tileIn 0.6s cubic-bezier(.2,.7,.2,1) both; }
.js .t2 { animation-delay: 0.08s; }
.js .t3 { animation-delay: 0.16s; }
.js .t4 { animation-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .js .tile { animation: none; }
  .tile:hover .tile-img img { transform: none; }
}

@media (max-width: 900px) {
  .hero { padding: 6.5rem 0 3rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 520px) {
  .hero-mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: 170px 130px 150px; gap: 0.6rem; }
  .t1, .t4 { grid-column: 1 / 3; }
  .t2 { grid-column: 1 / 2; }
  .t3 { grid-column: 2 / 3; }
  .tile { padding: 6px; border-radius: 22px; }
  .tile-img { border-radius: 16px; }
  .tile-label { left: 14px; bottom: 14px; font-size: 0.74rem; }
}

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }
.section-title { margin-bottom: 3rem; color: var(--text); font-size: clamp(2.2rem, 4.2vw, 3.1rem); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; text-align: center; }
.section-title.has-intro { margin-bottom: 1rem; }
.section-intro { max-width: 42rem; margin: 0 auto 3rem; color: var(--muted); font-size: 1.12rem; text-align: center; }

/* Apparition au défilement (fondu seul), uniquement si JavaScript est actif */
.js .reveal { opacity: 0; transition: opacity 0.4s ease; }
.js .reveal.visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transition: none; } }

/* ---------- À propos ---------- */
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 3rem; align-items: center; max-width: 64rem; margin: 0 auto; }
.about-photo { width: 280px; height: 280px; object-fit: cover; border-radius: 50%; }
.about-txt { color: var(--muted); font-size: 1.1rem; line-height: 1.7; }
.about-txt p + p { margin-top: 1rem; }
.about-txt b { color: var(--text); font-weight: 500; }
.about-grid.no-photo { grid-template-columns: 1fr; }
.about-grid.no-photo .about-txt { max-width: 48rem; margin: 0 auto; text-align: center; }
.logo-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.5rem 3rem; margin-top: 4rem; padding: 1.75rem 1rem; border-radius: 28px; background: var(--surface); }
.logo-band img { width: auto; height: 3.5rem; max-width: 190px; object-fit: contain; }
.logo-band img.logo-tall { height: 76px; }
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 1.6rem; justify-items: center; }
  .about-txt { text-align: center; }
}

/* ---------- Cartes projets (générées par scripts.js) ---------- */
.proj-card { width: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 28px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background 0.2s ease; }
.proj-card:hover { background: var(--surface-hi); }
.proj-card:focus-visible { outline: 3px solid rgba(11,87,208,0.35); outline-offset: 3px; }
.proj-banner { position: relative; height: 150px; margin: 10px 10px 0; overflow: hidden; border-radius: 20px; background: #fff; }
.proj-card-featured .proj-banner { height: 190px; }
.proj-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.proj-banner.fit-contain img { object-fit: contain; padding: 0.7rem 0.6rem 0.25rem; }
.proj-body { display: flex; flex: 1; flex-direction: column; padding: 1.2rem; }
.proj-card-featured .proj-body { padding: 1.4rem 1.45rem 1.3rem; }
.proj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.7rem; }
.proj-category { display: inline-flex; padding: 0.3rem 0.75rem; border-radius: 8px; background: var(--d-tone); color: var(--d-on); font-size: 0.76rem; font-weight: 500; }
.proj-body h3 { margin-top: 0.78rem; color: var(--text); font-size: 1.05rem; font-weight: 500; line-height: 1.32; }
.proj-card-featured h3 { min-height: 3.45rem; font-size: 1.3rem; }
.proj-card-compact h3 { min-height: 2.75rem; }
.proj-contribution { display: -webkit-box; min-height: 2.3rem; margin-top: 0.55rem; overflow: hidden; color: var(--muted); font-size: 0.8rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.proj-outcome { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.proj-outcome > div { display: flex; align-items: baseline; gap: 0.55rem; min-width: 0; }
.proj-outcome strong { flex: none; color: var(--d-ink); font-size: 1.4rem; font-weight: 500; line-height: 1; letter-spacing: -0.025em; }
.proj-outcome p { color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.proj-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: 1.15rem; }
.proj-tech { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.proj-tech > span { padding: 0.28rem 0.6rem; border: 1px solid var(--outline); border-radius: 8px; color: var(--muted); font-size: 0.7rem; font-weight: 500; white-space: nowrap; }
.proj-arrow { display: inline-flex; flex: 0 0 2rem; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--tonal); color: var(--on-tonal); font-size: 1rem; transition: background 0.2s, color 0.2s; }
.proj-card:hover .proj-arrow { background: var(--primary); color: #fff; }
.other-projects-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 4rem 0 1.2rem; }
.other-projects-head h3 { color: var(--text); font-size: 1.6rem; font-weight: 400; }
.other-projects-head span { color: var(--muted); font-size: 0.8rem; }
@media (max-width: 760px) {
  .other-projects-head { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}

/* ---------- Parcours : frise centrale alternée ---------- */
.timeline { position: relative; max-width: 1060px; margin: 0 auto; padding: 0.5rem 0; }
.timeline::before { content: ''; position: absolute; top: 1.4rem; bottom: 1.4rem; left: 50%; width: 2px; transform: translateX(-50%); background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 72px minmax(0,1fr); align-items: start; margin-bottom: 1.2rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker { z-index: 2; grid-column: 2; grid-row: 1; justify-self: center; width: 12px; height: 12px; margin-top: 1.8rem; border: 3px solid #fff; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px #a8c7fa; }
.timeline-experience .timeline-marker { background: var(--green); box-shadow: 0 0 0 1px #a7d7b2; }
.timeline-card { position: relative; grid-column: 3; display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 1rem; align-items: start; padding: 1.3rem; border-radius: 28px; background: var(--surface); transition: background 0.2s ease; }
.timeline-item:nth-child(odd) .timeline-card { grid-column: 1; }
.timeline-card:hover { background: var(--surface-hi); }
.timeline-card::after { content: ''; position: absolute; top: 1.95rem; left: -37px; width: 36px; height: 1px; background: var(--line); }
.timeline-item:nth-child(odd) .timeline-card::after { right: -37px; left: auto; }
.timeline-logo { position: relative; display: flex; align-items: center; justify-content: center; width: 72px; height: 68px; overflow: hidden; border-radius: 16px; background: #fff; }
.timeline-logo img { position: relative; z-index: 2; width: 90%; height: 90%; object-fit: contain; }
.timeline-logo img[src*="centrale-lille"], .timeline-logo img[src*="air-france"] { width: 96%; height: auto; }
.timeline-logo.g-logo-svg svg { width: 72%; height: 72%; }
.g-ini { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 1.05rem; font-weight: 700; }
.timeline-content { min-width: 0; }
.timeline-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.35rem 0.55rem; margin-bottom: 0.4rem; }
.timeline-type { color: var(--primary); font-size: 0.82rem; font-weight: 500; }
.timeline-experience .timeline-type { color: var(--green); }
.timeline-date { color: var(--muted); font-size: 0.82rem; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline-content h3 { color: var(--text); font-size: 1.1rem; font-weight: 500; line-height: 1.35; }
.timeline-place { margin-top: 0.16rem; color: var(--muted); font-size: 0.86rem; font-weight: 500; }
.timeline-details { max-width: 68ch; margin-top: 0.55rem; color: var(--subtle); font-size: 0.78rem; line-height: 1.55; }
@media (max-width: 800px) {
  .timeline::before { top: 0.75rem; bottom: 0.75rem; left: 8px; transform: none; }
  .timeline-item { grid-template-columns: 18px minmax(0,1fr); gap: 0.65rem; margin-bottom: 1rem; }
  .timeline-marker { grid-column: 1; grid-row: 1 / span 2; margin-top: 1.5rem; }
  .timeline-card, .timeline-item:nth-child(odd) .timeline-card { grid-column: 2; grid-template-columns: 58px minmax(0,1fr); gap: 0.85rem; padding: 1rem; border-radius: 24px; }
  .timeline-card::after { display: none; }
  .timeline-logo { width: 58px; height: 54px; border-radius: 14px; }
  .timeline-meta { justify-content: flex-start; }
}

/* ---------- Compétences : trois cartes ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.skill-group { padding: 1.8rem 1.5rem; border-radius: 28px; background: var(--surface); }
.skill-group h3 { color: var(--text); font-size: 1.2rem; font-weight: 500; line-height: 1.35; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0.5rem; margin-top: 1.15rem; }
.tool-chip { display: flex; align-items: center; gap: 0.5rem; min-width: 0; min-height: 44px; padding: 0.5rem 0.58rem; border: 1px solid var(--outline); border-radius: 8px; background: #fff; color: var(--text); font-size: 0.8rem; font-weight: 500; line-height: 1.2; }
.tool-chip i { flex: 0 0 25px; width: 25px; font-size: 24px; text-align: center; }
.tool-image { display: flex; flex: 0 0 27px; align-items: center; justify-content: center; width: 27px; height: 27px; }
.tool-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 760px) {
  .skills-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 520px) { .tool-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---------- Contact et pied de page ---------- */
.contact { max-width: 48rem; text-align: center; }
.contact .section-title { margin-bottom: 2rem; }
.contact-p { margin-bottom: 2.25rem; color: var(--muted); font-size: 1.12rem; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.site-footer { padding: 2rem 1.25rem; color: var(--muted); font-size: 0.875rem; text-align: center; }

/* ---------- Fenêtre de détail d'un projet ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 50; align-items: center; justify-content: center; padding: 1rem; background: rgba(0,0,0,0.4); }
.modal-box { position: relative; width: 100%; max-width: 64rem; max-height: 90vh; overflow-y: auto; border-radius: 28px; background: #fff; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.modal-box:focus, .modal-box:focus-visible { outline: none; }
.modal-close { position: absolute; top: 0.75rem; right: 0.75rem; z-index: 10; display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 999px; background: var(--surface); color: var(--muted); }
.modal-close:hover { background: var(--surface-hi); }
.case-hero { height: 310px; margin: 12px 12px 0; overflow: hidden; border-radius: 22px; background: var(--surface); }
.case-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-hero.fit-contain img { object-fit: contain; padding: 0.7rem 0.6rem 0.25rem; }
.case-content { padding: 2.25rem 2.5rem 2.5rem; }
.case-intro > h3 { max-width: 25ch; margin-top: 0.7rem; color: var(--text); font-size: clamp(1.65rem, 3vw, 2.2rem); font-weight: 400; line-height: 1.16; letter-spacing: -0.01em; }
.case-meta { max-width: 75ch; margin-top: 0.55rem; color: var(--muted); font-size: 0.83rem; line-height: 1.55; }
.case-highlight { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 1.5rem; margin-top: 1.45rem; padding: 1rem 1.15rem; border-radius: 20px; background: var(--surface); }
.case-role { color: var(--muted); font-size: 0.86rem; font-weight: 700; }
.case-kpi { display: flex; align-items: baseline; justify-content: flex-end; gap: 0.55rem; text-align: right; }
.case-kpi strong { flex: none; color: var(--d-ink); font-size: 1.35rem; font-weight: 500; letter-spacing: -0.025em; }
.case-kpi span { max-width: 28ch; color: var(--muted); font-size: 0.75rem; line-height: 1.35; }
.case-layout { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(280px,0.9fr); gap: 2.25rem; align-items: start; margin-top: 2rem; }
.case-narrative { min-width: 0; }
.case-block { padding: 1.3rem 0; border-top: 1px solid var(--line); }
.case-block:first-child { padding-top: 0; border-top: 0; }
.case-block h4, .case-media > h4, .case-resources > h4 { margin-bottom: 0.65rem; color: var(--text); font-size: 1rem; font-weight: 500; }
.case-results { margin-top: 0.45rem; padding: 1rem 1.05rem; border: 0; border-radius: 20px; background: var(--green-soft); }
.case-results h4 { color: var(--green); }
.star-p { color: var(--muted); font-size: 0.9rem; line-height: 1.72; }
.star-ul { padding-left: 1.2rem; list-style: disc; color: var(--muted); font-size: 0.9rem; line-height: 1.68; }
.star-ul li { margin: 0.4rem 0; padding-left: 0.15rem; }
.result-list li::marker { color: var(--green); }
.case-media { min-width: 0; padding-left: 1.5rem; border-left: 1px solid var(--line); }
.mgal { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.mgal-fig { margin: 0; }
.mgal-fig img { display: block; width: 100%; height: 220px; padding: 0.4rem; border-radius: 16px; background: var(--surface); object-fit: contain; cursor: zoom-in; }
.mgal-fig figcaption { margin-top: 0.42rem; color: var(--muted); font-size: 0.72rem; line-height: 1.45; }
.mgal-fig video { display: block; width: 100%; border-radius: 16px; background: #000; }
.case-resources { margin-top: 1.5rem; padding: 1.2rem 1.25rem; border-radius: 20px; background: var(--surface); }
.case-resources-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; }
.case-resource-label { display: block; margin-bottom: 0.45rem; color: var(--muted); font-size: 0.68rem; font-weight: 700; }
.case-tech { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.case-tech span { padding: 0.3rem 0.58rem; border: 1px solid var(--outline); border-radius: 8px; background: #fff; color: var(--muted); font-size: 0.7rem; font-weight: 500; }
.case-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.case-link { padding: 0.62rem 0.85rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.76rem; font-weight: 500; transition: background 0.15s; }
.case-link:hover { background: var(--primary-hover); }
.case-navigation { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 0.8rem; align-items: stretch; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.case-nav-btn { min-width: 0; padding: 0.75rem 0.85rem; border-radius: 20px; background: var(--surface); text-align: left; transition: background 0.18s; }
.case-nav-btn:hover { background: var(--surface-hi); }
.case-nav-btn span { display: block; margin-bottom: 0.18rem; color: var(--primary); font-size: 0.64rem; font-weight: 500; }
.case-nav-btn strong { display: block; overflow: hidden; color: var(--text); font-size: 0.76rem; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.case-nav-next { text-align: right; }
.case-nav-back { align-self: center; padding: 0.65rem 0.8rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.case-nav-back:hover { color: var(--primary); }
@media (max-width: 760px) {
  .case-hero { height: 220px; }
  .case-content { padding: 1.4rem; }
  .case-highlight { grid-template-columns: 1fr; gap: 0.55rem; }
  .case-kpi { justify-content: flex-start; text-align: left; }
  .case-layout { grid-template-columns: 1fr; gap: 1.4rem; }
  .case-media { padding: 1.4rem 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .mgal { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mgal-fig img { height: 180px; }
  .case-resources-row { flex-direction: column; align-items: flex-start; }
  .case-links { justify-content: flex-start; }
  .case-navigation { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .case-nav-back { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}
@media (max-width: 520px) {
  .case-hero { height: 180px; }
  .case-content { padding: 1.2rem; }
  .case-kpi { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
  .mgal { grid-template-columns: 1fr; }
  .mgal-fig img { height: auto; max-height: 260px; }
}

/* ---------- Visionneuse d'images ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; align-items: center; justify-content: center; padding: 1rem; background: rgba(0,0,0,0.8); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* Travaux pratiques : trois cartes par ligne en grand écran */
@media (min-width: 1024px) { #tp-project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
