/* =========================================
   1. VARIABLES & RESET
========================================= */
:root {
  --color-primary: #570794;
  --color-secondary: #A41993;
  --color-phrase: #000000;
  --color-text: #333333;
  --color-grey-light: #666666;
  --color-grey-lighter: #e0e0e0;
  --color-bg: #ffffff;
  --font-main: "Garamond", serif;
  --font-sans: "IBM Plex Sans", sans-serif; 
  --radius-img: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px; 
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-img);
  display: block;
}

/* =========================================
   2. TYPOGRAPHY
========================================= */
.short-title {
  color: var(--color-primary);
  text-transform: uppercase;
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 3;
}

.phrase {
  color: var(--color-phrase);
  font-family: var(--font-main);
  font-size: 3rem;
  font-weight: bold;
  line-height: 1;
  padding-bottom: 2rem;
  text-align: left;
}

.highlight {
  color: var(--color-secondary);
}

p {
  color: var(--color-text);
  font-size: 1.5rem;
}

section p, .card-text, .team-bio {
  text-align: justify;
  hyphens: none;
  -webkit-hyphens: none;
  -moz-hyphens: none;
}

.text-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

@media (max-width: 768px) {
  .phrase {font-size: 2rem; padding-bottom: 1.6rem; }
  p { font-size: 1.2rem; }
}

/* =========================================
   LIENS HYPERTEXTES GLOBAUX
========================================= */
p a, 
li a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

p a:hover, 
li a:hover {
  color: var(--color-primary); 
  text-decoration-color: var(--color-primary);
}

/* =========================================
   3. LAYOUTS & GRIDS
========================================= */
.section-spacing {
  padding: 4rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.layout-asym-right, .layout-intro {
  display: grid;
  gap: 3rem;
  align-items: start;
}

.layout-stacked {
  display: flex;
  flex-direction: column;
  margin-bottom: 3rem;
}

.layout-intro .short-title,
.layout-intro .col-text p:first-child,
.layout-stacked .short-title,
.layout-stacked .stacked-text p {
  margin-top: 0;
}

.layout-stacked .short-title {
  margin-bottom: 1rem;
}

.layout-stacked .phrase {
  margin-bottom: 0;
}

.grid-2-col, .grid-3-col {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

.team-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  column-gap: 5rem;
  margin-top: 7rem;
  margin-bottom: 0rem;
}

@media (min-width: 768px) {
  .layout-asym-right { grid-template-columns: 2fr 1fr; }
  .layout-intro { grid-template-columns: 1fr 1fr; }
  .grid-2-col { grid-template-columns: repeat(2, 1fr); }
  .grid-3-col { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================
   4. HEADER, NAVIGATION & FOOTER
========================================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: transparent;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.header .logo {
  height: 40px;
  border-radius: 0;
}

.main-nav {
  font-family: var(--font-sans);
  display: flex;
  gap: 1.0rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: bold;
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.main-nav a:hover {
  color: var(--color-secondary);
}

/* =========================================
   MENU DÉROULANT (NAVIGATION)
========================================= */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: color 0.3s ease;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  min-width: 120px; 
  background-color: var(--color-bg);
  
  border: none;
  border-right: 2px solid #000000;
  border-radius: 0; 
  
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  z-index: 1000;
  
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;

  padding: 0;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  padding: 6px 20px;
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: normal;
  text-align: right; 
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.nav-dropdown-menu a:hover {
  background-color: var(--color-grey-lighter);
  color: var(--color-primary);
}

@media (max-width: 900px) {
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: none;
    
  }
  .nav-dropdown:hover .nav-dropdown-menu {
    display: flex;
  }
}

.footer {
  text-align: center;
  padding: 2rem;
  background-color: var(--color-bg);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 4rem;
  color: var(--color-text);
  font-size: 0.9rem;
}

/* --- Language Switcher --- */
.lang-switcher {
  position: relative;
  display: inline-block;
  margin-right: 2rem;
  font-family: var(--font-sans);
}

.lang-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.lang-btn span {
  font-size: 1.0rem;
  color: var(--color-primary);
}

.lang-menu {
  display: none;
  position: absolute;
  top: 150%;
  left: 0;
  background-color: var(--color-bg);
  list-style: none;
  padding: 0.5rem 0;
  border-radius: var(--radius-img);
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  min-width: 60px;
  text-align: center;
}

.lang-menu.show { display: block; }

.lang-menu a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 1.1rem;
  display: block;
  padding: 0.4rem 1rem;
  transition: color 0.2s ease;
}

.lang-menu a:hover { color: var(--color-primary); }

/* --- Burger Menu --- */
.burger-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}

.burger-menu span {
  display: block;
  width: 30px;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 3px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger-menu.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.burger-menu.open span:nth-child(2) { opacity: 0; }
.burger-menu.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

@media (max-width: 768px) {
  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 2rem;
    background-color: var(--color-bg);
    padding: 1.5rem;
    border-radius: var(--radius-img);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
  }
  .main-nav.show { display: flex; }
  .burger-menu { display: flex; }
  .col-img { display: none;}
}

/* =========================================
   5. COMPONENTS: HERO & LOGOS
========================================= */
.hero {
  position: relative;
  background-color: transparent;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-logo-img {
  width: 400px;
  max-width: 100%;
  margin: 0 auto 1.1rem auto;
  display: block;
}

.hero-meaning {
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin: 0;
}

.hero-subtitle {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.hero-logos-center, .hero-logos {
  display: flex;
  gap: 1.5rem;
}

.hero-logos-center {
  justify-content: center;
}

.hero-logos-center img, .hero-logos img {
  height: 45px;
  width: auto;
  object-fit: contain;
}

.dynamic-logo {
  filter: grayscale(100%);
  transition: filter 0.3s ease, transform 0.3s ease;
  will-change: transform, filter;
  display: inline-block;
}

.dynamic-logo:hover {
  filter: grayscale(0%);
  transform: scale(1.05);
}

.dynamic-logo img {
  border-radius: 0;
}

.mission-logo {
  width: 70%;
  margin: 0 auto;
}

.center-vertical {
  align-self: center;
}

/* Hide specific logo on mobile */
@media (max-width: 767px) {
  .mission-logo {
    display: none;
  }
}

/* =========================================
   6. COMPONENTS: CARDS, TEAM & FUNDERS
========================================= */
.card {
  background: transparent;
  padding: 0;
}

.card h4 {
  color: var(--color-primary);
  margin: 1rem 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: normal;
}

.card-short-title {
  color: var(--color-primary);
  text-transform: uppercase;
  font-weight: bold;
  font-size: 1.5rem;
  margin: 1.5rem 0 0.1rem 0;
}

.card-title {
  color: var(--color-phrase);
  font-weight: bold;
  font-size: 1.4rem;
  margin: 0;
  line-height: 1.2;
}

.card-text {
  color: var(--color-grey-light);
  font-size: 1.2rem;
  line-height: 1.2;
}

/* --- Team --- */
.team-member {
  width: calc(22% - 1.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: transparent;
  padding: 0;
}

.team-photo {
  width: 70%;
  height: 70%;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.team-info {
  display: flex;
  flex-direction: column;
}

.team-member h4 {
  color: var(--color-phrase);
  margin: 0 0 0.2rem 0;
  font-size: 1.6rem;
  font-weight: bold;
}

.team-role {
  color: var(--color-primary);
  font-size: 1.0rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.team-bio {
  color: var(--color-grey-light);
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0;
}

.team-separator {
  width: 66%;
  border: 0;
  border-top: 1px solid var(--color-grey-lighter);
  margin: 60px auto;
}

@media (min-width: 901px) {
  .team-grid .team-member:nth-child(1) { margin-left: 12.5%; }
  .team-grid .team-member:nth-child(3) { margin-right: 12.5%; }
}

@media (max-width: 900px) {
  .team-member { width: calc(50% - 1.5rem); }
  .team-grid .team-member:first-child { margin-left: 0; }
}

@media (max-width: 600px) {
  .team-member { width: 100%; }
}

@media (max-width: 768px) {
  .team-member h4 {font-size: 1.2rem;}
  .team-role {font-size: 1.0rem;}
  .team-bio{font-size: 1.0rem;}
  .card-short-title {font-size: 1.2rem;}
  .card-title {font-size: 1.2rem;}
  .card-text {font-size: 1.0rem;}
}

/* --- Funders --- */
.funders-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  margin-top: 2rem;
}

.funders-logos img {
  height: 60px;
  object-fit: contain;
}

/* =========================================
   7. COMPONENTS: 3D MODELS (Ergo & Topo)
========================================= */
/* --- Ergo 3D Model --- */
.model-3d-section {
  padding-top: 0 !important;
  margin-top: -5rem;
  margin-bottom: -7rem;
}

.canvas-container {
  width: 100%;
  background-color: transparent;
  position: relative;
  overflow: hidden;
  cursor: grab;
  height: 60vh;
  min-height: 450px;
  margin: 0;
  touch-action: pan-y;
}

.canvas-container:active {
  cursor: grabbing;
}

.label-3d {
  position: absolute;
  color: #000;
  font-family: var(--font-main);
  font-size: 1.4rem;
  font-weight: bold;
  pointer-events: none;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

/* --- Topo 3D Model --- */
.topo-transition {
  width: 100%;
  height: 65vh;       
  min-height: 450px;  
  margin: 0;          
  position: relative;
  overflow: visible;
}

#topo-3d-container {
  width: 100%;
  height: 100%;
  opacity: 1;
  touch-action: pan-y;
}

.label-poi {
  font-family: sans-serif;
  pointer-events: none; 
  transform: translate(-50%, -100%); 
  margin-top: -15px; 
  text-align: center;
  transition: opacity 0.3s ease-in-out; 
  will-change: transform;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.label-sommet {
  font-size: 14px;
  font-weight: 600;
  color: #111111;
  text-shadow: -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px 1.5px 0 #fff, 0px 0px 15px #fff;
}

.label-ville {
  font-size: 18px;
  font-weight: 900;
  color: #000000;
  text-transform: uppercase;
  text-shadow: -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px 1.5px 0 #fff, 0px 0px 15px #fff;
}

.label-fove img {
  width: 100px; 
  height: auto;
  filter: drop-shadow(1px 1px 0px #ffffff) 
          drop-shadow(-1px -1px 0px #ffffff) 
          drop-shadow(1px -1px 0px #ffffff)
          drop-shadow(-1px 1px 0px #ffffff)
          drop-shadow(0px 0px 12px #ffffff);
}

@media (max-width: 768px) {
  .canvas-container, .topo-transition {
    max-width: 100%;
    max-height: 60vh;
  }
}

/* =========================================
   8. ANIMATIONS & EFFECTS
========================================= */
.comet-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.comets-svg {
  width: 100%;
  height: 100vh;
  max-width: none;
  object-fit: cover;
}

.fade-in-section {
  opacity: 0;
  transform: translateY(0px);
  will-change: opacity, transform;
}