/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Baskerville, "Palatino Linotype", Palatino, "Times New Roman", serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: #1e1e1e;
  color: #f5e7d3;
}

.nav-toggle-button {
    position: fixed;
    top: 20px;
    right:-15px;
    z-index: 1000;
    background-color: transparent; 
    color: transparent; 
    font-size: 0;
    width: 100px;
    height: 50px;
    border: none;
    border-radius: 5px;
    padding: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.nav-toggle-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.nav-toggle-button:hover {
    transform: scale(1.05);
}

.nav-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 300px;
    background-color: rgba(30, 30, 30, 0.5); 
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1); 
    z-index: 999;
    transform: translateX(300px); 
    transition: transform 0.4s ease-in-out;
    padding-top: 80px; /* Space for the top toggle button */
}

/* State to show the menu */
.nav-wrapper.open {
    transform: translateX(0); 
}

.bookmark {
    width: 100%;
    padding: 10px 15px; 
    border-radius: 4px;
    text-align: left;
    display: block; 
    text-decoration: none; 
    color: #ffcc70; 
    transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Create the Bullet Point (using pseudo-element) */
.bookmark span::before {
    content: '•'; /* The bullet character */
    color: #ffcc70; /* Bullet color */
    font-size: 1.2em;
    margin-right: 15px; /* Space between bullet and text */
    display: inline-block;
    width: 15px; /* Give it a fixed width for alignment */
}

.bookmark:hover {
    background-color: rgba(255, 204, 112, 0.25);
    transform: scale(1.05);
}

.bookmark span {
    opacity: 1; 
    color: #f7e2b3;
    font-weight: normal;
    font-size: 13px;
    display: inline; 
}

/* Backgrounds */
.backgrounds {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.bg {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}

.bg.active {
  opacity: 1;
}

/* ===== SCENE 1 NEW STYLING ===== */
/*  Make all scenes fixed and layered */
#scene1, #scene2, #scene3 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let scroll pass through inactive scenes */
}

/* Keep backgrounds fixed */
#scene1 .backgrounds,
#scene2 .backgrounds,
#scene3 .backgrounds {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

#scene1 .bg,
#scene2 .bg,
#scene3 .bg,
#scene2 .bg-video {
  position: fixed;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: -1;
}

#scene1 .bg.active,
#scene2 .bg.active,
#scene3 .bg.active,
#scene2 .bg-video.active {
  opacity: 1;
}

.scroll-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #f7e2b3;
  font-size: 16px;
  opacity: 1;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.5s ease, transform 1s ease-in-out;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-8px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

.scroll-hint.active {
  opacity: 1;
  pointer-events: auto;
}

/* Container for each part */
.scene1-part {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  z-index: 5;
}

.scene1-part.active {
  opacity: 1;
  pointer-events: auto;
}

/* Image positioning */
.part-img {
  position: absolute;
  opacity: 1;
}

.part-img.left {
  left: 10%;
  top: 50%;
  transform: translateY(-50%);
  max-width: 650px;
}

.part-img.left.top {
  top: 50%;
}

.part-img.left.bottom {
  top: 75%;
  left: 20%;
  width: 510px;
}

.part-img.right {
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
}

.part-img.center {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 750px;
}

.hero-large {
  width: 300px; /* adjust as needed */
  margin-right: 100px;
}

/* Grid for Part 2 */
.grid-container {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  width: 500px;
  height: 500px;
}

.grid-container .human,
.grid-container .hero-center {
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.legend {
  position: absolute;
  bottom: 25px;
  right: 18%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0,0,0,0.5);
  padding: 10px 15px;
  border-radius: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
}

.legend-item img {
  width: 24px;
  height: 24px;
}

/* Hero animation for Part 3 */
.part-img.hero-animate {
  right: 10%;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 350px;
  transition: transform 1.5s ease;
  margin-right: 100px;
}

.scene1-part[data-step="3"].active .hero-animate {
  transform: translateY(-50%) scale(1);
}

/* ===== SCENE 2 NEW STYLING ===== */

/* Container for each Scene 2 part */
.scene2-part {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  z-index: 5;
}

.scene2-part.active {
  opacity: 1;
  pointer-events: auto;
}

.scene2-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 1250px;
  opacity: 1;
}

/* Counter styling (override if needed) */
#scene2 .counter {
  font-size: 8em;
  font-weight: bold;
  color: #fff3bf;
  opacity: 0;
  transition: opacity 1s ease;
  margin: 0;
}

/* Progress Section Styling (adapted to your theme) */
#scene2 .progress-section {
  width: 70%;
  text-align: center;
}

#scene2 .progress-container {
  background: #58a039;
  height: 90px;
  width: 90%;
  margin: 20px auto;
  position: relative;
  overflow: hidden;
  border-radius: 0;
}

#scene2 .progress-bar {
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: width 2s ease;
}

#scene2 .progress-bar.found {
  width: 100%;
  z-index: 1;
}

#scene2 .progress-bar.hidden {
  background: #c01818;
  width: 0%;
  z-index: 2;
}

#scene2 .images img {
  width: 650px;
  margin-top: 60px;
  transition: opacity 1s ease;
}

/* Video backgrounds */
.bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: -1;
  transition: opacity 1s ease;
}

.bg-video.active {
  opacity: 1;
}

#scene2 button {
  background: #c01818;
  color: black;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.4s ease;
}

#scene2 button:hover {
  background: #a63a2f;
}


.scene3-part {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  z-index: 5;
}

.scene3-part.active {
  opacity: 1;
  pointer-events: auto;
}

.scene3-img {
  position: absolute;
  opacity: 1;
}

.scene3-img.left {
  left: 16%;
  top: 52%;
  transform: translateY(-50%);
  max-width: 650px;
}

.scene3-img.center {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 800px;
}

.scene3-img.top {
  left: 50%;
  top: 16%;
  transform: translate(-50%, -50%);
  max-width: 800px;
}

/* Pie Chart */
#scene3 .pie-chart {
  position: absolute;
  right: 10%;
  top:60%;
  transform: translateY(-50%);
  width: 400px;
  height: 400px;
}

svg {
  overflow: visible;
}

.slice:hover {
  opacity: 0.8;
  cursor: pointer;
  transition: 0.3s;
}

.label {
  font-size: 20px;
  text-anchor: middle;
  fill: #fff6d0;
}

/* Tooltip for pie chart */
.tooltip {
  position: absolute;
  background: #4d0585;
  border: 1px solid #ccc;
  padding: 8px 12px;
  pointer-events: none;
  font-size: 16px;
  fill: #fff6d0;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  display: none;
  max-width: 220px;
  z-index: 10000; 
}

.timeline-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 50px 0;
}

.timeline-wrapper {
  position: relative;
  width: 80%;
  margin: 0 auto;
  padding: 0;
  min-height: 100%;
}

.timeline-title {
  text-align: center;
  font-size: 3rem;
  margin: 50px 0;
  color: white;
}

.line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 0;
  background-color: #834c0f;
  z-index: -1;
  transition: height 0.3s ease-out;
}

.stop {
  position: absolute;
  left: 50.17%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #feb708;
  border: 3px solid #834c0f;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.stop.active {
  opacity: 1;
}

.timeline-item {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  opacity: 0.2;
  transform: translateY(40px);
  transition: all 0.8s ease;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
  text-align: right;
}

.timeline-item.show {
  opacity: 1;
  transform: translateY(0);
}

.timeline-wrapper p {
  font-size: 1.3rem;
  text-align: left;
}

.timeline-wrapper .content {
  max-width: 350px;
}

/* Individual image styles */
#infant {
  width: 200px;
  height: 140px;
  margin-left: -20px;
}

#child {
  width: 280px;
  height: 165px;
  margin-left: -37px;
}

#teen {
  width: 280px;
  height: 200px;
  margin-left: -40px;
}

#adulthood {
  width: 250px;
  height: 280px;
  margin-left: -47px;
}

#elderly {
  width: 280px;
  height: 280px;
  margin-left: -57px;
}

/* Progress Ring */
.progress-ring-container {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ring {
  transform: rotate(-90deg);
}

.background {
  fill: none;
  stroke: #bcfdff;
  stroke-width: 40;
}

.progress {
  fill: none;
  stroke: #c01818;
  stroke-width: 40;
  stroke-dasharray: 1005;
  stroke-dashoffset: 1005;
  transition: stroke-dashoffset 1.5s ease;
  stroke-linecap: round;
}

.percent {
  position: absolute;
  font-size: 55px;
  font-weight: bold;
  color: #c01818;
}

.music-toggle {
  position: fixed;
  top: 20px;
  right: 100px; /* to the left of nav-toggle (which is at right: -15px) */
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  padding: 0;
  width: auto;
  height: auto;
  outline: none;
  -webkit-tap-highlight-color: transparent; /* removes tap highlight on mobile */
}

.next-button {
  position: fixed;
  bottom: 40px;
  right: -30px;
  width: 140px;
  height: 125px;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  visibility: visible;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s ease;
  z-index: 100;
  padding: 0;
  outline: none;
}

.next-button:hover {
  opacity: 0.9; /* or apply a filter if you prefer */
}

.next-btn-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.next-button:hover {
  /* Scale the button up by 10% (1.1) */
  transform: scale(1.2);
  /* Slightly increase the opacity for emphasis (optional, you already have one) */
  opacity: 1; 
}