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

html, body {
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #2a1030 0%, #14081c 55%, #0a040f 100%);
  color: #f6e9f0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

/* Kalbin ortasındaki yazı */
#center-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  transition: opacity .5s ease;
  width: min(60vmin, 420px);
}
#center-text h1 {
  font-size: clamp(1.6rem, 5vmin, 3rem);
  font-weight: 300;
  letter-spacing: .12em;
  color: #ffd1e3;
  text-shadow: 0 0 24px rgba(255, 90, 150, .55);
}
#center-text p {
  margin-top: .6em;
  font-size: clamp(.75rem, 1.8vmin, 1rem);
  opacity: .6;
}
body.focused #center-text { opacity: 0; }

/* Fotoğraflar */
.photo {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #2b1636;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5), 0 0 0 2px rgba(255, 255, 255, .12);
  will-change: transform;
  opacity: var(--o, 1);
  user-select: none;
  -webkit-user-drag: none;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.photo.hover {
  opacity: 1;
  box-shadow: 0 10px 34px rgba(255, 90, 150, .55), 0 0 0 2px rgba(255, 190, 215, .85);
}

/* Büyüme / geri dönme animasyonu (sadece geçiş sırasında) */
.photo.animating {
  transition: transform .6s cubic-bezier(.22, .9, .25, 1),
              width .6s cubic-bezier(.22, .9, .25, 1),
              height .6s cubic-bezier(.22, .9, .25, 1),
              opacity .4s ease,
              box-shadow .4s ease,
              border-radius .6s ease;
}
.photo.active {
  opacity: 1;
  cursor: default;
  border-radius: 10px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .75), 0 0 0 3px rgba(255, 220, 235, .9);
}
.photo.active img { object-fit: contain; background: #0c0510; }

/* Diğer fotoğraflar büyük fotoğraf açıkken sönük kalsın */
body.focused .photo:not(.active) { opacity: calc(var(--o, 1) * .22); pointer-events: none; }
/* Büyütme/küçültme sırasında diğer fotoğrafların yumuşak sönmesi */
body.fadefx .photo:not(.active) { transition: opacity .4s ease; }

#backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 3, 12, .7);
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
  z-index: 0;
}
body.focused #backdrop { opacity: 1; }

#caption {
  position: fixed;
  left: 50%;
  bottom: 4vh;
  transform: translateX(-50%);
  z-index: 40;
  padding: .5em 1.2em;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #ffe3ee;
  font-size: clamp(.85rem, 2vmin, 1.1rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
  max-width: 90vw;
  text-align: center;
}
#caption.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .photo.animating { transition-duration: .01s; }
}
