.wrapper {
  min-height: 100vh;
  font-family: 'Roboto Slab', "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, "sans-serif";
  font-weight: 300;
  color: #393536;
  position: relative;
}

section {
  height: 100vh;
  font-size: 24px;
  font-weight: 100;
	text-align: center;
	margin: 10 10 10 50;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
	}

section:nth-child(1) { /* section0 */
  background: #0D0D0D; /* White */
}
section:nth-child(2) { /* section1 */
  background: #E5E5E5; /* Very Light Gray */
}
section:nth-child(3) { /* section2 */
  background: #CCCCCC; /* Light Gray */
}
section:nth-child(4) { /* section3 */
  background: #B2B2B2; /* Soft Gray */
}
section:nth-child(5) { /* section4 */
  background: #999999; /* Medium Gray */
}
section:nth-child(6) { /* section5 */
  background: #7F7F7F; /* Mid-Dark Gray */
}
section:nth-child(7) { /* section6 */
  background: #666666; /* Darker Gray */
}
section:nth-child(8) { /* section7 */
  background: #4C4C4C; /* Deep Gray */
}
section:nth-child(9) { /* section8 */
  background: #333333; /* Almost Dark Gray */
}
section:nth-child(10) { /* section9 */
  background: #262626; /* Dark Gray */
}

section:nth-child(11) { /* section9 */
  background: #0D0D0D; /* Dark Gray */
}
.nav__wrapper {
  position: fixed;
  height: 100%;
  padding: 40px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-flow: column nowrap;
          flex-flow: column nowrap;
  -webkit-box-pack: end;
      -ms-flex-pack: end;
          justify-content: flex-end;
	
	padding-right: 40px;
  top: 0;
  left: 0;
  min-height: 100vh;  /* safer than height:100% */
  width: auto;
	box-sizing: border-box;
}
}
.nav {
  margin: 10px 0 120px 50px;
}
.nav__counter {
  font-size: 25px;
  -webkit-transition: all 0.15s ease-out;
  transition: all 0.15s ease-out;
}
.nav__title {
  font-size: 18px;
  font-weight: 400;
  margin: 0 0 0.25em;
  width: 450px;
  height: 0;
  overflow: hidden;
  opacity: 0;
  -webkit-transition: height 0.3s ease-out, opacity 0.2s ease-out;
  transition: height 0.3s ease-out, opacity 0.2s ease-out;
}
.nav__body {
  font-weight: 300;
  font-size: 14px;
  font-size: 14px;
  width: 200px;
  height: 0;
  overflow: hidden;
  opacity: 0;
  -webkit-transition: height 0.3s ease-out, opacity 0.2s ease-out;
  transition: height 0.3s ease-out, opacity 0.2s ease-out;
}
.nav li {
  position: relative;
  -webkit-transition: all 0.3s ease-out;
  transition: all 0.3s ease-out;
  margin-bottom: 1em;
}
.nav li:after {
  content: '';
  display: block;
  border-left: 4px solid black;
  border-top: 2px solid black;
  height: 450px;
  width: 25px;
  position: absolute;
  left: -30px;
  top: 15px;
}
.nav li a {
  display: block;
  padding: 0;
  color: red;
  -webkit-transition: all 0.15s ease-out;
  transition: all 0.15s ease-out;
}
.nav li a:hover {
  background-color: transparent;
  padding-left: 1em;
}
.nav li a:focus {
  background-color: transparent;
}
.nav li.active {
  pointer-events: none;
  padding-left: 1em;
}
.nav li.active:after {
  width: 45px;
  height: 500px;
  top: 35px;
}
.nav li.active .nav__counter {
  font-size: 55px;
}
.nav li.active .nav__title {
  height: 79px;
  opacity: 1;
  overflow: visible;
}
.nav li.active .nav__body {
  height: 140px;
  opacity: 1;
  overflow: visible;
}
/* --- Add this block AFTER your original CSS --- */

/* Always allow vertical scrolling inside the fixed sidebar (safe, non-destructive) */
.nav__wrapper {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Gentle shrink for medium-low height viewports */
@media (max-height: 900px) {
  .nav {
    margin: 10px 0 70px 35px; /* reduce bottom spacing so content fits better */
  }

  .nav__counter {
    font-size: 20px; /* slightly smaller */
  }

  .nav__title {
    width: 360px;    /* keep the same look but narrower so it fits */
    font-size: 20px;
  }

  .nav__body {
    width: 260px;
    font-size: 18px;
  }

  .nav li:after {
    height: 180px;   /* reduce tall connector lines */
    top: 12px;
  }

  .nav li.active:after {
    height: 320px;   /* reduce the active connector height proportionally */
    top: 30px;
  }

  .nav li.active .nav__counter {
    font-size: 35px;
  }

  .nav li.active .nav__title { height: 50px; }
  .nav li.active .nav__body  { height: 140px;  }
}

/* Compact layout for short/mobile screens:
   start the timeline at the top so items aren't initially cropped,
   shrink fonts/connectors further so most content fits without scrolling. */
@media (max-height: 700px), (max-width: 520px) {
  .nav__wrapper {
    justify-content: flex-start; /* start from the top on very small screens */
    padding: 18px;               /* preserve original feel but reduce padding */
  }

  .nav {
    margin: 0 0 40px 20px;
  }

  .nav__counter {
    font-size: 18px;
  }

  .nav__title {
    width: 260px;
    font-size: 18px;
  }

  .nav__body {
    width: 200px;
    font-size: 18px;
  }

  .nav li:after {
    height: 120px;
    left: -30px;
    top: 10px;
  }

  .nav li.active:after {
    height: 220px;
    top: 20px;
    width: 35px;
  }

  .nav li.active .nav__counter {
    font-size: 34px;
  }

  .nav li.active .nav__title { height: 40px; }
  .nav li.active .nav__body  { height: 110px;  }
}
/* Always allow vertical scrolling inside the fixed sidebar */
.nav__wrapper {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;   /* hide scrollbar Firefox */
}
.nav__wrapper::-webkit-scrollbar {
  display: none;           /* hide scrollbar Chrome/Safari */
}

/* Medium screens: shrink more */
@media (max-height: 900px) {
  .nav__counter { font-size: 18px; }
  .nav__title   { width: 320px; font-size: 18px; }
  .nav__body    { width: 240px; font-size: 14px; }

  .nav li:after        { height: 150px; top: 10px; }
  .nav li.active:after { height: 260px; top: 20px; }

  .nav li.active .nav__counter { font-size: 32px; }
  .nav li.active .nav__title   { height: 30px; }
  .nav li.active .nav__body    { height: 70px; }
}

/* Very small screens/short height: shrink further + start at top */
@media (max-height: 700px), (max-width: 520px) {
  .nav__wrapper {
    justify-content: flex-start;
    padding: 12px;
  }

  .nav__counter { font-size: 14px; }
  .nav__title   { width: 220px; font-size: 14px; }
  .nav__body    { width: 180px; font-size: 12px; }

  .nav li:after        { height: 90px; top: 8px; }
  .nav li.active:after { height: 180px; top: 15px; }

  .nav li.active .nav__counter { font-size: 24px; }
  .nav li.active .nav__title   { height: 26px; }
  .nav li.active .nav__body    { height: 60px; }
}
/* Medium-small screens: stop bottom-aligning the nav */
@media (max-height: 800px) {
  .nav__wrapper {
    justify-content: flex-start; /* instead of flex-end */
    padding-top: 20px;           /* make sure content doesn’t clip */
  }
}
/* Collapse nav into number-only list on very small screens */
@media (max-width: 480px), (max-height: 600px) {
  .nav__wrapper {
    justify-content: flex-start;
    padding: 10px;
  }

  .nav {
    margin: 0;
  }

  .nav li {
    margin-bottom: 0.5em;
    position: relative;
  }

  /* ✅ keep the vertical line */
  .nav li:after {
    content: '';
    position: absolute;
    left: -5px; /* adjust for your layout */
    top: 0;
    bottom: 0;
    width: 2px;
    background: #000; /* black sideline */
  }

  /* ✅ active marker (slightly thicker / colored) */
  .nav li.active:after {
    background: #d00; /* red highlight for active */
    width: 3px;
  }

  /* counters always visible */
  .nav__counter {
    font-size: 16px;
    display: inline-block;
    margin-right: 6px;
    position: relative;
    z-index: 1; /* keeps number above the line */
    padding: 0 2px;
  }

  /* titles hidden by default */
  .nav__title {
    width: auto;
    height: 0;
    font-size: 14px;
    opacity: 0;
    overflow: hidden;
    display: inline-block;
    transition: height 0.3s ease-out, opacity 0.2s ease-out;
  }

  /* bodies hidden on mobile */
  .nav__body {
    display: none;
  }

  /* active state reveals title */
  .nav li.active .nav__title {
    height: auto;
    opacity: 1;
    overflow: visible;
    margin-left: 4px;
    font-weight: 500;
  }

  .nav li.active .nav__counter {
    font-size: 18px;
    font-weight: bold;
  }
}
section img {
  display: block;
  max-width: 100%;   /* never overflow container width */
  height: auto;      /* keep aspect ratio */
  max-height: 70vh;  /* optional: cap image so it never fills entire viewport */
  margin: 1rem auto; /* center with some breathing room */
}
@media (max-width: 600px) {
  section img {
    max-height: 50vh;
  }
}
