/* JID Technology - Portfolios du personnel
   Basé exclusivement sur tokens.css. Ne pas inventer de couleurs hors palette. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--jid-font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--jid-ink);
  background: var(--jid-paper);
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--jid-blue); outline-offset: 3px; border-radius: 4px; }

/* Accent personnel (défini par membre : blue / orange / yellow) */
body { --accent: var(--jid-blue); --accent-ink: #fff; }
body[data-accent="orange"] { --accent: var(--jid-orange); }
body[data-accent="yellow"] { --accent: var(--jid-yellow); --accent-ink: #0E1116; }

/* ---------- Primitives ---------- */
.wrap { padding: 0 var(--jid-pad-x); max-width: 1280px; margin: 0 auto; }
.section { padding: var(--jid-pad-y) 0; }
.section--warm { background: var(--jid-paper-warm); }
.section--cool { background: var(--jid-paper-cool); }
.section--dark { background: var(--jid-dark-bg); color: var(--jid-dark-fg); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.eyebrow .mono { color: var(--jid-ink-3); letter-spacing: 1px; font-weight: 400; }
.section--dark .eyebrow .mono { color: #8B92A0; }

h1, h2, h3, h4 { font-family: var(--jid-font-display); margin: 0; }
.h1 { font-size: clamp(40px, 7vw, 76px); font-weight: 700; line-height: 1.02; letter-spacing: -0.8px; }
.h2 { font-size: clamp(28px, 4.5vw, 48px); font-weight: 700; line-height: 1.05; letter-spacing: -0.8px; }
.h3 { font-size: clamp(22px, 2.8vw, 32px); font-weight: 600; line-height: 1.1; letter-spacing: -0.5px; }
.h4 { font-size: clamp(16px, 1.6vw, 20px); font-weight: 700; line-height: 1.2; }
.lead { font-size: clamp(15px, 1.4vw, 17px); line-height: 1.6; color: var(--jid-ink-2); max-width: 720px; margin: 0; }
.mono { font-family: var(--jid-font-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.muted { color: var(--jid-ink-3); }

.section-head { display: flex; flex-direction: column; gap: 0; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head .lead { margin-top: 16px; }

.filet { height: 4px; border-radius: 4px; background: var(--jid-gradient); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--jid-r-pill);
  font: 600 14px/1 var(--jid-font-body); text-decoration: none;
  border: 0; cursor: pointer; transition: transform .15s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn--lg { padding: 16px 26px; font-size: 15px; }
.btn--primary { background: var(--jid-blue); color: #fff; }
.btn--primary:hover { background: var(--jid-blue-dark); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--jid-ink); border: 1.5px solid var(--jid-ink); }
.btn--light { background: var(--jid-card-bg); color: var(--jid-ink); border: 1px solid var(--jid-line); }
.btn--onDark { background: #fff; color: #0E1116; }
.btn--onDarkGhost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.35); }

/* Pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.pill {
  display: inline-flex; align-items: center; padding: 6px 12px; border-radius: var(--jid-r-pill);
  font-size: 12px; font-weight: 600; letter-spacing: .3px;
  color: var(--jid-ink); background: var(--jid-card-bg); border: 1px solid var(--jid-line);
}
.pill--tag { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; padding: 4px 10px; }

/* Cartes */
.card {
  background: var(--jid-card-bg); border: 1px solid var(--jid-line);
  border-radius: var(--jid-r-card); padding: 24px; box-shadow: var(--jid-shadow-card);
  transition: background .3s, border-color .3s;
}

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--jid-paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--jid-line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand .sep { width: 1px; height: 22px; background: var(--jid-line); }
.brand .mono { color: var(--jid-ink-3); }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav a { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--jid-ink-2); }
.nav a:hover { color: var(--jid-ink); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--jid-r-pill);
  background: var(--jid-paper-cool); border: 1px solid var(--jid-line);
}
.theme-toggle button {
  width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent;
  color: var(--jid-ink-3); display: grid; place-items: center; cursor: pointer;
}
.theme-toggle button svg { width: 15px; height: 15px; }
.theme-toggle button[aria-pressed="true"] { background: var(--jid-card-bg); color: var(--jid-ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 7vw, 96px); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 .last { display: block; color: var(--jid-ink); }
.hero h1 .first { display: block; color: var(--jid-ink-2); font-weight: 600; }
.hero .role { margin-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.role-code {
  font-family: var(--jid-font-mono); font-size: 12px; font-weight: 700; letter-spacing: 1px;
  padding: 6px 12px; border-radius: var(--jid-r-pill); background: var(--accent); color: var(--accent-ink);
}
.role-title { font-size: clamp(17px, 1.8vw, 21px); font-weight: 600; color: var(--jid-ink); }
.hero .lead { margin-top: 22px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 32px; color: var(--jid-ink-3); }
.hero .meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero .meta svg { width: 14px; height: 14px; }

.portrait {
  position: relative; border-radius: var(--jid-r-card-lg); overflow: hidden;
  background: var(--jid-paper-cool); border: 1px solid var(--jid-line);
  aspect-ratio: 4 / 4.6;
}
.portrait::before {
  /* monogramme JID en filigrane */
  content: ""; position: absolute; inset: 8% -18% auto auto; width: 90%; aspect-ratio: 1;
  background: url("/assets/img/mark.png") center / contain no-repeat; opacity: .10;
}
.portrait img { position: absolute; inset: auto 0 0 0; width: 100%; height: 92%; object-fit: contain; object-position: bottom center; }
.portrait .filet { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0; height: 6px; }
.float-badge {
  position: absolute; display: flex; align-items: center; gap: 10px;
  background: var(--jid-card-bg); border: 1px solid var(--jid-line); border-radius: 14px;
  padding: 10px 14px; box-shadow: var(--jid-shadow-float);
}
.float-badge b { font-size: 14px; display: block; line-height: 1.2; }
.float-badge small { font-size: 11px; color: var(--jid-ink-3); display: block; }
.float-badge .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.float-badge .dot svg { width: 18px; height: 18px; }
.float-badge--a { left: 16px; top: 16px; }
.float-badge--b { right: 16px; bottom: 26px; }

/* ---------- Profil / stats ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.about-text { font-size: clamp(16px, 1.6vw, 19px); line-height: 1.65; color: var(--jid-ink-2); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { padding: 20px; }
.stat .num { font-family: var(--jid-font-display); font-size: clamp(32px, 4vw, 44px); font-weight: 700; line-height: 1; letter-spacing: -1px; }
.stat .num sup { font-size: .5em; color: var(--accent); }
.stat .lbl { margin-top: 8px; font-size: 13px; color: var(--jid-ink-3); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.tl-item { display: grid; grid-template-columns: 190px 1fr; gap: 24px; }
.tl-when { padding-top: 26px; display: flex; flex-direction: column; gap: 6px; }
.tl-when .mono { color: var(--accent); font-weight: 700; }
.tl-card h3 { font-size: 19px; font-weight: 700; line-height: 1.25; }
.tl-card .org { margin-top: 4px; font-size: 14px; color: var(--jid-ink-2); }
.tl-card .org b { color: var(--jid-ink); }
.tl-card ul.tasks { margin: 16px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.tl-card ul.tasks li { position: relative; padding-left: 18px; font-size: 14px; color: var(--jid-ink-2); }
.tl-card ul.tasks li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px;
  background: var(--accent); transform: rotate(45deg); border-radius: 1.5px;
}
.tl-card .pills { margin-top: 16px; }

/* ---------- Compétences ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skills-grid .card h3 { font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--jid-ink-3); margin-bottom: 18px; }
.lang { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.lang + .lang { margin-top: 14px; }
.lang .name { font-weight: 600; font-size: 15px; }
.lang .lvl { font-size: 12px; color: var(--jid-ink-3); }
.bars { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.bars i { height: 5px; border-radius: 3px; background: var(--jid-line); }
.bars i.on { background: var(--accent); }

/* ---------- Domaines ---------- */
.domains { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.domain { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; }
.domain::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); }
.domain .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
[data-theme="dark"] .domain[data-key="securite"] { --c: #C7CCD4 !important; }
.domain .ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.domain .top { display: flex; justify-content: space-between; align-items: flex-start; }
.domain h3 { font-size: 17px; font-weight: 700; }
.domain .pill--tag { color: var(--c); background: color-mix(in srgb, var(--c) 8%, transparent); border-color: color-mix(in srgb, var(--c) 20%, transparent); align-self: flex-start; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.section--dark .h2 { color: #fff; }
.section--dark .lead { color: #C7CCD4; }
.contact-list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.contact-item {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--jid-r-card);
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.10); text-decoration: none; color: #fff;
  transition: background .2s, border-color .2s;
}
a.contact-item:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
.contact-item .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); flex: none; }
.contact-item .ico svg { width: 18px; height: 18px; }
.contact-item small { display: block; font-family: var(--jid-font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #8B92A0; }
.contact-item span { font-size: 15px; font-weight: 600; word-break: break-word; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.ref-note { margin-top: 28px; font-size: 13px; color: #8B92A0; }

/* ---------- Footer ---------- */
.footer { background: var(--jid-dark-bg); color: #8B92A0; padding: 0 0 32px; }
.footer .filet { border-radius: 0; height: 3px; margin-bottom: 32px; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.footer img { height: 28px; width: auto; }
.footer a { color: #C7CCD4; text-decoration: none; }
.footer a:hover { color: #fff; }

/* ---------- Page équipe (index) ---------- */
.team-hero { padding: clamp(48px, 7vw, 96px) 0 clamp(32px, 4vw, 56px); }
.team-hero .h1 { max-width: 14ch; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.member { padding: 0; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s, background .3s; }
.member:hover { transform: translateY(-3px); box-shadow: var(--jid-shadow-float); }
.member .media { position: relative; height: 240px; background: var(--jid-paper-cool); overflow: hidden; }
.member .media::before { content: ""; position: absolute; inset: 10% -20% auto auto; width: 80%; aspect-ratio: 1; background: url("/assets/img/mark.png") center / contain no-repeat; opacity: .08; }
.member .media img { position: absolute; inset: auto 0 0 0; height: 92%; width: 100%; object-fit: contain; object-position: bottom; }
.member .media .filet { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0; height: 4px; }
.member .badge {
  position: absolute; top: 14px; left: 14px; font-family: var(--jid-font-mono); font-size: 11px; font-weight: 700; letter-spacing: 1px;
  padding: 5px 11px; border-radius: var(--jid-r-pill); background: rgba(14,17,22,.72); color: #fff; backdrop-filter: blur(6px);
}
.member .body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.member .body .mono { color: var(--accent); font-weight: 700; }
.member .body h2 { font-size: 20px; font-weight: 700; }
.member .body p { margin: 4px 0 0; font-size: 13px; color: var(--jid-ink-2); }
.member .go { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--jid-blue); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 440px; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
}
@media (max-width: 640px) {
  .tl-item { grid-template-columns: 1fr; gap: 0; }
  .tl-when { padding: 0 0 10px; flex-direction: row; gap: 12px; }
  .tl-card ul.tasks { grid-template-columns: 1fr; }
  .skills-grid, .stats { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat { padding: 14px; }
  .brand .sep, .brand .mono { display: none; }
  .hero .actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Impression : le portfolio devient un CV propre ---------- */
@media print {
  .topbar, .theme-toggle, .hero .actions, .contact-actions, .float-badge { display: none !important; }
  body { background: #fff; color: #0E1116; }
  .section { padding: 24px 0; }
  .section--dark { background: #fff; color: #0E1116; }
  .section--dark .h2, .contact-item, .contact-item span { color: #0E1116; }
  .contact-item { border-color: #E4E7EC; }
  .card { box-shadow: none; break-inside: avoid; }
}

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

/* ---------- Réalisations ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.project { display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.project::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--jid-gradient); opacity: 0; transition: opacity .2s; }
.project:hover::before { opacity: 1; }
.project .top { display: flex; justify-content: space-between; align-items: center; }
.project h3 { font-size: 18px; font-weight: 700; line-height: 1.25; }
.project .ctx { margin: 0; font-size: 13px; font-weight: 600; color: var(--accent); }
.project .desc { margin: 0; font-size: 14px; color: var(--jid-ink-2); flex: 1; }
.project .pills { margin-top: 6px; }
.project .go { font-size: 13px; font-weight: 600; color: var(--jid-blue); text-decoration: none; }
.pill--status { color: var(--jid-green); background: color-mix(in srgb, var(--jid-green) 10%, transparent); border-color: color-mix(in srgb, var(--jid-green) 25%, transparent); }

/* ---------- Monogramme (si pas de photo) ---------- */
.initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--jid-font-display); font-weight: 700; letter-spacing: -4px;
  font-size: clamp(96px, 14vw, 180px); color: var(--accent);
}
.member .initials { font-size: 96px; }
@media (max-width: 640px) { .projects { grid-template-columns: 1fr; } }

/* Photo plein cadre (photo non détourée : "photoFit": "cover") */
.portrait--cover::before, .media--cover::before { display: none; }
.portrait--cover img, .member .media--cover img { inset: 0; height: 100%; object-fit: cover; object-position: center 20%; }
