/* ============================================================
   Açılış animasyonu: dev yumurta → dokununca kırılır
   → içinden dev Ebubekir fotoğrafı çıkar
   ============================================================ */

body.intro-lock {
  overflow: hidden;
}

.egg-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    radial-gradient(120% 70% at 50% 12%, #262d3a 0%, var(--bg) 60%),
    var(--bg);
  cursor: pointer;
  overflow: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  -webkit-tap-highlight-color: transparent;
}

.egg-intro.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.egg-intro:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -8px;
}

/* --- Sahne: yumurta + içindeki fotoğraf --- */

.egg-stage {
  position: relative;
  width: min(72vw, 320px);
  flex: 0 0 auto;
}

/* Yumurtadan çıkan fotoğraf (başlangıçta kabuğun arkasında gizli) */
.egg-photo {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(58vw, 250px);
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.35);
  transform-origin: 50% 55%;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: transform 0.75s cubic-bezier(0.18, 0.9, 0.25, 1.06),
              opacity 0.4s ease,
              box-shadow 0.75s ease;
  will-change: transform, opacity;
}

.egg-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Kabuk: iki parça, birleşince tam yumurta görünümü --- */

.egg-shell {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  clip-path: none;
  transition: transform 0.85s cubic-bezier(0.3, 0.05, 0.7, 0.4), opacity 0.7s ease 0.25s;
  border-radius: 50% 50% 50% 50% / 62% 62% 40% 40%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 42%),
    radial-gradient(circle at 74% 70%, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0) 45%),
    radial-gradient(115% 100% at 34% 20%, #fffdf8 0%, #f6f0e4 34%, #e3dbca 68%, #c9c0ad 100%);
  box-shadow:
    inset -16px -22px 42px rgba(120, 100, 70, 0.22),
    inset 14px 16px 32px rgba(255, 255, 255, 0.85),
    0 30px 70px -22px rgba(0, 0, 0, 0.85);
  animation: egg-wobble 2.6s ease-in-out infinite;
  will-change: transform;
}

/* İnce benek dokusu */
.egg-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    radial-gradient(circle at 26% 34%, rgba(160, 142, 110, 0.30) 0 2px, transparent 3px),
    radial-gradient(circle at 61% 22%, rgba(160, 142, 110, 0.24) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 44% 62%, rgba(160, 142, 110, 0.22) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 48%, rgba(160, 142, 110, 0.26) 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 36% 78%, rgba(160, 142, 110, 0.20) 0 2.4px, transparent 3.4px);
  pointer-events: none;
}

/* Kabuk iki parçaya ayrılırken kırık kenarlar zikzak olur */
.egg-shell.is-top {
  position: absolute;
  inset: 0;
  clip-path: polygon(
    0 0, 100% 0,
    100% 44%, 89% 51%, 78% 43%, 66% 52%, 54% 44%,
    42% 53%, 30% 45%, 18% 52%, 8% 45%, 0 51%
  );
}

.egg-shell.is-bottom {
  clip-path: polygon(
    0 51%, 8% 45%, 18% 52%, 30% 45%, 42% 53%, 54% 44%,
    66% 52%, 78% 43%, 89% 51%, 100% 44%,
    100% 100%, 0 100%
  );
}

/* Kırık anında kabuğa düşen ışık */
.egg-glow {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(90vw, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 225, 0.85) 0%, rgba(255, 240, 190, 0.35) 38%, rgba(255, 235, 180, 0) 70%);
  opacity: 0;
  transform: scale(0.3);
  transition: transform 0.7s ease-out, opacity 0.5s ease;
  pointer-events: none;
}

/* --- "Dokun" ipucu --- */

.egg-hint {
  position: relative;
  margin: 0;
  padding: 11px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: hint-pulse 2s ease-in-out infinite;
}

/* ============================================================
   Kırılma durumu — .egg-intro.is-cracked
   ============================================================ */

.egg-intro.is-cracked .egg-shell {
  animation: none;
}

.egg-intro.is-cracked .egg-shell.is-top {
  transform: translate(-4vw, -68vh) rotate(-19deg);
  opacity: 0;
}

.egg-intro.is-cracked .egg-shell.is-bottom {
  transform: translate(4vw, 68vh) rotate(16deg);
  opacity: 0;
}

.egg-intro.is-cracked .egg-glow {
  opacity: 1;
  transform: scale(1.15);
}

.egg-intro.is-cracked .egg-photo {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

.egg-intro.is-cracked .egg-photo img {
  animation: photo-emerge 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.egg-intro.is-cracked .egg-hint {
  opacity: 0;
  transition: opacity 0.25s ease;
  animation: none;
}

/* ============================================================
   Keyframes
   ============================================================ */

@keyframes egg-wobble {
  0%, 100% { transform: rotate(-2.6deg) translateY(0); }
  50%      { transform: rotate(2.6deg) translateY(-10px); }
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.05); }
}

@keyframes photo-emerge {
  0%   { transform: scale(1.28); filter: brightness(1.5) saturate(0.6); }
  100% { transform: scale(1);    filter: brightness(1) saturate(1); }
}

/* Küçük ekranlarda ipucu biraz daha küçük */
@media (max-width: 400px) {
  .egg-hint {
    font-size: 0.8rem;
    padding: 10px 18px;
  }
}

/* Hareket azaltma tercihi: animasyon yerine yalnızca fotoğraf görünür */
@media (prefers-reduced-motion: reduce) {
  .egg-shell,
  .egg-hint {
    animation: none !important;
  }
}
