
:root {
  --bg: #f7f8fb;
  --ink: #0c1633;
  --muted: #6b7280;
  --card: #ffffff;
  --brand: #1f6feb; /* bleu accessible */
  --radius: 14px;
  --shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
  --maxw: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --ink: #e5e7eb;
    --muted: #9ca3af;
    --card: #121a2e;
    --shadow: 0 8px 30px rgba(0,0,0,0.4);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

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

.site-header {
  padding: 72px 0 32px;
  background: linear-gradient(180deg, rgba(31,111,235,0.09), transparent 55%);
  border-bottom: 1px solid rgba(31,111,235,0.12);
}



.projects {
  padding: 80px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.project-card {
  position: relative;
  text-decoration: none;
}

.project-card img {
  width: 100%;
  display: block;
}

.project-card span {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: white;
  font-size: 20px;
  font-weight: bold;
}


section.projects { padding: 48px 0 20px; }

.projects h2 {
  margin: 0 0 16px;
  font-size: 28px;
  letter-spacing: -0.01em;
}

.projects .intro { color: var(--muted); margin-bottom: 28px; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* fluide */
  gap: 22px;
}

.project-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .2s ease;
}

.project-card:hover { transform: translateY(-2px); }

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.project-meta {
  padding: 14px 16px 18px;
}

.project-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.tag { background: rgba(31,111,235,0.10); color: var(--brand); padding: 2px 8px; border-radius: 999px; }

.topnav { padding: 12px 0; border-bottom: 1px solid rgba(31,111,235,0.12); }
.topnav a { color: var(--brand); text-decoration: none; font-weight: 600; }

.case-hero { padding: 32px 0 10px; }
.muted { color: var(--muted); }

.case { padding: 22px 0 64px; }
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 14px 0 22px;
}
.shot img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.footer { padding: 32px 0; color: var(--muted); border-top: 1px solid rgba(31,111,235,0.12); }


/* === Grille projets (au cas où) === */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

/* === Carte projet (lien) === */
.project-card {
  position: relative;
  display: block;                 /* le lien occupe toute la carte */
  text-decoration: none;
  color: inherit;
  border-radius: 14px;            /* optionnel si tu veux des coins arrondis */
  overflow: hidden;               /* pour couper l'image + overlay aux bords */
  background: #000;               /* évite un flash blanc si l'image tarde */
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
  transform: translateZ(0);       /* aide les perfs pour l'overlay */
}

/* Image pleine largeur, hauteur fixe (ajuste si besoin) */
.project-card > img {
  width: 100%;
  height: 200px;                  /* ajuste (ex. 240/280px) */
  display: block;
  object-fit: cover;
}

/* Overlay dégradé : noir en bas -> transparent en haut */
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;                       /* couvre 100% de la carte */
  pointer-events: none;           /* laisse passer les clics */
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,       /* très sombre au bas */
    rgba(0, 0, 0, 0.50) 35%,
    rgba(0, 0, 0, 0.00) 70%       /* transparent vers le haut */
  );
  z-index: 1;                     /* au-dessus de l'image, sous le texte */
  opacity: 1;                     /* visible par défaut */
  transition: opacity .2s ease;
}

/* Titre (ton <span>) par-dessus l’overlay, en bas de la carte */
.project-card > span {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;                     /* au-dessus de l'overlay */
  color: #fff;                    /* blanc net */
  font-weight: 800;
  font-size: 16px;                /* ajuste si besoin */
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35); /* léger boost de lisibilité */
}

/* Effet hover/focus : légère levée et overlay un peu plus marqué */
.project-card:hover,
.project-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

@media (hover:hover) and (pointer:fine) {
  .project-card:hover::after { opacity: 1; } /* tu peux monter à 0.9 si tu veux plus sombre */
}

/* Accessibilité clavier : style focus visible */
.project-card:focus-visible {
  outline: 3px solid #1f6feb;     /* ou var(--brand) si tu as des variables */
  outline-offset: 3px;
  border-radius: 14px;
}

/* Variante : overlay uniquement sur la moitié basse (si tu préfères) */
/*
.project-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
  z-index: 1;
}
*/



/* ====== Header en grille ====== */
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;  /* texte : image */
  gap: 24px;
  align-items: center;               /* aligne verticalement */
}

/* Améliore l'espace du header si besoin */
.site-header {
  padding: 72px 0 40px;  /* top / bottom */
}

/* ====== Bloc texte ====== */
.hero-copy .site-title {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 40px);
  letter-spacing: -0.02em;
}
.hero-copy .site-subtitle {
  margin: 12px 0 0;
  color: var(--muted, #6b7280);
  font-size: clamp(14px, 1.7vw, 18px);
}

/* ====== Portrait rond ====== */
.hero-portrait {
  justify-self: end;      /* colle la photo à droite */
  margin: 0;
}

.avatar {
  display: block;
  width: min(320px, 38vw);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;                  /* cercle */
  border: 6px solid rgba(31,111,235,.15);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  background: #ddd;                    /* fallback si l'image tarde */
}

/* Effet léger au survol (optionnel) */
@media (hover: hover) and (pointer: fine) {
  .avatar:hover { transform: translateY(-2px); }
  .avatar { transition: transform .15s ease, box-shadow .2s ease; }
}

/* ====== Responsive : pile en colonne sur mobile ====== */
@media (max-width: 760px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .hero-portrait {
    justify-self: start;   /* photo passe sous le texte, alignée à gauche */
  }
  .site-header { padding: 48px 0 28px; }
}


/* =========================================================
   MODALE PDF — OPTION 1 (plein écran, UI native masquée)
   Dépendances HTML attendues :
   - <div id="pdfModal" class="modal">
       <div class="modal__backdrop" data-close-modal></div>
       <div class="modal__dialog" role="dialog" aria-modal="true">
         <button class="modal__close" type="button" data-close-modal>×</button>
         <div class="modal__content">
           <iframe id="pdfFrame" src="" title="Aperçu PDF"></iframe>
           <!-- <p class="modal__fallback">…</p> (optionnel) -->
         </div>
       </div>
     </div>
   - Le body reçoit la classe .has-modal à l’ouverture (pour bloquer le scroll).
   ========================================================= */

/* Accessibilité : masquage visuel sans retirer du flux pour les lecteurs d’écran */
.visually-hidden { 
  position: absolute !important; 
  height: 1px; width: 1px; 
  overflow: hidden; 
  clip: rect(1px, 1px, 1px, 1px); 
  white-space: nowrap; 
}

/* Conteneur principal de la modale */
.modal { 
  position: fixed; 
  inset: 0; 
  z-index: 9999; 
  display: none; 
}
.modal.is-open { display: block; }

/* Fond ombré (backdrop) */
.modal__backdrop {
  position: fixed; 
  inset: 0;
  background: rgba(2, 6, 23, 0.58); /* fond sombre */
  backdrop-filter: blur(2px);
  animation: fadeIn .18s ease-out;
}

/* Boîte de dialogue en PLEIN ÉCRAN */
.modal__dialog {
  position: fixed;
  inset: 0;                      /* plein écran */
  display: grid;
  grid-template-rows: 1fr;       /* une seule zone : le contenu */
  background: var(--card, #fff); /* fond blanc -> pas d’effet "lecteur noir" */
  color: var(--ink, #0f172a);
  border-radius: 0;
  box-shadow: none;              /* pas d’ombre, look "plein écran" */
  overflow: hidden;              /* évite tout scroll parasite interne */
  animation: none;               /* optionnel : pas d’anim zoom */
}

/* Contenu : aucune marge/padding, l’iframe occupe tout */
.modal__content { 
  padding: 0; 
  height: 100%;
  display: grid; 
  grid-template-rows: 1fr; 
  align-items: stretch;
}

/* Iframe PDF PLEIN ÉCRAN (largeur & hauteur) */
#pdfFrame {
  width: 100%;
  height: 100vh;                 /* fallback pour anciens navigateurs */
  height: 100dvh;                /* viewport dynamique réel (mobile) */
  border: 0;
  background: #fff;              /* fond blanc uniforme */
  display: block;                /* évite l’espace inline fantôme */
  box-shadow: inset 0 0 0 1px rgba(2,6,23,0.06); /* léger liseré interne (optionnel) */
}

/* Bouton Fermer : flottant (n’influence pas la hauteur du contenu) */
.modal__close {
  position: fixed;               /* fixé au viewport */
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 10000;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: rgba(15,23,42,0.06);
  color: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover { background: rgba(15,23,42,0.12); }

/* Fallback / lien d’ouverture externe si le PDF ne s’affiche pas */
.modal__fallback { 
  margin: 0; 
  padding: 8px 12px; 
  font-size: 14px; 
  color: var(--muted, #64748b); 
  background: #fff8; 
}
.modal__fallback a { 
  color: var(--brand, #1f6feb); 
  text-decoration: underline; 
}

/* Empêche le scroll de la page derrière la modale */
body.has-modal { overflow: hidden; }

/* Animations */
@keyframes fadeIn { 
  from { opacity: 0 } 
  to   { opacity: 1 } 
}

/* Responsive (au besoin) */
@media (max-width: 560px) {
  .modal__dialog { inset: 0; }  /* déjà plein écran */
  #pdfFrame { 
    height: calc(100vh - 8px);
    height: calc(100dvh - 8px);
  }
}

.modal__dialog { inset: 2% 3%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.modal__close  { position: absolute; top: 10px; right: 12px; }



/* ====== Section liens externes ====== */

.web-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}




/* Carte cliquable */
.web-link-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;

  background: var(--card, #ffffff);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: var(--ink, #0f172a);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
  border: 1px solid rgba(15, 23, 42, 0.06);
  transition: transform .15s ease, box-shadow .2s ease;
}

.web-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

/* Image vignette */
.web-link-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  background: #eef2f7;
}

/* Zone texte à droite */
.web-link-body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  row-gap: 6px;
  width: 100%;
  min-width: 0;
}

/* Titre */
.web-link-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

/* Description */
.web-link-desc {
  margin: 0;
  color: var(--muted, #6b7280);
  line-height: 1.5;
}

/* CTA aligné à droite */
.web-link-cta {
  justify-self: end;
  font-weight: 600;
  color: var(--brand, #1f6feb);
  border-bottom: 1px solid transparent;
}

.web-link-card:hover .web-link-cta {
  border-color: var(--brand, #1f6feb);
}

