/* Importation des Google Fonts (Sora et Fira Code) */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Sora:wght@400;500;600;700;800&display=swap');

/* --- Thème Sombre Moderne & Flat Design --- */
:root {
  --bg-color: #151c24; 
  --card-bg: #1e2631;  
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --accent-teal: #00a8a8;
  --accent-teal-hover: #00cbcb;
  --border-flat: #2d3745;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  /* Application de Sora */
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

/* Application de la police technique pour le code */
div.sourceCode, code, pre {
  font-family: 'Fira Code', monospace;
  background-color: var(--card-bg);
  border: 1px solid var(--border-flat);
  border-radius: 6px;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* --- Barre de navigation --- */
.navbar {
  background-color: var(--bg-color) !important;
  border-bottom: 1px solid var(--border-flat);
  padding: 0.7rem 1rem;
}

.navbar-brand {
  color: var(--text-main) !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.navbar-brand img, .brand-logo img {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar-brand:hover img, .brand-logo:hover img {
  transform: rotate(15deg) scale(1.1);
}

a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-teal-hover);
}

.nav-link:hover {
  color: var(--accent-teal) !important;
}

div.sourceCode {
  background-color: var(--card-bg);
  border: 1px solid var(--border-flat);
  border-radius: 6px;
  padding: 1rem;
}

/* Force a larger logo in the navbar */
.navbar-logo {
  max-height: 50px !important; /* Adjust this value to fit your needs */
  width: auto;
}
/* --- Boutons de Navigation (Tuiles Cosmiques) --- */
.btn-surface {
  background-color: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--border-flat);
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-align: center;
  font-weight: 600;
  font-size: 1.05rem;
  
  /* Flexbox empêche le texte de déborder et le centre */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 85px; 
  height: 100%;
  padding: 1rem;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  
  /* Paramètres pour la couleur */
  position: relative;
  overflow: hidden;
  --tile-color: var(--accent-teal); /* Teal par défaut */
}

/* Liseré coloré permanent en haut de la tuile pour donner de la vie */
.btn-surface::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--tile-color);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.btn-surface:hover {
  background-color: #1a222c;
  border-color: var(--tile-color);
  color: #ffffff;
  transform: translateY(-4px);
  /* Création d'une lueur (glow) de la couleur de la tuile */
  box-shadow: 0 10px 25px rgba(0,0,0,0.4), 0 0 12px var(--tile-color);
}
/* Mots en gras : utilisation d'un teal clair pour le contraste */
strong, b {
  color: #00d6d6; 
  font-weight: 600;
}
/* --- Blog Listing Grid (Integrating existing design system) --- */

/* Target the Quarto grid items specifically */
.quarto-grid-item .card {
  background-color: var(--card-bg) !important;
  border: 1px solid var(--border-flat) !important;
  border-radius: 10px !important; /* Matches your btn-surface radius */
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden; /* Needed for the top border effect */
  color: var(--text-main);
}

/* Add the 'top border' accent effect consistent with your buttons */
.quarto-grid-item .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-teal); /* Consistent with your default teal */
  opacity: 0.7;
}

/* Hover effect matching your btn-surface interaction */
.quarto-grid-item .card:hover {
  background-color: #1a222c !important; /* Slightly lighter shade as in your existing code */
  border-color: var(--accent-teal) !important;
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

/* Typography adjustments for the cards */
.quarto-grid-item .card-title {
  color: var(--text-main);
  font-weight: 700;
  margin-top: 0.5rem;
}

.quarto-grid-item .card-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.quarto-grid-item .listing-date {
  color: var(--accent-teal);
  font-size: 0.85rem;
  font-weight: 600;
}
/* --- La Palette "Théorie Quantique" --- */
.c-teal    { --tile-color: #00a8a8; }
.c-indigo  { --tile-color: #6366f1; } /* Bleu-violet profond */
.c-purple  { --tile-color: #a855f7; } /* Violet nébuleuse */
.c-blue    { --tile-color: #3b82f6; } /* Bleu électrique */
.c-emerald { --tile-color: #10b981; } /* Vert émeraude */
.c-rose    { --tile-color: #ec4899; } /* Rose vif d'accentuation */

/* --- Hero Banner (Pleine largeur avec animation en fond) --- */
.hero-section {
  position: relative;
  width: 100vw;
  height: 55vh; 
  min-height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -1.5em; /* Compense la marge interne par défaut de Quarto */
  margin-bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
}

/* Dégradé pour fondre l'animation dans le fond (remplace la coupure nette) */
.hero-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px; /* Taille de la zone de fondu */
  background: linear-gradient(to bottom, transparent, var(--bg-color));
  pointer-events: none; /* Ne bloque pas la souris pour l'interaction avec le canvas */
}

#spinfoamCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: var(--bg-color);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  background: rgba(21, 28, 36, 0.45);
  padding: 1.8rem 2.5rem; /* Marges réduites */
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  
  /* Ajustement magique : réduit la boîte à la taille du texte */
  max-width: 700px;
  width: fit-content; 
  margin: 0 auto;
}

/* Hiérarchie du texte repensée */
.hero-subtitle {
  color: var(--text-muted); /* Moins d'importance pour le statut PhD */
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-weight: 700;
  font-size: 2.1rem; /* Les sujets de recherche au centre de l'attention */
  margin-bottom: 1.5rem;
  color: var(--text-main);
  line-height: 1.4;
}

.hero-title .highlight {
  /* Dégradé du texte principal vers le Teal */
  background: linear-gradient(5deg, var(--tile-color, #a855f7) 0%, var(--accent-teal) 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  display: inline-block;
}

.hero-links {
  margin-top: 1rem;
}

.hero-links a {
  font-weight: 600;
  /* text-transform: uppercase; */
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--text-main);
  transition: color 0.2s ease;
}

.hero-links a:hover {
  color: var(--accent-teal);
}

.hero-links a i.bi {
  margin-right: 0.3rem;
  font-size: 1.1em;
  vertical-align: -0.1em;
}

.hero-links .separator {
  color: var(--border-flat);
  margin: 0 1rem;
}
/* Force la couleur des icônes Academicons en blanc (ou la couleur de ton choix) */
.ai {
    color: #beffff; /* Tu peux aussi mettre une couleur personnalisée comme ton teal */
    vertical-align: middle; /* Aligne proprement l'icône avec le texte */
}

/* Optionnel : Si tu veux une couleur différente au survol du lien */
a:hover .ai {
    color: #008080; /* Exemple de couleur au survol */
}
/* --- Modificateur pour Boutons en ligne (ex: rapports, slides dans le texte) --- */
.btn-inline {
  display: inline-flex !important;
  min-height: unset !important;
  height: auto !important;
  padding: 2px 10px !important;
  margin-left: 8px;
  vertical-align: middle;
  font-size: 0.80em;
  border-radius: 6px; /* Un peu moins arrondi que les grosses tuiles */
}

/* Ajustement de l'icône dans le bouton inline */
.btn-inline i.bi {
  margin-right: 4px;
}
/* --- Modificateur pour Boutons compacts (sous le texte) --- */
.btn-compact {
  display: inline-flex !important;
  min-height: unset !important;
  height: auto !important;
  width: fit-content !important;
  padding: 6px 14px !important;
  margin-top: 8px;
  font-size: 0.85em;
  border-radius: 6px;
}

/* Espacement de l'icône dans le bouton */
.btn-compact i.bi {
  margin-right: 6px;
}

/* --- Logo en filigrane (Watermark) --- */
body::after {
  content: "";
  position: fixed;
  bottom: -5vw;    /* Permet de le faire légèrement déborder de l'écran en bas */
  right: -10vw;     /* Permet de le faire légèrement déborder à droite */
  width: 60vw;     /* Taille très grande (50% de la largeur de l'écran) */
  max-width: 8000px;
  min-width: 4000px;
  height: 60vh;
  
  /* Chemin vers ton logo (ajuste si ton CSS n'est pas dans le même dossier) */
  background-image: url('logo_bi_whiteteal_shad.svg');
  background-repeat: no-repeat;
  background-position: bottom right;
  background-size: contain;
  
  /* Réglages cruciaux pour un fond */
  opacity: 0.05;          /* Règle la transparence ici (ex: 0.05 pour très discret) */
  z-index: -100;          /* Le place tout au fond, derrière le texte et le canvas */
  pointer-events: none;   /* EMPÊCHE le logo de bloquer les clics sur tes liens/boutons */
}