/*
  Direction : « atelier de planification ».
  Fond noir chaud, titres en IBM Plex Mono capitales comme des plaques de machine,
  illustrations isométriques bicolores.
  Règle de couleur : l'orange marque les grands titres et ce qui est calculé ou actif
  (le robot et son chemin, le poste actuel, les actions). Les données et le passé restent en gris chaud.
*/

/* Polices IBM Plex (licence SIL OFL) servies par le site, sous-ensemble latin : aucun serveur externe avant l'affichage.
   Plex Sans est une police variable, un seul fichier couvre les graisses 400 à 600. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(fonts/ibm-plex-sans-variable-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/ibm-plex-mono-600-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #1c1b19;          /* neutre dominant */
  --surface: #232220;
  --line: #3d3a37;
  --line-strong: #57524d;
  --text: #d6cfcb;        /* titres de contenu */
  --body: #a8a09b;        /* texte courant */
  --muted: #8f8782;       /* texte secondaire, contraste 5:1 sur --bg */
  --plate: #bcb3ae;       /* petites plaques mono (nom en haut, entreprises) et boutons pleins */
  --solution: #ef8a3c;    /* accent : grands titres et ce que l'algorithme produit */
  --solution-light: #f7a65a;
  --solution-dark: #c4651c;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
}

[data-lang="fr"] [lang="en"], [data-lang="en"] [lang="fr"] { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--body); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }

/* ---- Boutons-pilules (contour, le sélectionné est plein) ---- */
.pill { font: 500 .9rem/1 var(--sans); color: var(--text); background: transparent; border: 1px solid var(--line-strong);
        border-radius: 4px; padding: 8px 14px; text-decoration: none; cursor: pointer; display: inline-flex; gap: 6px;
        transition: border-color .15s, background .15s, color .15s; }
.pill:hover { border-color: var(--plate); }
.pill.solid, .pill[aria-pressed="true"] { background: var(--plate); color: var(--bg); border-color: var(--plate); }

/* ---- Barre du haut ---- */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent);
       backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.brand { font: 600 .82rem var(--mono); letter-spacing: .12em; color: var(--plate); text-decoration: none; }
.links { display: flex; align-items: center; gap: 22px; font-size: .92rem; }
.links a { text-decoration: none; color: var(--body); }
.links a:hover { color: var(--text); }
.lang { padding: 4px 8px; font-size: .8rem; }
.lang span { opacity: .45; }
[data-lang="fr"] .lang .on-fr, [data-lang="en"] .lang .on-en { opacity: 1; }
@media (max-width: 680px) { .links a { display: none; } }

/* ---- En-tête : texte + solveur isométrique ---- */
.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 40px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding-top: 44px; } }
h1 { font: 600 clamp(2.6rem, 6.4vw, 4.4rem)/1.02 var(--mono); letter-spacing: .02em; color: var(--solution); margin: 0 0 18px; }
.role { font-size: 1.12rem; color: var(--text); margin: 0 0 16px; }
.pitch { max-width: 56ch; margin: 0 0 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.solver { margin: 0; }
.solver svg { display: block; width: 100%; height: auto; overflow: visible; }
.solver figcaption { font: 500 .78rem var(--mono); color: var(--muted); text-align: center; margin-top: 6px; min-height: 1.4em; }
.solver figcaption b { color: var(--solution); font-weight: 600; }

/* ---- Sections ---- */
section { padding-block: 48px; }
h2 { font: 600 clamp(1.7rem, 3.4vw, 2.4rem)/1.1 var(--mono); letter-spacing: .04em; color: var(--solution); margin: 0 0 22px; }
.about p { font-size: 1.08rem; max-width: 70ch; margin: 0; color: var(--body); }

/* ---- Projets : filtres et cartes à filet bas ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 40px; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }
.card { border-bottom: 1px solid var(--line-strong); padding-bottom: 22px; display: flex; flex-direction: column; gap: 8px; }
.card[hidden] { display: none; }
.card h3 { font: 600 1.25rem/1.3 var(--sans); color: var(--text); margin: 0; }
.card p { margin: 0; color: var(--muted); }
.card .stack { color: var(--body); font-size: .92rem; }
.more { font: 500 .85rem var(--sans); letter-spacing: .06em; color: var(--muted); margin-top: 6px; }
a.more { color: var(--solution); text-decoration: none; align-self: flex-start; }  /* orange = une action possible */
a.more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Parcours : diagramme de Gantt ---- */
.gantt { --span: calc(var(--to) - var(--from)); }
.gantt .axis, .gantt .track { position: relative; margin-left: 38%; }
.gantt .axis { height: 30px; border-bottom: 1px solid var(--line); }
.gantt .axis span { position: absolute; left: calc((var(--t) - var(--from)) / var(--span) * 100%); bottom: 6px;
                    font: 500 .75rem var(--mono); color: var(--muted); transform: translateX(-50%); }
.gantt .axis .now { position: absolute; left: calc((var(--t) - var(--from)) / var(--span) * 100%); top: 100%; width: 0;
                    height: var(--now-h, 560px); border-left: 1px dashed var(--solution-dark); font-style: normal; z-index: 1; }
/* L'étiquette finit sur la ligne au lieu d'être centrée dessus : la ligne est au bord droit du planning,
   une étiquette centrée dépasserait de la page. */
.gantt .axis .now b { position: absolute; top: -40px; right: 0; font: 500 .72rem var(--mono);
                      color: var(--solution); white-space: nowrap; }
.task { display: grid; grid-template-columns: 38% 1fr; align-items: start; border-bottom: 1px solid var(--line); padding: 18px 0; }
.task .label { padding-right: 28px; }
.task h3 { font: 600 1.05rem/1.35 var(--sans); color: var(--text); margin: 0 0 2px; }
.task .org { font-size: .9rem; color: var(--body); margin: 0 0 6px; }
.task p { margin: 0; color: var(--muted); font-size: .94rem; }
.gantt .track { margin-left: 0; height: 26px; margin-top: 4px;
                background-image: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / 7)); }
.bar { position: absolute; top: 3px; height: 20px; border-radius: 2px;
       left: calc((var(--s) - 2020) / 7 * 100%); width: calc((var(--e) - var(--s)) / 7 * 100%);
       background: var(--line-strong); box-shadow: inset 0 -5px 0 rgba(0,0,0,.22); }
.current .bar { background: var(--solution); box-shadow: inset 0 -5px 0 var(--solution-dark); }
.current h3 { color: var(--solution-light); }
.bar.open::after { content: ""; position: absolute; right: -9px; top: 4px; border: 6px solid transparent; border-left: 7px solid var(--solution); }
/* Même entreprise : les deux rangées sont rattachées au nom de l'entreprise par un trait en pointillés. */
.company { position: relative; border-bottom: 1px solid var(--line); }
.company .task:last-child { border-bottom: 0; }
.company::before { content: ""; position: absolute; left: 3px; top: 46px; bottom: 34px; border-left: 1.5px dashed var(--line-strong); }
.company .task .label { padding-left: 20px; }
.company-head { padding-top: 20px; }
.company-name { margin: 0; display: flex; align-items: center; font: 600 .8rem var(--mono); letter-spacing: .12em; color: var(--plate); }
/* Logos des entreprises et écoles : petits, en gris clair monochrome pour rester dans la palette. */
.logo { height: 18px; width: auto; margin-right: 9px; filter: brightness(0) invert(.78); flex: none; }
.task .org .logo { height: 16px; vertical-align: -3px; margin-right: 8px; }
@media (max-width: 720px) {
  .gantt .axis { margin-left: 0; }
  .task { grid-template-columns: 1fr; }
  .task .label { padding-right: 0; order: 2; margin-top: 10px; }
  .gantt .track { order: 1; }
}

/* ---- Compétences ---- */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; }
.skills div { border-bottom: 1px solid var(--line); padding: 14px 0; }
.skills dt { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.skills dd { margin: 0; color: var(--muted); }
@media (max-width: 720px) { .skills { grid-template-columns: 1fr; } }

/* ---- Contact ---- */
.contact ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.contact a { font: 500 .95rem var(--sans); letter-spacing: .06em; color: var(--solution); text-decoration: none;
             border-bottom: 1px solid transparent; }
.contact a:hover { border-bottom-color: var(--solution); }

/* ---- E-mail copié au clic : petite bulle « Copié ! » au-dessus du lien ---- */
[data-copy] { position: relative; }
.pill.copied { border-color: var(--solution); color: var(--solution); }
.contact a.copied { border-bottom-color: var(--solution); }
.copy-tip { position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%); pointer-events: none;
            font: 600 .72rem/1 var(--mono); letter-spacing: .06em; white-space: nowrap; color: var(--bg);
            background: var(--solution); border-radius: 4px; padding: 6px 9px; animation: copy-tip 1.6s ease forwards; }
.copy-tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
                   border: 5px solid transparent; border-top-color: var(--solution); }
@keyframes copy-tip { 0% { opacity: 0; transform: translate(-50%, 5px) scale(.9); }
                      12%, 75% { opacity: 1; transform: translate(-50%, 0) scale(1); }
                      100% { opacity: 0; transform: translate(-50%, -3px); } }
@keyframes copy-tip-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .copy-tip { animation-name: copy-tip-fade; } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.foot { color: var(--muted); font: 500 .78rem var(--mono); padding-top: 22px; padding-bottom: 40px; border-top: 1px solid var(--line); margin-top: 30px; }
