@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

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

body {
  height: 100vh;
  background: linear-gradient(135deg, #090a0f 0%, #12141c 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Inter", sans-serif;
}

.device-mockup {
  position: relative;
  width: 375px;
  height: 812px;
  /* 💡 변경된 부분: 리얼한 iOS 스타일 다크 추상 배경화면 적용 */
  background-image: url("./imgs/application-bg.jpg");
  background-size: cover;
  background-position: center;

  border-radius: 45px;
  box-shadow:
    0 0 0 12px #111,
    0 0 0 14px #222,
    0 30px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: scale(var(--device-scale, 1));
  transform-origin: center center;
}

.device-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 30px;
  background: #111;
  border-radius: 0 0 20px 20px;
  z-index: 999;
}

.focus-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

.focus-overlay.active {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.folder {
  position: relative;
  z-index: 20;
  width: 68px;
  height: 68px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.folder.active {
  width: 320px;
  height: 320px;
  background: rgba(40, 40, 45, 0.65);
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  cursor: default;
}

.folder::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 100%
  );
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.folder.active::before {
  opacity: 1;
}

/* Dots & Icons Morphing */
.folder span {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  transform: translate(calc(14px * var(--x)), calc(14px * var(--y)));
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: calc(0.015s * var(--i));
  touch-action: none;
  user-select: none;
}

.folder.active span {
  width: 68px;
  height: 68px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translate(calc(90px * var(--x)), calc(90px * var(--y)));
  cursor: grab;
  transition-delay: 0s;
}

.folder.active span:hover {
  background: rgba(255, 255, 255, 0.2);
}

.folder.active span.dragging {
  transition: none !important;
  z-index: 100;
  cursor: grabbing;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.folder span ion-icon {
  font-size: 0em;
  color: #fff;
  opacity: 0;
  transition: all 0.4s ease;
  pointer-events: none;
}

.folder.active span ion-icon {
  font-size: 1.8em;
  opacity: 1;
  transition-delay: 0.2s;
}
