/* ---------- Project reel: React Bits FlexCarousel (ported to plain WebGL2) ---------- */
.reel {
  position: relative;
  z-index: 3;
  padding: 110px 0 70px;
  color: var(--ink);
}
.reel__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin: 0 4.5vw;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(17, 19, 18, .14);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.reel__top span { color: #23b97f; margin-right: 10px; }
.reel__carousel { height: min(76vh, 680px); min-height: 420px; margin-top: 12px; }

/* component styles (from React Bits, recoloured to the site) */
.flex-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: contain;
  outline: none;
}
.flex-carousel canvas { display: block; width: 100%; height: 100%; }
.flex-carousel[data-hover='open'] { cursor: zoom-in; }
.flex-carousel[data-hover='close'] { cursor: zoom-out; }
.flex-carousel[data-dragging] { cursor: grabbing; }
.flex-carousel:focus-visible { box-shadow: inset 0 0 0 2px rgba(35, 185, 127, .55); }

.flex-carousel__caption {
  position: absolute;
  left: 0; right: 0;
  top: calc(50% + var(--flex-carousel-half) * var(--flex-carousel-lift, 1) + 22px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
  text-align: center;
  animation: flex-carousel-reveal 900ms ease both;
}
.flex-carousel__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
  animation: flex-carousel-title 520ms cubic-bezier(.22, 1, .36, 1);
}
.flex-carousel__subtitle { margin-top: 4px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .6; }
.flex-carousel__link {
  pointer-events: auto;
  padding: 7px 12px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font: 600 10px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: background .2s, color .2s;
}
.flex-carousel__link:hover { background: var(--ink); color: #f3f1ea; }
.flex-carousel__count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font: 500 12px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  opacity: .5;
  transition: opacity 400ms ease;
}
.flex-carousel__count[data-hidden] { opacity: 0; }
.flex-carousel__digits { display: inline-flex; }
.flex-carousel__digit { display: inline-block; height: 1em; overflow: hidden; }
.flex-carousel__reel { display: flex; flex-direction: column; transition: transform 600ms cubic-bezier(.22, 1, .36, 1); }
.flex-carousel__reel span { height: 1em; }
.flex-carousel__slash { opacity: .6; }
.flex-carousel__live {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@keyframes flex-carousel-title { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes flex-carousel-reveal { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 640px) {
  .reel { padding-top: 90px; }
  .reel__hint { display: none; }
  .reel__carousel { height: 46vh; min-height: 340px; margin-top: 0; }
  .flex-carousel__title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .flex-carousel__caption, .flex-carousel__title { animation: none; }
  .flex-carousel__reel { transition: none; }
}

/* no WebGL2: a plain scrolling row of the same projects */
.flex-carousel.is-fallback { display: flex; gap: 14px; align-items: center; overflow-x: auto; padding: 0 4.5vw; cursor: auto; }
.flex-carousel.is-fallback a { flex: none; width: min(80vw, 520px); }
.flex-carousel.is-fallback img { width: 100%; border-radius: 6px; display: block; }
.flex-carousel.is-fallback b { display: block; margin-top: 10px; font: 400 22px/1.1 var(--serif); }
