/* =========================================================
   Onur & Beyza — davetiye teması
   Krem / altın / botanik, ince çerçeve, el yazısı isimler
   ========================================================= */

:root {
  --cream:   #f6f0e4;   /* sayfa arka planı */
  --card:    #fbf7ee;   /* kart */
  --ink:     #5b5237;   /* ana metin (zeytin-kahve) */
  --ink-soft:#7d7350;   /* ikincil metin */
  --gold:    #a9945f;   /* altın vurgu */
  --gold-2:  #c7b385;   /* açık altın */
  --line:    #cbb98e;   /* çerçeve çizgisi */
  --leaf:    #8a9a6b;   /* yeşillik */
  --shadow:  0 18px 50px rgba(91, 82, 55, 0.14);
}

* { box-sizing: border-box; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, #fffdf7 0%, var(--cream) 60%);
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px 64px;
  position: relative;
  z-index: 1;
}

/* ---------- Süzülen yapraklar (arka plan) ---------- */
.leaves {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.leaf-fall {
  position: absolute;
  top: -8vh;
  color: var(--leaf);
  opacity: 0.22;
  will-change: transform;
  animation-name: leaffall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes leaffall {
  0%   { transform: translate(0, -8vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.22; }
  90%  { opacity: 0.22; }
  100% { transform: translate(var(--drift, 0), 108vh) rotate(320deg); opacity: 0; }
}

/* =========================================================
   DECK: sayfa sayfa gezinme + "kalemle çizilme" geçişi
   ========================================================= */
@property --draw {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.deck {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 122px;      /* alt: gezinme çubuğu (iki buton) için boşluk */
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.page.off { display: none; }
.page.active { opacity: 1; visibility: visible; pointer-events: auto; }
.motion-ok .page { transition: opacity .55s ease, visibility .55s; }
.page .page-inner {
  width: 100%;
  max-width: 640px;
  margin: auto;                  /* dikey+yatay ortala, taşarsa üstten erişilir */
}
/* Kapak sayfası: görsel + buton TEK EKRANA sığsın, dikeyde ortalı.
   Görsel, ekran yüksekliğine göre küçülür; buton her zaman görünür kalır. */
.page-cover { padding: 16px; }
.page-cover .page-inner {
  max-width: min(720px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-img { display: block; }
.page-cover .hero-img {
  width: auto;
  max-width: 100%;
  max-height: calc(100svh - 150px);   /* buton + boşluk için yer bırak */
  height: auto;
  border-radius: 4px;
}

/* --- "Kalemle çizilme" maskesi (yalnızca .sketch öğesine) ---
   135° diyagonal, yumuşak (feather) kenarlı gradient maske.
   --draw 0 -> 140 arası animasyonla sol-üstten sağ-alta dolar. */
.motion-ok .sketch {
  position: relative;
  --draw: 0;
  transition: --draw 1.02s cubic-bezier(.6, .02, .2, 1);
  -webkit-mask-image: linear-gradient(135deg,
     #000 calc((var(--draw) - 22) * 1%),
     rgba(0, 0, 0, .35) calc((var(--draw) - 9) * 1%),
     transparent calc(var(--draw) * 1%));
  mask-image: linear-gradient(135deg,
     #000 calc((var(--draw) - 22) * 1%),
     rgba(0, 0, 0, .35) calc((var(--draw) - 9) * 1%),
     transparent calc(var(--draw) * 1%));
}
.motion-ok .page.active .sketch { --draw: 140; }
.motion-ok .page.predraw .sketch { transition: none; --draw: 0; }

/* İlerleyen kalem ucu izi (grafit leading edge) */
.motion-ok .page.active .sketch::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg,
     transparent calc((var(--draw) - 11) * 1%),
     rgba(91, 82, 55, .22) calc((var(--draw) - 4) * 1%),
     transparent calc(var(--draw) * 1%));
}
.motion-ok .page.predraw .sketch::after { content: none; }

/* --- Metin: çizimden hemen sonra fade + yukarı kayma (stagger) --- */
.motion-ok .draw-text { opacity: 0; }
.motion-ok .page.active .draw-text {
  animation: drawUp .6s cubic-bezier(.2, .6, .2, 1) both;
}
.motion-ok .page.predraw .draw-text { animation: none; opacity: 0; }
@keyframes drawUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* --- Kapak "başla" butonu --- */
.cta {
  align-self: center;
  margin: 20px auto 0;
  padding: 15px 34px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: .82rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .15s ease, color .15s ease;
}
.cta span { color: var(--gold); transition: color .15s ease; }
.cta:hover { background: var(--gold); color: #fffdf6; }
.cta:hover span { color: #fffdf6; }

/* --- Alt gezinme çubuğu --- */
.deck-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;      /* içerik 640px sütunda ortalı */
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--cream) 66%, rgba(246, 240, 228, 0));
}
.deck-nav-inner {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  justify-content: space-between;   /* Geri | noktalar | İleri */
  gap: 10px;
}
/* Geri ve İleri: iki belirgin buton */
.nav-prev, .nav-next {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-size: .76rem;
  white-space: nowrap;
}
/* Geri (sol) — çerçeveli, açık */
.nav-prev {
  padding: 11px 20px;
  border: 1px solid var(--gold);
  background: var(--card);
  color: var(--ink);
}
.nav-prev:hover { background: #f0e7d4; }
.nav-prev span { color: var(--gold); font-size: 1.1rem; line-height: 1; }
/* İleri (sağ) — dolu, en belirgin */
.nav-next {
  padding: 12px 24px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #f6f0e4;
}
.nav-next:hover { background: #4a4229; border-color: #4a4229; }
.nav-next span { font-size: 1.1rem; line-height: 1; }
/* Sayfa göstergesi (orta) */
.deck-dots { display: flex; gap: 7px; align-items: center; }
.deck-dots .dot {
  width: 8px; height: 8px; padding: 0;
  border-radius: 50%;
  border: 1px solid var(--gold-2);
  background: transparent;
  cursor: pointer;
}
.deck-dots .dot.on { background: var(--gold); border-color: var(--gold); transform: scale(1.25); }

/* İlk sayfa (kapak): alt gezinme çubuğu gizli — sadece "Hikâyemize Başla" butonu */
body.cover-active .deck-nav { display: none; }

/* Mekân sayfası: "Yol Tarifi Al" butonu ortada, tam genişlik değil */
#page-map .btn.gold {
  width: fit-content;
  min-width: 240px;
  margin: 18px auto 2px;
  display: block;
  text-align: center;
}

/* Hareket azaltıldıysa: maske yok, içerik direkt tam görünür */
@media (prefers-reduced-motion: reduce) {
  .sketch { -webkit-mask-image: none; mask-image: none; }
  .draw-text { opacity: 1 !important; }
}

/* ---------- Botanik köşe dalları ---------- */
.card { }
.card .corner {
  position: absolute;
  width: 74px;
  height: 74px;
  z-index: 2;
  pointer-events: none;
  opacity: 0.9;
}
.card .corner.tl { top: 4px; left: 4px; }
.card .corner.br { bottom: 4px; right: 4px; transform: rotate(180deg); }
@media (max-width: 380px) { .card .corner { width: 58px; height: 58px; } }

/* ---------- Yaprak ayraçları ---------- */
.sprig { text-align: center; margin: 8px 0 20px; }
.sprig svg { width: min(210px, 62%); height: auto; display: inline-block; }
.title-sprig { text-align: center; margin: -2px 0 10px; }
.title-sprig svg { width: 150px; height: auto; display: inline-block; opacity: 0.9; }

/* İsimler açılışta yumuşakça yükselsin */
.names { animation: nameRise 1s ease both; }
@keyframes nameRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Hareket duyarlılığı: tüm animasyonları kapat */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .leaves { display: none; }
}

/* ---------- Davetiye kartı ---------- */
.card {
  position: relative;
  background: var(--card);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 54px 30px 40px;
  overflow: hidden;
}
/* çift ince altın çerçeve */
.card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid var(--gold-2);
  border-radius: 3px;
  pointer-events: none;
}
.card::after {
  content: "";
  position: absolute;
  inset: 19px;
  border: 1px solid rgba(169, 148, 95, 0.35);
  border-radius: 2px;
  pointer-events: none;
}

.eyebrow {
  text-align: center;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
  margin: 0 0 8px;
}

.names {
  font-family: "Pinyon Script", cursive;
  font-weight: 400;
  text-align: center;
  color: var(--ink);
  font-size: clamp(3.4rem, 12vw, 5.4rem);
  line-height: 1.05;
  margin: 6px 0 4px;
}
.names .amp {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 0.42em;
  color: var(--gold);
  vertical-align: middle;
  padding: 0 0.15em;
}

.sprig {
  text-align: center;
  color: var(--leaf);
  font-size: 1.2rem;
  margin: 6px 0 20px;
  letter-spacing: 0.2em;
}

.invite-text {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.9;
  max-width: 30ch;
  margin: 0 auto 22px;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--gold);
  margin: 18px auto;
  max-width: 260px;
}
.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}

/* tarih / mekan / saat şeridi */
.meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  text-align: center;
  margin: 4px auto 8px;
}
.meta .item {
  padding: 6px 20px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
  color: var(--ink);
}
.meta .item + .item { border-left: 1px solid var(--gold-2); }
.meta .item strong { display: block; font-weight: 600; letter-spacing: 0.14em; }
.meta .item span { color: var(--ink-soft); font-size: 0.82rem; }

/* ---------- Bölüm başlığı ---------- */
.section {
  margin-top: 34px;
  background: var(--card);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 30px 26px;
  position: relative;
}
.section h2 {
  font-family: "Pinyon Script", cursive;
  font-weight: 400;
  font-size: 2.4rem;
  color: var(--gold);
  text-align: center;
  margin: 0 0 6px;
}
.section .sub {
  text-align: center;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  margin: 0 0 22px;
}

/* ---------- Hikâyemiz ---------- */
.story-photo {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 5;
  margin: 0 auto 20px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--gold-2);
  background: linear-gradient(135deg, #f2ead8, #e7dcc0);
  box-shadow: inset 0 0 0 6px rgba(255, 253, 246, 0.6);
}
.story-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-photo .story-ph {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  font-family: "Pinyon Script", cursive;
  font-size: 2.4rem; color: var(--gold);
}
.story-photo.no-photo .story-ph { display: flex; }
.story-text {
  color: var(--ink-soft);
  line-height: 1.8;
  font-size: 1.05rem;
  max-width: 44ch;
  margin: 0 auto;
  text-align: center;
}

/* ---------- Yükleme önizlemeleri (misafir) ---------- */
.uploads {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
@media (max-width: 420px) { .uploads { gap: 6px; } }
.up-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: #efe7d4;
  border: 1px solid var(--gold-2);
}
.up-cell img, .up-cell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-prog {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(40, 36, 24, 0.4);
  color: #fffdf6; font-size: 0.95rem; letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.up-cell.done .up-prog { display: none; }
.up-cell.err .up-prog { background: rgba(150, 50, 40, 0.55); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.up-badge {
  position: absolute; left: 5px; bottom: 5px;
  background: rgba(85, 102, 60, 0.92); color: #fff;
  border-radius: 4px; font-size: 0.7rem; padding: 2px 6px; line-height: 1;
}
.up-x {
  position: absolute; top: 5px; right: 5px;
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: rgba(40, 36, 24, 0.7); color: #fff;
  font-size: 0.8rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.up-x:hover { background: rgba(150, 50, 40, 0.9); }

/* ---------- Galeri (ortak albüm) ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 420px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 6px; } }
.g-cell {
  position: relative;
  padding: 0; border: none; cursor: pointer;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: #efe7d4;
}
.g-cell img, .g-cell video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.25s ease;
}
.g-cell:hover img, .g-cell:hover video { transform: scale(1.05); }
.g-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fffdf6; font-size: 1.6rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* ---------- Lightbox (büyütme) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(40, 36, 24, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox .lb-content { max-width: 96vw; max-height: 88vh; }
.lightbox img, .lightbox video {
  max-width: 96vw; max-height: 88vh;
  border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lb-close {
  position: absolute; top: 16px; right: 18px;
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: rgba(255,253,246,0.15); color: #fffdf6;
  font-size: 1.2rem; cursor: pointer;
}
.lb-close:hover { background: rgba(255,253,246,0.3); }

/* ---------- Geri sayım ---------- */
.countdown {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cd-box {
  min-width: 74px;
  padding: 14px 8px;
  border: 1px solid var(--gold-2);
  border-radius: 4px;
  background: #fffdf6;
  text-align: center;
}
.cd-box .num {
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-box .num.pulse { animation: cdPulse 0.5s ease; }
@keyframes cdPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.14); color: var(--gold); }
  100% { transform: scale(1); }
}
.cd-box .lbl {
  display: block;
  margin-top: 6px;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gold-2);
  border-radius: 4px;
  background: #fffdf6;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(169, 148, 95, 0.15);
}
.field textarea { resize: vertical; min-height: 70px; }

/* geliyorum / gelmiyorum seçimi */
.choice { display: flex; gap: 12px; }
.choice label {
  flex: 1;
  text-align: center;
  padding: 14px;
  border: 1px solid var(--gold-2);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--ink-soft);
  transition: all 0.15s ease;
  user-select: none;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice input:checked + span { color: var(--ink); }
.choice label:has(input:checked) {
  background: var(--gold);
  border-color: var(--gold);
  color: #fffdf6;
}
.choice label:has(input:checked) span { color: #fffdf6; }

/* buton */
.btn {
  display: inline-block;
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: 4px;
  background: var(--ink);
  color: #f6f0e4;
  font-family: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: #4a4229; }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #937f4d; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.btn-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.btn-link:hover { color: var(--ink); }

/* mesajlar */
.msg { text-align: center; padding: 10px; border-radius: 4px; margin-top: 14px; font-size: 0.95rem; }
.msg.ok { background: rgba(138, 154, 107, 0.16); color: #55663c; }
.msg.err { background: rgba(180, 90, 70, 0.14); color: #8a4030; }
.hidden { display: none !important; }

/* yükleme listesi */
.upload-list { margin-top: 16px; font-size: 0.9rem; }
.upload-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-bottom: 1px solid rgba(199, 179, 133, 0.4);
}
.upload-row .st { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.st.ok { color: #55663c; } .st.err { color: #8a4030; } .st.wait { color: var(--gold); }

.footnote {
  text-align: center; color: var(--ink-soft);
  font-size: 0.82rem; margin-top: 30px; letter-spacing: 0.04em;
}

/* admin tablo */
table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(199,179,133,0.4); }
th { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; color: var(--gold); }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.stat { flex: 1; min-width: 120px; text-align: center; padding: 16px; border: 1px solid var(--gold-2); border-radius: 4px; background: #fffdf6; }
.stat b { display: block; font-size: 1.8rem; color: var(--ink); }
.stat span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); }
