/* =====================================================================
   SANA BİR MEKTUP — Özür Dileme Deneyimi
   Tasarım sistemi · Mobil öncelikli
   Bu dosyayı DEĞİŞTİRMENE GEREK YOK. İçerik: js/icerik.js
   ===================================================================== */

/* ---------- Tokenlar ---------- */
:root {
  /* Kâğıt / zemin */
  --kagit:      #faf5ee;
  --kagit-2:    #f4eadc;
  --kagit-3:    #ecdfcd;

  /* Gül mürekkebi */
  --gul:        #7d2b3e;
  --gul-koyu:   #591d29;
  --gul-acik:   #a84a5e;
  --pudra:      #e7c3ca;

  /* Altın varak */
  --altin:      #bd9a55;
  --altin-acik: #dcc188;

  /* Metin */
  --murekkep:       #3a2a2e;
  --murekkep-hafif: #715d61;

  /* Gölge */
  --golge-yumusak: 0 18px 50px -20px rgba(89, 29, 41, .35);
  --golge-kart:    0 12px 34px -16px rgba(89, 29, 41, .40);

  /* Tipografi */
  --f-baslik: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-yazi:   "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-elyazi: "Dancing Script", "Segoe Script", cursive;

  --olcu: min(92vw, 640px);
  --olcu-genis: min(94vw, 1040px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden özniteliği her zaman kazansın (display:flex/grid tanımlayan kurallar ezmesin) */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Bölüm bölüm kaydırma: her sahne net biçimde kilitlenir */
  scroll-snap-type: y mandatory;
}

/* "Aç" butonuna basılana kadar sayfa hiç kaydırılamaz; diğer sahneler görünmez kalır */
html.mektup-kilit,
html.mektup-kilit body {
  overflow: hidden;
  height: 100%;
  touch-action: none;
  overscroll-behavior: none;
}

body {
  font-family: var(--f-yazi);
  color: var(--murekkep);
  line-height: 1.7;
  background:
    radial-gradient(120% 80% at 50% -10%, #fff9f1 0%, var(--kagit) 42%, var(--kagit-2) 100%);
  background-attachment: fixed;
  min-height: 100svh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Kâğıt grain dokusu — çok hafif */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--pudra); color: var(--gul-koyu); }

:focus-visible { outline: 2px solid var(--gul); outline-offset: 3px; border-radius: 4px; }

/* ---------- Canvas katmanları ---------- */
#yapraklar {
  position: fixed; inset: 0; z-index: 2;
  pointer-events: none;
}
#konfeti {
  position: fixed; inset: 0; z-index: 60;
  pointer-events: none;
}

/* ============================================================
   MÜHÜR / PIN KAPISI
   ============================================================ */
.perde {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  background:
    radial-gradient(130% 90% at 50% 25%, #fff8ef 0%, #f2e4d3 55%, #e6d3bd 100%);
  transition: opacity .9s ease, visibility .9s;
}
.perde.gizle { opacity: 0; visibility: hidden; }

.muhur-alan { text-align: center; max-width: 420px; }

.perde-ustyazi,
.ustyazi {
  font-size: .78rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--altin);
  font-weight: 500;
  margin-bottom: 1.4rem;
}

/* ---- Zarf (mühür artık zarfın kapak ucunda duruyor) ---- */
.zarf {
  position: relative;
  width: min(80vw, 300px);
  aspect-ratio: 3 / 2;
  margin: 0 auto 2.1rem;
  perspective: 900px;
}
.zarf-govde {
  position: absolute; inset: 0;
  border-radius: 6px;
  background: linear-gradient(160deg, #fdf1de, var(--kagit-3) 55%, #e2ceb0);
  box-shadow:
    var(--golge-yumusak),
    inset 0 0 0 1.5px rgba(189,154,85,.55);
  overflow: hidden;
  z-index: 1;
}
/* Zarfın içindeki katlama izleri (sol/sağ/alt kapaklar) — kâğıdın gerçek bir zarf gibi görünmesini sağlar */
.zarf-govde::before,
.zarf-govde::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(125,43,62,.05), rgba(125,43,62,.1));
}
.zarf-govde::before { clip-path: polygon(0 0, 50% 42%, 0 100%); }
.zarf-govde::after  { clip-path: polygon(100% 0, 50% 42%, 100% 100%); }

.zarf-kapak {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 58%;
  background: linear-gradient(165deg, #fffaf0, var(--kagit-3) 60%, #dfc9a8);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 12px 20px -14px rgba(89,29,41,.45);
  border-radius: 4px 4px 0 0;
  transform-origin: 50% 0%;
  transform-style: preserve-3d;
  transition: transform .75s cubic-bezier(.5,0,.2,1), opacity .5s ease .1s;
  z-index: 3;
}
.zarf:has(.muhur.kir) .zarf-kapak {
  transform: rotateX(-165deg);
  opacity: 0;
}

/* Balmumu mühür — zarfın kapağının uç (kapanma) noktasında */
.muhur {
  width: 92px; height: 92px;
  position: absolute;
  top: 58%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  animation: muhurNabiz 3.4s ease-in-out infinite;
}
.muhur.kir { animation: none; }

.muhur-govde {
  position: absolute; inset: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 34% 30%, var(--gul-acik), var(--gul) 45%, var(--gul-koyu) 100%);
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,.28),
    inset 0 -8px 16px rgba(0,0,0,.35),
    var(--golge-yumusak);
  overflow: hidden;
}
.muhur-govde::before {
  content: "";
  position: absolute; inset: 8px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255,255,255,.42);
}
.muhur-harf {
  font-family: var(--f-elyazi);
  font-weight: 600;
  font-size: 2.4rem;
  color: #f7e2c6;
  line-height: 1;
  text-shadow: 0 2px 3px rgba(0,0,0,.3);
  transform: translateY(2px);
}
@keyframes muhurNabiz {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.04); }
}

/* Çatlaklar — kırılmadan önce sırayla, adım adım beliriyor */
.muhur-catla {
  position: absolute; inset: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.muhur-catla.c1 {
  background-image: linear-gradient(105deg, transparent 47%, rgba(255,230,210,.85) 49%, rgba(255,230,210,.85) 51%, transparent 53%);
}
.muhur-catla.c2 {
  background-image: linear-gradient(18deg, transparent 60%, rgba(255,230,210,.75) 62%, rgba(255,230,210,.75) 63%, transparent 65%);
}
.muhur-catla.c3 {
  background-image: linear-gradient(-40deg, transparent 65%, rgba(255,230,210,.7) 67%, rgba(255,230,210,.7) 68%, transparent 70%);
}

/* Kırık parçalar — kırılınca ortaya çıkıp aşağı düşer */
.muhur-parca {
  position: absolute; inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 34% 30%, var(--gul-acik), var(--gul) 45%, var(--gul-koyu) 100%);
}
.muhur-parca.p1 { clip-path: polygon(50% 50%, 50% 0%, 100% 20%); --dx: -38px; --rot: -75deg; animation-delay: .86s; }
.muhur-parca.p2 { clip-path: polygon(50% 50%, 100% 20%, 85% 100%); --dx: 30px; --rot: 65deg; animation-delay: .9s; }
.muhur-parca.p3 { clip-path: polygon(50% 50%, 85% 100%, 15% 100%); --dx: 6px; --rot: -25deg; animation-delay: .88s; }
.muhur-parca.p4 { clip-path: polygon(50% 50%, 15% 100%, 0% 25%); --dx: -20px; --rot: 55deg; animation-delay: .93s; }
.muhur-parca.p5 { clip-path: polygon(50% 50%, 0% 25%, 50% 0%); --dx: -4px; --rot: -50deg; animation-delay: .85s; }

/* Gövde: her çatlak vuruşunda sarsılıp en sonda kırılıp kayboluyor */
.muhur.kir .muhur-govde { animation: govdeKir .85s ease-in forwards; }
@keyframes govdeKir {
  0%   { transform: scale(1) rotate(0deg); opacity: 1; }
  16%  { transform: scale(1.015) rotate(-1deg); opacity: 1; }
  30%  { transform: scale(1) rotate(0deg); opacity: 1; }
  45%  { transform: scale(1.03) rotate(-2deg); opacity: 1; }
  58%  { transform: scale(1.01) rotate(1deg); opacity: 1; }
  75%  { transform: scale(1.08) rotate(-3deg); opacity: 1; }
  100% { transform: scale(.9) rotate(4deg); opacity: 0; }
}
/* Her çizgi sırayla belirip gövdeyle birlikte söner */
.muhur.kir .muhur-catla { animation-name: catlaCizgi; animation-duration: .5s; animation-timing-function: ease; animation-fill-mode: forwards; }
.muhur.kir .muhur-catla.c1 { animation-delay: 0s; }
.muhur.kir .muhur-catla.c2 { animation-delay: .2s; }
.muhur.kir .muhur-catla.c3 { animation-delay: .4s; }
@keyframes catlaCizgi {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}
.muhur.kir .muhur-parca {
  animation-name: parcaDus;
  animation-duration: 1s;
  animation-timing-function: cubic-bezier(.55,0,.85,.35);
  animation-fill-mode: forwards;
}
@keyframes parcaDus {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  15%  { opacity: 1; transform: translate(calc(var(--dx) * .5), -5px) rotate(calc(var(--rot) * .25)) scale(1.02); }
  100% { opacity: 0; transform: translate(calc(var(--dx) * 2.6), 150px) rotate(var(--rot)) scale(.65); }
}

.perde-baslik {
  font-family: var(--f-baslik);
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  color: var(--gul-koyu);
  font-weight: 600;
  margin-bottom: .5rem;
}
.perde-alt { color: var(--murekkep-hafif); font-size: .98rem; margin-bottom: 1.8rem; }

.pin-form { display: flex; flex-direction: column; align-items: center; gap: 1.3rem; }

/* ---- Bavul kilidi tarzı 4 haneli şifre ---- */
.bavul-pin { display: flex; gap: 10px; }
.bavul-basamak {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  border-radius: 10px;
  padding: 2px;
}
.bavul-basamak:focus-visible { outline: 2px solid var(--gul); outline-offset: 3px; }
.bavul-ok {
  width: 34px; height: 22px;
  display: grid; place-items: center;
  color: var(--altin);
  font-size: .68rem;
  border-radius: 6px;
  transition: color .15s, transform .15s, background .15s;
}
.bavul-ok:hover { color: var(--gul); background: rgba(189,154,85,.14); transform: scale(1.1); }
.bavul-ok:active { transform: scale(.9); }
.bavul-rakam {
  width: 46px; height: 58px;
  display: grid; place-items: center;
  font-family: var(--f-baslik);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--gul-koyu);
  background: linear-gradient(180deg, #fffdf9, var(--kagit-3));
  border: 1.5px solid var(--altin);
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(89,29,41,.12), inset 0 -2px 4px rgba(255,255,255,.6);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  position: relative;
}
.bavul-rakam::before, .bavul-rakam::after {
  content: ""; position: absolute; left: 6px; right: 6px; height: 1px;
  background: rgba(189,154,85,.4);
}
.bavul-rakam::before { top: 8px; }
.bavul-rakam::after { bottom: 8px; }
.bavul-rakam span {
  display: inline-block;
  transition: transform .18s ease, opacity .18s ease;
}
.bavul-rakam span.giris-yukari { transform: translateY(10px); opacity: 0; }
.bavul-rakam span.giris-asagi { transform: translateY(-10px); opacity: 0; }

.pin-form.sallan { animation: sallan .45s; }
@keyframes sallan {
  10%,90% { transform: translateX(-2px); }
  30%,70% { transform: translateX(6px); }
  50%     { transform: translateX(-8px); }
}

.pin-btn, .ac-btn, .wa-btn {
  font-family: var(--f-yazi);
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff6ea;
  background: linear-gradient(160deg, var(--gul-acik), var(--gul) 55%, var(--gul-koyu));
  padding: .85rem 2.1rem;
  border-radius: 40px;
  box-shadow: var(--golge-kart);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s;
}
.pin-btn:hover, .ac-btn:hover, .wa-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.pin-btn:active, .ac-btn:active { transform: translateY(0) scale(.98); }

.pin-hata { color: var(--gul); font-size: .9rem; font-weight: 500; }

/* ============================================================
   MÜZİK OYNATICI
   ============================================================ */
.muzik-widget {
  position: fixed; z-index: 65;
  bottom: max(18px, env(safe-area-inset-bottom));
  right: 18px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.muzik-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,248,240,.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(189,154,85,.5);
  box-shadow: var(--golge-yumusak);
  transition: transform .2s;
  flex-shrink: 0;
}
.muzik-btn:hover { transform: scale(1.06); }
.muzik-ikon { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.muzik-ikon span {
  width: 3px; background: var(--gul); border-radius: 3px;
  height: 6px;
  animation: esle 1s ease-in-out infinite;
}
.muzik-ikon span:nth-child(2){ animation-delay: .2s; }
.muzik-ikon span:nth-child(3){ animation-delay: .4s; }
.muzik-ikon span:nth-child(4){ animation-delay: .6s; }
@keyframes esle { 0%,100%{ height:5px; } 50%{ height:19px; } }
/* Duraklatınca çubuklar dursun */
.muzik-btn.duraklat .muzik-ikon span { animation-play-state: paused; height: 7px; }

/* ---- Minimal oynatıcı paneli ---- */
.muzik-panel {
  width: min(78vw, 250px);
  background: rgba(255,248,240,.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(189,154,85,.5);
  border-radius: 20px;
  box-shadow: var(--golge-yumusak);
  padding: 14px 16px 16px;
  transform-origin: bottom right;
  animation: muzikPanelAc .22s ease;
}
@keyframes muzikPanelAc {
  from { opacity: 0; transform: scale(.92) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.muzik-bilgi { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.muzik-plak {
  position: relative;
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at center,
    var(--gul) 0 4px, #262022 4px 5px, #34292c 5px 9px,
    #262022 9px 10px, #34292c 10px 13px, #262022 13px 14px, #34292c 14px 17px);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  animation: plakDon 2.8s linear infinite;
  animation-play-state: paused;
}
/* Simetrik halkalar dönüşü belli etmez; ince bir ışık parlaması ekleyip
   hareketi göze görünür kılıyoruz — tasarım aynı kalıyor */
.muzik-plak::after {
  content: "";
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(255,255,255,.32) 0deg, transparent 26deg,
    transparent 334deg, rgba(255,255,255,.14) 360deg);
  pointer-events: none;
}
.muzik-plak.donuyor { animation-play-state: running; }
@keyframes plakDon { to { transform: rotate(360deg); } }
.muzik-bilgi-metin { min-width: 0; display: flex; flex-direction: column; text-align: left; }
.muzik-sarki-adi {
  font-size: .82rem; font-weight: 600; color: var(--gul-koyu);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.muzik-sanatci {
  font-size: .7rem; color: var(--murekkep-hafif);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Kontrol satırı: oynat/duraklat — süre çizgisi — ses ---- */
.muzik-ilerleme { display: flex; align-items: center; gap: 6px; }
.muzik-mini-btn {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(189,154,85,.16);
  color: var(--gul-koyu);
  transition: transform .15s, background .15s;
}
.muzik-mini-btn:hover { transform: scale(1.08); background: rgba(189,154,85,.28); }
.muzik-mini-btn .ikon-play { font-size: .5rem; margin-left: 1px; }
.muzik-mini-btn .ikon-pause { display: none; font-size: .48rem; letter-spacing: 1px; }
.muzik-mini-btn.duraklat .ikon-play { display: inline; }
.muzik-mini-btn.duraklat .ikon-pause { display: none; }
.muzik-mini-btn:not(.duraklat) .ikon-play { display: none; }
.muzik-mini-btn:not(.duraklat) .ikon-pause { display: inline; }
.muzik-ses-btn { margin-left: 2px; }
.muzik-ses-btn.acik { background: rgba(189,154,85,.32); }
.muzik-zaman {
  font-size: .64rem; color: var(--murekkep-hafif);
  font-variant-numeric: tabular-nums; min-width: 2.1em;
}
.muzik-seek {
  -webkit-appearance: none; appearance: none;
  flex: 1; min-width: 0; height: 3px; border-radius: 2px;
  background: rgba(189,154,85,.3); outline: none;
  margin-left: 2px;
}
.muzik-seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%;
  background: var(--gul); cursor: pointer; border: none;
}
.muzik-seek::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%; background: var(--gul); border: none; cursor: pointer;
}

/* ---- Ses paneli: ikona tıklayınca açılan minimal satır ---- */
.muzik-ses {
  display: flex; align-items: center;
  margin-top: 10px;
  animation: muzikSesAc .18s ease;
}
@keyframes muzikSesAc {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.muzik-ses input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 2px; border-radius: 2px;
  background: rgba(189,154,85,.3); outline: none;
}
.muzik-ses input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gul); cursor: pointer; border: none;
}
.muzik-ses input[type="range"]::-moz-range-thumb {
  width: 9px; height: 9px; border-radius: 50%; background: var(--gul); border: none; cursor: pointer;
}

/* ============================================================
   SAHNE İSKELETİ
   ============================================================ */
.mektup { position: relative; z-index: 3; }

.sahne {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5.5rem 1.4rem;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.ic { width: var(--olcu); text-align: center; }
.ic--genis { width: var(--olcu-genis); }

/* Scroll ile açılış — JS yoksa içerik zaten görünür kalır (progressive enhancement) */
.sahne .ic { transition: opacity 1s ease, transform 1s ease; }
.js .sahne .ic { opacity: 0; transform: translateY(26px); }
.sahne.gorunur .ic { opacity: 1; transform: none; }

/* ---------- Ortak tipografi ---------- */
.dev-baslik {
  font-family: var(--f-baslik);
  font-weight: 600;
  font-size: clamp(2.6rem, 12vw, 5.4rem);
  line-height: 1.02;
  color: var(--gul-koyu);
  letter-spacing: -.01em;
}
.orta-baslik {
  font-family: var(--f-baslik);
  font-weight: 600;
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: 1.12;
  color: var(--gul-koyu);
  margin-bottom: 1.4rem;
}
.metin {
  font-size: clamp(1.05rem, 3.6vw, 1.22rem);
  color: var(--murekkep);
  max-width: 34ch;
  margin: 1.3rem auto 0;
}
.metin--yazici { min-height: 1.4em; }
.metin--yazici .imlec {
  display: inline-block; width: 2px; margin-left: 1px;
  background: var(--gul-acik);
  animation: yanip 1s steps(1) infinite;
  vertical-align: -.05em;
}
@keyframes yanip { 50% { opacity: 0; } }

.isaret {
  display: block;
  font-size: 1.5rem;
  color: var(--altin);
  margin-bottom: 1rem;
}

/* ============================================================
   1 · GİRİŞ
   ============================================================ */
.giris-baslik {
  font-family: var(--f-baslik);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2rem, 8vw, 3.6rem);
  line-height: 1.2;
  color: var(--gul-koyu);
  margin: .6rem auto 2.2rem;
  max-width: 18ch;
}
.giris-baslik .isim { font-style: normal; color: var(--gul); }

/* ---- İkiye katlanmış gerçek bir kâğıt ----
   Kapalı hâlde yalnızca alt yarı (katlanmış paket) görünür; kat izi üst kenardadır.
   "Aç" denince üst yarı kat izinden yukarı doğru açılır, kâğıt ekrana yaklaşır. */
.zarf-anim {
  /* Katlanmış paket ölçüsü — açıldığında iki katı yükseklik olur */
  width: min(66vw, 236px);
  aspect-ratio: 7 / 4.6;
  margin: .5rem auto 2.4rem;
  perspective: 950px;
  perspective-origin: 50% 100%;
}
.zarf-anim-govde {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  /* elle bırakılmış gibi hafif eğik */
  transform: rotate(-1.4deg);
  transition: transform 1s cubic-bezier(.45,.05,.2,1);
}
/* Açılınca tam sayfa ortalanacak kadar aşağı kayar ve ekrana doğru gelir */
.zarf-anim.ac .zarf-anim-govde {
  transform: rotate(0deg) translateY(47%) translateZ(70px);
}

/* Kâğıt yüzeyi: sıcak beyaz, hafif dokulu */
.kagit-alt,
.kagit-yuz {
  background:
    linear-gradient(163deg, #fffdf8 0%, #fdf7ec 44%, #f5ecdc 100%);
  box-shadow:
    inset 0 0 0 1px rgba(189,154,85,.16),
    inset 0 0 26px -14px rgba(89,29,41,.14);
}

/* Alt yarı — kâğıdın iç yüzü, üzerinde yazı satırları var */
.kagit-alt {
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 100%;
  /* Kat kenarı (üst) köşesiz olmalı, yoksa açılınca iki yarı arasında boşluk okunur */
  border-radius: 0 0 4px 4px;
  box-shadow:
    inset 0 0 0 1px rgba(189,154,85,.16),
    inset 0 0 26px -14px rgba(89,29,41,.14),
    0 16px 32px -16px rgba(89,29,41,.42);
}
/* Kapalıyken üst yarının alta düşürdüğü gölge */
.kagit-alt::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(89,29,41,.22), rgba(89,29,41,0));
  transition: opacity .8s ease;
}
.zarf-anim.ac .kagit-alt::before { opacity: 0; }

/* Yazı satırları */
.kagit-alt::after,
.kagit-yuz--ic::after {
  content: "";
  position: absolute; left: 15%; right: 15%; top: 22%; bottom: 18%;
  background: repeating-linear-gradient(180deg,
    rgba(125,43,62,.16) 0 1px, transparent 1px 12px);
  opacity: .9;
}

/* Üst yarı — kat izinden dönen kapak.
   Tam ortadan değil: elle katlanmış gibi biraz kısa ve hafif yan yatmış, bu yüzden
   alt yarının bir şeridi kapağın altından görünür. */
.kagit-ust {
  position: absolute; left: 0;
  /* 1px bindirme: kat çizgisinde saç teli kadar bile aralık kalmasın */
  bottom: calc(100% - 1px);
  width: 100%; height: 91%;
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
  /* Kapalı: alt yarının üstüne katlanmış — hafif yan yatık ve kısa, tam denk gelmiyor */
  transform: rotate(1.4deg) rotateX(-177deg);
  transition: transform 1s cubic-bezier(.45,.05,.2,1);
}
/* Açıkken kat çizgisi tek bir hat olduğu için yan yatıklık sıfırlanır, kenarlar birleşir */
.zarf-anim.ac .kagit-ust { transform: rotate(0deg) rotateX(-2deg); }

.kagit-yuz {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  /* Serbest kenar yuvarlak, kat kenarı (kendi alt kenarı) köşesiz */
  border-radius: 3px 3px 0 0;
}
/* Kapalıyken bize bakan dış yüz — boş, düz kâğıt (iç yüz .kagit-yuz--ic, yazılı).
   180° çevrildiği için negatif y gölgesi ekranda aşağı, yani açıkta kalan şeride düşer. */
.kagit-yuz--dis {
  transform: rotateX(180deg);
  box-shadow:
    inset 0 0 0 1px rgba(189,154,85,.16),
    0 -7px 12px -7px rgba(89,29,41,.4);
}

/* Kat izi: alt yarının üst kenarında duran katlama çizgisi.
   İki yarıyı birleştirir; açıkken tek bir kâğıdın ortasındaki iz gibi kalır. */
.kagit-kat {
  position: absolute; left: 0; right: 0; top: -1px;
  height: 4px;
  background: linear-gradient(180deg,
    rgba(255,255,255,.85) 0%,
    rgba(148,116,64,.34) 55%,
    rgba(89,29,41,.16) 100%);
  z-index: 4;
  transition: background .8s ease, opacity .8s ease;
}
.zarf-anim.ac .kagit-kat {
  opacity: .5;
  background: linear-gradient(180deg,
    rgba(148,116,64,.10) 0%,
    rgba(148,116,64,.30) 50%,
    rgba(255,255,255,.55) 100%);
}

/* Kâğıt açılırken giriş yazıları geri çekilir */
.sahne--giris.acildi .ustyazi,
.sahne--giris.acildi .giris-baslik,
.sahne--giris.acildi .ac-btn {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
}

.ac-btn { font-size: 1.05rem; padding: .95rem 2.8rem; }

.site-alt-not {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 300px; padding: 0 16px;
  font-size: .66rem; color: var(--murekkep-hafif); opacity: .55;
  text-align: center;
}
.site-alt-not a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-alt-not a:hover { opacity: .85; }

/* ============================================================
   4 · ANILAR — kırmızı ip zaman tüneli
   ============================================================ */
.tunel {
  position: relative;
  margin-top: 2.6rem;
  padding-left: 44px;
  text-align: left;
}
.tunel .ip {
  position: absolute; top: 6px; bottom: 6px; left: 15px;
  width: 2px;
  background: linear-gradient(var(--gul-acik), var(--gul) 50%, transparent);
  opacity: .55;
}
.ani {
  position: relative;
  margin-bottom: 2.6rem;
  transform: rotate(var(--don, -1.4deg));
  transition: opacity .8s ease, transform .8s ease;
}
.js .ani { opacity: 0; transform: translateY(24px) rotate(var(--don, -1.4deg)); }
.ani.acik { opacity: 1; transform: translateY(0) rotate(var(--don, -1.4deg)); }
.ani:nth-child(even) { --don: 1.6deg; }
.ani::before { /* ipteki düğüm */
  content: "";
  position: absolute; left: -33px; top: 12px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gul);
  box-shadow: 0 0 0 4px rgba(231,195,202,.6);
}
.polaroid {
  background: #fffdf9;
  padding: 12px 12px 8px;
  border-radius: 4px;
  box-shadow: var(--golge-kart);
  max-width: 300px;
}
.polaroid .foto {
  width: 100%; aspect-ratio: 4/5; object-fit: cover;
  border-radius: 2px; background: var(--kagit-3);
}
.polaroid .foto-bos {
  width: 100%; aspect-ratio: 4/5; border-radius: 2px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--pudra), #f6e3e6);
  color: var(--gul); font-size: 2rem;
}
.polaroid .tarih {
  font-family: var(--f-yazi); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--altin); margin: .7rem 2px .1rem;
}
.polaroid .not {
  font-family: var(--f-elyazi); font-weight: 600; font-size: 1.35rem; line-height: 1.25;
  color: var(--gul-koyu); margin: 0 2px .3rem;
}

/* Başlık ve not ayrı ayrı gizlenebilir — kart her durumda kasıtlı görünsün,
   altında boş bir şerit kalmasın. */

/* Yalnızca fotoğraf: temiz bir çerçeve, altta polaroid payı kadar boşluk */
.polaroid--yalin { padding: 12px 12px 14px; }

/* Yalnızca başlık: tek satır altta yalnız kalmasın diye biraz nefes payı */
.polaroid--yalniz-tarih .tarih { margin-bottom: .5rem; }

/* Yalnızca not: üstünde başlık olmadığı için fotoğraftan biraz ayrılsın */
.polaroid--yalniz-not .not { margin-top: .8rem; }

/* ============================================================
   5 · SEBEPLER
   ============================================================ */
.kartlar {
  margin-top: 2.4rem;
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
.kart {
  background: rgba(255,253,249,.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(189,154,85,.28);
  border-radius: 16px;
  padding: 1.5rem 1.3rem;
  text-align: left;
  display: flex; gap: .95rem; align-items: flex-start;
  box-shadow: var(--golge-yumusak);
  transition: opacity .6s ease, transform .6s ease;
}
.js .kart { opacity: 0; transform: translateY(20px) scale(.98); }
.kart.acik { opacity: 1; transform: none; }
.kart .no {
  font-family: var(--f-baslik); font-style: italic;
  font-size: 1.5rem; color: var(--altin); line-height: 1; flex-shrink: 0;
  min-width: 1.6ch;
}
.kart .sebep { font-size: 1.06rem; color: var(--murekkep); }

/* ============================================================
   6 · SAYAÇ
   ============================================================ */
.sayac-grid {
  margin-top: 2rem;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .6rem; max-width: 480px; margin-inline: auto;
}
.sayac-hucre {
  background: rgba(255,253,249,.7);
  border: 1px solid rgba(189,154,85,.3);
  border-radius: 14px;
  padding: 1rem .3rem;
}
.sayac-hucre .rakam {
  font-family: var(--f-baslik); font-weight: 600;
  font-size: clamp(1.6rem, 7vw, 2.5rem); color: var(--gul);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.sayac-hucre .etiket {
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--murekkep-hafif); margin-top: .5rem;
}
.sayac-alt { margin-top: 1.6rem; font-family: var(--f-elyazi); font-weight: 600; font-size: 1.5rem; color: var(--gul-koyu); }

/* ============================================================
   8 · AFFEDER MİSİN?
   ============================================================ */
.sahne--affet .ic { position: relative; }
#affetSoru { transition: opacity .32s ease, transform .32s ease; }
#affetSoru.affet-baslik-gecis { opacity: 0; transform: translateY(-6px); }
.affet-gif {
  display: block;
  width: min(46vw, 150px);
  margin: 0 auto 1.4rem;
  border-radius: 20px;
  box-shadow: var(--golge-kart);
}
.affet-butonlar {
  margin-top: 2.4rem;
  display: flex; gap: 1.1rem; justify-content: center; align-items: center;
  flex-wrap: wrap; position: relative; min-height: 90px;
}
.btn-evet {
  font-family: var(--f-yazi); font-weight: 600; font-size: 1.15rem;
  color: #fff6ea;
  background: linear-gradient(160deg, var(--gul-acik), var(--gul) 55%, var(--gul-koyu));
  padding: 1rem 2.6rem; border-radius: 40px;
  box-shadow: var(--golge-kart);
  transition: transform .25s ease, box-shadow .25s;
}
.btn-evet:hover { transform: translateY(-2px) scale(1.03); }
.btn-hayir {
  font-family: var(--f-yazi); font-weight: 500; font-size: 1rem;
  color: var(--murekkep-hafif);
  background: rgba(255,253,249,.8);
  border: 1px solid rgba(189,154,85,.35);
  padding: .9rem 1.8rem; border-radius: 40px;
  transition: transform .18s ease, opacity .18s;
}
.btn-hayir.kacan { position: absolute; transition: left .28s ease, top .28s ease, transform .28s ease; }

.affet-sonuc { margin-top: 2rem; }
.affet-sonuc-yazi {
  font-family: var(--f-elyazi); font-weight: 600; font-size: clamp(2rem, 9vw, 3.2rem);
  color: var(--gul); line-height: 1.15;
}

/* ============================================================
   9 · FİNAL
   ============================================================ */
.sahne--final { background: radial-gradient(120% 90% at 50% 40%, rgba(231,195,202,.35), transparent 70%); }
.final-metin {
  font-family: var(--f-baslik); font-style: italic; font-weight: 500;
  font-size: clamp(2.2rem, 10vw, 4rem);
  color: var(--gul-koyu); line-height: 1.15;
}
.imza {
  font-family: var(--f-elyazi); font-weight: 600; font-size: clamp(2rem, 9vw, 3rem);
  color: var(--gul); margin-top: 1.4rem;
}
.imza::before { content: "— "; color: var(--altin); }
.wa-btn { display: inline-block; margin-top: 2rem; font-size: 1rem; text-decoration: none; }
.kunye {
  position: absolute; bottom: 18px; left: 0; right: 0;
  text-align: center; font-size: .72rem; letter-spacing: .12em;
  color: var(--murekkep-hafif); opacity: .6;
}
.kunye a { color: inherit; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 700px) {
  .sahne { padding: 6rem 2rem; }
  .kartlar { grid-template-columns: 1fr 1fr; gap: 1.2rem; }
  .tunel { padding-left: 60px; }
  .tunel .ip { left: 22px; }
  .ani::before { left: -40px; }
  .polaroid { max-width: 340px; }
}

@media (min-width: 1000px) {
  .kartlar { grid-template-columns: repeat(3, 1fr); }
  /* Zaman tünelini ortala, kartları büyüt */
  .tunel { max-width: 720px; margin-inline: auto; }
  .polaroid { max-width: 380px; }
  .sayac-hucre .etiket { font-size: .72rem; }
}

/* ============================================================
   HAREKET AZALTMA
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .sahne .ic, .ani, .kart { opacity: 1 !important; transform: none !important; }
}

/* Metnin son boyutunu baştan koruyan, bölüme göre yazı efekti. */
.metin--yazici { display: grid; }
.yazici-rezerv, .yazici-yazi { grid-area: 1 / 1; min-width: 0; }
.yazici-rezerv { visibility: hidden; pointer-events: none; user-select: none; }
.metin--yazici .imlec { height: 1em; }
.kaydirma-ipucu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  margin-top: 2.5rem;
  color: var(--altin);
  font-size: .68rem;
  letter-spacing: .12em;
  line-height: 1.6;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease;
}
.sahne.gorunur .kaydirma-ipucu.hazir { opacity: .8; visibility: visible; }
.kaydirma-ok { font-size: 1.1rem; line-height: 1; }
@media (prefers-reduced-motion: reduce) {
  .kaydirma-ipucu { transition: none; }
}
