/* ════════════════════════════════════════════════════════════════
   cover.css — GİRİŞ EŞİĞİ v3 · "KİTAP AÇILIŞI" (book-opening)
   Motor LOCK kapsamı DIŞINDADIR. Yalnızca giriş katmanı.

   Kapalı bir cilt durur (gerçekçi kalınlık, sırt, zemin gölgesi, ayraç,
   köşe kıvrımı). Dokun/tıkla → kapak sırttan açılır, ilk sayfa çevrilir,
   içeriden ışık sızar; ardından eşik solar ve kodeks (içeride) belirir.

   Tümü CSS geçişi/transform (rAF döngüsü yok, parallax yok, GPU suistimali
   yok, CLS yok). prefers-reduced-motion'da animasyon kapalı, anında geçiş.
   Davet METİNSİZ: küçük bir açık-kitap simgesi (5 kitapta ortak).
   ════════════════════════════════════════════════════════════════ */

.cover-gate {
    position: fixed; inset: 0; z-index: 300;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: clamp(1rem, 3.4vh, 2.1rem);
    padding: clamp(1rem, 4vh, 3rem) 1rem;
    background: radial-gradient(ellipse at 50% 40%, #1a2630 0%, #0b1116 62%, #05080b 100%);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 520ms ease, visibility 520ms;
}
/* Önce kitap açılsın, SONRA eşik solsun (gecikmeli) */
body.is-entered .cover-gate {
    opacity: 0; visibility: hidden; pointer-events: none;
    transition-delay: 660ms;
}

/* ── Kitap (buton = açma alanı; metinsiz, kapağın kendisi) ── */
.book3d {
    -webkit-appearance: none; appearance: none;
    background: none; border: 0; margin: 0; padding: 0; font: inherit; line-height: 0;
    cursor: pointer; position: relative; display: inline-block; overflow: visible;
    -webkit-tap-highlight-color: transparent;
    perspective: 2000px;                  /* açılışın 3B derinliği */
    border-radius: 2px 5px 5px 2px;
    outline: none;
}
.book3d:focus-visible { box-shadow: 0 0 0 2px rgba(205, 179, 124, 0.75); border-radius: 3px; }

/* ── Cilt gövdesi / en arka sayfa: kalınlık (sağ yaprak bloğu) + zemin
   gölgesi BURADA durur; açılırken kıpırdamaz (gerçekçi kalınlık hissi) ── */
.book3d__inside {
    position: absolute; inset: 0; z-index: 0;
    border-radius: 2px 5px 5px 2px;
    background: linear-gradient(100deg, #e7dabe 0%, #f3ead4 22%, #e4d6b8 68%, #d3c4a2 100%);
    box-shadow:
        3px 0 0 -1px #cdc1a4, 6px 0 0 -1px #c0b395, 9px 0 0 -1px #b3a687,
        12px 0 0 -1px #a69979, 14px 2px 0 -2px #8f8264,
        0 30px 55px -18px rgba(0, 0, 0, 0.78), 0 10px 22px -12px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}
/* Işık sızması: sırt tarafından (sol) içeriye dolan aydınlık */
.book3d__inside::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 52%;
    background: linear-gradient(90deg, rgba(255, 245, 218, 0.92), rgba(255, 245, 218, 0) 100%);
    opacity: 0;
    transition: opacity 760ms ease; transition-delay: 200ms;
}
body.is-entered .book3d__inside::before { opacity: 0.9; }

/* ── İlk sayfa: kapaktan sonra, sırttan çevrilir (doğal sayfa dönüşü) ── */
.book3d__page {
    position: absolute; inset: 0; z-index: 1;
    border-radius: 2px 5px 5px 2px;
    background: linear-gradient(100deg, #efe6d0, #e6d8bc 60%, #d6c8a6);
    box-shadow: inset 0 0 34px rgba(120, 100, 60, 0.14);
    transform-origin: left center;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    transition: transform 720ms cubic-bezier(0.40, 0.05, 0.20, 1);
    transition-delay: 300ms;
    will-change: transform;
}
body.is-entered .book3d__page { transform: rotateY(-76deg); }

/* ── Ön kapak: sırttan açılır (kapağı aralama) ── */
.book3d__leaf {
    position: relative; z-index: 2;
    transform-origin: left center;
    transform-style: preserve-3d;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    transition: transform 820ms cubic-bezier(0.40, 0.05, 0.20, 1);
    will-change: transform;
}
body.is-entered .book3d__leaf { transform: rotateY(-84deg); }

.book3d__cover {
    display: block; width: auto; height: auto;
    max-block-size: 78vh; max-inline-size: 86vw;
    border-radius: 2px 5px 5px 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.40);   /* ince çerçeve */
}

/* ── Sırt: sol kenar cilt kıvrımı (kapağın üstünde) ── */
.book3d__spine {
    position: absolute; top: 0; bottom: 0; left: 0; width: 6.5%;
    border-radius: 2px 0 0 2px;
    background: linear-gradient(90deg, rgba(0,0,0,0.46), rgba(0,0,0,0.14) 42%, rgba(0,0,0,0) 80%);
    pointer-events: none;
}
.book3d__spine::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 16%; width: 1px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.10) 50%, transparent);
}

/* ── Ayraç şeridi: ciltten sarkar; açılırken usulca solar ── */
.book3d__ribbon {
    position: absolute; z-index: 3; top: -9px; left: 35%;
    width: 12px; height: calc(100% + 56px);
    background: linear-gradient(180deg, #813434, #5f2525 58%, #491c1c);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 11px), 50% 100%, 0 calc(100% - 11px));
    pointer-events: none;
    transition: opacity 280ms ease;
}

/* ── Sayfa-kıvrımı ipucu: alt-sağ köşe (kapakta) ── */
.book3d__peel {
    position: absolute; right: 0; bottom: 0; width: 24px; height: 24px;
    background: linear-gradient(135deg, rgba(0,0,0,0) 50%, #efe7d4 50%);
    border-bottom-right-radius: 5px;
    box-shadow: -3px -3px 7px rgba(0, 0, 0, 0.40);
    transition: width 260ms ease, height 260ms ease, opacity 280ms ease;
    pointer-events: none;
}
.book3d:hover .book3d__peel,
.book3d:focus-visible .book3d__peel { width: 40px; height: 40px; }

/* Açılış başlayınca kapalı-kitap işaretleri (ayraç/kıvrım/ipucu) çekilir */
body.is-entered .book3d__ribbon,
body.is-entered .book3d__peel,
body.is-entered .cover-gate__cue { opacity: 0; }

/* ── METİNSİZ davet: küçük açık-kitap simgesi (5 kitapta ortak) ── */
.cover-gate__cue {
    color: rgba(216, 200, 150, 0.5);
    line-height: 0;
    transition: color 240ms ease, transform 240ms ease;
}
.cover-gate:hover .cover-gate__cue { color: rgba(240, 220, 166, 0.9); transform: translateY(2px); }
.cover-gate__cue svg { display: block; }

/* ── Hareketi azalt: animasyon yok, anında geçiş ── */
@media (prefers-reduced-motion: reduce) {
    .cover-gate, .book3d__leaf, .book3d__page, .book3d__inside::before,
    .book3d__ribbon, .book3d__peel, .cover-gate__cue {
        transition: opacity 1ms, visibility 1ms;
    }
    body.is-entered .cover-gate { transition-delay: 0ms; }
    body.is-entered .book3d__leaf, body.is-entered .book3d__page { transform: none; }
}

/* ── Çok kısa ekranlar ── */
@media (max-height: 600px) { .book3d__cover { max-block-size: 70vh; } }
