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

.tipeee-project-btn {
  padding: 10px 20px !important;
  font-size: 1 rem !important;
}

.tip a.tipee-project-btn{
  font-size: 10px !important;
}

.tip {
  opacity: 0;
  position: fixed;
  top: 20px;
  left: auto;
  right: 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.5em;
  font-weight: bold;
  padding: 8px 14px;
  border-radius: 4px;
  z-index: 9999; /* toujours au-dessus */
  letter-spacing: 1px; /* un peu d’espace entre les lettres */
}

/* Container positioned bottom-right */
.progress-wrap {
    position: fixed;
    right: 20px;
    bottom: 20px;
    height: 50px;
    width: 50px;
    cursor: pointer;
    display: block;
    border-radius: 50px;
    box-shadow: inset 0 0 0 2px rgba(100, 100, 100, 0.2); /* Subtle track */
    z-index: 10000; /* Ensure it is above graphs */
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 200ms linear;
    background-color: rgba(255, 255, 255, 0.1); /* Slight background */
}

/* Make it visible when scrolling starts */
.progress-wrap.active-progress {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* SVG Circle Logic */
.progress-circle path {
    fill: none;
    stroke: #ff4500; /* YOUR COLOR HERE (Orange-Red) */
    stroke-width: 4;
    box-sizing: border-box;
    transition: stroke-dashoffset 10ms linear;
}

/* Optional: Percentage Text inside */
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: #888; /* Grey text */
}

/* Dark Mode / Black Background Adjustment */
body[style*="background: black"] .progress-text {
    color: white;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-15px);
  }
  50% {
    transform: translateY(9px);
  }
  70% {
    transform: translateY(-9px);
  }
  90% {
    transform: translateY(5px);
  }
}

.tip.bounce {
  animation: bounce 1s;
}

.article-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  position: fixed;
  top: 3vh;
  left: 2vw;
  z-index: 9999; /* toujours au-dessus */
}

.site-logo {
  display: flex;
}

.site-title{
  color: white;
  font-size: clamp(1.2rem, 1.5vw, 2.8rem);
  text-decoration: none !important;
}

.logo-image {
  border-radius: 5px;
  transition: opacity 0.3s ease;
  width: 3.2vw;
  height: 3.2vw;
}

#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;
}

.text-pre{
  color: #aaa !important;
  top: 30% !important;
  text-align: center !important;
  font-size: clamp(45px, 8vw, 60px) !important;
}

.scroll-arrow {
  font-size: clamp(60px, 9vw, 70px) !important;
  animation: bounce 3s infinite;
}

.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: 75%; 
  height: 30vh;
  position: relative;
}


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

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

.step.very-tall-step {
  height: 700vh;
}

.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: 85%;
  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;
  font-size: clamp(2.0rem, 2.2vw, 3.5rem);
  text-align: justify;
  text-rendering: optimizeLegibility;
  hyphens: auto;
  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;
  font-size: clamp(3.0rem, 2.8vw, 3.8rem);
  text-align: center;
  opacity: 0; /* hidden initially */
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.title-fixed {
  position: fixed;
  top: 8%;
  width: 75%; 
  z-index: 10;
  color: white;
  text-align: justify;
  text-rendering: optimizeLegibility;
  hyphens: auto;
  opacity: 0; /* hidden initially */
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.text-fixed {
  position: fixed;
  top: 35%;
  width: 75%; 
  left: 50%;
  transform: translateX(-50%) !important;
  z-index: 10;
  color: white;
  font-size: clamp(1.4rem, 2.1vw, 2.5rem);
  text-align: justify;
  text-rendering: optimizeLegibility;
  hyphens: auto;
  opacity: 0; /* hidden initially */
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.graph-text-fixed {
  position: fixed;
  pointer-events: none;
  top: 8%;
  width: 75%; 
  text-align: justify;
  text-rendering: optimizeLegibility;
  hyphens: auto;
  font-size: clamp(1.4rem, 2.1vw, 2.5rem);
  color: white;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 10;
}

#text-4-5-9{
  top: 2% !important;
}

.text-1-7-0.graph-text-fixed{
  top: 10% !important;
}

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

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


@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate(-50%, -20%); /* keep translateX here */
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%); /* final centered position */
  }
}

.title-fixed.text-0.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

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

/* only when active */
.title-fixed.text-0.animate-in {
  animation: fadeInUp 2s ease-out forwards;
}

.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;
  }
  
  .graph-svg .pct-label {
    font-size: clamp(20px, 3vw, 18px) !important;
  }

  .graph-svg .pct-label-eval {
    font-size: clamp(20px, 3vw, 18px) !important;
  }

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

  .graph-svg .axis-title {
    font-size: clamp(30px, 3.5vw, 22px) !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;
  }

  .graph-svg .pct-label {
    font-size: clamp(15px, 2vw, 18px) !important;
    transform: translateY(-2%) !important;
  }

  .graph-svg .pct-label-eval {
    font-size: clamp(15px, 2vw, 18px) !important;
  }

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

  .graph-svg .axis-title {
    font-size: clamp(30px, 3.2vw, 35px) !important;
  }
  
  .graph-svg .source-text {
    font-size: clamp(25px, 2.8vw, 30px) !important;
    transform: translateY(+5%) !important;
  }

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

@media (max-width: 768px) {
  /* Adjust other elements for mobile */
 
  .logo-image {
    width: 45px;   /* adjust as needed */
    height: 45px;  /* keep similar proportions */
  }

  .step {
    width: 90%;
    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 */
  }
  
  .text-fixed {
    font-size: 1rem !important;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
  }

  .graph-text-fixed {
    font-size: 1rem !important;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
  }

  .article-logo {
    font-size: 0.5rem !important;
  }
  /*
  #gr-svg-1-12 {
    transform: translateY(-50%) !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;
  }
  
  .graph-svg .axis-bottom-text {
    font-size: clamp(13px, 3vw, 18px) !important;
  }

  .graph-svg .axis-title-bottom {
    font-size: clamp(15px, 3.5vw, 22px) !important;
    transform: translateY(7%); 
  }

  .graph-svg .axis-title {
    font-size: clamp(15px, 3.5vw, 22px) !important;
  }
  
  .graph-svg .source-text {
    font-size: clamp(12px, 2.8vw, 16px) !important;
  }
  
  #gr-svg-4-5 .source-text {
     transform: translateY(0%) !important;
     font-size: clamp(12px, 2.8vw, 16px) !important;
  }

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

}

