/* ==========================================================================
   Portfolio : Ousmane Lalo Maman Sanoussi
   Approche mobile-first.
   Identité : un indigo profond (le bleu des tissus teints de la région),
   un fond blanc, et un jaune doré utilisé uniquement sur les zones indigo.
   Pour changer la couleur principale, modifiez --indigo (section 1).
   ========================================================================== */

/* ---------- 1. Variables ---------- */
:root {
  --indigo: #1e2a6b;        /* couleur principale */
  --indigo-deep: #141c4a;   /* variante plus sombre (pied de page) */
  --ink: #14172e;           /* texte principal */
  --muted: #555a75;         /* texte secondaire */
  --line: #d3d7ea;          /* séparateurs */
  --tint: #eef0f8;          /* fond des sections alternées */
  --gold: #f0c04a;          /* accent, uniquement sur fond indigo */
  --on-dark: #dfe3ff;       /* texte secondaire sur fond indigo */
  --on-dark-soft: #bcc2e6;

  --radius: 6px;
  --header-h: 64px;

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
a { color: var(--indigo); }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 700; }

:focus-visible { outline: 3px solid #4b63d8; outline-offset: 3px; border-radius: 3px; }
.hero :focus-visible, .contact :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }

.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { max-width: 46rem; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--indigo); color: #fff; padding: .6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* Champs à compléter (à supprimer une fois remplis) */
.todo { background: #fff1b8; color: #5b4300; padding: 0 .25em; border-radius: 3px; }

/* ---------- 3. Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .8rem 1.4rem; font: inherit; font-weight: 600; font-size: 1rem;
  border: 1.5px solid transparent; border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-small { padding: .5rem 1rem; font-size: .92rem; }

.btn-solid { background: var(--indigo); color: #fff; }
.btn-solid:hover { background: var(--indigo-deep); }

.btn-gold { background: var(--gold); color: var(--indigo-deep); }
.btn-gold:hover { background: #fff; }

.btn-ghost { border-color: rgba(255, 255, 255, .55); color: #fff; background: transparent; }
.btn-ghost:hover { background: #fff; color: var(--indigo); border-color: #fff; }

/* ---------- 4. En-tête & navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* Logo : votre photo en médaillon */
.brand { display: block; line-height: 0; border-radius: 50%; }
.brand img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--indigo); background: var(--tint);
}

/* Menu mobile : panneau déroulant */
.nav {
  position: absolute; top: var(--header-h); left: 0; right: 0;
  display: none; flex-direction: column; align-items: flex-start; gap: 1.2rem;
  padding: .5rem 1.25rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line);
}
.nav.is-open { display: flex; }
.nav-list { width: 100%; display: flex; flex-direction: column; }
.nav-list a {
  display: block; padding: .75rem 0; color: var(--ink); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.nav-list a:hover { color: var(--indigo); }
.nav-list a.is-active { color: var(--indigo); font-weight: 600; }

.menu-toggle {
  display: grid; place-items: center; width: 44px; height: 44px;
  background: transparent; color: var(--indigo);
  border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.bars, .bars::before, .bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .25s ease;
}
.bars { position: relative; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; }
.bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 5. Accueil ---------- */
.hero { background: var(--indigo); color: #fff; padding-top: 3.5rem; overflow: hidden; }
.hero-inner { display: grid; gap: 2.5rem; align-items: end; }
.hero-copy { padding-bottom: 0; }

.hero-name {
  display: block;
  font-size: clamp(2rem, 8.2vw, 3.7rem); line-height: 1.05; letter-spacing: .005em;
}
.hero-role {
  display: block; margin-top: 1.25rem;
  font-family: var(--sans); font-weight: 500; font-size: clamp(1.1rem, 3vw, 1.4rem);
  line-height: 1.35; color: var(--on-dark);
}
.hero-focus { margin-top: .5rem; font-weight: 600; color: var(--gold); }
.hero-pitch { margin-top: 1.6rem; max-width: 34rem; font-size: 1.15rem; color: #eef0ff; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

/* Chaîne TIC → Décision : verticale sur mobile, horizontale ensuite */
.chain {
  position: relative; display: grid; gap: .7rem; margin-top: 2.75rem;
  font-size: .92rem; color: var(--on-dark-soft);
}
.chain::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px;
  background: rgba(255, 255, 255, .25);
}
.chain li { position: relative; padding-left: 1.6rem; }
.chain li::before {
  content: ""; position: absolute; left: 0; top: .32em; width: 12px; height: 12px;
  border-radius: 50%; background: var(--indigo); border: 2px solid var(--on-dark-soft);
}
.chain li:last-child { color: #fff; font-weight: 600; }
.chain li:last-child::before { background: var(--gold); border-color: var(--gold); }

/* Photo : posée sur le bord inférieur du bandeau */
.hero-photo { width: min(100%, 320px); justify-self: center; line-height: 0; }
.hero-photo img {
  width: 100%; height: auto; aspect-ratio: 5 / 6; object-fit: cover; object-position: center top;
  border-radius: var(--radius) var(--radius) 0 0; background: #dfe3ee;
}

/* ---------- 6. Sections ---------- */
.section { padding: 4.5rem 0; }
.band { background: var(--tint); }

.section h2 {
  margin-bottom: 2.25rem; color: var(--indigo);
  font-size: clamp(1.8rem, 4.2vw, 2.5rem); letter-spacing: -.005em;
}

/* À propos : la première phrase est mise en avant par sa taille */
.lead { margin-bottom: 1.5rem; font-family: var(--serif); font-size: clamp(1.25rem, 2.6vw, 1.5rem); line-height: 1.55; font-weight: 500; }
.about-text p + p { margin-top: 1.1rem; color: var(--muted); }
.narrow p + p { margin-top: 1.1rem; color: var(--muted); }

/* À propos : texte à gauche, fiche « En bref » à droite dès que la largeur le permet */
.about-layout { display: grid; gap: 2.5rem; }
.about-facts { padding: 1.5rem 1.5rem 1.6rem; background: var(--tint); border-top: 3px solid var(--indigo); border-radius: 0 0 var(--radius) var(--radius); align-self: start; }
.about-facts[hidden] { display: none; }
.about-facts h3 { margin-bottom: 1rem; color: var(--indigo); font-size: 1.15rem; }
.about-facts dt { margin-top: 1rem; color: var(--muted); font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.about-facts dt:first-child { margin-top: 0; }
.about-facts dd { margin: .2rem 0 0; font-size: .98rem; line-height: 1.5; }
@media (min-width: 900px) {
  .about-layout { grid-template-columns: minmax(0, 1fr) 20rem; gap: 4rem; }
  .about-facts { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}

/* ---------- 7. Ce que je peux apporter ---------- */
.apport-grid { display: grid; gap: 2.5rem; }
.apport { padding-top: 1.1rem; border-top: 3px solid var(--indigo); }
.apport h3 { margin-bottom: .5rem; color: var(--indigo); font-size: clamp(1.6rem, 3.6vw, 2.15rem); }
.apport p { max-width: 28rem; color: var(--muted); }

/* ---------- 8. Compétences ---------- */
.skills { display: grid; gap: 3rem; }

.tools h3, .domain h3 { font-family: var(--sans); }
.tools h3 { margin-bottom: 1rem; font-size: 1rem; font-weight: 600; color: var(--muted); }
.tools-list li {
  font-family: var(--serif); font-weight: 700; color: var(--indigo);
  font-size: clamp(1.8rem, 4.4vw, 2.6rem); line-height: 1.3;
}
.tools-list li span { font-family: var(--sans); font-weight: 400; font-size: 1rem; color: var(--muted); }

.tools-more { margin-top: 1.25rem; color: var(--muted); }
.domains { display: grid; gap: 2rem; align-content: start; }
.domain h3 { margin-bottom: .35rem; font-size: 1.08rem; font-weight: 600; color: var(--ink); }
.domain p { color: var(--muted); }

/* ---------- 9. Projets ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin-bottom: 1.75rem; }
.filter {
  padding: .35rem 0; font: inherit; font-weight: 500; color: var(--muted);
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.filter:hover { color: var(--indigo); }
.filter.is-active { color: var(--indigo); font-weight: 600; border-bottom-color: var(--indigo); }

.project { border-top: 1px solid #c4c9e3; }
.project:last-child { border-bottom: 1px solid #c4c9e3; }
.project.is-hidden { display: none; }

.project summary {
  position: relative; display: grid; gap: .15rem; padding: 1.35rem 2.75rem 1.35rem 0;
  cursor: pointer; list-style: none;
}
.project summary::-webkit-details-marker { display: none; }
.project summary::after {
  content: "+"; position: absolute; right: .25rem; top: 1.05rem;
  font-size: 1.8rem; line-height: 1; color: var(--indigo); transition: transform .25s ease;
}
.project[open] summary::after { transform: rotate(45deg); }

.project-title { font-size: clamp(1.15rem, 2.4vw, 1.4rem); transition: color .2s ease; }
.project summary:hover .project-title { color: var(--indigo); }
.project-cats { font-size: .92rem; color: var(--muted); }

.project-body { max-width: 44rem; padding: 0 2.75rem 1.6rem 0; color: var(--muted); }
.project[open] .project-body { animation: fade-in .3s ease; }
.project-tools { margin-top: .7rem; font-weight: 500; color: var(--indigo); font-size: .96rem; }
.no-result { margin-top: 1.5rem; color: var(--muted); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 10. Expérience ---------- */
.jobs { max-width: 50rem; padding-left: 1.5rem; border-left: 2px solid var(--line); }
.job { position: relative; padding-bottom: 2.75rem; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: calc(-1.5rem - 7px); top: .3rem;
  width: 12px; height: 12px; border-radius: 50%; background: var(--indigo);
}
.job-date { margin-bottom: .25rem; font-size: .95rem; font-weight: 600; color: var(--muted); }
.job h3 { font-size: 1.3rem; }
.job-org { margin: .2rem 0 .9rem; font-weight: 600; color: var(--indigo); }
.job-list { display: grid; gap: .45rem; color: var(--muted); }
.job-list li { position: relative; padding-left: 1.1rem; }
.job-list li::before { content: "–"; position: absolute; left: 0; color: var(--indigo); }
.job-skills { margin-top: .9rem; font-size: .93rem; color: var(--muted); }

/* ---------- 11. Formations ---------- */
.edu-group + .edu-group { margin-top: 3rem; }
.edu-group > h3 { margin-bottom: 1.1rem; font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--muted); }
.edu-list { display: grid; gap: 1.4rem; }
.edu { display: grid; gap: .15rem; }
.edu-year { font-size: .95rem; font-weight: 600; color: var(--muted); }
.edu h4 { font-family: var(--serif); font-size: 1.15rem; line-height: 1.3; }
.edu p:not(.edu-year) { color: var(--muted); }
.lang-list { display: flex; flex-wrap: wrap; gap: .4rem 2rem; color: var(--muted); }
.lang-list strong { color: var(--ink); font-weight: 600; margin-right: .3rem; }

/* ---------- 12. Contact ---------- */
.contact { padding: 5rem 0; background: var(--indigo); color: #fff; }
.contact-grid { display: grid; gap: 3rem; }

.contact h2 { margin-bottom: 1.75rem; font-size: clamp(1.7rem, 3.8vw, 2.4rem); }
.contact-mail {
  font-family: var(--serif); font-weight: 700; font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--gold); text-underline-offset: 4px; word-break: break-word;
}
.contact-mail:hover { color: #fff; }
.contact-links { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 1.25rem 0 2rem; color: var(--on-dark); }
.contact-links a { color: #fff; }

.contact-form { display: grid; gap: 1.2rem; align-content: start; }
.field { display: grid; gap: .1rem; }
.field label { font-size: .92rem; color: var(--on-dark-soft); }
.field input, .field textarea {
  width: 100%; padding: .55rem 0; font: inherit; color: #fff;
  background: transparent; border: 0; border-bottom: 1.5px solid rgba(255, 255, 255, .4); border-radius: 0;
  transition: border-color .2s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--gold); box-shadow: 0 1px 0 var(--gold); }
.field.has-error input, .field.has-error textarea { border-bottom-color: #ffb4a2; }
.error { min-height: 1.1em; font-size: .85rem; color: #ffb4a2; }
.contact-form .btn { justify-self: start; }
.form-status { font-size: .95rem; color: var(--on-dark); }
.form-status.is-success { color: var(--gold); }

/* ---------- 13. Pied de page ---------- */
.site-footer { padding: 1.5rem 0; background: var(--indigo-deep); color: var(--on-dark-soft); font-size: .92rem; }
.footer-wrap { display: flex; flex-direction: column; gap: .75rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.footer-links a { color: var(--on-dark); }
.footer-links a:hover { color: #fff; }

/* ---------- 13b. Blog et articles ---------- */
[hidden] { display: none !important; }
.text-link { font-weight: 600; text-underline-offset: 4px; }
.noscript, .load-error { padding: 1.5rem 0; color: var(--muted); }
.more-link { margin-top: 1.75rem; }

.page-blog { padding: 3.5rem 0 5rem; min-height: 60vh; }
.blog-head h1 { margin-bottom: 1.75rem; color: var(--indigo); font-size: clamp(2rem, 5vw, 3rem); }

.post-list { display: grid; }
.post-row { display: grid; gap: .35rem; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.post-row:last-child { border-bottom: 1px solid var(--line); }
.post-row h2, .post-row h3 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); }
.post-row h2 a, .post-row h3 a { color: var(--ink); text-decoration: none; transition: color .2s ease; }
.post-row h2 a:hover, .post-row h3 a:hover { color: var(--indigo); text-decoration: underline; text-underline-offset: 4px; }
.post-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; font-size: .92rem; color: var(--muted); }
.post-summary { max-width: 42rem; color: var(--muted); }

.post { max-width: 44rem; }
.post h1 { margin: 1.25rem 0 .75rem; color: var(--indigo); font-size: clamp(2rem, 5vw, 2.8rem); }
.post-cover { width: 100%; height: auto; margin: 1.75rem 0; border-radius: var(--radius); }
.post-foot { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

.prose { margin-top: 2rem; font-size: 1.12rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.2rem; }
.prose h2 { margin-top: 2.4rem; color: var(--indigo); font-size: 1.7rem; }
.prose h3 { margin-top: 2rem; font-size: 1.35rem; }
.prose h4 { margin-top: 1.6rem; font-family: var(--serif); font-size: 1.15rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4rem; }
.prose blockquote { padding-left: 1.1rem; border-left: 3px solid var(--indigo); color: var(--muted); font-family: var(--serif); }
.prose code { padding: .1em .35em; background: var(--tint); border-radius: 4px; font-size: .92em; }
.prose pre { overflow-x: auto; padding: 1rem; background: var(--tint); border-radius: var(--radius); }
.prose pre code { padding: 0; background: none; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose hr { border: 0; border-top: 1px solid var(--line); }

/* ---------- 14. Apparition discrète (opacité uniquement) ---------- */
.js .reveal { opacity: 0; transition: opacity .7s ease; }
.js .reveal.is-visible { opacity: 1; }

/* ---------- 15. Tablette (≥ 640px) ---------- */
@media (min-width: 640px) {
  .apport-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem 4rem; }
  .domains { grid-template-columns: repeat(2, 1fr); gap: 2rem 3rem; }
  .footer-wrap { flex-direction: row; justify-content: space-between; align-items: center; }

  /* Chaîne horizontale */
  .chain { display: flex; justify-content: space-between; gap: 1rem; max-width: 40rem; }
  .chain::before { left: 6px; right: 6px; top: 5px; bottom: auto; width: auto; height: 2px; }
  .chain li { padding: 1.6rem 0 0; }
  .chain li::before { top: 0; }

  .edu { grid-template-columns: 12rem 1fr; gap: 1.5rem; }
}

/* ---------- 16. Ordinateur (≥ 900px) ---------- */
@media (min-width: 900px) {
  .section { padding: 6.5rem 0; }
  .contact { padding: 6.5rem 0; }

  /* Menu horizontal */
  .menu-toggle { display: none; }
  .nav {
    position: static; display: flex !important; flex-direction: row; align-items: center;
    gap: 1.5rem; padding: 0; background: none; border: 0;
  }
  .nav-list { width: auto; flex-direction: row; gap: 1.35rem; }
  .nav-list a { padding: .35rem 0; font-size: .95rem; border-bottom: 2px solid transparent; }
  .nav-list a:hover, .nav-list a.is-active { border-bottom-color: var(--indigo); }

  .hero { padding-top: 5rem; }
  .hero-inner { grid-template-columns: 1.25fr .75fr; gap: 4rem; }
  .hero-copy { padding-bottom: 4.5rem; }
  .hero-photo { width: min(100%, 400px); justify-self: end; }

  .skills { grid-template-columns: .85fr 1.15fr; gap: 5rem; }
  .project summary { grid-template-columns: 1fr 16rem; align-items: baseline; gap: 2rem; }
  .project-cats { text-align: left; }
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
}

/* ---------- 17. Préférences utilisateur ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; }
}

/* ---------- 18. Impression ---------- */
@media print {
  .site-header, .hero-cta, .filters, .contact-form, .site-footer { display: none !important; }
  .js .reveal { opacity: 1 !important; }
  .hero, .contact { background: #fff; color: #000; }
  .project:not([open]) .project-body { display: block; }
}
