/* ================================
   PROJECT CANVAS — Scroll-Panning
   ================================ */

/* Wrapper: scroll height drives the pan distance */
.pcw {
  height: calc(74svh + 125vw);
  position: relative;
  background: #fbfaf7;
}

.pc {
  position: sticky;
  top: 72px;
  height: min(720px, 74svh);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 14%, rgba(236, 221, 184, 0.36) 0 13%, transparent 34%),
    radial-gradient(circle at 78% 22%, rgba(190, 196, 202, 0.18) 0 12%, transparent 31%),
    linear-gradient(135deg, #ffffff 0%, #f7f5ef 46%, #ffffff 100%);
  border-top: 1px solid rgba(154, 133, 92, 0.14);
  border-bottom: 1px solid rgba(154, 133, 92, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.pc::before,
.pc::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pc::before {
  z-index: 1;
  background-image:
    linear-gradient(rgba(128, 119, 101, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 119, 101, 0.07) 1px, transparent 1px),
    linear-gradient(115deg, transparent 0 44%, rgba(205, 171, 96, 0.08) 45%, transparent 47% 100%);
  background-size: 82px 82px, 82px 82px, 360px 360px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.pc::after {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.78) 0%, transparent 18%, transparent 82%, rgba(255, 255, 255, 0.78) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), transparent 24%, transparent 76%, rgba(240, 229, 207, 0.34));
}

#pc-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 390vw;
  height: 100%;
  will-change: transform;
  z-index: 5;
  background-image:
    linear-gradient(90deg, rgba(128, 119, 101, 0.075) 1px, transparent 1px),
    linear-gradient(rgba(128, 119, 101, 0.052) 1px, transparent 1px),
    repeating-linear-gradient(118deg, transparent 0 170px, rgba(205, 171, 96, 0.06) 171px 172px, transparent 173px 340px);
  background-size: 9vw 9vw, 9vw 9vw, 100% 100%;
}

/* Section header (sticky, above canvas) */
.pc__header {
  position: absolute;
  top: clamp(1.25rem, 3vw, 2rem);
  left: clamp(1rem, 4vw, 3rem);
  right: clamp(1rem, 4vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  z-index: 20;
  pointer-events: none;
}

.pc__title {
  max-width: 560px;
  margin: 0.4rem 0 0;
  color: #2f3740;
  font-family: "Open Sans", sans-serif;
  font-size: clamp(1.55rem, 2.7vw, 2.65rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0;
  text-shadow: 0 10px 26px rgba(111, 90, 54, 0.10);
}

.pc__eyebrow {
  font-family: "Open Sans", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a7642;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(205, 171, 96, 0.18);
}

.pc__hint {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(47, 55, 64, 0.48);
  font-style: italic;
  transition: opacity 0.6s ease;
  pointer-events: none;
  white-space: nowrap;
  margin-top: 0.2rem;
}

/* Bottom progress bar */
.pc__progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(128, 119, 101, 0.12);
  z-index: 20;
}

#pc-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f4e1a3, #c99a5b, #6f7780);
  box-shadow: 0 0 18px rgba(205, 171, 96, 0.26);
  transition: width 0.1s linear;
}

/* Project cards */
.pc-card {
  position: absolute;
  width: 20vw;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  filter: drop-shadow(0 18px 30px rgba(52, 34, 8, 0.14)) drop-shadow(0 0 18px rgba(205, 171, 96, 0.08));
}

.pc-card__img {
  position: relative;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  border: 7px solid #d6aa4f;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.45s ease;
  box-shadow:
    inset 0 0 0 2px rgba(255, 244, 189, 0.78),
    inset 0 0 0 5px rgba(111, 70, 12, 0.22),
    0 4px 24px rgba(0, 0, 0, 0.10),
    0 0 0 1px rgba(205, 171, 96, 0.10);
  border-radius: 6px;
  overflow: visible;
}

.pc-card__img::before,
.pc-card__img::after {
  content: "";
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.pc-card__img::before {
  top: -15px;
  right: 16px;
  width: 72px;
  height: 28px;
  background: linear-gradient(135deg, #f8dc82 0%, #c99127 45%, #fff0a8 52%, #a96f18 100%);
  clip-path: polygon(0 0, 100% 0, 88% 50%, 100% 100%, 0 100%, 12% 50%);
  box-shadow: 0 6px 14px rgba(96, 54, 6, 0.24);
  transform: rotate(4deg);
}

.pc-card__img::after {
  top: -21px;
  right: 58px;
  width: 26px;
  height: 38px;
  border-radius: 50% 50% 8px 8px;
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.6) 0 18%, transparent 19%),
              linear-gradient(160deg, #fff0a8 0%, #c08a22 48%, #f5ce69 100%);
  box-shadow: inset 0 -4px 0 rgba(105, 66, 11, 0.15), 0 5px 10px rgba(96, 54, 6, 0.18);
  transform: rotate(-8deg);
}

.pc-card:hover .pc-card__img {
  transform: scale(1.025);
  box-shadow:
    inset 0 0 0 2px rgba(255, 244, 189, 0.88),
    inset 0 0 0 5px rgba(111, 70, 12, 0.24),
    0 10px 40px rgba(0, 0, 0, 0.18);
}

.pc-card__label {
  display: none;
  margin-top: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(52, 73, 94, 0.55);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Lightbox overlay */
#pc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#pc-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

#pc-ov-img {
  width: min(90vw, 90vh);
  height: min(60vw, 70vh);
  background-size: cover;
  background-position: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

#pc-ov-title {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

#pc-ov-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.5rem;
  transition: color 0.2s ease;
}

#pc-ov-close:hover {
  color: #fff;
}

@media (max-width: 900px) {
  .pcw {
    height: auto;
  }

  .pc {
    position: relative;
    top: auto;
    height: 64svh;
    min-height: 490px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
  }

  #pc-canvas {
    width: 880vw;
    transform: none !important;
    touch-action: pan-x;
  }

  .pc__header {
    flex-direction: column;
    justify-content: flex-start;
    top: 1rem;
    gap: 0.4rem;
  }

  .pc__title {
    max-width: 360px;
    font-size: clamp(1.25rem, 6vw, 1.75rem);
    line-height: 1.12;
  }

  .pc__hint {
    display: none;
  }

  .pc-card {
    width: 54vw;
    min-width: 0;
    scroll-snap-align: center;
  }

  .pc-card__img {
    border-width: 5px;
  }

  .pc-card__img::before {
    top: -12px;
    right: 10px;
    width: 54px;
    height: 22px;
  }

  .pc-card__img::after {
    top: -17px;
    right: 40px;
    width: 20px;
    height: 30px;
  }

}
