/* ─── Reset & Base ─── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #08040f;
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  overflow: hidden;
  user-select: none;
  padding: 20px;
}

/* ─── Animated Gradient Background ─── */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: radial-gradient(ellipse at 20% 50%, #1a0a3e 0%, #08040f 70%);
  animation: bgShift 16s ease-in-out infinite alternate;
}
@keyframes bgShift {
  0% {
    background: radial-gradient(ellipse at 20% 50%, #1a0a3e 0%, #08040f 70%);
  }
  33% {
    background: radial-gradient(ellipse at 80% 30%, #2d1b69 0%, #08040f 70%);
  }
  66% {
    background: radial-gradient(ellipse at 30% 80%, #1f0f4a 0%, #08040f 70%);
  }
  100% {
    background: radial-gradient(ellipse at 70% 70%, #2a1555 0%, #08040f 70%);
  }
}

/* ─── Animated Background Canvas ─── */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ─── Glow Orbs ─── */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 12s ease-in-out infinite alternate;
}
.glow-orb.orb1 {
  width: 600px;
  height: 600px;
  background: rgba(120, 80, 255, 0.08);
  top: -15%;
  left: -15%;
  animation-duration: 16s;
}
.glow-orb.orb2 {
  width: 500px;
  height: 500px;
  background: rgba(255, 80, 200, 0.06);
  bottom: -15%;
  right: -15%;
  animation-duration: 20s;
  animation-delay: -5s;
}
.glow-orb.orb3 {
  width: 400px;
  height: 400px;
  background: rgba(80, 200, 255, 0.05);
  top: 30%;
  left: 55%;
  animation-duration: 14s;
  animation-delay: -9s;
}
.glow-orb.orb4 {
  width: 350px;
  height: 350px;
  background: rgba(255, 180, 60, 0.04);
  bottom: 20%;
  left: 10%;
  animation-duration: 18s;
  animation-delay: -3s;
}
@keyframes orbFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(70px, -50px) scale(1.15);
  }
  66% {
    transform: translate(-40px, 60px) scale(0.85);
  }
  100% {
    transform: translate(30px, -30px) scale(1.05);
  }
}

/* ─── Title / Name ─── */
.brand {
  position: fixed;
  top: 28px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 10px 34px 10px 28px;
  border-radius: 60px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 8px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  pointer-events: none;
  transition: all 0.5s ease;
}
.brand .divider {
  width: 1px;
  height: 26px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
}
.brand .label {
  color: rgba(255, 255, 255, 0.15);
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  font-weight: 300;
}
.brand .name {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    #a78bfa,
    #60a5fa,
    #f472b6,
    #a78bfa,
    #60a5fa
  );
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: nameShine 5s ease-in-out infinite;
  letter-spacing: 2px;
  filter: drop-shadow(0 0 40px rgba(120, 80, 255, 0.15));
}
@keyframes nameShine {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* ─── Gallery Container ─── */
.wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
  padding: 20px;
}

.container {
  width: 200px;
  height: 350px;
  position: relative;
  transform-style: preserve-3d;
  cursor: grab;
  transition: filter 0.4s ease;
}
.container:active {
  cursor: grabbing;
}

/* ─── Each Image Wrapper ─── */
.container span {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(calc(var(--i) * 45deg)) translateZ(500px);
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

/* ─── Image Cards ─── */
.container span img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(120, 80, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: brightness(0.75) saturate(0.9) contrast(1.05);
  -webkit-box-reflect: below 2px
    linear-gradient(transparent, transparent, rgba(0, 0, 0, 0.15));
}

/* ─── Shimmer overlay ─── */
.container span img::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    transparent 20%,
    rgba(255, 255, 255, 0.02) 40%,
    rgba(255, 255, 255, 0.04) 50%,
    rgba(255, 255, 255, 0.02) 60%,
    transparent 80%
  );
  pointer-events: none;
  z-index: 2;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* ─── Glow ring around active image ─── */
.container span::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 26px;
  background: transparent;
  z-index: -1;
  transition: all 0.8s ease;
  opacity: 0;
}
.container span.active::after {
  opacity: 1;
  background: radial-gradient(
    circle at center,
    rgba(160, 120, 255, 0.2),
    transparent 70%
  );
  filter: blur(25px);
  animation: pulseRing 2.5s ease-in-out infinite;
}
@keyframes pulseRing {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* ─── Hover Effects ─── */
.container:hover span img {
  filter: brightness(0.85) saturate(1) contrast(1.05);
}

.container span:hover img {
  transform: scale(1.07) translateY(-10px) rotateY(-3deg);
  border-color: rgba(160, 120, 255, 0.4);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.9),
    0 0 80px rgba(120, 80, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  filter: brightness(1) saturate(1.15) contrast(1.05);
}

/* ─── Controls ─── */
.controls {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 8px 18px;
  border-radius: 60px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    0 20px 70px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.controls button {
  background: rgba(255, 255, 255, 0.04);
  border: none;
  color: rgba(255, 255, 255, 0.4);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
}

.controls button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(160, 120, 255, 0.25),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
}

.controls button:hover::before {
  opacity: 1;
}

.controls button:hover {
  color: #fff;
  transform: scale(1.12) translateY(-2px);
  border-color: rgba(160, 120, 255, 0.3);
  box-shadow: 0 0 50px rgba(120, 80, 255, 0.12);
  background: rgba(160, 120, 255, 0.08);
}
.controls button:active {
  transform: scale(0.88);
}

/* ─── Dots ─── */
.dots {
  display: flex;
  gap: 7px;
  padding: 0 6px;
}

.dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  border: none;
  padding: 0;
  position: relative;
}

.dots .dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(160, 120, 255, 0.15),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
}

.dots .dot:hover::after {
  opacity: 1;
}

.dots .dot.active {
  background: rgba(160, 120, 255, 0.7);
  box-shadow: 0 0 30px rgba(120, 80, 255, 0.25);
  transform: scale(1.4);
  width: 24px;
  border-radius: 4px;
}

.dots .dot.active::after {
  opacity: 1;
}

.dots .dot:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ─── Counter ─── */
.counter {
  color: rgba(255, 255, 255, 0.15);
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 300;
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: "SF Mono", "Segoe UI", monospace;
}
.counter span {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

/* ─── Keyboard hint ─── */
.hint {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  color: rgba(255, 255, 255, 0.03);
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 300;
  pointer-events: none;
  animation: hintPulse 5s ease-in-out infinite;
}
@keyframes hintPulse {
  0%,
  100% {
    opacity: 0.03;
  }
  50% {
    opacity: 0.1;
  }
}

/* ─── Floating particles (CSS) ─── */
.float-particle {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(160, 120, 255, 0.3),
    transparent
  );
  pointer-events: none;
  z-index: 0;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .container {
    width: 160px;
    height: 280px;
  }
  .container span {
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(400px);
  }
  .brand {
    top: 18px;
    padding: 8px 20px 8px 16px;
    gap: 10px;
  }
  .brand .name {
    font-size: 18px;
  }
  .brand .label {
    font-size: 8px;
    letter-spacing: 3px;
  }
  .brand .divider {
    height: 20px;
  }
  .controls {
    padding: 6px 14px;
    gap: 10px;
    bottom: 24px;
  }
  .controls button {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .dots .dot {
    width: 6px;
    height: 6px;
  }
  .dots .dot.active {
    width: 18px;
  }
  .counter {
    font-size: 10px;
    min-width: 36px;
  }
  .hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    width: 120px;
    height: 210px;
  }
  .container span {
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(300px);
  }
  .brand {
    top: 12px;
    padding: 6px 14px 6px 12px;
    gap: 8px;
    border-radius: 40px;
  }
  .brand .name {
    font-size: 14px;
    letter-spacing: 1px;
  }
  .brand .label {
    font-size: 7px;
    letter-spacing: 2px;
  }
  .brand .divider {
    height: 16px;
  }
  .controls {
    padding: 5px 10px;
    gap: 6px;
    bottom: 16px;
    border-radius: 40px;
  }
  .controls button {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  .dots {
    gap: 5px;
    padding: 0 4px;
  }
  .dots .dot {
    width: 5px;
    height: 5px;
  }
  .dots .dot.active {
    width: 14px;
  }
  .counter {
    font-size: 9px;
    min-width: 30px;
  }
  .wrapper {
    padding: 10px;
  }
  body {
    padding: 10px;
  }
}

@media (max-width: 380px) {
  .container {
    width: 95px;
    height: 165px;
  }
  .container span {
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(240px);
  }
  .brand .name {
    font-size: 12px;
  }
  .brand {
    padding: 4px 10px 4px 8px;
    gap: 6px;
  }
  .controls button {
    width: 24px;
    height: 24px;
    font-size: 9px;
  }
  .controls {
    padding: 4px 8px;
    gap: 4px;
  }
  .dots .dot {
    width: 4px;
    height: 4px;
  }
  .dots .dot.active {
    width: 12px;
  }
  .counter {
    font-size: 8px;
    min-width: 24px;
  }
}

/* ─── Landscape phone support ─── */
@media (max-height: 500px) and (orientation: landscape) {
  .container {
    width: 130px;
    height: 200px;
  }
  .container span {
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(320px);
  }
  .brand {
    top: 10px;
    padding: 5px 14px 5px 10px;
    gap: 8px;
  }
  .brand .name {
    font-size: 14px;
  }
  .brand .label {
    font-size: 7px;
  }
  .controls {
    bottom: 14px;
    padding: 4px 12px;
    gap: 8px;
  }
  .controls button {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  .hint {
    display: none;
  }
}

@media (max-height: 400px) and (orientation: landscape) {
  .container {
    width: 100px;
    height: 155px;
  }
  .container span {
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(250px);
  }
  .brand .name {
    font-size: 12px;
  }
  .controls {
    bottom: 10px;
    padding: 3px 8px;
    gap: 4px;
  }
  .controls button {
    width: 22px;
    height: 22px;
    font-size: 9px;
  }
  .dots .dot {
    width: 4px;
    height: 4px;
  }
  .dots .dot.active {
    width: 10px;
  }
  .counter {
    font-size: 7px;
    min-width: 20px;
  }
}
