/* ===== Projects Scroll Gallery ===== */
[data-testid="featured-projects"].psg-active {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  position: relative;
}

.psg-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #1a1a18;
}

/* ── Slides ── */
/* clip-path is on the slide, so both image AND content are masked by the curtain */
.psg-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(var(--reveal, 0%) 0 0 0);
  will-change: clip-path;
}

/* Non-first slides default to fully closed (--reveal: 100%) */
.psg-slide:not([data-psg-index="0"]) {
  --reveal: 100%;
}

/* Hide non-first slides' text so it can't bleed through before GSAP sets inline opacity */
.psg-slide:not([data-psg-index="0"]) .psg-index,
.psg-slide:not([data-psg-index="0"]) .psg-category,
.psg-slide:not([data-psg-index="0"]) .psg-word,
.psg-slide:not([data-psg-index="0"]) .psg-quote,
.psg-slide:not([data-psg-index="0"]) .psg-btn,
.psg-slide:not([data-psg-index="0"]) .psg-meta {
  opacity: 0;
}

.psg-slide:not([data-psg-index="0"]) .psg-content {
  pointer-events: none;
}

/* Background image layer */
.psg-media {
  position: absolute;
  inset: 0;
}

.psg-media-inner {
  position: absolute;
  inset: -8%;       /* extra room for scale effect */
  transform-origin: center center;
  will-change: transform;
  /* Prevent sub-pixel compositing blur on mobile */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.psg-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Gradient overlay */
.psg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 9, 8, 0.18) 0%,
    rgba(10, 9, 8, 0.08) 35%,
    rgba(10, 9, 8, 0.55) 75%,
    rgba(10, 9, 8, 0.75) 100%
  );
  z-index: 1;
}

/* ── Content ── */
.psg-content {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 44px 64px 52px;
}

@media (max-width: 768px) {
  .psg-content {
    padding: 28px 24px 40px;
  }
}

.psg-content-inner {
  max-width: 720px;
}

.psg-index {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.55);
  margin: 0 0 10px;
  transform-origin: top center;
  will-change: transform, opacity;
  font-family: 'Inter', sans-serif;
}

.psg-category {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(215, 205, 182, 0.7);
  margin: 0 0 14px;
  will-change: opacity;
  font-family: 'Inter', sans-serif;
}

.psg-title {
  font-size: clamp(2.4rem, 6.5vw, 5.2rem);
  font-weight: 400;
  line-height: 1.05;
  color: #f7f4ee;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
  will-change: transform, opacity;
  /* use whatever display font the site declares */
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
}

/* word spans injected by JS for word-by-word animation */
.psg-word {
  display: inline-block;
  will-change: transform, opacity;
}

.psg-quote {
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  color: rgba(247, 244, 238, 0.75);
  margin: 0 0 28px;
  max-width: 540px;
  line-height: 1.6;
  will-change: transform, opacity;
  font-family: 'Inter', sans-serif;
}

.psg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.8);
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 244, 238, 0.3);
  padding-bottom: 4px;
  width: fit-content;
  will-change: transform, opacity;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s, border-color 0.2s;
}

.psg-btn:hover {
  color: #fff;
  border-color: rgba(247, 244, 238, 0.8);
}

/* location + year footer line */
.psg-meta {
  display: flex;
  gap: 28px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(247, 244, 238, 0.12);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.38);
  font-family: 'Inter', sans-serif;
}

/* ── Top bar (header + view-all + progress) ── */
.psg-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 36px 64px 0;
}

@media (max-width: 768px) {
  .psg-topbar {
    padding: 24px 24px 0;
  }
}

.psg-header {}

.psg-overline {
  display: block;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.38);
  margin-bottom: 5px;
  font-family: 'Inter', sans-serif;
}

.psg-heading {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(247, 244, 238, 0.65);
  margin: 0;
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  letter-spacing: 0.03em;
}

.psg-view-all {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.45);
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 244, 238, 0.15);
  padding-bottom: 2px;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s, border-color 0.2s;
  margin-top: 2px;
}

.psg-view-all:hover {
  color: rgba(247, 244, 238, 0.85);
  border-color: rgba(247, 244, 238, 0.5);
}

/* ── Progress bar ── */
.psg-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: rgba(247, 244, 238, 0.1);
  z-index: 30;
}

.psg-progress {
  display: block;
  height: 100%;
  background: rgba(247, 244, 238, 0.6);
  width: 0%;
  will-change: width;
  transition: none;
}

/* scroll hint — fades out after first interaction */
.psg-scroll-hint {
  position: absolute;
  bottom: 52px;
  right: 64px;
  z-index: 20;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.35);
  font-family: 'Inter', sans-serif;
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .psg-scroll-hint { display: none; }
  .psg-topbar { padding: 24px 24px 0; }
}

/* dot counter */
.psg-dots {
  position: absolute;
  bottom: 52px;
  left: 64px;
  z-index: 20;
  display: flex;
  gap: 6px;
  align-items: center;
}

@media (max-width: 768px) {
  .psg-dots { left: 24px; bottom: 40px; }
  .psg-scroll-hint { right: 24px; bottom: 40px; }
}

.psg-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(247, 244, 238, 0.25);
  transition: background 0.3s, transform 0.3s;
}

.psg-dot.is-active {
  background: rgba(247, 244, 238, 0.8);
  transform: scale(1.4);
}
