.middle {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background-color: white;
  text-align: center;
  overflow: hidden;
}

.middle ::selection {
  background: white;
  color: black;
}

.middle ::-moz-selection {
  background: white;
  color: black;
}

@media (max-width: 768px) {
  .middle {
    -webkit-user-select: none;
    user-select: none;
  }
}

.middle-text {
  padding-top: 20vh;
  mix-blend-mode: difference;
  z-index: 10;
  will-change: transform;
}

/* =========================
   Typography — all fluid
   ========================= */
h5 {
  font-family: "sohne";
  font-size: clamp(13px, 1.4vw, 17px);
  font-weight: 400;
  line-height: 2.3;
  text-transform: uppercase;
  color: white;
  margin-bottom: 5px;
}

h2 {
  font-family: "sohne-bold";
  font-size: clamp(32px, 3.8vw, 55px);
  line-height: 1.1;
  letter-spacing: -0.32px;
  white-space: nowrap;
  color: white;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  h2 {
    white-space: normal;
  }
}

h3 {
  font-family: "sohne";
  font-size: clamp(14px, 2.8vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.24px;
}

p {
  font-family: "sohne";
  font-size: clamp(15px, 1.4vw, 20px);
  line-height: 1.8;
  color: white;
}

:root {
  --color-text: #fff;
  --color-bg: #000;
  --thumb-width: 120px;
  --line-spacing: 10px;
  --line-base-height: 15px;
  --line-max-height: 50px;
}

/* =========================
   Bottom UI (slideshow controls)
   ========================= */
.bottom-ui-container {
  font-family: sohne-bold;
  position: relative;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 92vw);
  z-index: 100;
  padding-top: clamp(2rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  mix-blend-mode: difference;
}

.slide-section {
  font-family: "sohne-bold";
  font-size: clamp(16px, 3vw, 25px);
  line-height: 1.1;
  letter-spacing: -0.32px;
  white-space: nowrap;
  color: white;
  text-transform: uppercase;
  width: 100%;
  text-align: center;
  margin-bottom: clamp(20px, 3vw, 36px);
}

.slide-counter {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  color: #fff;
  font-size: clamp(0.7rem, 1vw, 0.825rem);
  margin-bottom: clamp(14px, 2.5vw, 24px);
}

.counter-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.counter-nav {
  width: 20px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.counter-nav:hover {
  opacity: 1;
}

.counter-divider {
  opacity: 0.6;
  font-size: 0.8rem;
}

.slide-tag-container {
  width: 100%;
  text-align: center;
  margin-bottom: 4px;
}

.slide-tag-label {
  font-family: "sohne";
  font-size: clamp(10px, 0.9vw, 12px);
  letter-spacing: 0.15em;
  opacity: 0.45;
  text-transform: uppercase;
  color: white;
}

.slide-title-container {
  width: 100%;
  text-align: center;
  height: 30px;
  overflow: hidden;
  margin-bottom: clamp(10px, 2vw, 16px);
  position: relative;
}

.slide-title {
  position: absolute;
  width: 100%;
  color: #fff;
  transition: transform 0.5s ease, opacity 0.5s ease;
  left: 0;
  pointer-events: auto;
}

.slide-title.exit-up {
  transform: translateY(-30px);
  opacity: 0;
}

.slide-title.enter-up {
  transform: translateY(30px);
  opacity: 0;
}

.drag-indicator {
  display: none;
  width: 100%;
  height: 20px;
  pointer-events: none;
}

.lines-container {
  display: flex;
  height: 100%;
  width: 100%;
  position: relative;
  align-items: flex-end;
  justify-content: space-between;
}

.drag-line {
  width: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  height: var(--line-base-height);
  transform-origin: bottom center;
  transition: height 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
    background-color 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* =========================
   Slide thumbnails
   ========================= */
.thumbs-container {
  width: 100%;
  overflow: hidden;
}

.slide-thumbs {
  display: flex;
  position: relative;
  background: none;
  padding: 0;
  z-index: 11;
  gap: 0;
  justify-content: center;
}

.frost-bg {
  display: none;
}

.slide-thumb {
  width: var(--thumb-width);
  height: clamp(40px, 5vw, 60px);
  background-size: cover;
  background-position: left center;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s;
  border: none;
  outline: none;
  box-shadow: none;
  margin: 0;
  position: relative;
  z-index: 12;
}

.slide-thumb:hover {
  opacity: 0.8;
}

.slide-thumb.active {
  opacity: 1;
}

/* =========================
   Slides
   ========================= */
.slides {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
  place-items: center;
}

.slide {
  width: 85%;
  height: 100%;
  grid-area: 1 / 1 / -1 / -1;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 4vw, 5rem);
  will-change: transform, opacity;
}

.slide--current {
  pointer-events: auto;
  opacity: 1;
}

.slide__info {
  display: flex;
  flex-direction: column;
  gap: clamp(0.6rem, 1.2vw, 1rem);
  text-align: left;
  color: white;
}

.slide__tag {
  font-family: "sohne";
  font-size: clamp(10px, 0.9vw, 12px);
  letter-spacing: 0.15em;
  opacity: 0.45;
  text-transform: uppercase;
  line-height: 1;
}

.slide__title {
  font-family: "sohne-bold";
  font-size: clamp(22px, 2.8vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: white;
  text-transform: uppercase;
}

.slide__desc {
  font-family: "sohne";
  font-size: clamp(12px, 1vw, 14px);
  line-height: 1.75;
  opacity: 0.65;
  color: white;
  max-width: 38ch;
}

.slide__stack {
  font-family: "sohne-medium";
  font-size: clamp(10px, 0.85vw, 12px);
  letter-spacing: 0.1em;
  opacity: 0.4;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.slide-counter-mobile {
  display: none;
}

.slide__img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.slide__img {
  width: 100%;
  height: 108%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  will-change: transform, opacity, filter;
}

@media (max-width: 768px) {
  .slides {
    height: auto;
    place-items: start center;
  }

  .slide-tag-container,
  .slide-title-container {
    display: none;
  }

  .slide-counter {
    display: none;
  }

  /* slide: display as flex column so we can order children freely */
  .slide {
    display: flex;
    flex-direction: column;
    width: 92%;
    height: auto;
    gap: 0;
  }

  /* order: tag → title → img → desc → stack */
  .slide__tag {
    display: block;
    order: 1;
    text-align: center;
    margin-bottom: 0.2rem;
  }

  .slide__title {
    display: block;
    order: 2;
    text-align: center;
    margin-bottom: 0.8rem;
  }

  .slide__img-wrap {
    order: 3;
  }

  .slide__img {
    height: 108%;
  }

  .slide__info {
    display: contents;
  }

  .slide__desc {
    order: 4;
    max-width: 100%;
    text-align: center;
    margin-top: 0.8rem;
  }

  .slide__stack {
    order: 5;
    text-align: center;
  }

  .slide-counter-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 92vw;
    margin: clamp(1rem, 4vw, 1.5rem) auto clamp(1rem, 4vw, 2rem);
    color: #fff;
    font-family: sohne-bold;
    font-size: clamp(0.7rem, 3vw, 0.9rem);
    mix-blend-mode: difference;
    box-sizing: border-box;
  }

  .slide-counter-mobile .counter-nav {
    flex: 1;
    text-align: center;
  }

  .slide-counter-mobile .counter-nav.prev-slide-m {
    text-align: left;
  }

  .slide-counter-mobile .counter-nav.next-slide-m {
    text-align: right;
  }

}