/* =====================================================================
   Kalyon Balık · açılış animasyonu (siteye girişte bardak dolar)
   ---------------------------------------------------------------------
   Akış (toplam ~2,4 sn):
     0,00-0,40  logodaki Y bardağı ince beyaz çizgiyle çizilir
     0,28-1,40  bardak alttan dalgalı sıvıyla dolar (+ birkaç kabarcık)
     1,36-1,86  görüntü uzaklaşır, bardak logodaki Y'nin üstüne oturur,
                KALYON logosu belirir
     1,86-1,90  kısa duruş
     1,90-2,40  lacivert perde dalga kenarıyla yukarı çekilir
   Perde öğesini js/acilis.js oluşturur. <head>'deki küçük satır içi betik
   html'e .acilis-var ekler; yalnız o durumda içerik perde kurulana kadar
   gizli kalır (ilk boyamada içerik görünüp sonra perde gelmesin diye).
   Yalnız transform / opacity anime edilir (çizim için küçük bir SVG'de
   stroke-dashoffset). prefers-reduced-motion'da hiçbir şey görünmez.
   ===================================================================== */

/* Perde kurulana kadar: zemin lacivert, içerik görünmez (erişilebilirlik
   ağacından çıkmasın diye visibility değil opacity). Satır içi betik bu
   sınıfı en geç 4 sn sonra kendiliğinden kaldırır. */
html.acilis-var,
html.acilis-var body {
    background-color: #0A2342 !important;
}
html.acilis-var body > :not(.acilis-perde) {
    opacity: 0 !important;
}

/* Animasyon sırasında sayfa kaymaz */
html.acilis-kilit {
    overflow: hidden !important;
    scrollbar-gutter: stable;
}

/* ---------- Perde ---------- */
.acilis-perde {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 2147483000;            /* dalga geçişi (9999) ve balık imlecinin (10001) üstünde */
    height: 100vh;
    height: 100lvh;
    margin: 0;
    padding: 0;
    background: #0A2342;
    color: #fff;
    cursor: pointer !important;     /* ortak.css balık imleci için imleci gizliyor; perdede görünsün */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transform: translateY(0);
    will-change: transform;
}
.acilis-perde.acilis-cikiyor {
    pointer-events: none;           /* çekilirken altındaki site hemen kullanılabilir */
}

/* Alt kenardaki dalga (perdeyle birlikte yukarı çekilir) */
.acilis-kenar {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    width: 100%;
    height: clamp(40px, 7vw, 90px);
    overflow: hidden;
    pointer-events: none;
}
.acilis-kenar svg {
    display: block;
    width: 120%;
    height: 100%;
    margin-left: -10%;
    transform: translateX(-4%);
}

/* ---------- Sahne (ortadaki bardak / logo) ---------- */
.acilis-orta {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.acilis-sahne {
    flex: none;
    width: clamp(220px, min(80vw, 120svh), 560px);
    aspect-ratio: 3 / 1;            /* viewBox 960 × 320 */
    /* başlangıç: bardak ekranın ortasında, 1,9 kat büyük
       (bardak merkezi viewBox merkezinden +%4,03 sağda, %1,25 yukarıda) */
    transform: translate(-7.66%, 2.375%) scale(1.9);
    transform-origin: 50% 50%;
    will-change: transform;
}
.acilis-sahne svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.acilis-logo,
.acilis-y-dolu {
    opacity: 0;
}
.acilis-cizgi {
    fill: none;
    stroke: #fff;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1 2;
    stroke-dashoffset: 1;
    opacity: 0;
}
.acilis-sivi {
    transform: translateY(516px);   /* yüzey bardak dibinin altında: boş */
}
.acilis-kabarcik {
    opacity: 0;
}

/* ---------- Oynatma zaman çizelgesi ---------- */
.acilis-oyna .acilis-cizgi-kase {
    animation: acilisCiz .4s cubic-bezier(.5, .05, .3, 1) both;
}
.acilis-oyna .acilis-cizgi-sap {
    animation: acilisCiz .22s cubic-bezier(.3, 0, .3, 1) .2s both;
}
.acilis-oyna .acilis-sivi {
    animation: acilisDol 1.12s cubic-bezier(.42, .05, .3, 1) .28s both;
}
.acilis-oyna .acilis-dalga-on {
    animation: acilisKay 1.1s linear infinite;
}
.acilis-oyna .acilis-dalga-arka {
    animation: acilisKayTers 1.7s linear infinite;
}
.acilis-oyna .acilis-kabarcik {
    animation: acilisKabarcik .85s ease-out .5s both;
}
.acilis-oyna .acilis-kabarcik.k2 { animation-delay: .72s; }
.acilis-oyna .acilis-kabarcik.k3 { animation-delay: .9s; }
.acilis-oyna .acilis-kabarcik.k4 { animation-delay: 1.08s; }

/* bardak doldu → uzaklaş, logoya otur */
.acilis-oyna .acilis-sahne {
    animation: acilisUzak .5s cubic-bezier(.6, 0, .25, 1) 1.36s both;
}
.acilis-oyna .acilis-y-dolu {
    animation: acilisGel .3s ease 1.38s both;
}
.acilis-oyna .acilis-cizgiler {
    animation: acilisGit .3s ease 1.42s both;
}
.acilis-oyna .acilis-logo {
    animation: acilisGel .4s ease 1.45s both;
}
.acilis-oyna .acilis-sivi-kat {
    animation: acilisGit .4s ease 1.5s both;   /* logodaki sıvı ve balık altından görünür */
}
.acilis-logo-yok .acilis-sivi-kat {
    animation: none;                           /* logo görseli gelmediyse dolu bardak kalsın */
}

/* perde dalga kenarıyla yukarı çekilir */
.acilis-perde.acilis-oyna {
    animation: acilisCikis .5s cubic-bezier(.7, 0, .25, 1) 1.9s both;
}
.acilis-oyna .acilis-orta {
    animation: acilisGit .35s ease 1.95s both;
}
.acilis-oyna .acilis-kenar svg {
    animation: acilisKenar .5s ease-in-out 1.9s both;
}

/* Atlama (tıklama / dokunma / tuş): hemen çekil. Ayrı ad, böylece baştan başlar. */
.acilis-perde.acilis-atla {
    animation: acilisAtla .42s cubic-bezier(.7, 0, .25, 1) both;
    pointer-events: none;
}
.acilis-atla .acilis-orta {
    animation: acilisGit .22s ease both;
}
.acilis-atla .acilis-kenar svg {
    animation: acilisKenar .42s ease-in-out both;
}

@keyframes acilisCiz {
    0% { stroke-dashoffset: 1; opacity: 0; }
    8% { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes acilisDol {
    from { transform: translateY(516px); }
    to { transform: translateY(430px); }
}
@keyframes acilisKay {
    from { transform: translateX(0); }
    to { transform: translateX(-115px); }
}
@keyframes acilisKayTers {
    from { transform: translateX(-115px); }
    to { transform: translateX(0); }
}
@keyframes acilisKabarcik {
    0% { transform: translateY(0); opacity: 0; }
    20% { opacity: .85; }
    100% { transform: translateY(-46px); opacity: 0; }
}
@keyframes acilisUzak {
    from { transform: translate(-7.66%, 2.375%) scale(1.9); }
    to { transform: translate(0, 0) scale(1); }
}
@keyframes acilisGel {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes acilisGit {
    to { opacity: 0; }
}
@keyframes acilisCikis {
    from { transform: translateY(0); }
    to { transform: translateY(calc(-100% - 110px)); visibility: hidden; }
}
@keyframes acilisAtla {
    from { transform: translateY(0); }
    to { transform: translateY(calc(-100% - 110px)); visibility: hidden; }
}
@keyframes acilisKenar {
    from { transform: translateX(-4%); }
    to { transform: translateX(4%); }
}

/* Hareketi azalt: hiç perde yok, içerik hemen görünür */
@media (prefers-reduced-motion: reduce) {
    .acilis-perde { display: none !important; }
    html.acilis-var body > :not(.acilis-perde) { opacity: 1 !important; }
    html.acilis-kilit { overflow: visible !important; }
}

/* Yazdırmada görünmez */
@media print {
    .acilis-perde { display: none !important; }
    html.acilis-var body > :not(.acilis-perde) { opacity: 1 !important; }
}
