/* =================================================================
   Portfolio — Xavier Bérault
   Palette rétro / néo-brutaliste : fond crème, traits francs,
   ombres portées dures, accent terracotta repris du CV.
   ================================================================= */

:root {
  --bg:        #f3efe6;
  --surface:   #fffdf8;
  --ink:       #1b1a24;
  --muted:     #66626f;
  --line:      #cfc8b8;
  --accent:    #A94B2A;
  --accent-ink:#fff;

  /* Gris d'encre pour le texte courant (du plus foncé au plus clair). */
  --ink-strong: #36333f;
  --ink-body:   #46434f;
  --ink-soft:   #56535f;

  /* Couleurs ponctuelles. */
  --ok:        #2f9e44;   /* LED de statut */
  --dot-empty: #ece6d8;   /* point de niveau vide (skills) */

  /* Ombres dures néo-brutalistes (une source par profondeur). */
  --shadow-press:      1px 1px 0 var(--ink);
  --shadow-sm:         2px 2px 0 var(--ink);
  --shadow-md:         3px 3px 0 var(--ink);
  --shadow:            4px 4px 0 var(--ink);
  --shadow-hover:      5px 5px 0 var(--ink);
  --shadow-card-hover: 6px 6px 0 var(--ink);
  --shadow-lg:         7px 7px 0 var(--ink);

  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --font-pixel:'Press Start 2P', monospace;

  --maxw: 1060px;
}

/* ----------------------------- Base ----------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; }

h1, h2, h3 { margin: 0; letter-spacing: -0.5px; }

ul { margin: 0; padding: 0; list-style: none; }

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

/* Étiquettes mono en petites capitales (motif réutilisé partout). */
.main-nav a,
.section-sub,
.panel-label,
.publication-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ----------------------------- Buttons -------------------------- */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 14px 22px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover  { transform: translate(-1px, -1px); box-shadow: var(--shadow-hover); }
.btn:active { transform: translate(2px, 2px);   box-shadow: var(--shadow-press); }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost   { background: var(--surface); color: var(--ink); }

/* ----------------------------- Header --------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 239, 230, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--ink);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  text-decoration: none;
}
.brand-badge {
  display: block;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-md);
  image-rendering: pixelated;
}
.brand-name { font-weight: 700; font-size: 16px; white-space: nowrap; }

.main-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 14px;
}
.main-nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  flex: none;
  transition: color .12s ease;
}
.main-nav a:hover { color: var(--ink); }

/* Actions à droite du header : CV persistant + bascule de langue. */
.header-actions { display: flex; align-items: center; gap: 14px; }

.header-cv {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-ink);
  text-decoration: none;
  padding: 9px 13px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease;
}
.header-cv:hover  { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.header-cv:active { transform: translate(1px, 1px);   box-shadow: var(--shadow-press); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.lang-btn {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: none;
  border: 2px solid transparent;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
  transition: color .12s ease;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ----------------------------- Hero ----------------------------- */
.hero {
  position: relative;
  scroll-margin-top: 80px;
  padding-top: 72px;
  padding-bottom: 56px;
}
.pixel-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(var(--ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: 30px 30px;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.45fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 28px;
  padding: 7px 12px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-md);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.status-dot {
  width: 9px;
  height: 9px;
  background: var(--ok);
  display: inline-block;
  animation: blink 1.6s steps(1) infinite;
}
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.25; } }

.hero-name { font-weight: 700; font-size: 62px; line-height: 1.02; letter-spacing: -2px; margin-bottom: 16px; }
.caret {
  display: inline-block;
  width: 0.55ch;
  height: 0.82em;
  margin-left: 8px;
  background: var(--accent);
  vertical-align: baseline;
  animation: blink 1.1s steps(1) infinite;
}
.hero-role { font-family: var(--font-mono); font-size: 18px; color: var(--accent); margin: 0 0 24px; }
.hero-tagline { font-size: 21px; line-height: 1.55; color: var(--ink-body); max-width: 50ch; margin: 0 0 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Fast facts VIE — panneau style commentaire de code. */
.fastfacts {
  margin: 30px 0 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 13px;
  display: grid;
  gap: 7px;
}
.fastfacts div { display: flex; gap: 10px; flex-wrap: wrap; }
.fastfacts dt { color: var(--accent); min-width: 124px; }
.fastfacts dd { margin: 0; color: var(--ink); }

.hero-photo { justify-self: center; }
.photo-frame {
  margin: 0;
  padding: 10px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-lg);
}
/* Conteneur de la photo : support des scanlines rétro. */
.photo-media {
  position: relative;
  display: block;
  line-height: 0;
}
.photo-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Fines scanlines horizontales (effet écran CRT), discrètes. */
  background: repeating-linear-gradient(
    to bottom,
    rgba(27, 26, 36, 0.16) 0,
    rgba(27, 26, 36, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.9;
  transition: opacity .35s ease;
}
.photo-frame:hover .photo-media::after { opacity: 0.5; }

.photo-frame img {
  display: block;
  width: 200px;
  height: 200px;
  object-fit: cover;
  /* Duotone chaud terracotta au repos, couleur réelle au survol. */
  filter: grayscale(1) sepia(0.55) saturate(1.9) hue-rotate(-12deg) contrast(1.05);
  transition: filter .35s ease;
}
.photo-frame:hover img { filter: none; }
.photo-frame figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.5px;
  padding: 9px 2px 2px;
}

.metrics {
  position: relative;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin: 50px 0 0;
  padding-top: 30px;
  border-top: 2px solid var(--ink);
}
.metric { display: flex; flex-direction: column; gap: 3px; max-width: 230px; }
.metric dt { font-family: var(--font-pixel); font-size: 22px; line-height: 1.15; }
.metric dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

/* --------------------------- Sections --------------------------- */
.section { scroll-margin-top: 80px; padding-top: 46px; padding-bottom: 46px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 30px;
}
.section-num { font-family: var(--font-pixel); font-size: 13px; color: var(--accent); }
.section-head h2 { font-weight: 700; font-size: 30px; }
.section-rule { flex: 1; height: 2px; background: var(--ink); opacity: 0.14; }
.section-sub {
  color: var(--muted);
}

.lead { font-size: 23px; line-height: 1.6; color: var(--ink-strong); max-width: 62ch; margin: 0; }

/* ----------------------------- Tags ----------------------------- */
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-strong);
  border: 1.5px solid var(--line);
  background: var(--bg);
  padding: 4px 9px;
}

/* --------------------------- Experience ------------------------- */
.timeline { display: flex; flex-direction: column; gap: 14px; }

.job {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 28px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 26px 28px;
}
.job-period { font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.job-company { font-weight: 700; font-size: 19px; margin: 0; }
.job-place { font-size: 14px; color: var(--muted); margin: 2px 0 0; }
.badge {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 8px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
/* Variante discrète (contour) : ex. « Stage », pour ne pas concurrencer
   l'accent plein du badge « Poste actuel ». */
.badge-muted { background: transparent; color: var(--muted); }

.job-role { font-weight: 600; font-size: 19px; color: var(--accent); margin-bottom: 12px; }
.job-intro { font-size: 16px; line-height: 1.5; color: var(--ink-body); max-width: 62ch; margin: 0 0 22px; }

/* Missions Enéance : grille 2×2 de sous-panneaux plats (1 ombre dure
   sur la carte parente, intérieurs encastrés = densité maîtrisée). */
.job-body { counter-reset: mission; }

/* Poste actuel : méta en bandeau d'en-tête, missions en grille pleine largeur
   (évite le grand vide à gauche d'une carte très haute). */
.job-lead {
  grid-template-areas:
    "meta head"
    "missions missions";
  row-gap: 22px;
}
.job-lead .job-meta { grid-area: meta; }
.job-lead .job-head { grid-area: head; }
.job-lead .missions { grid-area: missions; }
.job-head .job-intro { margin-bottom: 0; }

.missions {
  counter-reset: mission;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mission {
  counter-increment: mission;
  background: var(--bg);
  border: 1.5px solid var(--line);
  padding: 16px 18px;
  margin: 0;
}
.mission-sector {
  display: inline-block;
  margin: 0 0 10px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.mission-client {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.2px;
}
.mission-client::before {
  content: "0" counter(mission) "  ";
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.mission-lead {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 12px;
}
.mission .tags { margin-top: 0; }

.bullets { display: flex; flex-direction: column; gap: 7px; }
.bullets li {
  position: relative;
  padding-left: 22px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-body);
}
.bullets li::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

.job-body .tags { margin-top: 16px; }

/* ------------------------------ Cards --------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
/* Grille des réalisations secondaires : ligne de 3 (Biebog, NSIMD, Unilabs),
   auto-fit pour se replier proprement en 2 puis 1 colonne selon la largeur. */
.cards-secondary { grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }

/* --- Réalisation phare (JDME) : carte vedette pleine largeur --- */
/* .card.card-featured : spécificité &gt; .card pour battre son display:flex. */
.card.card-featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  margin-bottom: 18px;
}
.card.card-featured:hover { transform: none; box-shadow: var(--shadow); }
.featured-body { display: flex; flex-direction: column; gap: 12px; }
.featured-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--ink);
  padding: 2px 8px;
}
.featured-media {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  min-height: 240px;
  border: 2px solid var(--ink);
  background: var(--bg);
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  transition: box-shadow .12s ease;
}
.featured-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.featured-media:hover { box-shadow: inset 0 0 0 3px var(--accent); }
.featured-media-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 7px 11px;
}

/* Repli « + détails » (carte Biebog). */
.card-more { margin: 0; }
.card-more summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}
.card-more summary::-webkit-details-marker { display: none; }
.card-more p { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-body); }
.more-list { margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.more-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-body);
}
.more-list li::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* --- Bandeau client prestige (Christian Dior Couture) ---
   Même rythme que la carte phare, mais sans démo : colonne gauche = ce que
   j'ai fait + stack ; colonne droite = sous-projets + chiffres d'échelle,
   en aplat teinté à la place du thumbnail. Volontairement plus calme que la
   carte phare pour rester sous elle dans la hiérarchie. */
.card.dior-band {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  margin-bottom: 18px;
}
.card.dior-band:hover { transform: none; box-shadow: var(--shadow); }
.dior-body { display: flex; flex-direction: column; gap: 12px; }
/* Chip secteur : simple contour (pas l'accent plein du tag « phare » de JDME). */
.dior-sector {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 2px 8px;
}
.dior-label {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}
.dior-did .more-list { margin-top: 8px; }

/* Colonne droite : panneau bordé/teinté (rappel du média de la carte phare). */
.dior-projects {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 2px solid var(--ink);
  background: var(--bg);
}
.dior-project-name {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
}
.dior-project-desc { margin: 5px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
/* Chiffres d'échelle, séparés des sous-projets par un filet. */
.dior-facts {
  margin: 2px 0 0;
  padding-top: 14px;
  border-top: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dior-facts div { display: flex; flex-direction: column; gap: 2px; }
.dior-facts dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
}
.dior-facts dd { margin: 0; font-size: 14px; line-height: 1.4; color: var(--ink-body); }

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 22px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-card-hover); }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-dot { width: 13px; height: 13px; border: 2px solid var(--ink); display: inline-block; }
.card-dot.dot-accent { background: var(--accent); }
.card-dot.dot-ink    { background: var(--ink); }
.card-dot.dot-copper { background: #c9803a; }
.card-note { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.card-title { font-weight: 700; font-size: 17px; }
.card-desc { font-size: 16px; line-height: 1.5; color: var(--ink-soft); margin: 0; }
.card .tags { margin-top: auto; }
.card-links { display: flex; gap: 18px; flex-wrap: wrap; }
.card-link {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  align-self: flex-start;
}
.card-link-muted {
  color: var(--muted);
  border-bottom-color: var(--line);
}
.card-link-muted:hover { color: var(--ink); border-bottom-color: var(--ink); }
/* Déclencheur de démo : un bouton qui se présente comme un card-link. */
.card-link-btn {
  background: none;
  border: none;
  border-bottom: 2px solid var(--accent);
  padding: 0 0 2px;
  margin: 0;
  cursor: pointer;
  line-height: 1.2;
}

/* --- Projets personnels : cartes « démo en avant » (thumbnail cliquable) --- */
.projects-grid { grid-template-columns: 1fr 1fr; }
.project-card { padding: 0; overflow: hidden; }
/* Thumbnail cliquable en tête de carte (ouvre la démo en overlay). */
.project-media {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: var(--bg);
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  aspect-ratio: 16 / 10;
  transition: box-shadow .12s ease;
}
.project-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.project-media:hover { box-shadow: inset 0 0 0 3px var(--accent); }
.project-media-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 7px 11px;
}
.project-body { display: flex; flex-direction: column; gap: 12px; padding: 22px; flex: 1; }

/* --------------------------- Démo overlay ----------------------- */
.demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.demo-overlay[hidden] { display: none; }
.demo-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 26, 36, 0.55);
  backdrop-filter: blur(2px);
}
.demo-overlay-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1480px, 100%);
  height: min(900px, 100%);
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-lg);
}
.demo-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 2px solid var(--ink);
  background: var(--bg);
}
.demo-overlay-title {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.demo-overlay-actions { display: flex; align-items: center; gap: 16px; }
.demo-overlay-ext {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  white-space: nowrap;
}
.demo-overlay-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 15px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.demo-overlay-close:hover  { transform: translate(-1px, -1px); box-shadow: var(--shadow-md); }
.demo-overlay-close:active { transform: translate(1px, 1px);   box-shadow: var(--shadow-press); }
/* Conteneur de l'iframe : sert de cadre de découpe quand la maquette
   (pensée pour desktop) est réduite à l'échelle sur mobile. */
.demo-overlay-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #fff;
}
.demo-overlay-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  display: block;
}

/* Corps de l'overlay : panneau de contexte (gauche) + maquette (droite). */
.demo-overlay-body {
  flex: 1;
  display: flex;
  min-height: 0;
}
.demo-about {
  width: 320px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 24px 22px;
  background: var(--bg);
  border-right: 2px solid var(--ink);
}
/* Mode plein cadre (démos de projets perso) : pas de panneau de contexte,
   l'iframe occupe tout le corps de l'overlay. */
.demo-overlay-panel.is-bare .demo-about { display: none; }
/* Fond sombre pendant les navigations internes de l'iframe (démos au thème
   sombre : Glozème #10131a, PyPrep proche), pour éviter un flash blanc entre
   deux pages. */
.demo-overlay-panel.is-bare .demo-overlay-viewport,
.demo-overlay-panel.is-bare .demo-overlay-frame {
  background: #10131a;
}
/* Chip d'en-tête : reprend l'idiome .mission-sector du site. */
.demo-about-tag {
  display: inline-block;
  margin: 0 0 16px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.demo-about-title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin: 0 0 14px;
}
.demo-about-lead {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-body);
  margin: 0 0 20px;
}
.demo-about-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 9px;
}
.demo-about-bullets {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.demo-about-bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-body);
}
.demo-about-bullets li::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}
/* Encadré méta : reprend l'idiome .fastfacts (bordure encre + ombre dure). */
.demo-about-facts {
  margin: 20px 0 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  display: grid;
  gap: 8px;
}
.demo-about-facts div { display: flex; gap: 10px; flex-wrap: wrap; }
.demo-about-facts dt { color: var(--accent); min-width: 62px; }
.demo-about-facts dd { margin: 0; color: var(--ink); line-height: 1.45; }

/* Sous ~820px : le panneau passe au-dessus de la maquette (empilé). */
@media (max-width: 820px) {
  .demo-overlay-body { flex-direction: column; }
  .demo-about {
    width: auto;
    max-height: 38vh;
    border-right: none;
    border-bottom: 2px solid var(--ink);
  }
}

body.no-scroll { overflow: hidden; }

@media (max-width: 560px) {
  .demo-overlay { padding: 0; }
  .demo-overlay-panel { height: 100%; }
  /* Titre court tronqué à gauche, lien « nouvel onglet » retiré (évitait
     les sorties accidentelles), croix de fermeture agrandie. */
  .demo-overlay-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .demo-overlay-ext { display: none; }
  .demo-overlay-close { width: 44px; height: 44px; font-size: 18px; }
  /* La maquette desktop est réduite à l'échelle par JS pour tenir en
     largeur, puis centrée verticalement (letterbox crème autour). */
  .demo-overlay-viewport { background: var(--bg); }
  .demo-overlay-frame {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
  }
}

/* --------------------------- Publication ------------------------ */
.publication {
  margin-top: 20px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.publication-tag {
  color: var(--accent);
  margin: 0 0 8px;
}
.publication-body { margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink-body); }
.publication .card-link { display: inline-block; margin-top: 12px; }

/* ----------------------------- Skills --------------------------- */
.skills-grid { display: flex; flex-direction: column; gap: 18px; }
.panel {
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel-label {
  color: var(--muted);
  margin: 0 0 16px;
}
.panel-label.accent { color: var(--accent); margin-bottom: 13px; }

/* Bandeau « Maîtrise principale » : pleine largeur, mini-cartes + barres. */
.core-skills { position: relative; overflow: hidden; box-shadow: var(--shadow-md); }
.core-skills::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image:
    linear-gradient(var(--ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: 26px 26px;
}
.core-skills > * { position: relative; }

.levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.levels li {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  padding: 14px 16px;
}
.levels span:first-child { font-weight: 600; font-size: 15px; line-height: 1.25; }

/* Points -> segments pleine largeur (barre de niveau). */
.dots { display: flex; gap: 4px; margin-top: auto; }
.dots i {
  flex: 1;
  height: 10px;
  border: 2px solid var(--ink);
  background: var(--dot-empty);
  display: inline-block;
}
.dots i.on { background: var(--accent); }

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  align-content: start;
  counter-reset: skillgroup;
}
.skill-groups .panel { padding: 18px 20px; counter-increment: skillgroup; }
.skill-groups .panel-label::before {
  content: "0" counter(skillgroup) " · ";
  color: var(--accent);
  font-weight: 700;
}
.chips { display: flex; gap: 9px; flex-wrap: wrap; }
.chips li {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  background: var(--bg);
  padding: 5px 11px;
}

/* --------------------------- Education -------------------------- */
.edu-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card.edu { gap: 8px; }
.edu-year { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent); }
.edu-degree { font-weight: 700; font-size: 19px; line-height: 1.2; }
.edu-school { font-size: 16px; color: var(--muted); margin: 0; }
.edu-note { font-size: 14px; color: var(--muted); margin: 0; }

/* ---------------------------- Contact --------------------------- */
.contact-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 44px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-lg);
  padding: 42px 40px;
}
.contact-text { max-width: 36ch; }
.contact-text h3 { font-weight: 700; font-size: 34px; letter-spacing: -1px; margin-bottom: 12px; }
.contact-text p { font-size: 19px; line-height: 1.55; color: var(--ink-soft); margin: 0; }
.contact-links { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.contact-links .panel-label { margin: 0; }
/* CTA e-mail : monospace (cohérent avec le reste de la colonne contact)
   et largeur alignée sur la ligne de liens en dessous → bloc net, plus de
   largeur « arbitraire » dictée par les métriques de la police. */
.contact-links .btn-primary {
  align-self: stretch;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;
  text-align: center;
}
.contact-secondary { display: flex; gap: 20px; margin-top: 2px; }
.contact-secondary a {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  padding-bottom: 2px;
  transition: border-color .12s ease;
}
.contact-secondary a:hover { border-color: var(--ink); }

.footer {
  text-align: center;
  margin-top: 38px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* ------------------------- Accessibilité ------------------------ */
/* Lien d'évitement : caché jusqu'au focus clavier. */
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.btn:focus-visible,
.header-cv:focus-visible,
.lang-btn:focus-visible,
.card:focus-visible { outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* --------------------------- Responsive ------------------------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  /* Portrait : passe en bandeau pleine largeur centré (source 480² = net). */
  .hero-photo { justify-self: stretch; }
  .photo-frame { width: 100%; max-width: 380px; margin: 0 auto; }
  .photo-frame img { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  .hero-name { font-size: 48px; }
  .skills-grid { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: 18px; }
  .job-lead { grid-template-areas: "meta" "head" "missions"; row-gap: 18px; }
  .missions { grid-template-columns: 1fr; }
  .card.card-featured { grid-template-columns: 1fr; }
  .card.dior-band { grid-template-columns: 1fr; }
}

/* Sous cette largeur, la nav passe en barre d'ancres scrollable
   (style command bar) plutôt que d'être masquée. En dessous de ~1080 px les
   sept libellés FR ne tiennent plus sur une ligne dans la colonne de contenu. */
@media (max-width: 1080px) {
  /* Header compact : marque ↔ actions sur une ligne, nav scrollable dessous. */
  .header-inner { flex-wrap: wrap; gap: 12px; justify-content: space-between; }
  .brand-name { font-size: 15px; }
  .brand { gap: 10px; }
  .header-actions { gap: 8px; }
  .header-cv { padding: 8px 11px; }
  .main-nav {
    order: 3;
    width: 100%;
    flex: 1 0 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 18px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    /* Affordance de défilement : fondu sur le bord droit + scrollbar masquée. */
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
            mask-image: linear-gradient(to right, #000 88%, transparent);
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { white-space: nowrap; }
}

@media (max-width: 560px) {
  /* Rythme vertical resserré sur mobile. */
  .hero { padding-top: 40px; padding-bottom: 40px; }
  .section { padding-top: 34px; padding-bottom: 34px; }
  .section-head { flex-wrap: wrap; row-gap: 6px; margin-bottom: 22px; }

  /* Hiérarchie typographique allégée. */
  .hero-name { font-size: 40px; }
  .hero-tagline { font-size: 18px; line-height: 1.5; margin-bottom: 28px; }
  .lead { font-size: 18px; line-height: 1.55; }

  /* Boutons hero empilés, pleine largeur (tap targets francs). */
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; text-align: center; }

  /* Fast-facts : libellé au-dessus de la valeur, fini l'escalier. */
  .fastfacts div { flex-direction: column; gap: 2px; }
  .fastfacts dt { min-width: 0; }

  /* Métriques resserrées. */
  .metrics { gap: 18px; margin-top: 32px; padding-top: 24px; }

  .skill-groups { grid-template-columns: 1fr; }
  .cards-secondary { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  /* Contact : titre adouci, liens secondaires empilés. */
  .contact-card { padding: 28px 24px; }
  .contact-text h3 { font-size: 26px; }
  .contact-text p { font-size: 17px; }
  .contact-secondary { flex-direction: column; gap: 12px; align-items: flex-start; }
}
