#horizontal-scroll-wrapper {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-image: url("../assets/sponsors/river.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.horizontal-track {
  display: flex;
  width: 200vw;
  height: 100vh;
  will-change: transform;
  position: relative;
}

.panel-river,
.panel-bridge {
  width: 100vw;
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
}

.float-stream {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.float-item {
  position: absolute;
  width: clamp(160px, 30vw, 350px);
  height: clamp(60px, 12vw, 120px);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.wave {
  z-index: 1; /* behind boats */
  width: clamp(140px, 22vw, 320px);
  height: clamp(35px, 6vw, 80px);
  background-image: url("../assets/sponsors/wave.svg");
}

.surfing-crab {
  z-index: 2;
  width: clamp(140px, 22vw, 320px);
  height: clamp(35px, 6vw, 80px);
  background-image: url("../assets/sponsors/surfing-crab.svg");
  transform: scaleX(-1);
}

/* Logic for keeping waves in the river */
:root {
  --blue-top: 30%;
  --blue-height: 30%;
}

.float-item.wave {
  top: calc(var(--blue-top) + (var(--lane-y, 0) * var(--blue-height)));
}

.float-item.surfing-crab {
  top: calc(var(--blue-top) + (var(--lane-y, 0) * var(--blue-height)));
}

@media (max-width: 520px) {
  .float-item.surfing-crab {
    display: none;
  }
}

.boat-grid {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: center;

  gap: clamp(8px, 1.5vw, 14px) clamp(4px, 1vw, 8px);

  width: min(90vw, 780px);
  margin: 0 auto;

  place-content: center;
  place-items: center;

  z-index: 2;
  pointer-events: none;
}

.boat {
  width: clamp(140px, 24vw, 280px);
  aspect-ratio: 25 / 8;
  height: auto;

  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Sponsors! */
.oucu {
  grid-column: 1 / -1;

  width: clamp(220px, 55vw, 520px);
  aspect-ratio: 10 / 3;
  height: auto;

  background-image: url("../assets/sponsors/OUCU_boat.svg");
}

.intrepid {
  background-image: url("../assets/sponsors/intrepid_boat.svg");
}

.retail {
  background-image: url("../assets/sponsors/365_boat.svg");
}

.stellantis {
  background-image: url("../assets/sponsors/stellantis_boat.svg");
}

.tomey {
  background-image: url("../assets/sponsors/tomey_boat.svg");
}

.lightguide {
  background-image: url("../assets/sponsors/lightguide_boat.svg");
}

.onestream {
  background-image: url("../assets/sponsors/onestream_boat.svg");
}

/* Sponsor animations */
@keyframes bob {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}

.bob {
  animation: bob 3s ease-in-out infinite;
  will-change: transform;
}

@keyframes river-float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(2px, -8px) rotate(0.6deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

.float {
  animation: river-float 5s ease-in-out infinite;
}

/* BRIDGE STYLES */

/* Bridge supports - fixed position, not affected by scroll */
.bridge-support {
  position: absolute;
  top: 0;
  height: 100%;
  width: auto;
  z-index: 5;
  pointer-events: none;
}

.bridge-support-left {
  left: 25%;
  transform: translateX(-50%);
}

.bridge-support-right {
  left: 75%;
  transform: translateX(-50%);
}

/* Scrollable bridge container */
.bridge-scroll-container {
  width: 50%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 20;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.bridge-scroll-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* BRIDGE STYLES */

/* Bridge supports - fixed position, not affected by scroll */
.bridge-support {
  position: absolute;
  top: 0;
  height: 100%;
  width: auto;
  z-index: 5;
  pointer-events: none;
}

.bridge-support-left {
  left: 25%;
  transform: translateX(-50%);
}

.bridge-support-right {
  left: 75%;
  transform: translateX(-50%);
}

/* Scrollable bridge container */
.bridge-scroll-container {
  width: 50%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 20;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.bridge-scroll-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.bridge-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: rotate(-1deg);
  padding: 20px 0;
  box-sizing: border-box;
}

/* Wrapper for FAQ planks – gap here creates space between each plank */
#bridge-planks {
  font-family: "Rubik", sans-serif;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Plank flip container */
.bridge-plank-container {
  position: relative;
  width: 100%;
  perspective: 1000px;
  cursor: pointer;
}

.bridge-plank-container:hover {
  transform: scale(1.03);
  transition: transform 0.2s ease;
}

/* Inner wrapper for 3D flip */
.plank-inner {
  position: relative;
  width: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

.bridge-plank-container.flipped .plank-inner {
  transform: rotateX(180deg);
}

/* Front and back faces */
.plank-front,
.plank-back {
  width: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.plank-front {
  position: relative;
}

.plank-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateX(180deg);
}

.plank-front .bridge-plank-img,
.plank-back .bridge-plank-img {
  width: 100%;
  height: auto;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.bridge-question,
.bridge-answer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  width: 90%;
  box-sizing: border-box;
  color: #ffffff;
}

.bridge-question {
  font-weight: 400;
}

.bridge-answer {
  font-size: 1rem;
  font-weight: 200;
}

/* Placeholder planks at top and bottom - show only a quarter */
.plank-placeholder {
  position: relative;
  width: 100%;
  pointer-events: none;
  overflow: hidden;
  /* Plank aspect ratio is 390:61, quarter height = 61/4 = 15.25 relative to 390 width
    /* aspect-ratio: 390 / 15.25 ≈ 25.57 */
  aspect-ratio: 8;
}

.plank-placeholder .bridge-plank-img {
  position: absolute;
  width: 100%;
  height: auto;
  left: 0;
}

/* Top placeholder - show only bottom quarter */
.plank-placeholder-top .bridge-plank-img {
  bottom: 0;
}

/* Bottom placeholder - show only top quarter */
.plank-placeholder-bottom .bridge-plank-img {
  top: 0;
}

@media (max-width: 520px) {
  /* give the planks more room */
  .bridge-scroll-container {
    width: min(92vw, 520px);
    margin: 0 auto;
  }

  /* optional: make text scale down a bit on small screens */
  .bridge-question {
    font-size: clamp(0.95rem, 4.2vw, 1.15rem);
  }
  .bridge-answer {
    font-size: clamp(0.85rem, 3.6vw, 1rem);
  }
}
