body {
  margin: 0;
  background: black;
  color: white;
  //background-color: #f5f5f5;
  font-family: "Trebuchet MS";
  font-size: 0.7em;
}

.article-logo {
  position: fixed;
  top: 20px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.8); /* fond sombre semi-transparent */
  color: white;
  font-family: 'Trebuchet MS'; // sans-serif; /* police souhaitée */
  font-size: 1.2em;
  font-weight: bold;
  padding: 8px 14px;
  border-radius: 4px;
  z-index: 9999; /* toujours au-dessus */
  //text-transform: uppercase; /* tout en majuscules */
  letter-spacing: 1px; /* un peu d’espace entre les lettres */
}

#reading-pointer {
  position: absolute;
  right: 2vw;
  width: 0;
  height: 0;
  border-left: 1vw solid white;
  border-top: 1vw solid transparent;
  border-bottom: 1vw solid transparent;
  display: none;
  pointer-events: none;
  z-index: 1000;
}

.article-container {
  margin: 0 auto;        /* Center on wide screens */
  padding: 2rem 1rem;    /* Ample breathing room */
  background-color: #0d1117;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* Subtle elevation */
}

.step {
  margin: 0 auto;
  padding: 500px 0;
  width: 60%; 
  height: 30vh;
  position: relative;
}


.step.middle-step {
  height: 200vh;
}

.step.tall-step {
  height: 450vh;
}

.sticky-container {
  position: sticky;
  top: 55%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  height: 10vh;
  isolation: isolate;
}

.graphic-wrapper {
  position: sticky;
  transform: translateY(-40%); // was -60% middle
  display: flex;
  justify-content: center;
  height: 100 vh;
  width: 100%;
  //max-width: 850px;
  margin: 0 auto;
}

/* Default state - hidden */
.graphic-wrapper svg {
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* Visible state - matches gr-svg-1-1 behavior */
.graphic-wrapper.visible svg {
  opacity: 1;
}

#circle-svg {
  position: fixed;
  top: 50vh !important;
  left: 50vw;
  transform: translate(-50%, -50%);
  width: 80vw;   /* responsive size */
  height: 80vh;  
  pointer-events: none;
  z-index: 5;
}

#circle-1-4-1 {
  cx: 50%;
  cy: 50%;
  fill: none;
  stroke: white;
  stroke-width: 5;
  opacity: 1;
  transition: r 0.2s ease, opacity 0.5s ease;
}

#circle-1-4-2 {
  cy: 50%;
  fill: none;
  stroke: orange;
  stroke-width: 5;
  opacity: 1;
  transition: r 0.2s ease, opacity 0.5s ease;
}

#circle-1-4-1.grow {
  r: 200; /* Target radius */
}

#circle-1-4-2.grow {
  r: 150; /* Target radius */
}

.steps {
  flex: 1;
  padding: 2rem;
  height: 100vh;
}

.text-moving {
  top: 40%;
  left: 50%; 
  z-index: 10;
  color: white;
  //background: black;
  font-size: clamp(2.0rem, 2.2vw, 3.5rem);
  text-align: center;
  opacity: 0; /* hidden initially */
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.text-moving-ref {
  font-size: 2.4em;
}

.title-moving {
  top: 40%;
  left: 50%; 
  z-index: 10;
  color: white;
  //background: black;
  //font-size: 4em;
  font-size: clamp(3.0rem, 2.8vw, 3.8rem);
  text-align: center;
  opacity: 0; /* hidden initially */
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.text-fixed {
  position: fixed;
  top: 0%;
  left: 50%; 
  transform: translateX(-50%);
  z-index: 10;
  color: white;
  //background: black;
  //font-size: 2.7em;
  text-align: center;
  opacity: 0; /* hidden initially */
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.graph-text-fixed {
  position: fixed;
  pointer-events: none;
  width: 100%;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: clamp(1.4rem, 2.1vw, 2.5rem);
  color: white;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 10;
}
#text-1-3-3.graph-text-fixed, #text-2-2-2.graph-text-fixed{
  top: -37%;
}

#text-2-2-3.graph-text-fixed, #text-3-5-4.graph-text-fixed,#text-4-2-2.graph-text-fixed, #text-4-2-3.graph-text-fixed{
  top: -30%;
}

#text-2-2-1.graph-text-fixed, #text-3-2-4.graph-text-fixed{ 
  top: -20%;
}

#text-1-4-0.graph-text-fixed {
  color: white;
  top: 8%;
}

#text-1-4-1.graph-text-fixed {
  color: white; 
  top: 13%;
}

.graph-text-fixed.right-position {
  left: 66%; /* Move right */
  transform: translateX(0); /* Remove centering transform */
}

.visible {
  opacity: 1 !important;
  transition: opacity 0.2s ease  !important;
}

.fade-out {
  opacity: 0  !important;
  transition: opacity 0.2s ease  !important;
}

.text-fixed.text-0 {
  //font-family: 'Lora', serif;
  position: fixed;
  top: 50vh !important;
  left: 50vw;
  transform: translate(-50%, -50%);
  color: white;
  text-align: center;
  z-index: 10;
  pointer-events: none;
}

.text-0-title {
  font-size: 4.5em !important;
  //font-weight: bold;
  //margin-bottom: 0.5em;
}

.text-0-authors {
  font-size: 3em;
  color: #ccc;
  margin: 0.2em 0;
}

.text-0-date {
  font-size: 3em;
  color: #ccc;
  margin: 0.2em 0;
}

.grid path {
  display: none;
}

/* fade-in on scroll */
.graphic-wrapper svg {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.graphic-wrapper.visible svg {
  opacity: 1;
}

.spacer {
  height: 120vh;
}

  .graph-svg .legend-text {
    font-size: clamp(24px, 3vw, 18px) !important;
    //fill: red !important;
  }

  .graph-svg .axis-left-text {
    font-size: clamp(22px, 3vw, 18px) !important;
    //fill: purple !important;
  }
  
  .graph-svg .axis-bottom-text {
    font-size: clamp(22px, 3vw, 18px) !important;
    //fill: purple !important;
  }

  .graph-svg .axis-title {
    font-size: clamp(30px, 3.5vw, 22px) !important;
    //fill: green !important;
  }
  
  .graph-svg .source-text {
    font-size: clamp(24px, 2.8vw, 16px) !important;
    //fill: blue !important;
  }

  /* Base styles (for all devices) */
.graphic-wrapper svg {
  width: 100%; /* Fixed width for desktop */
  height: auto; /* Fixed height for desktop */
  display: block;
  aspect-ratio: 850 / 550;
}

/* Mobile styles 768 - 1440 laptop */
@media (max-width: 1280px) {

  body {
    overflow-x: hidden;
  }

  .title-moving {
    font-size: clamp(1.4rem, 3.0vw, 2.5rem);
  }

  .title-moving {
    font-size: clamp(1.4rem, 3.5vw, 2.5rem); 
  }
  
  .graph-text-fixed {
    font-size: clamp(1.4rem, 3.0vw, 2.5rem);
  }

  .graph-svg {
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
  }
  
    /* Reset sticky container positioning */
  .sticky-container {
    position: sticky;
    //top: 10px !important;
    top: 55%; /* Center vertically */
    transform: translateY(-50%);
    width: 100% !important;
    height: auto;
    justify-content: center;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
  }

  .graphic-wrapper {
    position: relative !important;
    transform: none !important;
    width: 100% !important;
    height: auto;
    padding: 0;
    margin: 0;
    display: block;
    justify-content: center;
    align-items: center;
  }

  /* Make SVG fill the screen */
  .graphic-wrapper svg {
    width: 100% !important;
    height: auto !important;
    max-height: 60vh !important;
    max-width: 100% !important;
    transform: none !important;
    //border: 2px solid orange !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
  }
  
  .graph-svg .legend-text {
    font-size: clamp(25px, 3vw, 18px) !important;
    //fill: red !important;
  }

  .graph-svg .axis-left-text {
    font-size: clamp(12px, 2.3vw, 30px) !important;
    //fill: purple !important;
  }
  
  .graph-svg .axis-bottom-text {
    font-size: clamp(12px, 2.3vw, 30px) !important;
    //fill: purple !important;
  }

  .graph-svg .axis-title {
    font-size: clamp(30px, 3.2vw, 35px) !important;
    //fill: pink !important;
  }
  
  .graph-svg .source-text {
    font-size: clamp(25px, 2.8vw, 30px) !important;
    //fill: blue !important;
  }

  .step {
    width: 90%;
    padding: 50px 0; /* Reduced padding */
    height: 70vh;
  }
}

@media (max-width: 768px) {
  /* Adjust other elements for mobile */
 
  .step {
    width: 100%;
    padding: 50px 0; /* Reduced padding */
    height: 80vh;
  }

  .text-moving {
    font-size: 1.5em; /* Slightly larger than before */ 
    position: relative;
    bottom: 5% !important;
    //top: auto !important;  
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .title-moving {
    font-size: 1.8em; /* Slightly larger than before */ 
    bottom: 5% !important;
    //top: auto !important;
    position: relative;
    transform: translateX(-50%) !important;
  }

  .text-0-title {
    font-size: 1.9em !important; /* Slightly larger than before */
    //padding: 0 1rem;
    width: 100% !important;
    //top: 0% !important;
  }

  .text-0 {
    top: 34% !important;
  } 

  .text-0-date, .text-0-authors {
    font-size: 1.2em; /* Slightly larger than before */
  }

  .graph-text-fixed {
    font-size: 1rem !important;
    padding: 0 1rem;
    top: -40%;
  }

  #text-1-3-3.graph-text-fixed, #text-2-2-2.graph-text-fixed{
    top: -75%;
  }

  #text-2-2-3.graph-text-fixed, #text-3-5-4.graph-text-fixed, #text-4-2-2.graph-text-fixed, #text-4-2-3.graph-text-fixed{
   top: -57%;
  }

  #text-2-2-1.graph-text-fixed, #text-3-2-4.graph-text-fixed{
    top: -45%;
  }

  #circle-svg {
    width: 90%;
    height: auto;
    top: 100px;
  }

  #text-1-4-0.graph-text-fixed {
    color: white;
    top: 23%;
  }

  #text-1-4-1.graph-text-fixed {
    color: white; 
    top: 29%;
  }
  
  .article-logo {
    font-size: 0.5rem !important;
  }

  .graph-svg .legend-text {
    font-size: clamp(12px, 3vw, 18px) !important;
    //fill: red !important;
  }

  .graph-svg .axis-left-text {
    font-size: clamp(13px, 3vw, 18px) !important;
    //fill: purple !important;
  }
  
  .graph-svg .axis-bottom-text {
    font-size: clamp(13px, 3vw, 18px) !important;
    //fill: purple !important;
  }

  .graph-svg .axis-title {
    font-size: clamp(15px, 3.5vw, 22px) !important;
    //fill: red !important;
  }
  
  .graph-svg .source-text {
    font-size: clamp(12px, 2.8vw, 16px) !important;
    //fill: blue !important;
  }

  .text-moving-ref {
    font-size: 1.2em;
  }

}
/*
@media screen and (orientation: landscape) {
  .graphic-wrapper {
    height: 80vh !important;
    max-width: 100vw !important;
  }
  
  #gr-svg-1-3 {
    height: 100% !important;
    aspect-ratio: unset !important;
  }
}
*/
/* Correction spécifique pour iOS 
@supports (-webkit-touch-callout: none) {
  @media (orientation: landscape) {
    .sticky-container {
      top: 40% !important;
    }
  }
}
*/

