*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: #0a0a0a;
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  font-optical-sizing: auto;
  letter-spacing: -0.04em;
  -webkit-font-smoothing: antialiased;
}

html.lenis,
html.lenis body {
  height: auto;
}

img {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.works {
  position: relative;
  z-index: 1;
  width: 100%;
  background: #0a0a0a;
  cursor: none;
}

/* Sticky overlay: text + center card only */
.works__stage {
  position: sticky;
  top: 0;
  z-index: 2;
  width: 100%;
  height: 100vh;
  margin-bottom: -100vh;
  overflow: hidden;
  pointer-events: none;
}

.works__ui {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.ui-layer__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: 1920px;
  height: 100%;
  padding: 0 20px;
}

.work__title,
.work__aside {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  width: 1px;
  min-width: 0;
}

.work__title {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}

.work__mask {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.work__mask h2,
.work__mask p {
  width: 100%;
  will-change: transform, filter, opacity;
}

.work__mask h2 + h2,
.work__mask p + p {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
}

.work__aside .work__mask {
  width: 70%;
}

.work__copy {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  text-wrap: balance;
}

.work__slot {
  flex: 1 1 0;
  width: 1px;
  aspect-ratio: 4 / 3;
}

.card-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: calc((min(100vw, 1920px) - 40px - 80px) / 3);
  max-width: 640px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.card-layer {
  position: absolute;
  inset: 0;
  clip-path: inset(calc(var(--clip, 0) * 1%) 0 0 0);
  will-change: clip-path;
}

.card-layer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

/* Backgrounds: normal page scroll */
.works__bgs {
  position: relative;
  z-index: 0;
}

.work-bg {
  position: relative;
  width: 100%;
  height: 110vh;
  overflow: hidden;
}

.work-bg__bleed {
  position: absolute;
  inset: 0;
  overflow: hidden;
  filter: brightness(0.6);
}

.work-bg__blur {
  position: absolute;
  inset: 0;
  z-index: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

.parallax {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.work-bg__bleed > .parallax {
  position: absolute;
  inset: 0;
}

.parallax__shift {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.parallax__shift img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  padding: 8px 14px;
  background: #fff;
  color: #0a0a0a;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.cursor[hidden] {
  display: none;
}

@media (max-width: 1199px) {
  .work__title {
    font-size: 20px;
  }

  .work__copy {
    font-size: 14px;
  }

  .card-stack {
    width: min(50vw, 520px);
    max-width: 50%;
  }
}

@media (max-width: 809px) {
  .works {
    cursor: auto;
  }

  .ui-layer__row {
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 8px;
    padding: 24px 20px 0;
  }

  .work__title,
  .work__aside {
    flex: none;
    width: 100%;
    display: block;
  }

  .work__slot {
    display: none;
  }

  .work__title {
    font-size: 18px;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
  }

  .work__mask h2 {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .work__aside .work__mask {
    width: 100%;
  }

  .work__copy {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.35;
  }

  .card-stack {
    top: 50%;
    width: min(86vw, 420px);
    max-width: none;
    transform: translate(-50%, -50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-layer {
    clip-path: none;
  }

  .parallax__shift {
    transform: none !important;
  }
}
