/* =====================================================================
   Portfolio BTS SIO — feuille de style
   ===================================================================== */

/* Polices hébergées avec le site (assets/fonts) : aucun appel à Google,
   le site s'affiche à l'identique même sans accès à internet. */
@font-face {
  font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("../assets/fonts/inter-latin-wght-normal.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: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations"), url("../assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url("../assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations"), url("../assets/fonts/jetbrains-mono-latin-wght-normal.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: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url("../assets/fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2-variations"), url("../assets/fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #1a1f29;
  --text-muted: #5b6474;
  --border: #dde2ea;
  --accent: #0f6fd1;
  --accent-soft: #e3effc;
  --accent-text: #0b5bb0;
  --ok: #1e8e5a;
  --ok-soft: #e1f4ea;
  --warn: #b76e00;
  --warn-soft: #fff1d9;
  --muted-soft: #eceff3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 12px;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --maxw: 1120px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1d232d;
  --text: #e6e9ef;
  --text-muted: #9aa4b2;
  --border: #2a313c;
  --accent: #4ea1ff;
  --accent-soft: #15273d;
  --accent-text: #7db8ff;
  --ok: #3fbf7f;
  --ok-soft: #14301f;
  --warn: #e0a33a;
  --warn-soft: #33270f;
  --muted-soft: #222833;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; width: 100%; min-width: 0; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -.02em; }
h2 { font-size: 1.5rem; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 8px; }

/* ---------- En-tête & navigation ---------- */
/* En-tête sans barre : les onglets se fondent dans le fond de la page */
.site-header { position: relative; z-index: 50; background: transparent; }
.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }

.nav { flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; }
.nav a {
  position: relative; color: var(--text-muted); padding: 8px 11px; font-size: .92rem; font-weight: 500; white-space: nowrap;
  transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform .25s cubic-bezier(.2, .7, .2, 1);
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a:hover::after { transform: scaleX(.5); }
.nav a[aria-current="page"] { color: var(--accent-text); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-header .icon-btn { background: transparent; border-color: transparent; color: var(--text-muted); }
.site-header .icon-btn:hover { background: transparent; color: var(--text); }

.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

@media (max-width: 1020px) {
  .menu-btn { display: grid; margin-right: auto; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; padding: 10px 16px 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
    margin: 0 12px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; }
  .nav a::after { display: none; }
  .nav a[aria-current="page"] { background: var(--accent-soft); border-radius: 8px; }
}

/* ---------- Bandeaux de page ---------- */
.page-head { padding: 48px 0 28px; }
.eyebrow {
  font-family: var(--mono); font-size: .8rem; color: var(--accent-text); letter-spacing: .04em; text-transform: uppercase;
}
.page-head p.lead { color: var(--text-muted); font-size: 1.08rem; max-width: 760px; }

.section { padding: 12px 0 48px; }
.section + .section { padding-top: 0; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.section-title h2 { margin: 0; }
.section-title .count { color: var(--text-muted); font-size: .9rem; }

/* ---------- Hero accueil ---------- */
/* Accueil épuré : nom, domaines qui s'écrivent, trois boutons, centrés à l'écran */
.hero-simple {
  min-height: calc(100svh - 64px);
  display: grid; place-items: center; text-align: center; padding: 40px 0;
}
.hero-center { display: flex; flex-direction: column; align-items: center; }
.hero-center .eyebrow { margin: 0 0 14px; }
.hero-simple h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); letter-spacing: -.03em; margin: 0 0 14px; }
.hero h1 span { color: var(--accent-text); }
.hero-roles { font-family: var(--mono); font-size: clamp(1rem, 2.4vw, 1.2rem); color: var(--text-muted); min-height: 1.6em; margin: 0; }
.hero-prompt { color: var(--accent-text); }
.hero-btns { justify-content: center; margin-top: 32px; }
.cursor { display: inline-block; width: 8px; height: 1em; background: #c9d1d9; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Boutons, badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 9px;
  font-weight: 600; font-size: .95rem; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; font-family: inherit;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn svg { width: 16px; height: 16px; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-comp { font-family: var(--mono); background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
}
/* Logos officiels : posés sur une pastille blanche pour rester lisibles en thème sombre */
.tag .logo { width: 18px; height: 18px; padding: 2px; background: #fff; border-radius: 4px; flex: none; object-fit: contain; }
.inline-logo { width: 18px; height: 18px; border-radius: 3px; vertical-align: -4px; object-fit: contain; }
.footer-logo-link { display: inline-flex; align-items: center; gap: 6px; }
.tool-icon.brand { background: #fff; }
.tool-icon .brand-logo { width: 24px; height: 24px; object-fit: contain; }

.example-flag {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 9px;
  background: var(--warn-soft); color: var(--warn); font-size: .88rem; font-weight: 500; margin-bottom: 16px;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.nav-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); transition: transform .15s, border-color .15s; }
.nav-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.nav-card .num { font-family: var(--mono); color: var(--accent-text); font-size: .8rem; }
.nav-card p { color: var(--text-muted); font-size: .92rem; margin: 0; }

.stat { text-align: left; }
.stat strong { display: block; font-size: 2rem; line-height: 1.1; }
.stat span { color: var(--text-muted); font-size: .9rem; }

/* ---------- Timeline (parcours) ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; margin-bottom: 18px; }
.tl-item::before {
  content: ""; position: absolute; left: -26px; top: 26px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.tl-period { font-family: var(--mono); font-size: .82rem; color: var(--accent-text); }
.tl-item h3 { margin: 4px 0 2px; }
.tl-sub { color: var(--text-muted); font-size: .92rem; margin-bottom: 8px; }
.tl-item ul { margin: 6px 0 0; padding-left: 20px; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.skill-card h3 { font-size: 1rem; margin-bottom: 10px; }
.skill-card ul { margin: 0; padding-left: 20px; font-size: .93rem; }
.avatar img { object-position: 50% 30%; }

.profile-card { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.avatar {
  width: 96px; height: 96px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text);
  display: grid; place-items: center; font-weight: 700; font-size: 1.8rem; overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Photo affichée en entier (format portrait, sans recadrage) */
.avatar.avatar-photo {
  display: block; width: 160px; height: auto; border-radius: 14px; background: none;
  border: 2px solid var(--accent); box-shadow: 0 0 0 5px var(--accent-soft);
}
.avatar.avatar-photo img { width: 100%; height: auto; display: block; object-fit: initial; }
@media (max-width: 560px) { .avatar.avatar-photo { width: 140px; } }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.dl dt { color: var(--text-muted); font-size: .9rem; }
.dl dd { margin: 0; font-weight: 500; }

/* ---------- Projets ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
/* Réalisations : deux colonnes CFA / entreprise */
.projects-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
.projects-col-head { padding-bottom: 14px; margin-bottom: 18px; border-bottom: 2px solid var(--accent); }
.projects-col-head h2 { margin: 0 0 4px; font-size: 1.35rem; }
.projects-col-head .count { color: var(--text-muted); font-size: .95rem; font-weight: 500; }
.projects-col-head p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.projects-col-list { display: grid; gap: 18px; }
@media (max-width: 860px) { .projects-cols { grid-template-columns: 1fr; gap: 40px; } }
.filter-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .88rem; font-weight: 500;
}
.filter-btn:hover { color: var(--text); }
.filter-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.project-card { display: flex; flex-direction: column; gap: 10px; color: var(--text); transition: border-color .15s, transform .15s; }
.project-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.project-card h3 { margin: 0; }
.project-card p { color: var(--text-muted); font-size: .93rem; margin: 0; }
.project-card .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.project-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-muted); }

/* Détail projet */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.detail-aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } .detail-aside { position: static; } }
.detail-block { margin-bottom: 28px; }
.detail-block h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.detail-block h2::before { content: ""; width: 4px; height: 1.1em; background: var(--accent); border-radius: 2px; }
.detail-block ul { padding-left: 20px; margin: 0; }
.detail-block li { margin-bottom: 4px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 620px) { .two-col { grid-template-columns: 1fr; } }
.tech-group { margin-bottom: 12px; }
.tech-group h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 6px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; cursor: zoom-in; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.gallery img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.gallery figcaption { font-size: .82rem; color: var(--text-muted); padding: 8px 10px; }

.doc-list { list-style: none; padding: 0 !important; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-list a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface); color: var(--text);
}
.doc-list a:hover { border-color: var(--accent); text-decoration: none; }
.doc-list svg { width: 18px; height: 18px; color: var(--accent-text); flex: none; }

.video-wrap { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #000; }
.video-wrap iframe, .video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.empty { color: var(--text-muted); font-style: italic; font-size: .92rem; }

.comp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.comp-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .85); display: none; z-index: 200;
  align-items: center; justify-content: center; padding: 24px; flex-direction: column; gap: 12px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 82vh; max-width: 100%; border-radius: 8px; }
.lightbox p { color: #ddd; margin: 0; text-align: center; }
.lightbox .icon-btn { position: absolute; top: 16px; right: 16px; background: #222; color: #fff; border-color: #444; }

/* ---------- Tableau de synthèse ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.synth { border-collapse: collapse; width: 100%; min-width: 860px; font-size: .9rem; }
.synth th, .synth td { border-bottom: 1px solid var(--border); padding: 10px 12px; vertical-align: middle; }
.synth thead th {
  background: var(--surface-2); font-size: .78rem; text-align: center; font-weight: 600; vertical-align: bottom;
  position: sticky; top: 0;
}
.synth thead th:first-child, .synth thead th:nth-child(2) { text-align: left; }
.synth thead th .code { display: block; font-family: var(--mono); color: var(--accent-text); font-size: .85rem; margin-bottom: 4px; }
.synth td.check { text-align: center; }
.synth td.check span {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px;
  background: var(--ok-soft); color: var(--ok); font-weight: 700;
}
.synth tr.group td { background: var(--muted-soft); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.synth tbody tr:not(.group):hover td { background: var(--surface-2); }
.synth tfoot td { font-weight: 700; background: var(--surface-2); text-align: center; }
.synth tfoot td:first-child { text-align: left; }
.synth .periode { font-family: var(--mono); font-size: .8rem; color: var(--text-muted); white-space: nowrap; }

.coverage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .coverage { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .coverage { grid-template-columns: 1fr; } }
.cov-item { display: flex; flex-direction: column; gap: 8px; }
.cov-item header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cov-item h3 { font-size: .98rem; margin: 0; }
.cov-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.cov-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.cov-item details { font-size: .86rem; color: var(--text-muted); }
.cov-item details ul { padding-left: 18px; margin: 6px 0 0; }
.cov-item summary { cursor: pointer; }

/* ---------- Veille ---------- */
.tool-card { display: flex; gap: 14px; align-items: flex-start; }
.tool-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text);
  display: grid; place-items: center; flex: none;
}
.tool-icon svg { width: 20px; height: 20px; }
.tool-card h3 { font-size: 1rem; margin: 0 0 2px; }
.tool-card p { margin: 0; color: var(--text-muted); font-size: .9rem; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before {
  content: counter(step); flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .82rem; font-weight: 700;
}

.article { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.article:last-child { border-bottom: 0; }
.article time { font-family: var(--mono); font-size: .82rem; color: var(--text-muted); }
.article h3 { font-size: 1rem; margin: 0 0 4px; }
.article p { margin: 0; color: var(--text-muted); font-size: .92rem; }
@media (max-width: 560px) { .article { grid-template-columns: 1fr; gap: 4px; } }

.callout {
  border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 16px 20px; border-radius: 0 10px 10px 0;
}
.callout p:last-child { margin: 0; }

/* ---------- Certifications ---------- */
.cert-card { display: flex; flex-direction: column; gap: 8px; }
.cert-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cert-card h3 { margin: 0; font-size: 1.05rem; }
.cert-card .org { color: var(--text-muted); font-size: .88rem; }
.cert-card p { margin: 0; font-size: .92rem; }
.cert-card .foot { margin-top: auto; padding-top: 8px; }

/* ---------- Export du tableau de synthèse ---------- */
.export-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.export-status { margin: 0; font-size: .82rem; color: var(--text-muted); max-width: 340px; text-align: right; }
@media (max-width: 620px) { .export-box { align-items: flex-start; } .export-status { text-align: left; } }

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; } }
.contact-col { display: flex; flex-direction: column; gap: 14px; }
.contact-ways { display: flex; flex-direction: column; gap: 12px; }
.contact-way { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.contact-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.contact-text a, .contact-text span:last-child { overflow-wrap: anywhere; font-weight: 500; }
.contact-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form h2 { margin: 0; font-size: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .88rem; font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field.invalid input, .field.invalid textarea { border-color: #e5484d; }
.field-error { color: #e5484d; font-size: .82rem; min-height: 0; }
.field-error:empty { display: none; }
.contact-form .btn { align-self: flex-start; }
.form-status { margin: 0; color: var(--ok); font-size: .9rem; }
.form-status:empty { display: none; }

/* ---------- Fenêtre « CV / attestation disponible sur demande » ---------- */
.demande-dialog {
  width: min(440px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.demande-dialog::backdrop { background: rgba(5, 8, 12, .6); backdrop-filter: blur(3px); }
.demande-dialog h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.demande-dialog h2 svg { width: 22px; height: 22px; color: var(--accent-text); flex: none; }
.demande-dialog p { color: var(--text-muted); margin: 0 0 18px; }
.demande-dialog .demande-nom { color: var(--text); font-weight: 600; margin: -4px 0 10px; }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 24px; }
.footer-inner { padding: 48px 20px 24px; color: var(--text-muted); font-size: .9rem; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 32px 48px; padding-bottom: 32px; }
.footer-brand { max-width: 380px; }
.footer-brand strong { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: 8px; }
.footer-brand p { margin: 0 0 16px; line-height: 1.6; }
.footer-socials { display: flex; gap: 10px; }
.footer-social {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
  transition: color .2s, border-color .2s, transform .2s;
}
.footer-social svg { width: 18px; height: 18px; }
.footer-social:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.footer-col { max-width: 640px; }
.footer-col h3 { margin: 0 0 14px; color: var(--text); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.footer-nav { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, auto); gap: 12px 36px; }
.footer-nav a { color: var(--text); opacity: .8; font-size: .92rem; text-decoration: none; white-space: nowrap; transition: color .2s, opacity .2s; }
.footer-nav a:hover { color: var(--accent); opacity: 1; }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  padding-top: 20px; border-top: 1px solid var(--border); font-size: .82rem;
}
.footer-hint:empty { display: none; }
.footer-updated { font-family: var(--mono); font-size: .78rem; }
.footer-updated:empty { display: none; }
@media (max-width: 520px) { .footer-nav { grid-template-columns: repeat(2, auto); justify-content: start; } .footer-bottom { flex-direction: column; align-items: flex-start; } }

.back-top {
  position: fixed; right: 18px; bottom: 18px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40;
}
.back-top.show { opacity: 1; pointer-events: auto; }

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

/* ---------- Animations (pilotées par js/animations.js) ---------- */
.hero { position: relative; }
.hero > :not(.net-bg) { position: relative; z-index: 1; }
.net-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .45;
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 60% 45%, #000 35%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 90% at 60% 45%, #000 35%, transparent 80%);
}
:root[data-theme="dark"] .net-bg { opacity: .55; }

.reveal { opacity: 0; transform: translateY(24px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }

html, body { overflow-x: clip; }
.page-head { position: relative; }
.page-head > :not(.net-bg) { position: relative; z-index: 1; }
.net-bg.bleed { left: 50%; width: 100vw; transform: translateX(-50%); }
.cursor-sm { width: 7px; height: .95em; margin-left: 2px; background: var(--accent-text); }

.page-stats { padding-top: 0; }
.page-stats .grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.project-card, .nav-card, .stat, .tool-card, .cert-card, .cov-item, .news-card, .news-lead { position: relative; overflow: hidden; }
.tl-item { will-change: transform; }
.stat::after, .tool-card::after, .cert-card::after, .cov-item::after, .news-card::after, .news-lead::after,
.project-card::after, .nav-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
}
.project-card:hover::after, .nav-card:hover::after, .stat:hover::after, .tool-card:hover::after, .cert-card:hover::after,
.cov-item:hover::after, .news-card:hover::after, .news-lead:hover::after { opacity: 1; }

.cov-bar i { transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }

.synth td.check span.pre-pop { transform: scale(0); }
.synth td.check span.pop { transform: scale(1); transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Écran de démarrage : logo ED qui se dessine ---------- */
.booting body { overflow: hidden; }
.booting body::before { content: ""; position: fixed; inset: 0; background: #0b0e13; z-index: 999; }
.boot { position: fixed; inset: 0; z-index: 1000; background: #0b0e13; display: grid; place-items: center; cursor: pointer; }
.boot-logo { width: min(150px, 36vw); height: auto; overflow: visible; }
/* Tracé progressif : chaque trait mesure 1 (pathLength) et se dévoile en faisant glisser les pointillés */
.boot-logo polygon, .boot-logo path {
  fill: none; stroke: #4ea1ff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 2; stroke-dashoffset: 1.05;
}
.boot-logo path { stroke-width: 4; }
.boot-hex { animation: boot-draw .7s ease .1s forwards; }
.boot-letters { animation: boot-draw .6s ease .75s forwards; }
@keyframes boot-draw { to { stroke-dashoffset: 0; } }

/* ---------- Actualités en direct (veille) ---------- */
.live-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, #e5484d 16%, transparent); color: #e5484d; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .6); } 100% { box-shadow: 0 0 0 9px rgba(229, 72, 77, 0); } }
.live-tools { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: .85rem; }
.icon-btn.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ticker {
  display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--surface); margin-bottom: 16px; font-size: .88rem;
}
.ticker-label {
  flex: none; display: flex; align-items: center; padding: 0 14px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
}
.ticker-track { overflow: hidden; flex: 1; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-move { display: flex; width: max-content; animation: ticker var(--dur, 60s) linear infinite; }
.ticker-move > div { display: flex; align-items: center; white-space: nowrap; padding: 10px 0; }
.ticker-move a { color: var(--text); padding: 0 4px; }
.ticker-move a strong { color: var(--accent-text); margin-right: 4px; }
.ticker:hover .ticker-move { animation-play-state: paused; }
.tick-sep { color: var(--text-muted); font-size: .6rem; padding: 0 14px; }
@keyframes ticker { to { transform: translateX(-50%); } }

.live-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.live-filters .filters { margin: 0; }
.live-search {
  flex: 0 1 300px; min-width: 200px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: .9rem;
}
.live-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.live-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
@media (max-width: 860px) { .live-top { grid-template-columns: 1fr; } }
.news-lead, .news-card { display: flex; flex-direction: column; padding: 0; color: var(--text); transition: border-color .15s; }
.news-lead:hover, .news-card:hover { text-decoration: none; border-color: var(--accent); }
.news-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; flex: none; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.news-lead:hover .news-thumb img, .news-card:hover .news-thumb img { transform: scale(1.05); }
.news-ph { display: none; }
.news-thumb.noimg {
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 18%, var(--surface-2));
}
.news-thumb.noimg .news-ph { display: block; font-weight: 700; font-size: 1.2rem; color: var(--c); letter-spacing: .02em; }
.news-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.news-body h3 { font-size: 1rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-lead .news-body h3 { font-size: 1.3rem; }
.news-lead .news-body p { color: var(--text-muted); margin: 0; font-size: .93rem; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); }
.news-meta strong { color: var(--text); font-weight: 600; }
.src-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.news-new { padding: 1px 7px; font-size: .7rem; }
.is-new { animation: newflash 2.4s ease-out; }
@keyframes newflash { 0%, 30% { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); } }

.live-side { display: flex; flex-direction: column; padding: 16px 18px; }
.live-side-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); margin-bottom: 4px; }
.side-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.side-item:last-child { border-bottom: 0; padding-bottom: 0; }
.side-item:hover { text-decoration: none; }
.side-item:hover .side-title { color: var(--accent-text); }
.side-title { font-weight: 600; font-size: .95rem; line-height: 1.35; }

.live-grid .news-card { height: 100%; }
.live-more { display: flex; justify-content: center; margin-top: 18px; }
.live-note { color: var(--text-muted); font-size: .82rem; text-align: center; margin: 12px 0 0; }
.live-error { text-align: center; }

.skeleton { pointer-events: none; }
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 60%, var(--border)) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk-line { height: 12px; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Transitions entre les pages (glissement) ---------- */
/* Réserve la place de la barre de défilement : le contenu ne se décale plus d'une page à l'autre */
html { scrollbar-gutter: stable; }

/* Transition native (Chrome, Edge, Safari récents) : seul le contenu glisse, l'en-tête reste immobile */
@view-transition { navigation: auto; }
main { view-transition-name: page-content; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(page-content) { animation: none; }
/* Les captures gardent leur taille réelle et restent centrées : l'accueil (pleine largeur)
   et les autres pages (largeur limitée) ne sont plus étirés l'un vers l'autre pendant la transition */
::view-transition-old(page-content), ::view-transition-new(page-content) {
  inline-size: auto; block-size: auto; inset-inline: 0; margin-inline: auto;
}
::view-transition-old(page-content) { animation: vt-out-left .22s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(page-content) { animation: vt-in-right .38s cubic-bezier(.2, .7, .2, 1) both; }
html:active-view-transition-type(back)::view-transition-old(page-content) { animation-name: vt-out-right; }
html:active-view-transition-type(back)::view-transition-new(page-content) { animation-name: vt-in-left; }
@keyframes vt-out-left { to { opacity: 0; transform: translateX(-40px); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(40px); } }
@keyframes vt-in-right { from { opacity: 0; transform: translateX(40px); } }
@keyframes vt-in-left { from { opacity: 0; transform: translateX(-40px); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-old(page-content), ::view-transition-new(page-content) { animation: none; }
}

/* Autres navigateurs : glissement en JavaScript, contenu masqué jusqu'au départ de l'animation */
html.pt-enter main { opacity: 0; }
@keyframes slideFromRight { from { opacity: 0; transform: translateX(48px); } }
@keyframes slideFromLeft { from { opacity: 0; transform: translateX(-48px); } }
main.page-enter.from-right { animation: slideFromRight .4s cubic-bezier(.2, .7, .2, 1) both; }
main.page-enter.from-left { animation: slideFromLeft .4s cubic-bezier(.2, .7, .2, 1) both; }
main.page-leave { opacity: 0; transition: opacity .25s ease, transform .25s ease; }
main.page-leave.to-left { transform: translateX(-48px); }
main.page-leave.to-right { transform: translateX(48px); }

/* ---------- Frise du parcours qui se dessine ---------- */
.timeline-progress {
  position: absolute; left: 8px; top: 6px; width: 2px; height: 0; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}
.tl-item::before { transition: background .35s, border-color .35s, box-shadow .35s, transform .35s; }
.tl-anim .tl-item::before { border-color: var(--border); }
.tl-anim .tl-item.lit::before {
  border-color: var(--accent); background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 0 14px var(--accent); transform: scale(1.1);
}

/* ---------- Barre de lecture ---------- */
.read-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; pointer-events: none;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  transform: scaleX(0); transform-origin: 0 50%; transition: opacity .3s;
}

/* ---------- Halo lumineux ---------- */
.halo {
  position: fixed; left: -320px; top: -320px; width: 640px; height: 640px; border-radius: 50%;
  pointer-events: none; z-index: -1; opacity: 0; transition: opacity .5s;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent), transparent 65%);
}
:root[data-theme="light"] .halo { background: radial-gradient(circle, color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%); }

/* ---------- Terminal secret ---------- */
.term-hint { color: var(--text-muted); }
kbd {
  font-family: var(--mono); font-size: .8em; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.term-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(5, 8, 12, .6); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px;
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.term-overlay.open { opacity: 1; visibility: visible; }
.term-win {
  width: min(760px, 100%); height: min(480px, 75vh); display: flex; flex-direction: column;
  background: #0d1117; color: #c9d1d9; border: 1px solid #262c36; border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5); font-family: var(--mono); font-size: .86rem;
  transform: translateY(-14px) scale(.98); transition: transform .25s cubic-bezier(.2, .7, .2, 1);
}
.term-overlay.open .term-win { transform: none; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #161b22; color: #8b949e; font-size: .78rem; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; }
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { flex: 1; text-align: center; }
.term-close { background: none; border: 0; color: #8b949e; cursor: pointer; font-size: .95rem; padding: 0 4px; }
.term-close:hover { color: #fff; }
.term-out { flex: 1; overflow-y: auto; padding: 14px 16px 4px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.term-out a { color: #79c0ff; }
.term-line { display: flex; align-items: center; padding: 6px 16px 14px; white-space: pre; cursor: text; }
.term-line input { all: unset; flex: 1; min-width: 0; color: #e6edf3; caret-color: #7ee787; font-family: var(--mono); font-size: .86rem; }
.tp { color: #4ea1ff; }
.tk { color: #7ee787; }
.te { color: #ff7b72; }
.tm { color: #8b949e; }
@media (max-width: 560px) { .term-hint { display: none; } }

/* ---------- Impression (tableau de synthèse notamment) ---------- */
@media print {
  .site-header, .site-footer, .back-top, .no-print, .filters { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .table-wrap { box-shadow: none; }
  table.synth { min-width: 0; font-size: 9pt; }
  .synth thead th { position: static; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .synth td.check span { transform: none !important; }
  .net-bg, .boot, #live, .halo, .read-bar, .term-overlay, .timeline-progress { display: none !important; }
  .tl-anim .tl-item::before { border-color: #000; }
  .booting body::before { display: none; }
  a { color: #000; }
}
