/* ==========================================================
   Çaylar · Cihaz vitrini (DeviceShowcase)
   Kırmızı kart + tarayıcı penceresi + üst üste binen iki telefon.
   Şablon: js/components.js › DeviceShowcase
   Hareket: js/animations.js (giriş, süzülme, paralaks) — yalnızca transform ve opacity.
   Renkler :root değişkenlerinden gelir. Rol sayfalarında .device-showcase--role
   ile --role-grad kullanılır.
   ========================================================== */

.device-showcase {
  position: relative;
  isolation: isolate;
  flex: 1 1 560px;
  min-width: 0;
  min-height: 640px;
  box-sizing: border-box;
  padding: 88px 40px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 32px;
  background: var(--showcase-bg, var(--g-ocak));
  overflow: hidden;
}
.device-showcase--compact { flex-basis: 300px; min-height: 520px; padding: 80px 24px 28px; }
.device-showcase--role { --showcase-bg: var(--role-grad); }

/* Arka plan daireleri */
.device-showcase__ring {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: var(--c-primary-light);
  pointer-events: none;
}
.device-showcase__ring--large { width: 560px; height: 560px; right: -170px; top: -190px; opacity: 0.35; animation: device-showcase-breathe 24s ease-in-out infinite alternate; }
.device-showcase__ring--small { width: 380px; height: 380px; left: -130px; bottom: -150px; opacity: 0.25; transform-origin: 120% 50%; animation: device-showcase-orbit 60s linear infinite; }

/* Etiket */
.device-showcase__badge {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: var(--c-white);
  font-size: 14px;
  font-weight: 700;
}

/* Sahne: yüzdelerle konumlanan katmanlar */
.device-showcase__stage {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 9 / 8;
}

/* Katman = konum + paralaks. Giriş ve süzülme iç öğelerde olduğundan transform'lar çakışmaz. */
.device-showcase__layer {
  position: absolute;
  transform: translate3d(calc(var(--mx, 0) * var(--depth, 0) * 1px), calc(var(--my, 0) * var(--depth, 0) * 1px), 0);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.device-showcase__layer--browser { --depth: 4; z-index: 1; left: 0; top: 12%; width: 84%; }
.device-showcase__layer--back { --depth: 8; z-index: 2; right: 0; top: 26%; width: 28%; }
.device-showcase__layer--front { --depth: 10; z-index: 3; right: 17%; bottom: 0; width: 31%; }

/* Tarayıcı penceresi: web paneli görüntüsü kendi pencere çerçevesini (üç nokta) içerir */
.device-showcase__browser {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}
.device-showcase__screen { display: block; width: 100%; height: auto; }

/* Telefonlar */
.device-showcase__phone { display: block; width: 100%; height: auto; filter: drop-shadow(0 24px 30px rgba(60, 0, 0, 0.35)); }

/* Tek telefon (Özellikler sayfasındaki rol vitrinleri): tarayıcı ve arka telefon yok */
.device-showcase--single { padding: 40px 24px; }
.device-showcase--single .device-showcase__stage { max-width: 290px; aspect-ratio: 290 / 523; }
.device-showcase--single .device-showcase__layer--front { left: 0; right: 0; top: 0; bottom: auto; width: 100%; }

/* ---- Hareket ---- */
/* JS hazır olunca (is-armed) öğeler gizlenir, görünür olunca (is-in) sırayla gelir. */
.device-showcase.is-armed .device-showcase__enter,
.device-showcase.is-armed .device-showcase__badge { opacity: 0; }
.device-showcase.is-armed.is-in .device-showcase__enter--browser { animation: device-showcase-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.device-showcase.is-armed.is-in .device-showcase__enter--back { animation: device-showcase-slide 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both; }
.device-showcase.is-armed.is-in .device-showcase__enter--front { animation: device-showcase-slide 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.32s both; }
.device-showcase.is-armed.is-in .device-showcase__badge { animation: device-showcase-fade 0.6s ease-out 0.56s both; }

/* Giriş bittikten sonra telefonlar farklı hız ve fazda süzülür; tarayıcı sabit kalır. */
.device-showcase.is-in .device-showcase__phone--back { animation: device-showcase-float 5.6s ease-in-out 1.6s infinite; }
.device-showcase.is-in .device-showcase__phone--front { animation: device-showcase-float 4.4s ease-in-out 1.3s infinite; }

@keyframes device-showcase-rise { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
@keyframes device-showcase-slide { from { opacity: 0; transform: translateX(56px); } to { opacity: 1; transform: none; } }
@keyframes device-showcase-fade { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes device-showcase-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes device-showcase-breathe { from { transform: scale(1); } to { transform: scale(1.1); } }
@keyframes device-showcase-orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---- Mobil: orantılı küçülme, paralaks kapalı ---- */
@media (max-width: 760px) {
  .device-showcase,
  .device-showcase--compact { min-height: 0; padding: 72px 16px 28px; border-radius: 24px; }
  .device-showcase__badge { top: 20px; left: 16px; padding: 7px 13px; font-size: 13px; }
  .device-showcase__ring--large { width: 360px; height: 360px; right: -140px; top: -150px; }
  .device-showcase__ring--small { width: 260px; height: 260px; left: -110px; bottom: -110px; }
  .device-showcase__browser { border-radius: 10px; }
  .device-showcase__layer { transform: none; transition: none; }
}

/* ---- Hareketi azalt: animasyon yok, son hâl statik ---- */
@media (prefers-reduced-motion: reduce) {
  .device-showcase *,
  .device-showcase *::before { animation: none !important; transition: none !important; }
  .device-showcase .device-showcase__enter,
  .device-showcase .device-showcase__badge { opacity: 1 !important; }
  .device-showcase .device-showcase__layer { transform: none !important; }
}
