/* ==========================================================
   AÇILIŞ BÖLÜMÜ — mobil öncelikli
   Renkler videodaki İstanbul gün batımından alındı.
   ========================================================== */

:root {
  --gece: #2b2438;          /* alacakaranlık moru */
  --krem: #fff4e2;          /* sıcak krem */
  --altin: #ffd9a0;         /* gün batımı altını */
  --seftali: #ffb98a;       /* şeftali / turuncu ışık */
  --golge: rgba(43, 28, 48, .45);

  --yazi-el: "Great Vibes", "Segoe Script", cursive;
  --yazi-serif: "Cormorant Garamond", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--gece);
  overflow: hidden;                 /* şimdilik tek bölüm var */
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Sahne ---------- */

.acilis {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  background: var(--gece);
}

/* Telefonda tüm ekran; geniş ekranda ortalanmış 9:16 dikey çerçeve */
.acilis__sahne {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: calc(100dvh * 9 / 16);
  overflow: hidden;
  container-type: inline-size;
  /* video bitince son karenin kaybolmaması için güvence */
  background: var(--gece) url("../img/acilis-son-kare.jpg") center / cover no-repeat;
}

@media (max-aspect-ratio: 9/16) {
  .acilis__sahne { max-width: none; }
}

.acilis__video,
.acilis__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.acilis__video {
  background: #000;
  pointer-events: none;             /* dokununca kontrol çıkmasın */
  opacity: 0;
}
.acilis.oynuyor .acilis__video,
.acilis.bitti .acilis__video { opacity: 1; }

.acilis__video::-webkit-media-controls,
.acilis__video::-webkit-media-controls-enclosure,
.acilis__video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

/* ---------- Kapak: poster + buton ---------- */

.acilis__kapak {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: #000;
  transition: opacity .9s ease, visibility 0s linear .9s;
}

.acilis__kapak::after {             /* butonu öne çıkaran yumuşak karartma */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 45% at 50% 50%, rgba(43, 28, 48, .38), transparent 70%),
    linear-gradient(to bottom, rgba(43, 28, 48, .25), transparent 30%, transparent 70%, rgba(43, 28, 48, .35));
  pointer-events: none;
}

.acilis.oynuyor .acilis__kapak,
.acilis.bitti .acilis__kapak {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.acilis__buton {
  position: relative;
  z-index: 1;
  padding: 17px 38px 16px;
  border: 1px solid rgba(255, 233, 200, .75);
  border-radius: 999px;
  background: rgba(255, 244, 226, .12);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  color: var(--krem);
  font-family: var(--yazi-serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .26em;
  text-indent: .26em;               /* harf aralığını optik olarak ortala */
  text-transform: uppercase;
  text-shadow: 0 1px 8px var(--golge);
  box-shadow:
    0 10px 40px rgba(43, 28, 48, .35),
    inset 0 0 22px rgba(255, 217, 160, .12);
  cursor: pointer;
  transition: transform .25s ease, background .25s ease, opacity .4s ease;
  animation: buton-gelis 1.4s .3s both cubic-bezier(.2, .7, .2, 1);
}

.acilis__buton::before {            /* nefes alan ince halka */
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  border: 1px solid rgba(255, 217, 160, .55);
  animation: halka 3.2s ease-out infinite 1.6s;
  opacity: 0;
  pointer-events: none;
}

.acilis__buton:active { transform: scale(.97); background: rgba(255, 244, 226, .2); }
.acilis__buton:focus-visible { outline: 2px solid var(--altin); outline-offset: 6px; }
.acilis__buton[disabled] { opacity: .6; }

@media (hover: hover) {
  .acilis__buton:hover { background: rgba(255, 244, 226, .2); }
}

@keyframes buton-gelis {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes halka {
  0%   { opacity: .8; transform: scale(1); }
  70%  { opacity: 0;  transform: scale(1.14, 1.4); }
  100% { opacity: 0;  transform: scale(1.14, 1.4); }
}

/* ---------- Karşılama: Hoş Geldiniz ---------- */

.acilis__karsilama {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  visibility: hidden;
}
.acilis.selam .acilis__karsilama { visibility: visible; }

.acilis__hosgeldiniz {
  position: absolute;
  top: 27%;
  left: 50%;
  width: max-content;
  max-width: 94%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.acilis__hosgeldiniz::before {      /* yazının arkasında çok hafif sıcak hale */
  content: "";
  position: absolute;
  inset: -40% -18%;
  background: radial-gradient(ellipse at center, rgba(43, 28, 48, .30), transparent 68%);
  z-index: -1;
}

.acilis__hosgeldiniz h1 {
  margin: 0;
  padding: .15em .2em .25em;
  font-family: var(--yazi-el);
  font-weight: 400;
  font-size: clamp(54px, 16.5vw, 84px);
  font-size: clamp(28px, 16.5cqw, 84px);   /* sahne genişliğine göre */
  line-height: 1.1;
  white-space: nowrap;
  color: var(--krem);
  background: linear-gradient(100deg,
    var(--krem) 0%, var(--krem) 38%,
    #ffffff 48%, var(--altin) 54%,
    var(--krem) 64%, var(--krem) 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 0 14px rgba(255, 190, 130, .55))
    drop-shadow(0 2px 5px rgba(43, 28, 48, .45));
}

.acilis.selam .acilis__hosgeldiniz {
  animation: yazi-belir 3.6s 0s both cubic-bezier(.4, 0, .2, 1);
}
.acilis.selam .acilis__hosgeldiniz h1 {
  animation: isilti 6s 3.2s ease-in-out infinite;
}

@keyframes yazi-belir {
  0%   { opacity: 0; filter: blur(10px); transform: translate(-50%, -45%) scale(.985); }
  75%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; filter: blur(0);    transform: translate(-50%, -50%) scale(1); }
}
@keyframes isilti {
  0%        { background-position: 100% 0; }
  45%, 100% { background-position: 0% 0; }
}

/* küçük yıldız pırıltıları */
.pirilti {
  position: absolute;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #fff 0%, var(--altin) 45%, transparent 70%);
  -webkit-clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  opacity: 0;
  transform: scale(.3);
}
.acilis.selam .pirilti { animation: pirilti 3.4s ease-in-out infinite; }

.p1 { top: 6%;  left: 4%;   animation-delay: 2.2s !important; }
.p2 { top: -4%; left: 46%;  width: 9px;  height: 9px;  animation-delay: 3.1s !important; }
.p3 { top: 14%; right: 2%;  width: 14px; height: 14px; animation-delay: 2.6s !important; }
.p4 { bottom: 4%;  left: 20%;  width: 8px;  height: 8px;  animation-delay: 4.0s !important; }
.p5 { bottom: -2%; right: 24%; animation-delay: 3.5s !important; }
.p6 { top: 46%; right: -3%; width: 8px; height: 8px; animation-delay: 4.6s !important; }

@keyframes pirilti {
  0%, 100% { opacity: 0;  transform: scale(.3) rotate(0deg); }
  50%      { opacity: .95; transform: scale(1) rotate(45deg); }
}

/* ---------- Aşağı kaydırma göstergesi ---------- */

.acilis__kaydir {
  position: absolute;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
}
.acilis.selam .acilis__kaydir { animation: kaydir-belir 1.4s 3s both ease; }

.acilis__kaydir-yazi {
  font-family: var(--yazi-serif);
  font-size: 11px;
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  color: var(--krem);
  text-shadow: 0 1px 6px rgba(43, 28, 48, .8);
}

.acilis__kaydir-cizgi {
  position: relative;
  width: 2px;
  height: 40px;
  border-radius: 2px;
  background: rgba(255, 244, 226, .45);
  box-shadow: 0 0 6px rgba(43, 28, 48, .55);
  overflow: hidden;
}
.acilis__kaydir::after {             /* küçük ok ucu */
  content: "";
  width: 9px;
  height: 9px;
  margin-top: -14px;
  border-right: 2px solid var(--krem);
  border-bottom: 2px solid var(--krem);
  transform: rotate(45deg);
  filter: drop-shadow(0 0 4px rgba(43, 28, 48, .7));
  animation: ok-zipla 2s ease-in-out infinite;
}
@keyframes ok-zipla {
  0%, 100% { transform: translateY(0) rotate(45deg); opacity: .6; }
  50%      { transform: translateY(5px) rotate(45deg); opacity: 1; }
}
.acilis__kaydir-cizgi::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 45%;
  background: linear-gradient(to bottom, transparent, var(--krem));
  animation: kaydir-ak 2s cubic-bezier(.6, 0, .3, 1) infinite;
}

@keyframes kaydir-belir {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes kaydir-ak {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(230%); }
}

/* ---------- Hareket azaltma tercihi ---------- */

@media (prefers-reduced-motion: reduce) {
  .acilis__buton::before,
  .pirilti,
  .acilis__kaydir::after,
  .acilis__kaydir-cizgi::after { animation: none !important; }
  .acilis.selam .acilis__hosgeldiniz h1 { animation: none; }
  .acilis.selam .acilis__hosgeldiniz { animation-duration: .8s; }
}
