/* External values formerly declared on individual HTML elements. */
.nav {
  --i: 0;
}

.hero__intro {
  font-size: 25px;
}

.hero__title {
  --i: 2;
}

.hero__title .marquee {
  --dur: 38s;
}

.stats {
  --i: 3;
}

.hero__foot {
  --i: 4;
}

.stroke-text text:nth-child(1) {
  --letter: 0;
}

.stroke-text text:nth-child(2) {
  --letter: 1;
}

.stroke-text text:nth-child(3) {
  --letter: 2;
}

.stroke-text text:nth-child(4) {
  --letter: 3;
}

.projects {
  padding: clamp(72px, 9vw, 132px) 0 clamp(56px, 7vw, 104px);
  border-top: 1px solid var(--line);
  overflow: hidden;
  scroll-margin-top: 100px;
}

.projects__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-inline: var(--pad);
  margin-bottom: clamp(32px, 5vw, 72px);
}

.projects__eyebrow, .projects__caption {
  margin: 0;
  font-size: .95rem;
}

.projects__eyebrow {
  color: var(--accent);
  font-weight: 600;
}

.projects__caption {
  color: var(--muted);
}

.projects__intro {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: end;
  gap: clamp(32px, 6vw, 96px);
  padding-inline: var(--pad);
}

.projects__title {
  margin: 0;
  font-size: clamp(2.6rem, 7.8vw, 8.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.065em;
}

.projects__description {
  margin: 0 0 .2em;
  max-width: 36ch;
  font-size: clamp(1.15rem, 1.8vw, 1.7rem);
  line-height: 1.55;
  letter-spacing: -.025em;
  color: var(--muted);
}

.project-carousel {
  margin-top: clamp(20px, 4vw, 56px);
}

.project-carousel__stage {
  position: relative;
  height: clamp(380px, 46vw, 640px);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  outline-offset: -4px;
}

.project-carousel__stage.is-over-image { cursor: zoom-in; }
.project-carousel.is-focused .project-carousel__stage { cursor: zoom-out; }
.project-carousel__stage.is-dragging { cursor: grabbing; }

.project-carousel__canvas {
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.project-carousel.is-enhanced .project-carousel__canvas { display: block; }

.project-carousel__track {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  overflow-x: auto;
  padding: 0 var(--pad);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.project-carousel__track::-webkit-scrollbar { display: none; }
.project-carousel__track[hidden] { display: none; }
.project-carousel.is-focused .project-carousel__track { overflow: hidden; }

.project-card {
  position: relative;
  display: block;
  flex: 0 0 auto;
  height: 50%;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  scroll-snap-align: center;
  cursor: zoom-in;
  transition: transform 750ms cubic-bezier(.22, 1, .36, 1), opacity 500ms ease;
}

.project-card img {
  display: block;
  width: auto;
  height: 100%;
  max-width: none;
}

.project-carousel.is-focused .project-card.is-focused-card {
  transform: scale(var(--project-focus-scale, 1.3));
  cursor: zoom-out;
  z-index: 1;
}

.project-carousel.is-focused .project-card:not(.is-focused-card) {
  opacity: 0;
  transform: translateX(var(--project-focus-shift, 0px)) scale(.96);
  pointer-events: none;
}

.project-carousel__caption {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + var(--project-card-half, 140px) + 22px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  pointer-events: none;
  text-align: center;
  transition: opacity 400ms ease;
}

.project-carousel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.project-carousel__counter {
  font-size: .875rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  opacity: .65;
}

.project-carousel.is-focused .project-carousel__caption { opacity: 0; }

@media (max-width: 760px) {
  .projects__intro { grid-template-columns: 1fr; gap: 28px; }
  .projects__title { font-size: clamp(2.6rem, 8.6vw, 4.6rem); }
  .projects__description { max-width: 40ch; }
  .projects__caption { max-width: 15ch; text-align: right; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  .project-card, .project-carousel__caption { transition: none; }
}
