/* ================= açılış (acilis.js) ================= */
/* --ac-sol: yazıların sol boşluğu; --ac-cubuk: sağdaki bölüm çubuğunun kapladığı genişlik (kenar + kapsül);
   --ac-sag: çubuğun soluna yaslanan öğelerin (kat sayacı, sağdaki yazılar) sağ boşluğu, çubukla arada en az 28 px */
#acilis { --ac-sol: clamp(24px, 6vw, 96px); --ac-cubuk: calc(clamp(14px, 2.4vw, 34px) + 48px); --ac-sag: calc(var(--ac-cubuk) + 28px); --ac-alt: clamp(64px, 11vh, 120px);
  position: fixed; inset: 0; z-index: 90; background: var(--gece-2); color: #fff; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; transition: opacity .9s ease, visibility 0s .9s; }
#acilis.bitti { opacity: 0; visibility: hidden; pointer-events: none; }
/* kapanırken yazılar önce çekilir, görüntü erir */
#acilis.bitti .ac-metinler, #acilis.bitti .ac-ust, #acilis.bitti .ac-ilerleme, #acilis.bitti .ac-bolum-ad, #acilis.bitti .ac-etiketler, #acilis.bitti .ac-cizgiler, #acilis.bitti .ac-kat { opacity: 0; transition: opacity .3s ease; }
.ac-tuval { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.1s ease; }
/* görüntünün tamamı karartılmaz: yalnız üstte marka ve düğmeler için ince bir bant; yazının arkasındaki gölge yazıyla gelir (.ac-metin::before) */
.ac-perde { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.1s ease;
  background: linear-gradient(to bottom, rgba(4, 17, 29, .42), rgba(4, 17, 29, 0) 130px); }
#acilis[data-adim="sahne"] .ac-tuval, #acilis[data-adim="sahne"] .ac-perde { opacity: 1; }
#acilis[data-adim="kart"].kare-var .ac-tuval { opacity: .28; }

/* ortaklık kartı */
.ac-kredi { position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; pointer-events: none; transition: opacity .7s ease, transform .9s var(--cik); }
.ac-logolar { display: flex; align-items: center; gap: clamp(20px, 4vw, 56px); }
.ac-logolar img { height: clamp(34px, 5.2vw, 64px); width: auto; opacity: 0; transform: translateY(14px); transition: opacity .9s ease, transform 1.1s var(--cik); }
.ac-logolar img:last-child { transition-delay: .25s; }
.ac-carpi { position: relative; width: 26px; height: 26px; }
.ac-carpi::before, .ac-carpi::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 1px; background: var(--altin); transform: translate(-50%, -50%) rotate(45deg) scaleX(0); transition: transform .7s var(--cik) .45s; }
.ac-carpi::after { transform: translate(-50%, -50%) rotate(-45deg) scaleX(0); transition-delay: .6s; }
.ac-kredi p { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.2vw, 30px); color: var(--altin-acik); opacity: 0; transition: opacity .9s ease .8s; }
#acilis[data-adim] .ac-logolar img { opacity: 1; transform: none; }
#acilis[data-adim] .ac-carpi::before { transform: translate(-50%, -50%) rotate(45deg) scaleX(1); }
#acilis[data-adim] .ac-carpi::after { transform: translate(-50%, -50%) rotate(-45deg) scaleX(1); }
#acilis[data-adim] .ac-kredi p { opacity: 1; }
#acilis[data-adim="sahne"] .ac-kredi { opacity: 0; transform: translateY(-24px); }

/* üst: marka, Bilgi al ve Geç (her bölümde) */
.ac-ust { position: absolute; left: 0; right: 0; top: 0; z-index: 7; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px clamp(20px, 3.4vw, 48px); }
.ac-marka { height: 28px; width: auto; opacity: 0; transition: opacity .8s ease .3s; }
#acilis[data-adim="sahne"] .ac-marka { opacity: 1; }
.ac-ust-eylem { display: flex; align-items: center; gap: 10px; }
#ac-bilgi { min-height: 44px; padding: 0 20px; }
#ac-gec { min-height: 44px; padding: 0 20px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px; font-size: 14px; color: #fff; background: rgba(4, 17, 29, .32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .25s ease, color .25s ease; }
#ac-gec:hover { background: #fff; color: var(--gece); }

/* bölüm yazıları: her bölümde o karenin boş yerine (bilgisayarda aşağıdaki bölüm kuralları), kamera durulurken gelir */
.ac-metinler { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.ac-metin { position: absolute; left: var(--ac-sol); bottom: var(--ac-alt); max-width: min(calc(100% - var(--ac-sol) - 200px), 780px); isolation: isolate; opacity: 0; visibility: hidden; transform: translateY(16px); transition: opacity .6s ease, transform .9s var(--cik), visibility 0s .6s; }
.ac-metin.gor { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .8s ease .15s, transform 1s var(--cik) .15s, visibility 0s; }
/* yazının gölgesi: görüntünün geri kalanı aydınlık kalır */
.ac-metin::before { content: ""; position: absolute; z-index: -1; inset: -64px -84px -56px -84px; border-radius: 48px; background: rgba(4, 17, 29, .58); filter: blur(44px); pointer-events: none; }
.ac-metin h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 8vw, 128px); line-height: .92; letter-spacing: -.02em; max-width: 9em; text-wrap: balance; text-shadow: 0 2px 24px rgba(4, 17, 29, .35); }
.ac-metin h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 80px); line-height: .98; letter-spacing: -.015em; max-width: 11em; text-wrap: balance; text-shadow: 0 2px 24px rgba(4, 17, 29, .35); }
.ac-metin p { margin-top: 14px; font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, .9); max-width: 34em; text-shadow: 0 1px 12px rgba(4, 17, 29, .5); }
.ac-metin[data-bolum="karsilama"] p:not(.ac-kaydir) { color: var(--fildisi); font-size: 17px; }
.ac-kaydir { display: flex; align-items: center; gap: 14px; margin-top: 30px !important; font-size: 13.5px !important; color: rgba(255, 255, 255, .88) !important; }
.ac-kaydir span { position: relative; width: 1px; height: 36px; overflow: hidden; background: rgba(255, 255, 255, .26); }
.ac-kaydir span::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: #fff; animation: ac-kay 1.8s var(--egri) infinite; }
@keyframes ac-kay { to { top: 100%; } }
.ac-eylem { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.ac-eylem .dugme.hafif { color: #fff; border-color: rgba(255, 255, 255, .7); }

/* etiketler: noktadan çizgiyle yazıya */
.ac-cizgiler { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ac-cizgi { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .6s var(--cik), opacity .3s ease; }
.ac-cizgi.gor { stroke-dashoffset: 0; opacity: 1; }
.ac-nokta { fill: #fff; stroke: rgba(255, 255, 255, .28); stroke-width: 7; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.3); transition: opacity .3s ease, transform .45s var(--cik); }
.ac-nokta.gor { opacity: 1; transform: none; }
.ac-etiketler { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ac-etiket { position: absolute; left: 0; top: 0; margin: 0; padding: 6px 11px 7px; background: rgba(4, 17, 29, .76); border-left: 2px solid var(--altin); font-size: 13.5px; font-weight: 500; line-height: 1.3; white-space: nowrap; opacity: 0; transition: opacity .35s ease; }
.ac-etiket.gor { opacity: 1; transition-delay: .28s; }

/* lobiden yükselişe: asansör kapısı */
.ac-kapi { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: none; }
#acilis.kapida .ac-kapi { display: block; }
.ac-kapi span { position: absolute; top: 0; bottom: 0; width: 50.4%; background: #0b1c2b; will-change: transform; }
.ac-kapi-sol { left: 0; box-shadow: inset -1px 0 rgba(226, 201, 143, .55); }
.ac-kapi-sag { right: 0; box-shadow: inset 1px 0 rgba(226, 201, 143, .55); }

/* yükselişte kat sayacı */
.ac-kat { position: absolute; z-index: 4; right: var(--ac-sag); top: 50%; display: flex; align-items: baseline; gap: 12px; opacity: 0; transform: translateY(-50%); transition: opacity .5s ease; pointer-events: none; text-shadow: 0 2px 30px rgba(4, 17, 29, .4); }
.ac-kat.gor { opacity: 1; }
#ac-kat-sayi { font-family: var(--serif); font-size: clamp(110px, 13vw, 200px); line-height: .8; letter-spacing: -.03em; min-width: 1.1em; text-align: right; }
.ac-kat small { font-size: 15px; color: var(--altin-acik); }

/* sağda bölüm ilerlemesi (gökyüzünde de okunsun diye ince koyu kapsül), köşede bölüm adı */
.ac-ilerleme { position: absolute; z-index: 5; right: clamp(14px, 2.4vw, 34px); top: 50%; transform: translateY(-50%); display: grid; width: 48px; padding: 8px 0; border-radius: 999px; background: rgba(4, 17, 29, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity .8s ease .4s; }
#acilis[data-adim="sahne"] .ac-ilerleme, #acilis[data-adim="sahne"] .ac-bolum-ad { opacity: 1; }
.ac-iz { position: absolute; left: 12px; top: 28px; bottom: 28px; width: 1px; background: rgba(255, 255, 255, .3); }
.ac-iz-dolu { position: absolute; left: 0; top: 0; width: 1px; height: calc(var(--dolu, 0) * 100%); background: var(--altin); }
.ac-sira { min-width: 48px; min-height: 40px; padding: 0 0 0 20px; text-align: left; font-size: 12.5px; font-weight: 500; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .8); transition: color .3s ease; }
.ac-sira:hover { color: #fff; }
.ac-sira.secili { color: var(--altin-acik); }
.ac-bolum-ad { position: absolute; z-index: 5; right: clamp(14px, 2.4vw, 34px); bottom: 26px; isolation: isolate; font-family: var(--serif); font-size: 22px; color: #fff; text-shadow: 0 1px 14px rgba(4, 17, 29, .85), 0 0 2px rgba(4, 17, 29, .6); opacity: 0; transition: opacity .8s ease .4s; }
.ac-bolum-ad::before { content: ""; position: absolute; z-index: -1; inset: -18px -26px; border-radius: 30px; background: rgba(4, 17, 29, .5); filter: blur(16px); }

/* bilgisayar: her bölümün yazısı o karenin boş gökyüzünde (kareler 16:9, ekran genişliğine oturur; kule karşılamada
   genişliğin %35'inden, caddede %34'ünden başlar, yükseliş ve kapanışta %64'e kadar uzanır) */
@media (min-width: 821px) {
  .ac-metin[data-bolum="karsilama"] h1 { font-size: clamp(46px, 5.4vw, 112px); max-width: 6.2em; }
  .ac-metin[data-bolum="cadde"] { bottom: auto; top: calc(96px + 4vh); max-width: min(30vw, 520px); }
  .ac-metin[data-bolum="cadde"] h2 { font-size: clamp(36px, 4.4vw, 76px); }
  /* yükseliş: kat sayacı ve altında yazı sağdaki gökyüzünde, sağa yaslı */
  #acilis[data-bolum="yukselis"] .ac-kat { top: 17%; transform: none; }
  .ac-metin[data-bolum="yukselis"] { left: auto; right: var(--ac-sag); bottom: auto; top: calc(17% + clamp(110px, 13vw, 200px) * .8 + 28px); max-width: min(28vw, 400px); text-align: right; }
  .ac-metin[data-bolum="yukselis"] h2, .ac-metin[data-bolum="yukselis"] p { margin-left: auto; }
  .ac-metin[data-bolum="yukselis"] p { max-width: 17em; }
  .ac-metin[data-bolum="yukselis"]::before { background: rgba(4, 17, 29, .66); }
  /* kapanış: kulenin sağındaki gece gökyüzü */
  .ac-metin[data-bolum="kapanis"] { left: 67%; bottom: auto; top: 36%; max-width: min(27vw, 460px); }
}

@media (max-width: 820px) {
  /* telefon: kule her karede ekranı dolduruyor; yazı alttaki koyu bandın üstünde, görüntünün üst yarısı aydınlık */
  #acilis { --ac-sol: 20px; --ac-cubuk: 38px; --ac-sag: calc(var(--ac-cubuk) + 28px); --ac-alt: calc(env(safe-area-inset-bottom, 0px) + 58px); }
  .ac-perde { background: linear-gradient(to bottom, rgba(4, 17, 29, .42), rgba(4, 17, 29, 0) 110px); }
  .ac-perde::before, .ac-perde::after { content: ""; position: absolute; inset: 0; pointer-events: none; transition: opacity .8s ease; }
  .ac-perde::before { background: linear-gradient(to top, rgba(4, 17, 29, .93), rgba(4, 17, 29, .86) 34%, rgba(4, 17, 29, .5) 46%, rgba(4, 17, 29, 0) 60%); opacity: 1; }
  .ac-perde::after { background: linear-gradient(to top, rgba(4, 17, 29, .55), rgba(4, 17, 29, 0) 22%); opacity: 0; }
  #acilis.yazisiz .ac-perde::before { opacity: 0; }
  #acilis.yazisiz .ac-perde::after { opacity: 1; }
  .ac-metin { max-width: none; right: 54px; }
  .ac-metin::before { display: none; }
  .ac-ust { padding: 12px 14px; }
  .ac-marka { height: 22px; }
  .ac-ust-eylem { gap: 8px; }
  #ac-bilgi, #ac-gec { min-height: 40px; padding: 0 16px; font-size: 13.5px; }
  .ac-metin h1 { font-size: clamp(46px, 13vw, 66px); }
  .ac-metin h2 { font-size: clamp(36px, 10.4vw, 54px); }
  .ac-metin p { font-size: 15px; }
  .ac-eylem .dugme { flex: 1 1 140px; }
  .ac-ilerleme { right: 4px; width: 34px; padding: 6px 0; background: rgba(4, 17, 29, .42); }
  .ac-iz { left: 9px; top: 20px; bottom: 20px; }
  .ac-iz-dolu { left: 0; }
  .ac-sira { min-width: 34px; min-height: 34px; padding: 0; font-size: 0; }
  .ac-sira::before { content: ""; display: block; width: 7px; height: 1px; margin-left: 6px; background: currentColor; }
  .ac-sira.secili::before { width: 12px; }
  .ac-bolum-ad { display: none; }
  .ac-kat { top: 15%; transform: none; }
  #ac-kat-sayi { font-size: 104px; }
  .ac-etiket { font-size: 12.5px; padding: 5px 9px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .ac-kaydir span::after { animation: none; top: 0; height: 100%; opacity: .5; }
  .ac-metin, .ac-metin.gor { transform: none; }
}
