/* =====================================================================
   THÈMES — deux palettes en harmonie, pilotées par [data-theme].
   Sombre = bleu-nuit + menthe (style Wanqi Zhu / Jane Street)
   Clair  = blanc + teal (lisible), pour le bouton clair/sombre
   ===================================================================== */
:root,
[data-theme="dark"] {
  --bg:        #0A192F;   /* bleu-nuit profond */
  --surface:   #112240;   /* cartes */
  --surface-2: #1D2D50;   /* survol */
  --heading:   #E6F1FF;   /* titres, presque blanc */
  --text:      #C3D0E8;   /* texte courant, bleu-ardoise clair */
  --muted:     #8892B0;   /* texte secondaire */
  --accent:    #E0A44C;   /* ambre / or : LA couleur d'accent */
  --accent-soft: rgba(224, 164, 76, 0.12);
  --on-accent: #0A192F;   /* texte posé sur la couleur d'accent */
  --status:    #3FCF8E;   /* vert « disponible » (statut uniquement) */
  --border:    rgba(136, 146, 176, 0.2);
  --nav-bg:    rgba(10, 25, 47, 0.85);
}

[data-theme="light"] {
  --bg:        #F7F9FC;
  --surface:   #FFFFFF;
  --surface-2: #EEF2F8;
  --heading:   #0B1B34;
  --text:      #35435C;
  --muted:     #6A7690;
  --accent:    #B67A12;   /* ocre / or foncé, lisible sur blanc */
  --accent-soft: rgba(182, 122, 18, 0.1);
  --on-accent: #FFFFFF;
  --status:    #0E9E6E;   /* vert « disponible » lisible sur blanc */
  --border:    rgba(11, 27, 52, 0.12);
  --nav-bg:    rgba(247, 249, 252, 0.85);
}

/* Variables communes */
:root {
  --font-display: "Space Grotesk", sans-serif;
  --font-body:    "Inter", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", monospace;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --maxw:         1180px;
  --nav-h:        68px;   /* hauteur de la barre de nav, qui reste au-dessus des modales */
}

/* ===== Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* transition douce lors du changement de thème */
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

/* Halo d'ambiance en haut de page */
.bg-glow {
  position: fixed;
  top: -260px; left: 50%;
  width: 1100px; height: 760px;
  transform: translateX(-50%);
  background:
    radial-gradient(46% 56% at 40% 42%, var(--accent-soft), transparent 70%),
    radial-gradient(40% 48% at 63% 58%, var(--accent-soft), transparent 72%);
  filter: blur(12px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
  animation: auroraDrift 30s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { transform: translateX(-52%) translateY(0)     scale(1);    }
  50%  { transform: translateX(-47%) translateY(26px)  scale(1.09); }
  100% { transform: translateX(-53%) translateY(-8px)  scale(1.03); }
}

strong { color: var(--heading); font-weight: 600; }

/* ===================== NAVIGATION ===================== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);          /* effet verre dépoli */
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 4px 10px;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

/* Bouton « CV » dans la barre du haut (à côté de About) */
.topnav-links .nav-cv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 5px 11px;
  transition: background 0.2s var(--ease);
}
.topnav-links .nav-cv:hover { color: var(--accent); background: var(--accent-soft); }
.topnav-links .nav-cv svg { flex-shrink: 0; }

.topnav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.topnav-links a:hover,
.topnav-links a.active { color: var(--accent); }

/* Bouton clair / sombre */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* On n'affiche que l'icône correspondant au thème */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ===================== FOCUS CLAVIER ===================== */
/* Anneau visible uniquement au clavier (pas au clic souris). */
.brand:focus-visible,
.topnav-links a:focus-visible,
.theme-toggle:focus-visible,
.socials a:focus-visible,
.btn:focus-visible,
.feature:focus-visible,
.entry-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
/* Le lien de nom : on réutilise l'indication du survol (trait + ambre). */
.entry-link:focus-visible {
  outline: none;
  color: var(--accent);
  background-size: 100% 1.5px;
}

/* ===================== CONTENEUR ===================== */
.container {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 24px 40px;
}

/* ===================== HERO / ABOUT ===================== */
/* Photo à gauche, texte "about" en face à droite ; occupe l'écran. */
.hero {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 640px);
  gap: 60px;
  align-items: center;
  min-height: calc(100vh - 128px);   /* remplit l'écran sous la nav */
  padding: 0 0 32px;
  margin-bottom: 24px;
}
/* Grain très fin dans le hero (texture, pas de lib) */
.hero::before {
  content: "";
  position: absolute;
  inset: -20px;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
}
/* Dégradé ambre qui respire lentement derrière le texte du hero */
.hero::after {
  content: "";
  position: absolute;
  inset: -8% -6% -8% -12%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(52% 56% at 30% 36%, var(--accent-soft), transparent 74%);
  opacity: 0.55;
  animation: heroSheen 34s ease-in-out infinite alternate;
}
@keyframes heroSheen {
  0%   { transform: translate(0, 0)         scale(1);    opacity: 0.4;  }
  100% { transform: translate(34px, -20px)  scale(1.16); opacity: 0.66; }
}

.hero-photo img {
  width: 100%;
  height: auto;              /* les attributs width/height ne servent que de ratio (anti-décalage) */
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;                 /* cercle : on ne voit plus les coins */
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
}

.hello {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 6px;
}
.name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--heading);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.tagline {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-top: 12px;
}

/* Ligne de disponibilité : point vert pulsant + texte vert */
.availability {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--status);
  margin-top: 14px;
}
.status-dot {
  flex-shrink: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--status);
  box-shadow: 0 0 0 0 var(--status);
  animation: pulse-status 2.2s infinite;
}
@keyframes pulse-status {
  0%   { box-shadow: 0 0 0 0 rgba(63, 207, 142, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(63, 207, 142, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 207, 142, 0); }
}

.socials {
  display: flex;
  gap: 12px;
  list-style: none;
  margin-top: 18px;
}
.socials a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
              background 0.2s var(--ease), transform 0.2s var(--ease);
}
.socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-3px);
}
.socials .hf { font-size: 22px; line-height: 1; } /* logo Hugging Face en emoji */

.bio {
  font-size: 1.05rem;
  max-width: none;          /* la colonne hero borne déjà la largeur */
  margin-top: 20px;
  line-height: 1.6;
  text-align: justify;      /* texte justifié */
  text-wrap: pretty;
}
.bio p { margin-top: 14px; }
.bio p:first-child { margin-top: 0; }
/* Lien dans la bio : ambre + trait qui grandit au survol */
.bio a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size 0.25s var(--ease);
}
.bio a:hover { background-size: 100% 1.5px; }

/* ===================== SECTIONS ===================== */
.section { margin-bottom: 72px; scroll-margin-top: 80px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin-bottom: 32px;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--accent);
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* =====================================================================
   ENTRÉES ACCORDÉON (Expérience / Éducation)
   Logo + titre toujours visibles ; le détail se déroule au CLIC
   (classe .open ajoutée par le JS quand on clique sur l'en-tête / la flèche).
   ===================================================================== */
.timeline { display: flex; flex-direction: column; gap: 10px; }

.entry {
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.1s var(--ease);
}

/* En-tête cliquable (bouton pleine largeur) */
.entry-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.entry-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading);
}
.entry-title .at { color: var(--muted); font-weight: 500; }

/* Nom d'entreprise / école cliquable : au survol, un trait fin d'accent
   grandit depuis la gauche + la couleur passe à l'ambre. Plus fin/élégant
   qu'un soulignement classique. */
.entry-link {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size 0.25s var(--ease), color 0.15s var(--ease);
}
.entry-link:hover {
  color: var(--accent);
  background-size: 100% 1.5px;
}

.entry-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
  text-align: right;
}
.entry-loc { color: var(--accent); }   /* ville, pays en couleur d'accent */

/* Vignette logo : toutes de la MÊME taille (carré fixe), fond blanc.
   Les logos sont rognés/nettoyés en amont pour bien remplir le carré. */
.entry-logo {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 10px;
  background: #FBFCFE;                        /* blanc doux (préféré au gris-bleu) */
  box-shadow: inset 0 0 0 1px rgba(10, 25, 47, 0.05);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 5px;                              /* les logos sont rognés serré : petit retrait pour ne pas toucher les coins */
  overflow: hidden;
}
[data-theme="light"] .entry-logo { background: #FBFCFE; }
.entry-logo img { max-width: 100%; max-height: 100%; height: auto; object-fit: contain; }

/* Chevron qui pivote à l'ouverture */
/* Bouton flèche : bascule le déroulé (le nom reste un lien à part) */
.entry-toggle {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 0; margin: 0;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
}

.chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.3s var(--ease), color 0.2s var(--ease);
}

/* Panneau déroulant : replié par défaut */
.entry-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s var(--ease), opacity 0.25s var(--ease);
}
.entry-panel-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 20px;                 /* horizontal seulement : le vertical vient des marges des enfants (sinon il resterait visible replié) */
}
.entry-panel p { font-size: 0.95rem; margin-bottom: 12px; }

/* Survol : bordure qui s'accentue + chevron ambre (indique que c'est cliquable) */
.entry:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--surface);
}
.entry:hover .chevron { color: var(--accent); }
.entry-head:active { transform: scale(0.997); }

/* Ouverture UNIQUEMENT au clic (classe .open posée par le JS) */
.entry.open {
  border-color: var(--accent);
  background: var(--surface);
}
.entry.open .entry-panel {
  grid-template-rows: 1fr;
  opacity: 1;
}
.entry.open .chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

/* ============================================================
   Panneau déroulé raffiné (« note en marge ») — Expérience ET
   Éducation. Modificateur .rich posé sur les panneaux concernés
   (les entrées sans .rich gardent le style de base sobre).
   Calage : logo 48px + gap 14px = 62px -> la prose et la stack
   « pendent » sous le titre, pas sous le logo.
   ============================================================ */
/* Indentation suspendue : prose + stack alignées sous le titre */
.entry-panel.rich .entry-panel-inner >p,
.entry-panel.rich .entry-panel-inner >.tags {
  margin-left: 62px;
  padding-left: 20px;
  padding-right: 20px;      /* la prose remplit la largeur du panneau au lieu de couper à mi-page */
}
/* Prose : interligne plus aéré, couleur de corps, pas d'orphelines */
.entry-panel.rich .entry-panel-inner >p {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.72;
  color: var(--text);
  margin-top: 6px;
  margin-bottom: 16px;
  text-align: justify;
  text-wrap: pretty;
}
/* Le seul accent : un filet ambre de 1px en marge, allumé en haut
   puis estompé vers le bas (dégradé). Repli couleur pleine si pas
   de color-mix. Rappelle le soulignement ambre des .entry-link. */
.entry-panel.rich .entry-panel-inner >p::before {
  content: "";
  position: absolute;
  left: 0; top: 0.15em; bottom: 0;
  width: 1px;
  border-radius: 1px;
  background: var(--accent);
  background: linear-gradient(
    to bottom,
    var(--accent) 0,
    color-mix(in srgb, var(--accent) 35%, transparent) 2.2em,
    color-mix(in srgb, var(--accent) 12%, transparent) 100%
  );
}
/* Stack : réutilise .tags ; un filet horizontal fin la sépare de la prose */
.entry-panel.rich .entry-panel-inner >.tags.stack {
  padding-top: 14px;
  margin-bottom: 20px;             /* bas du panneau (le wrapper n'a plus de padding vertical) */
  border-top: 1px solid var(--border);
}
/* Sous-titre diplôme dans l'en-tête (entrées Éducation) */
.entry-degree {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin-top: 4px;
}
@media (max-width: 640px) {
  .entry-panel-inner { padding: 0 16px; }
  .entry-panel.rich .entry-panel-inner >p,
  .entry-panel.rich .entry-panel-inner >.tags {
    margin-left: 0; padding-left: 16px; max-width: none;
  }
  .entry-panel.rich .entry-panel-inner >p { line-height: 1.65; }
}

/* ===================== CARTES PROJETS ===================== */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
a.card:hover { transform: translateY(-4px); border-color: var(--accent); }

/* En-tête de carte : logo à gauche, flèche en haut à droite */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 10px;
}
.arrow { display: inline-block; font-size: 1.2rem; color: var(--accent); transition: transform 0.2s var(--ease); }
a.card:hover .arrow { transform: translate(3px, -3px); }
.card-desc { font-size: 0.92rem; margin-bottom: 16px; }

/* ===================== PROJET PHARE (pleine largeur) ===================== */
.feature {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 300px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.feature:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.feature:hover .feature-media img { transform: scale(1.04); }

/* Panneau visuel du projet phare : le tableau « Boreas » de Waterhouse */
.feature-media {
  position: relative;                 /* l'image en absolu ne dicte plus la hauteur */
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.feature-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  display: block;
  transition: transform 0.5s var(--ease);
}

/* Bandeau miroir (Part 2) : texte à gauche, tableau à droite — rythme dynamique */
.feature--reverse { grid-template-columns: 1fr 340px; margin-top: 20px; }
.feature--reverse .feature-media {
  border-right: none;
  border-left: 1px solid var(--border);
}
/* Le tableau de la Part 2 (portrait) : on cadre bas, sur la femme allongée */
.feature--reverse .feature-media img { object-position: 50% 78%; }

/* Projet secondaire : mini-carte, bien plus petite que les bandeaux */
.also-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 34px 0 12px;
}
/* Deux mini-projets côte à côte (déclencheurs de modale, pas des liens).
   Même largeur que les bannières de projet -> séparation au centre. */
.miniprojects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.miniproject {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-decoration: none;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px 12px 12px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.miniproject::after {                 /* indice « ouvre une fiche » (visible aussi sur tactile) */
  content: "⤢";
  position: absolute;
  top: 9px; right: 11px;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.55;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.miniproject:hover { border-color: var(--accent); transform: translateY(-2px); }
.miniproject:hover::after { color: var(--accent); opacity: 1; }
.miniproject:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 640px) {
  .miniprojects { grid-template-columns: 1fr; }
}
.miniproject-art {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 8px;
  overflow: hidden;
}
.miniproject-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.miniproject-text { display: flex; flex-direction: column; gap: 3px; }
.miniproject-title {
  font-family: var(--font-display);
  font-size: 0.98rem; font-weight: 600; color: var(--heading);
}
.miniproject-desc { font-size: 0.84rem; color: var(--muted); line-height: 1.4; }

.feature-body { padding: 40px 40px; }
.feature-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.feature-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 6px 0 14px;
}

/* Liens de recherche (ouvrir l'app / lire le rapport) */
.feature-links { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; }
.rlink {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size 0.25s var(--ease);
}
.rlink:hover { background-size: 100% 1.5px; }

/* Phrase d'intro sous le titre de section */
.section-intro {
  color: var(--muted);
  margin: -18px 0 28px;
}

/* Sous-projet (Part 2) : carte plus petite que le projet phare */
.subproject {
  max-width: 660px;
  margin-top: 20px;
  padding: 26px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.subproject-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--heading);
  margin: 8px 0 12px;
}
.subproject .tags { margin-bottom: 16px; }

/* Projet phare cliquable : curseur + icône d'agrandissement + indice */
.feature { cursor: pointer; }
.feature-expand {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 25, 47, 0.65);
  color: #fff;
  border-radius: 8px;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.feature:hover .feature-expand,
.feature:focus-visible .feature-expand { opacity: 1; }
.feature-cue {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 18px;
}

/* ===================== MODALE (fiche projet Boreas) ===================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  /* La barre de nav reste peinte au-dessus : on centre dans l'espace VISIBLE,
     sinon la fiche paraît collée en haut (marge du haut mangée par la nav). */
  padding: calc(var(--nav-h) + 24px) 24px 24px;
}
.modal.open { display: flex; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 22, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-box {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) 1fr;
  width: 100%;
  max-width: 960px;
  max-height: calc(100vh - var(--nav-h) - 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.7);
}
.modal-art {
  background: var(--surface-2);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.modal-art img {
  width: auto; height: auto; max-width: 100%; max-height: 56vh;
  border-radius: 8px; display: block; margin: 0 auto;
}
.modal-caption { font-size: 0.9rem; font-style: italic; color: var(--text); }
.modal-credit { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.modal-body { padding: 34px 36px; overflow-y: auto; }
.modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em;
  color: var(--heading);
  margin: 6px 0 16px;
}
.modal-body p { margin-bottom: 16px; text-align: justify; }
.modal-body .tags { margin-bottom: 20px; }
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem; line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); }

/* Variante miroir : tableau à droite, texte à gauche (rappelle la bannière) */
.modal-box--reverse { grid-template-columns: 1fr minmax(0, 0.82fr); }
.modal-box--reverse .modal-art { order: 2; }
.modal-box--reverse .modal-body { order: 1; }
.modal-box--reverse .modal-close { right: auto; left: 12px; }

/* Fond qui se fond doucement (pas d'animation d'ouverture de la boîte) */
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal.open .modal-overlay { animation: modalFade 0.2s var(--ease); }
.modal-body, .modal-art { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
a, button, [role="button"], .entry-head, .feature, .miniproject { -webkit-tap-highlight-color: transparent; }

/* Tactile (pas de survol) : les liens gardent leur soulignement visible et les
   indices « ouvrable » restent affichés -> on voit ce qui est cliquable sur mobile. */
@media (hover: none) {
  .bio a, .entry-link, .rlink { background-size: 100% 1.5px; }
  .feature-expand { opacity: 1; }
}
/* Retour tactile au tap sur les cartes cliquables (fluidité) */
.feature:active, .miniproject:active { transform: scale(0.985); }

/* Mobile : la modale devient un « bottom sheet » (poignée + glisser pour fermer) */
@media (max-width: 720px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-box, .modal-box--reverse {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);   /* le corps prend la place restante et DÉFILE */
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding-top: 24px;                 /* bande d'en-tête pour la poignée + la croix */
  }
  .modal-body { min-height: 0; }       /* autorise le corps à rétrécir et donc à défiler */
  .modal-box::before {                 /* poignée de glissement */
    content: "";
    position: absolute;
    top: 10px; left: 50%; transform: translateX(-50%);
    width: 42px; height: 4px; border-radius: 999px;
    background: var(--muted); opacity: 0.5; z-index: 3;
  }
  .modal-box--reverse .modal-art { order: 0; }
  .modal-box--reverse .modal-body { order: 0; }
  .modal-art { max-height: 40vh; }
  .modal-body { padding: 20px 22px 30px; }
  .modal-close, .modal-box--reverse .modal-close {
    top: 14px; right: 14px; left: auto;
    width: 40px; height: 40px;
    background: var(--surface-2);
    border-radius: 10px;
    font-size: 1.6rem;
  }
}

/* ===================== TAGS & PILLS ===================== */
.tags, .pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.pills { margin-top: 16px; }
.pills li {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
}

/* ===================== CONTACT ===================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 14px;
}
.contact-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 14px;
}
.contact-text { max-width: 460px; margin: 0 auto 30px; }

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 14px 28px;
  transition: background 0.2s var(--ease);
}
.btn:hover { background: var(--accent-soft); }

/* Boutons rectangulaires « Get in touch » (LinkedIn / Email / GitHub) */
.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}
.cbtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 13px 24px;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
.cbtn:hover { background: var(--accent-soft); transform: translateY(-2px); }
.cbtn svg { flex-shrink: 0; }

/* Section contact centrée */
#contact { text-align: center; }

/* ===================== PIED DE PAGE ===================== */
.footer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

/* ===================== APPARITION AU SCROLL ===================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s var(--ease) var(--d, 0ms), transform 0.55s var(--ease) var(--d, 0ms);
}
.reveal.in-view { opacity: 1; transform: none; }

/* ===================== RESPONSIVE ===================== */

/* Tablette large (≤900px) : on resserre le hero avant l'empilement. */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(200px, 260px) 1fr; gap: 40px; }
  .feature { grid-template-columns: 300px 1fr; }
  .feature--reverse { grid-template-columns: 1fr 300px; }
}

/* Tablette portrait & petits écrans (≤760px) : tout passe en une colonne. */
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 28px;
    min-height: auto;
    padding: 16px 0 40px;
  }
  .hero-photo img { max-width: 240px; margin: 0 auto; display: block; }
  .bio { max-width: 560px; margin-left: auto; margin-right: auto; }
  .socials { justify-content: center; }
  .cards { grid-template-columns: 1fr; }
  /* Les bandeaux passent en une colonne, tableau au-dessus du texte */
  .feature { grid-template-columns: 1fr; min-height: 0; }
  .feature-media {
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--border);
    height: 220px;
  }
  .feature--reverse .feature-media { order: -1; }
}

/* Mobile (≤640px) : nav en ligne défilante + lignes d'entrée réorganisées. */
@media (max-width: 640px) {
  .topnav { flex-wrap: wrap; row-gap: 10px; }
  .topnav-links {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topnav-links::-webkit-scrollbar { display: none; }

  /* Ligne en grille : logo + titre + flèche en haut, ville/date dessous */
  .entry-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo title toggle" ". meta meta";
    align-items: center;
    gap: 8px 12px;
  }
  .entry-logo { grid-area: logo; }
  .entry-title { grid-area: title; min-width: 0; }
  .entry-toggle { grid-area: toggle; }
  .entry-meta {
    grid-area: meta;
    margin: 0; width: auto;
    flex-direction: row; align-items: baseline; gap: 10px; text-align: left;
  }
}

/* ===================== ANIMATIONS RÉDUITES ===================== */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
