:root {
  --ink: #12202f;          
  --ink-soft: #4a5a6a;     
  --snow: #f5f7fa;         
  --paper: #ffffff;
  --line: #d9e0e8;         
  --accent: #3b4bc8;      
  --accent-dark: #2c3aa6;
  --slate: #1b2a3b;        

  --font-title: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --nav-h: 64px;


  --bs-primary: var(--accent);
  --bs-primary-rgb: 59, 75, 200;
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--snow);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--accent-dark);
}


html { scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;          /* footer toujours en bas */
  padding-top: var(--nav-h); 
  font-family: var(--font-body);
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--font-title);
  color: var(--ink);
  letter-spacing: -0.02em;
}

main { flex: 1 0 auto; }
p { max-width: 62ch; }

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-dark);
  --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-active-bg: var(--accent-dark);
  --bs-btn-active-border-color: var(--accent-dark);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-bg: var(--accent-dark);
}
.btn { border-radius: .5rem; font-weight: 500; padding: .6rem 1.2rem; }

.site-nav {
  min-height: var(--nav-h);
  background: rgba(245, 247, 250, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav .navbar-brand {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .01em;
}
.brand-tag {
  background: var(--accent);
  color: #fff;
  padding: .15rem .45rem;
  border-radius: .35rem;
}
.site-nav .nav-link {
  color: var(--ink-soft);
  font-weight: 500;
  padding: .5rem .85rem;
  border-bottom: 2px solid transparent;
}
.site-nav .nav-link:hover { color: var(--ink); }
.site-nav .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hero { padding: 4rem 0 3rem; }
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
}
.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.hero-text { color: var(--ink-soft); font-size: 1.05rem; }


.code-card {
  background: var(--slate);
  color: #d7e0ea;
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(18, 32, 47, .6);
  font-family: var(--font-mono);
  font-size: .9rem;
}
.code-card__bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem .9rem;
  background: rgba(255, 255, 255, .06);
  color: #8fa1b4;
  font-size: .8rem;
}

.code-card__dot { width: .6rem; height: .6rem; border-radius: 50%; background: #5b6c7f; }
.code-card__body { margin: 0; padding: 1.1rem 1.2rem 1.3rem; line-height: 1.7; overflow-x: auto; }
.tok-kw  { color: #8e9bff; }
.tok-str { color: #9fd9b1; }
.tok-fn  { color: #f0c987; }
.tok-cm  { color: #6f8196; }


.facts { border-top: 1px solid var(--line); padding: 2rem 0; }
.fact-label { font-size: .85rem; color: var(--ink-soft); margin: 0; }
.fact-value { font-weight: 600; margin: 0; }


.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }


:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -999px; top: .5rem;
  background: var(--accent); color: #fff; padding: .5rem 1rem; border-radius: .4rem; z-index: 2000;
}
.skip-link:focus { left: .5rem; }

@media (max-width: 767.98px) {
  .hero { padding-top: 2rem; }
  .site-footer .text-end, .site-footer .text-center { text-align: left !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
@keyframes entree {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.hero-title,
.hero-subtitle,
.hero-text,
.hero .btn,
.code-card {
  animation: entree .7s cubic-bezier(.2, .7, .2, 1) both;
}

.hero-subtitle { animation-delay: .10s; }
.hero-text     { animation-delay: .20s; }
.hero .btn     { animation-delay: .30s; }
.code-card     { animation-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
  .hero-title, .hero-subtitle, .hero-text, .hero .btn, .code-card {
    animation: none;
  }
}


/* ===== Sections de contenu (accueil) ===== */
.section { padding: 3.5rem 0; border-top: 1px solid var(--line); }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-bottom: .4rem; }
.section-intro { color: var(--ink-soft); margin-bottom: 2rem; }

.project { padding: 1.4rem 0; border-top: 1px solid var(--line); }
.project:first-of-type { border-top: 0; }
.project h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .3rem; }
.project p { margin-bottom: .6rem; color: var(--ink-soft); }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .78rem;
  padding: .15rem .55rem;
  margin: 0 .3rem .3rem 0;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--paper);
  color: var(--ink);
}

.skill-group h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .6rem; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding-bottom: 1.6rem; }
.timeline li::before {
  content: "";
  position: absolute; left: calc(-1.4rem - 7px); top: .45rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--snow);
}
.timeline h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .2rem; }
.timeline p { margin: 0; color: var(--ink-soft); }

.cta-band { background: var(--slate); color: #d7e0ea; padding: 3rem 0; }
.cta-band h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.cta-band p { color: #aebccb; }
.cta-band .btn-primary {
  --bs-btn-bg: #fff; --bs-btn-color: var(--slate); --bs-btn-border-color: #fff;
  --bs-btn-hover-bg: #e4e9f5; --bs-btn-hover-color: var(--slate); --bs-btn-hover-border-color: #e4e9f5;
}

/* ===== Pages intérieures (stages, etc.) ===== */
.page-head { padding: 3rem 0 1.5rem; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; }
.page-head p { color: var(--ink-soft); font-size: 1.1rem; margin: 0; }

.stage { padding: 1.8rem 0; border-top: 1px solid var(--line); }
.stage:first-of-type { border-top: 0; }
.stage h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: .2rem; }
.stage-meta { color: var(--ink-soft); font-size: .92rem; margin: 0 0 .15rem; }
.stage-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin: 1rem 0 .4rem; }
.stage ul { color: var(--ink-soft); padding-left: 1.1rem; margin-bottom: .6rem; }
.stage li { margin-bottom: .25rem; }
.badge-now { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: .35rem; background: var(--accent); color: #fff; margin-bottom: .5rem; }

/* ===== Animations réutilisables (toutes les pages) ===== */
/* .anim        : apparaît au chargement de la page  */
/* .anim-scroll : apparaît quand on arrive dessus en scrollant */
.anim { animation: entree .7s cubic-bezier(.2, .7, .2, 1) both; }
.anim-d1 { animation-delay: .10s; }
.anim-d2 { animation-delay: .20s; }

@supports (animation-timeline: view()) {
  .anim-scroll {
    animation: entree linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .anim, .anim-scroll { animation: none; }
}

/* ===== Listes de contenu (veille, etc.) ===== */
.stage-list { color: var(--ink-soft); padding-left: 1.1rem; }
.stage-list li { margin-bottom: .35rem; }
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--line); font-size: .95rem; }
.table th { color: var(--ink); font-weight: 600; }
.table td { color: var(--ink-soft); }

/* ===== Page en cours de fabrication ===== */
.wip {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin: 1rem 0 4rem;
  padding: 1.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: .75rem;
}
.wip__icon { font-size: 1.8rem; color: var(--accent); line-height: 1; }
.wip__title { font-size: 1.3rem; font-weight: 700; margin-bottom: .3rem; }
.wip p { color: var(--ink-soft); }

/* ===== Accueil des stages (grille cliquable) ===== */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}
.stage-tile {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .75rem;
  color: inherit;
  text-decoration: none;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.stage-tile:hover, .stage-tile:focus-visible {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -20px rgba(18, 32, 47, .5);
  color: inherit;
}
.stage-tile h2 { font-size: 1.3rem; font-weight: 700; margin: 0; }
.stage-tile__date { font-size: .85rem; font-weight: 600; color: var(--accent); }
.stage-tile__desc { color: var(--ink-soft); margin: 0; }
.stage-tile__go { margin-top: auto; padding-top: 1rem; font-weight: 600; color: var(--accent); }

/* ===== Page de détail d'un stage (image à gauche, texte à droite) ===== */
.back-link { display: inline-block; margin-top: 1.5rem; color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.back-link:hover { color: var(--accent); }

.doc-fig { margin: 0; }
.doc-fig img { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: .5rem; }
.doc-fig figcaption { margin-top: .45rem; font-size: .82rem; color: var(--ink-soft); }
.fig-placeholder {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  border: 2px dashed var(--line);
  border-radius: .5rem;
  color: var(--ink-soft);
}

.doc-section { margin-top: 2.5rem; }
.doc-section h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1rem; }

.week-list { list-style: none; margin: 0; padding: 0; }
.week-list li {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: .75rem;
  padding: .8rem 0;
  border-top: 1px solid var(--line);
}
.week-list strong { color: var(--accent); }
.week-list span { color: var(--ink-soft); }
@media (max-width: 575.98px) { .week-list li { grid-template-columns: 1fr; gap: .1rem; } }

/* ===== Fiche d'identité d'une organisation ===== */
.fiche { display: grid; grid-template-columns: 9rem 1fr; gap: .6rem 1rem; margin: 0; }
.fiche dt { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); padding-top: .15rem; }
.fiche dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 575.98px) { .fiche { grid-template-columns: 1fr; gap: .1rem; } .fiche dd { margin-bottom: .7rem; } }

.doc-fig--logo img { padding: 1.5rem; object-fit: contain; }