/* ---- Pixel cloud canvas --------------------------------------- */
#pixel-cloud {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

/* ---- Page hero ------------------------------------------------ */
.pd-hero {
  padding: 220px 48px 100px;
  position: relative;
  overflow: visible;
  isolation: isolate;
  z-index: 1;
  display: flex;
  justify-content: center;
  min-height: clamp(480px, 68vh, 760px);
}

.pd-orbit {
  position: absolute;
  top: 40px;
  right: 0;
  bottom: -56px;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 0;
  pointer-events: none;
  opacity: 0.96;
}

.pd-hero-copy {
  width: min(840px, 100%);
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pd-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: lowercase;
  margin-top: 18px;
}

.pd-title {
  font-family: var(--sans);
  font-size: clamp(56px, 8vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 500;
  margin: 36px 0 0;
  color: var(--fg);
  overflow-wrap: anywhere;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.03);
}

.pd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.pd-tags .proj-tag {
  font-size: 11px;
  padding: 6px 14px;
}

/* ---- Rule ----------------------------------------------------- */
.pd-rule {
  display: none;
}

/* ---- Overview paragraph --------------------------------------- */
.pd-intro {
  padding: 80px 48px 80px;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

.pd-intro .pd-tags {
  justify-content: flex-start;
  margin-bottom: 28px;
}

.pd-intro p {
  font-family: var(--sans);
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

/* ---- Gallery / coverflow -------------------------------------- */
.pd-gallery {
  padding: 0 0 80px;
  position: relative;
  z-index: 1;
  user-select: none;
}

.pd-gallery-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: lowercase;
  text-align: center;
  margin-bottom: 48px;
}

.cf-wrap {
  position: relative;
}

.cf-track {
  position: relative;
  height: 460px;
  perspective: 1400px;
  overflow: visible;
  cursor: grab;
}

.cf-track:active { cursor: grabbing; }

.cf-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 224px;
  height: 400px;
  margin-left: -112px;
  margin-top: -200px;
  border-radius: 24px;
  overflow: hidden;
  background: transparent;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity   0.45s ease;
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.cf-item--landscape {
  width: 400px;
  height: 225px;
  margin-left: -200px;
  margin-top: -112px;
}

.cf-item img,
.cf-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
  border-radius: 24px;
  clip-path: inset(0 round 24px);
}

.cf-arrows {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 max(24px, calc(50% - 420px));
  pointer-events: none;
  z-index: 20;
}

.cf-prev,
.cf-next {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.75);
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 0.2s, color 0.2s, opacity 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cf-prev:hover,
.cf-next:hover {
  border-color: var(--fg-2);
  color: var(--fg);
}

.cf-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 36px;
}

.cf-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}

.cf-dot.active {
  background: var(--fg);
  transform: scale(1.5);
}

@media (max-width: 900px) {
  .cf-track { height: 380px; }
  .cf-item { width: 185px; height: 328px; margin-left: -92px; margin-top: -164px; }
  .cf-item--landscape { width: 320px; height: 180px; margin-left: -160px; margin-top: -90px; }
  .cf-arrows { padding: 0 12px; }
}

/* ---- Detail grid ---------------------------------------------- */
.pd-details {
  padding: 0 0 80px;
  position: relative;
  z-index: 1;
}

.pd-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.pd-block {
  background: var(--bg);
  padding: clamp(40px, 5vw, 64px) clamp(32px, 4vw, 52px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: background 0.5s ease;
}

.pd-block:hover {
  background: var(--bg-2);
}

.pd-block-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: lowercase;
}

.pd-block p {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-2);
  margin: 0;
  text-wrap: pretty;
}

/* ---- Stack pills ---------------------------------------------- */
.pd-stack-section {
  padding: 80px 48px 80px;
  position: relative;
  z-index: 1;
}

.pd-stack-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.pd-stack-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: lowercase;
  margin-bottom: 24px;
}

.pd-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pd-pill {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 8px 16px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  color: var(--fg-2);
  text-transform: lowercase;
  transition: border-color 0.2s, color 0.2s;
}

.pd-pill:hover {
  border-color: var(--fg);
  color: var(--fg);
}

/* ---- Footer nav ----------------------------------------------- */
.pd-nav-footer {
  padding: 0 48px 120px;
  position: relative;
  z-index: 1;
}

.pd-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 48px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pd-back,
.pd-next {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--fg-2);
  text-decoration: none;
  text-transform: lowercase;
  transition: color 0.25s;
}

.pd-back:hover,
.pd-next:hover {
  color: var(--fg);
}

/* ---- Responsive ----------------------------------------------- */
@media (max-width: 900px) {
  .pd-hero {
    padding: 160px 24px 80px;
    min-height: clamp(420px, 60vh, 620px);
  }
  .pd-orbit {
    top: 28px;
    right: 0;
    bottom: -38px;
    left: 0;
    height: auto;
  }
  .pd-hero-copy {
    width: min(720px, calc(100% - 16px));
  }
  .pd-title {
    font-size: clamp(40px, 10vw, 72px);
    margin-top: 28px;
  }
  .pd-intro { padding: 60px 24px; }
  .pd-detail-grid { grid-template-columns: 1fr; }
  .pd-stack-section { padding: 60px 24px; }
  .pd-nav-footer { padding: 0 24px 80px; }
}

@media (max-width: 600px) {
  .pd-hero {
    min-height: clamp(380px, 56vh, 520px);
  }
  .pd-title {
    font-size: clamp(36px, 12vw, 60px);
    margin-top: 24px;
  }
}
