/* ==========================================================================
   ARCHAEOSYMBOLA - STYLESHEET
   Design d'excellence scientifique, didactique et muséographique
   ========================================================================== */

:root {
  /* Palette Minérale Sombre (Par défaut) */
  --bg-primary: #0d0f12;
  --bg-secondary: #13171e;
  --bg-card: #181d26;
  --bg-card-hover: #1f2532;
  --bg-glass: rgba(19, 23, 30, 0.82);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-highlight: rgba(217, 155, 38, 0.4);

  --text-main: #e8ecf2;
  --text-muted: #9aa5b8;
  --text-dim: #6c788c;

  /* Couleurs Sémantiques Archéologiques */
  --ochre-red: #c94334;
  --ochre-red-glow: rgba(201, 67, 52, 0.25);
  --goethite-gold: #d99b26;
  --goethite-gold-glow: rgba(217, 155, 38, 0.25);
  --lapis-blue: #326be2;
  --lapis-blue-glow: rgba(50, 107, 226, 0.25);
  --malachite-green: #1ea377;
  --malachite-green-glow: rgba(30, 163, 119, 0.25);
  --amethyst-purple: #9059e0;

  /* Badges Consensus */
  --badge-established-bg: rgba(30, 163, 119, 0.18);
  --badge-established-text: #4ce5b1;
  --badge-debated-bg: rgba(217, 155, 38, 0.18);
  --badge-debated-text: #ffcf6b;
  --badge-historic-bg: rgba(201, 67, 52, 0.18);
  --badge-historic-text: #ff8578;

  /* Typographie */
  --font-serif: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --font-editorial: "Cormorant Garamond", "Newsreader", serif;
  --font-sans: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Échelles & Ombres */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px var(--goethite-gold-glow);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.18s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mode Parchemin d'Argile (Lecture Diurne) */
[data-theme="parchment"] {
  --bg-primary: #f6f3eb;
  --bg-secondary: #eee9dd;
  --bg-card: #ffffff;
  --bg-card-hover: #faf7f0;
  --bg-glass: rgba(246, 243, 235, 0.9);
  --border-subtle: rgba(70, 50, 30, 0.1);
  --border-medium: rgba(70, 50, 30, 0.22);
  --border-highlight: rgba(184, 115, 25, 0.5);

  --text-main: #201e1a;
  --text-muted: #5e5950;
  --text-dim: #8c8577;

  --ochre-red: #a82e21;
  --ochre-red-glow: rgba(168, 46, 33, 0.18);
  --goethite-gold: #b37815;
  --goethite-gold-glow: rgba(179, 120, 21, 0.18);
  --lapis-blue: #1f4cb0;
  --lapis-blue-glow: rgba(31, 76, 176, 0.18);
  --malachite-green: #137754;
  --malachite-green-glow: rgba(19, 119, 84, 0.18);

  --badge-established-bg: rgba(19, 119, 84, 0.12);
  --badge-established-text: #137754;
  --badge-debated-bg: rgba(179, 120, 21, 0.12);
  --badge-debated-text: #965f08;
  --badge-historic-bg: rgba(168, 46, 33, 0.12);
  --badge-historic-text: #a82e21;

  --shadow-sm: 0 2px 8px rgba(70, 50, 30, 0.08);
  --shadow-md: 0 8px 24px rgba(70, 50, 30, 0.12);
  --shadow-lg: 0 16px 40px rgba(70, 50, 30, 0.16);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(201, 67, 52, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(217, 155, 38, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(50, 107, 226, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Liens */
a {
  color: var(--goethite-gold);
  text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
a:hover {
  color: #ffc863;
  text-decoration: underline;
}
[data-theme="parchment"] a:hover {
  color: #8c5b05;
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.brand-glyph {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(201, 67, 52, 0.25), rgba(217, 155, 38, 0.25));
  border: 1px solid var(--border-highlight);
  color: var(--goethite-gold);
  font-size: 1.25rem;
  box-shadow: 0 0 15px rgba(217, 155, 38, 0.15);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-main);
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
}

/* Navigation Principale */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-link {
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

[data-theme="parchment"] .nav-link:hover,
[data-theme="parchment"] .nav-link.active {
  background-color: rgba(70, 50, 30, 0.08);
}

/* Outils Header : Recherche, Thème, Index */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.search-trigger-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-main);
  background-color: var(--bg-card-hover);
}
.kbd-shortcut {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
[data-theme="parchment"] .kbd-shortcut {
  background: rgba(0, 0, 0, 0.08);
}

.theme-toggle-btn, .index-jump-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-fast);
}
.theme-toggle-btn:hover, .index-jump-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.index-jump-btn {
  width: auto;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 0.4rem;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   HERO PRESTIGE SCIENTIFIQUE
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-badge-scientific {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(90deg, rgba(201, 67, 52, 0.15), rgba(217, 155, 38, 0.15));
  border: 1px solid var(--border-highlight);
  color: var(--goethite-gold);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4.8vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #ffffff 30%, #c4cbd4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="parchment"] .hero-title {
  background: linear-gradient(180deg, #1c1b18 40%, #544b3d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-family: var(--font-editorial);
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  font-style: italic;
  color: var(--goethite-gold);
  max-width: 860px;
  margin: 0 auto 1.5rem;
  line-height: 1.4;
}

.hero-lead-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 820px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
}

/* HUD / Stats scientifiques */
.scientific-metrics-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.2rem;
  max-width: 1000px;
  margin: 0 auto 3rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--border-subtle);
  padding: 0.4rem 0.6rem;
}
.metric-item:last-child {
  border-right: none;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--goethite-gold);
  line-height: 1.1;
}

.metric-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-top: 0.25rem;
  text-align: center;
}

/* ==========================================================================
   NAVIGATION RAPIDE PAR MODULES (FRISE SCROLLYTELLING)
   ========================================================================== */
.era-timeline-strip {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 61px;
  z-index: 90;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.timeline-strip-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.25rem;
}

.timeline-era-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.timeline-era-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-main);
  text-decoration: none;
}
.timeline-era-btn.active {
  border-color: var(--goethite-gold);
  background: rgba(217, 155, 38, 0.12);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(217, 155, 38, 0.2);
}

.era-number-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border-medium);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-main);
}
.timeline-era-btn.active .era-number-dot {
  background: var(--goethite-gold);
  color: #000;
}

.era-btn-dating {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ==========================================================================
   SECTION CONTENEUR GÉNÉRAL
   ========================================================================== */
.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--goethite-gold);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.section-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 850px;
  line-height: 1.7;
}

/* ==========================================================================
   MODULE COMPOSANT : LE CALQUE HERMÉNEUTIQUE (INSPECTEUR DE TERRAIN)
   ========================================================================== */
.inspector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 580px;
  margin-bottom: 3rem;
}
@media (max-width: 1024px) {
  .inspector-card {
    grid-template-columns: 1fr;
  }
}

.inspector-stage {
  position: relative;
  background: #08090b;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border-subtle);
}

/* Sélecteur d'artéfacts */
.inspector-artifact-nav {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}
.artifact-tab-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.artifact-tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}
.artifact-tab-btn.active {
  background: var(--goethite-gold);
  color: #0b0c0e;
  border-color: var(--goethite-gold);
  font-weight: 700;
}

/* Zone de rendu SVG / Visualisation graphique de l'artéfact */
.inspector-canvas-wrapper {
  position: relative;
  flex: 1;
  min-height: 380px;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.svg-artifact-canvas {
  width: 100%;
  max-width: 520px;
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.8));
  transition: all var(--transition-normal);
}

/* Points d'intérêts sur le canvas */
.inspection-hotspot {
  cursor: pointer;
  transition: transform 0.2s ease;
}
.inspection-hotspot:hover {
  transform: scale(1.15);
}

/* Barre de bascule des 3 calques herméneutiques */
.inspector-layers-bar {
  padding: 0.85rem 1.25rem;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.layers-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 700;
}

.layer-toggle-group {
  display: flex;
  background: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.layer-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.layer-btn:hover {
  color: var(--text-main);
}
.layer-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.layer-btn[data-layer="1"].active { color: #52e3c2; }
.layer-btn[data-layer="2"].active { color: #f5b041; }
.layer-btn[data-layer="3"].active { color: #a569bd; }

/* Panneau de droite : Exégèse et Données Scientifiques */
.inspector-details {
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 650px;
}

.inspector-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.badge-era {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.badge-dating {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--goethite-gold);
}

.inspector-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.inspector-site-loc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Contenu des calques */
.layer-content-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}
.layer-content-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.data-row {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.data-row:last-child {
  border-bottom: none;
}

.data-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.data-value {
  font-size: 0.94rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* Boîte de confrontation herméneutique */
.hermeneutic-schools-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.school-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  transition: border-color var(--transition-fast);
}
.school-card:hover {
  border-color: var(--border-medium);
}

.school-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.school-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.school-theorists {
  font-size: 0.8rem;
  color: var(--goethite-gold);
  font-weight: 500;
}

.school-thesis {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.school-critique {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding-left: 0.75rem;
  border-left: 2px solid var(--border-medium);
  font-style: italic;
}

/* ==========================================================================
   MODULE COMPOSANT : LE GRAPHE DES FILIALES SYMBOLIQUES
   ========================================================================== */
.threads-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 4.5rem 1.5rem;
}

.threads-nav {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
  flex-wrap: wrap;
}

.thread-selector-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.thread-selector-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-main);
}
.thread-selector-btn.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: currentColor;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}
.thread-selector-btn[data-thread="ocre"] { --accent-color: var(--ochre-red); }
.thread-selector-btn[data-thread="bucrane"] { --accent-color: var(--goethite-gold); }
.thread-selector-btn[data-thread="crane"] { --accent-color: var(--malachite-green); }
.thread-selector-btn[data-thread="hybride"] { --accent-color: var(--amethyst-purple); }

.thread-selector-btn.active {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.thread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-color);
}

.thread-display-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.thread-intro {
  margin-bottom: 2rem;
  max-width: 900px;
}
.thread-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.thread-concept-thesis {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Chaîne cognitive (Station par station) */
.cognitive-chain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  position: relative;
}

.chain-station {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.chain-station:hover {
  transform: translateY(-4px);
  border-color: var(--border-medium);
}

.station-era {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--goethite-gold);
  margin-bottom: 0.4rem;
  display: block;
}

.station-site {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.station-mutation {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   LES 5 MODULES DU CORPUS (GRILLE DES SITES & DÉCOUVERTES)
   ========================================================================== */
.corpus-module {
  margin-bottom: 5rem;
  scroll-margin-top: 130px;
}

.module-header-banner {
  border-left: 4px solid var(--goethite-gold);
  padding-left: 1.5rem;
  margin-bottom: 2rem;
}

.module-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--goethite-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.module-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 700;
  margin: 0.25rem 0 0.5rem;
  color: var(--text-main);
}

.module-dating-span {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.module-synthesis {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 900px;
  line-height: 1.7;
}

/* Grille des enregistrements archéologiques */
.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.75rem;
}
@media (max-width: 768px) {
  .records-grid {
    grid-template-columns: 1fr;
  }
}

.archaeo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-normal);
  position: relative;
  box-shadow: var(--shadow-sm);
}
.archaeo-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
  background-color: var(--bg-card-hover);
}

.card-top {
  margin-bottom: 1rem;
}

.card-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.category-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}
.category-tag.sepulture {
  background: rgba(201, 67, 52, 0.15);
  color: #ff7669;
}
.category-tag.parietal {
  background: rgba(217, 155, 38, 0.15);
  color: #ffcf6b;
}
.category-tag.sanctuaire {
  background: rgba(30, 163, 119, 0.15);
  color: #4ce5b1;
}
.category-tag.megalithe {
  background: rgba(144, 89, 224, 0.15);
  color: #c7a4ff;
}
.category-tag.epigraphie {
  background: rgba(50, 107, 226, 0.15);
  color: #79a6ff;
}

.consensus-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}
.consensus-badge.etabli {
  background: var(--badge-established-bg);
  color: var(--badge-established-text);
}
.consensus-badge.debattu {
  background: var(--badge-debated-bg);
  color: var(--badge-debated-text);
}
.consensus-badge.historique {
  background: var(--badge-historic-bg);
  color: var(--badge-historic-text);
}

.card-site-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.card-dating {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--goethite-gold);
  margin-bottom: 0.75rem;
  display: block;
}

.card-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.card-meta-list {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.card-meta-item {
  display: flex;
  gap: 0.5rem;
}
.card-meta-label {
  color: var(--text-dim);
  font-weight: 600;
  min-width: 95px;
}
.card-meta-val {
  color: var(--text-main);
}

.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.card-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
  color: var(--goethite-gold);
}

/* ==========================================================================
   TABLEAU COMPARATIF DES ÉCOLES HERMÉNEUTIQUES
   ========================================================================== */
.matrix-section {
  padding: 4.5rem 1.5rem;
}

.matrix-table-wrapper {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.matrix-table th {
  background: var(--bg-secondary);
  padding: 1.1rem 1.25rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-medium);
  letter-spacing: 0.04em;
}

.matrix-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--text-muted);
  line-height: 1.6;
}

.matrix-table tr:hover td {
  background-color: var(--bg-card-hover);
}

.matrix-school-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
}

.theorist-chip {
  display: inline-block;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--goethite-gold);
  margin: 0.15rem;
}

/* ==========================================================================
   GLOSSAIRE CONTEXTUEL FLOTTANT & TOOLTIPS
   ========================================================================== */
.glossary-term {
  border-bottom: 1px dashed var(--goethite-gold);
  cursor: help;
  color: inherit;
  transition: background-color var(--transition-fast);
  padding: 0 0.15rem;
  border-radius: 2px;
}
.glossary-term:hover {
  background-color: rgba(217, 155, 38, 0.15);
}

.glossary-popover {
  position: absolute;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 1rem;
  width: 290px;
  box-shadow: var(--shadow-lg);
  font-size: 0.82rem;
  color: var(--text-main);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.glossary-popover.visible {
  opacity: 1;
  transform: translateY(0);
}
.glossary-popover-title {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--goethite-gold);
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

/* ==========================================================================
   INDEX EN BAS DE PAGE & RÉFÉRENCES SCIENTIFIQUES EXHAUSTIVES
   ========================================================================== */
.page-index-section {
  background: #090a0d;
  border-top: 2px solid var(--border-highlight);
  padding: 5rem 1.5rem 3rem;
  color: var(--text-main);
}
[data-theme="parchment"] .page-index-section {
  background: #ede8dc;
  border-top-color: var(--goethite-gold);
}

.index-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.index-tab-btn {
  background: transparent;
  border: none;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.index-tab-btn:hover {
  color: var(--text-main);
}
.index-tab-btn.active {
  color: var(--goethite-gold);
  border-bottom-color: var(--goethite-gold);
}

.index-tab-pane {
  display: none;
}
.index-tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Colonnes d'index alphabétique */
.alpha-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.index-letter-group {
  margin-bottom: 1.5rem;
}

.index-letter-header {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--goethite-gold);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.25rem;
  margin-bottom: 0.75rem;
}

.index-list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.index-entry {
  font-size: 0.88rem;
  line-height: 1.5;
}
.index-entry-term {
  font-weight: 600;
  color: var(--text-main);
}
.index-entry-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: block;
}
.index-entry-link {
  font-size: 0.76rem;
  color: var(--goethite-gold);
  margin-left: 0.4rem;
}

/* Répertoire bibliographique de référence */
.bibliography-list {
  list-style: none;
  display: grid;
  gap: 1.2rem;
}

.biblio-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.4rem;
  font-size: 0.88rem;
  line-height: 1.6;
  transition: border-color var(--transition-fast);
}
.biblio-item:hover {
  border-color: var(--border-medium);
}

.biblio-authors {
  font-weight: 700;
  color: var(--text-main);
}
.biblio-year {
  color: var(--goethite-gold);
  font-family: var(--font-mono);
  font-weight: 600;
}
.biblio-title {
  font-style: italic;
  color: #fff;
}
[data-theme="parchment"] .biblio-title {
  color: #000;
}
.biblio-journal {
  color: var(--text-muted);
}
.biblio-links {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.8rem;
  font-size: 0.78rem;
}
.biblio-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  color: var(--goethite-gold);
}
.biblio-link-pill:hover {
  background: rgba(217, 155, 38, 0.2);
  text-decoration: none;
}

/* Footer crédits & mentions */
.site-footer-credits {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.footer-author-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.footer-author-name {
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.footer-author-badge a {
  color: var(--goethite-gold);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-author-badge a:hover {
  color: #ffcf6b;
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: rgba(217, 155, 38, 0.18);
  color: var(--goethite-gold);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  border: 1px solid rgba(217, 155, 38, 0.3);
}

/* Bouton Flèche vers le haut (Back to top) */
.back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 95;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  color: var(--goethite-gold);
  font-size: 1.35rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity var(--transition-normal), transform var(--transition-normal), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.back-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background: var(--goethite-gold);
  color: #0b0c0e;
  border-color: var(--goethite-gold);
  box-shadow: 0 6px 26px rgba(217, 155, 38, 0.45);
  transform: translateY(-4px);
}

.back-to-top-btn:active {
  transform: translateY(0);
}


/* ==========================================================================
   MODAL DE DIALOGUE SCIENTIFIQUE (LABORATORY RECORD MODAL)
   ========================================================================== */
.dialog-overlay {
  border: none;
  background: transparent;
  padding: 1.5rem;
  max-width: 850px;
  width: 100%;
  margin: auto;
}

.dialog-overlay::backdrop {
  background: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}
.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-main);
}

/* Modal Recherche Globale */
.search-dialog {
  max-width: 650px;
}
.search-input-box {
  position: relative;
  margin-bottom: 1.5rem;
}
.search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem 0.9rem 2.75rem;
  font-size: 1.05rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  outline: none;
}
.search-input:focus {
  border-color: var(--goethite-gold);
  box-shadow: 0 0 0 3px rgba(217, 155, 38, 0.2);
}
.search-icon-pos {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1.1rem;
}
.search-results-list {
  max-height: 400px;
  overflow-y: auto;
  display: grid;
  gap: 0.6rem;
}
.search-result-item {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: all var(--transition-fast);
}
.search-result-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}
.search-result-title {
  font-weight: 700;
  color: var(--text-main);
}
.search-result-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Accessibilité et Réduction des Animations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
