/* ============================================================================
 * Studio OS — Animations
 * Linear issue: TECH-5463 (F1.3)
 *
 * Tum animasyonlar CSS-only (JS yok). 200-700ms gorus icin. Slider, parallax,
 * autoplay video YOK (tasarim sistemi kurali).
 *
 * Reduced motion preference'i aktifken animasyonlar durur veya hizi azalir.
 * ========================================================================== */

/* ----------------------------------------------------------------------------
 * Aurora blob hareketleri — hero arka plani
 * 14-18 saniye dongu, easeInOut
 * -------------------------------------------------------------------------- */
@keyframes studio-blob-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(60px, 40px) scale(1.1); }
}

@keyframes studio-blob-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-50px, 30px) scale(0.95); }
}

@keyframes studio-blob-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(40px, -50px) scale(1.05); }
}

/* ----------------------------------------------------------------------------
 * Gradient text shift — H1 ve buyuk display textler
 * 8 saniye dongu
 * -------------------------------------------------------------------------- */
@keyframes studio-grad-shift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ----------------------------------------------------------------------------
 * Ping — eyebrow noktasi (canli durum)
 * 2 saniye dongu
 * -------------------------------------------------------------------------- */
@keyframes studio-ping {
    0%   { box-shadow: 0 0 0 0 rgba(0, 194, 142, 0.5); }
    100% { box-shadow: 0 0 0 12px rgba(0, 194, 142, 0); }
}

/* ----------------------------------------------------------------------------
 * Pulse — urun karti aktif beta nokta
 * 1.6 saniye dongu
 * -------------------------------------------------------------------------- */
@keyframes studio-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.studio-pulse-dot {
    animation: studio-pulse 1.6s ease-in-out infinite;
}

/* ----------------------------------------------------------------------------
 * Stagger reveal — liste ogeleri sirayla goruntulenir
 * Kullanim: parent'a .studio-stagger ekle, cocuklar otomatik delay alir
 * -------------------------------------------------------------------------- */
@keyframes studio-stagger-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.studio-stagger > * {
    opacity: 0;
    animation: studio-stagger-in 600ms ease-out forwards;
}

.studio-stagger > *:nth-child(1) { animation-delay: 0ms; }
.studio-stagger > *:nth-child(2) { animation-delay: 80ms; }
.studio-stagger > *:nth-child(3) { animation-delay: 160ms; }
.studio-stagger > *:nth-child(4) { animation-delay: 240ms; }
.studio-stagger > *:nth-child(5) { animation-delay: 320ms; }
.studio-stagger > *:nth-child(6) { animation-delay: 400ms; }
.studio-stagger > *:nth-child(7) { animation-delay: 480ms; }
.studio-stagger > *:nth-child(8) { animation-delay: 560ms; }
.studio-stagger > *:nth-child(n+9) { animation-delay: 640ms; }

/* Skeleton placeholder stagger (loading durumu) */
@keyframes studio-stagger-skeleton {
    0%, 100% {
        background: var(--studio-cream-2);
        transform: translateX(0);
    }
    40% {
        background: var(--studio-product-muh);
        transform: translateX(8px);
    }
}

.studio-stagger-skeleton {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.studio-stagger-skeleton i {
    display: block;
    height: 10px;
    background: var(--studio-cream-2);
    border-radius: 4px;
    animation: studio-stagger-skeleton 2.4s ease-in-out infinite;
}

.studio-stagger-skeleton i:nth-child(1) { animation-delay: 0s; width: 60%; }
.studio-stagger-skeleton i:nth-child(2) { animation-delay: 0.1s; width: 90%; }
.studio-stagger-skeleton i:nth-child(3) { animation-delay: 0.2s; width: 50%; }
.studio-stagger-skeleton i:nth-child(4) { animation-delay: 0.3s; width: 75%; }

/* ----------------------------------------------------------------------------
 * Magnetic CTA — buyuk butonlarda renkli bulut kaymasi
 * 4 saniye dongu, sadece .studio-magnetic uzerinde aktif
 * -------------------------------------------------------------------------- */
@keyframes studio-magnetic {
    0%, 100% { transform: translate(-110%, -50%); }
    50%      { transform: translate(10%, -50%); }
}

.studio-magnetic {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.studio-magnetic::before {
    content: "";
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--studio-product-muh), var(--studio-product-gof));
    filter: blur(15px);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: studio-magnetic 4s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

/* ----------------------------------------------------------------------------
 * Hover lift — kartlar uzerinde
 * -------------------------------------------------------------------------- */
.studio-hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.studio-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--studio-shadow-card);
}

/* ----------------------------------------------------------------------------
 * Fade in — basit opacity 0 -> 1 (200-400ms)
 * -------------------------------------------------------------------------- */
@keyframes studio-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.studio-fade-in {
    animation: studio-fade-in 400ms ease-out forwards;
}

/* ----------------------------------------------------------------------------
 * Reduced motion — kullanici tercih ettiyse tum animasyonlari durdur
 * -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .studio-aurora::before,
    .studio-aurora::after,
    .studio-aurora > i,
    .studio-pulse-dot,
    .studio-magnetic::before,
    .studio-grad-text {
        animation: none !important;
    }

    .studio-stagger > * {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .studio-hover-lift {
        transition: none;
    }
}

/* ============================================================
   GLITCH RGB-shift (proposal:795-803 port)
   data-text attribute'undaki icerik ::before/::after ile
   parca parca titreyerek dijital his uretir.
   .studio-glitch base class — .studio-grad-text ile combine edilir.
   ============================================================ */
.studio-glitch {
    position: relative;
    display: inline-block;
}

.studio-glitch::before,
.studio-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    background-clip: initial;
    color: transparent;
    transition: opacity 0.15s linear;
}

.studio-glitch:hover::before {
    color: var(--studio-product-rate, #FF3D8B);
    opacity: 0.9;
    animation: studio-glitch-1 0.5s steps(2) infinite;
    text-shadow: 0 0 8px rgba(255, 61, 139, 0.6);
}

.studio-glitch:hover::after {
    color: var(--studio-product-muh, #2E5BFF);
    opacity: 0.9;
    animation: studio-glitch-2 0.5s steps(2) infinite;
    text-shadow: 0 0 8px rgba(46, 91, 255, 0.6);
}

@keyframes studio-glitch-1 {
    0%   { clip-path: inset(20% 0 60% 0); transform: translate(-2px, -1px); }
    25%  { clip-path: inset(70% 0 10% 0); transform: translate(2px, 1px); }
    50%  { clip-path: inset(40% 0 40% 0); transform: translate(-1px, 2px); }
    75%  { clip-path: inset(10% 0 70% 0); transform: translate(2px, -2px); }
    100% { clip-path: inset(50% 0 30% 0); transform: translate(-2px, 1px); }
}

@keyframes studio-glitch-2 {
    0%   { clip-path: inset(60% 0 20% 0); transform: translate(2px, 1px); }
    25%  { clip-path: inset(15% 0 65% 0); transform: translate(-2px, -1px); }
    50%  { clip-path: inset(45% 0 35% 0); transform: translate(1px, -2px); }
    75%  { clip-path: inset(75% 0 5% 0);  transform: translate(-2px, 2px); }
    100% { clip-path: inset(25% 0 55% 0); transform: translate(2px, -1px); }
}

html[data-theme="neon"] .studio-glitch:hover::before {
    color: #00D9FF;
    text-shadow: 0 0 12px rgba(0, 217, 255, 0.7);
}

html[data-theme="neon"] .studio-glitch:hover::after {
    color: #FF1B6B;
    text-shadow: 0 0 12px rgba(255, 27, 107, 0.7);
}

@media (prefers-reduced-motion: reduce) {
    .studio-glitch:hover::before,
    .studio-glitch:hover::after {
        animation: none !important;
        opacity: 0 !important;
    }
}
