/* ============================================================
   Ayşe & Sefa — Nişan Davetiyesi
   Soft-luxury, sinematik tek sayfa. Tek vurgu: mühür kırmızısı.
   ============================================================ */

/* ---------- Tasarım belirteçleri ---------- */
:root {
  /* Renkler — sıcak fildişi/krem zemin, yumuşak antrasit metin */
  --cream:    #F4EFE6;   /* sayfa zemini (videodaki krem ile uyumlu) */
  --cream-2:  #EFE7D9;   /* hafif derin krem */
  --paper:    #FBF8F2;   /* açık paneller */
  --ink:      #221E1A;   /* ana metin (yumuşak siyah) */
  --ink-2:    #5C5349;   /* ikincil metin */
  --ink-3:    #93897B;   /* etiket / soluk */
  --seal:     #8E1B1B;   /* TEK vurgu: balmumu mührü kırmızısı */
  --seal-2:   #6E1414;   /* koyu kırmızı */
  --seal-3:   #B5302A;   /* açık kırmızı (parlama) */
  --gold:     #B89360;   /* monogram için metalik altın (videoyu yankılar) */
  --gold-1:   #CBAA73;
  --gold-2:   #9A7B43;

  --line:      rgba(34, 30, 26, 0.14);
  --line-soft: rgba(34, 30, 26, 0.08);
  --shadow:    rgba(34, 30, 26, 0.10);

  /* Tipografi */
  --serif:  "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:   "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Allura", "Snell Roundhand", cursive;

  /* Yumuşak easing (expo-out hissi) */
  --ease:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Yükleme sırasında scroll kilidi */
body.is-loading { overflow: hidden; height: 100vh; }

img { max-width: 100%; display: block; }

/* [hidden] her zaman gizli kalsın (class kuralları display'i ezmesin) */
[hidden] { display: none !important; }

::selection { background: rgba(142, 27, 27, 0.16); color: var(--ink); }

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

/* ---------- Film grain dokusu (çok hafif) ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* Etkileşimli parçacık katmanı (fare + dokunmaya tepki) — JS oluşturur */
.fx {
  position: fixed;
  inset: 0;
  width: 100%;        /* canvas'ı viewport'a SABİTLE (retina'da imleç kayması olmasın) */
  height: 100%;
  z-index: 60;
  pointer-events: none;
  transition: opacity 0.5s ease;   /* krem davetiye kartında yumuşak solma */
}

/* ============================================================
   LOADER
   ============================================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--cream);
  display: grid;
  place-items: center;
  transition: opacity 0.9s var(--ease), visibility 0.9s var(--ease);
}
.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader__inner {
  width: min(74vw, 300px);
  text-align: center;
}
.loader__mono {
  font-family: var(--script);          /* Allura — zarif ince el yazısı */
  font-weight: 400;
  font-size: clamp(3.4rem, 12vw, 5rem);
  line-height: 1;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2) 52%, var(--gold-1));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.loader__mono span {
  font-size: 0.78em;
  vertical-align: 0.05em;
  padding: 0 0.05em;
  -webkit-text-fill-color: var(--seal);   /* gradyan değil, görünür kırmızı & */
  color: var(--seal);
}

.loader__names {
  margin: 0.7rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: var(--ink-2);
}
.loader__bar {
  position: relative;
  height: 1px;
  margin: 1.4rem auto 1rem;
  background: var(--line);
  overflow: hidden;
}
.loader__fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 0%;
  background: var(--ink);
  transition: width 0.35s var(--ease);
}
.loader__pct {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--ink-2);
}

/* ============================================================
   SİNEMATİK SAHNE (scroll-scrubbing)
   ============================================================ */
.stage {
  position: relative;
  height: 720vh;          /* daha uzun ray → animasyon daha izlenebilir, hızlı kaydırmada yavaş iner */
}
.stage__pin {
  height: 100vh;
  height: 100svh;
  position: relative;
  overflow: hidden;
  background: var(--cream);
}
.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Canvas üstü metin katmanları ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* Açılış başlığı (siyah cold-open üstünde beyaz) */
.intro {
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  width: min(92vw, 900px);
  text-align: center;
  color: #FBF7F0;
  text-shadow: 0 2px 50px rgba(0, 0, 0, 0.45);
  will-change: transform, opacity;
}
.intro__eyebrow {
  margin: 0 0 1.4rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(0.62rem, 1.6vw, 0.78rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-transform: uppercase;
  opacity: 0.86;
}
.intro__names {
  margin: 0;
  font-weight: 300;
  font-size: clamp(3.4rem, 12vw, 8.5rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
}
.intro__names em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold-1);
  padding: 0 0.12em;
}
.intro__rule {
  display: block;
  width: 72px;
  height: 1px;
  margin: 1.7rem auto 1.4rem;
  background: rgba(255, 255, 255, 0.55);
}
.intro__sub {
  margin: 0;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 3vw, 1.7rem);
  letter-spacing: 0.02em;
  opacity: 0.95;
}
.intro__date {
  margin: 1rem 0 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(0.7rem, 1.8vw, 0.86rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  opacity: 0.82;
}

/* Orta sahne — narin caption */
.caption {
  position: absolute;
  left: 50%;
  top: 17%;
  transform: translate(-50%, 0);
  margin: 0;
  width: min(90vw, 640px);
  text-align: center;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 3.6vw, 2.1rem);
  letter-spacing: 0.03em;
  color: var(--ink);
  opacity: 0;                  /* GSAP açar */
  will-change: transform, opacity;
}
.caption__dot { color: var(--seal); padding: 0 0.5em; font-style: normal; }

/* Kaydır göstergesi */
.scrollcue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.6rem, 4vh, 2.6rem);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  color: #FBF7F0;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
}
.scrollcue__txt {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(0.98rem, 2.6vw, 1.16rem);
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  text-transform: uppercase;
  opacity: 1;
}
.scrollcue__line {
  position: relative;
  width: 1px;
  height: 82px;
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}
.scrollcue__line::after {
  content: "";
  position: absolute;
  left: 0; top: -50%;
  width: 100%;
  height: 50%;
  background: rgba(255, 255, 255, 0.95);
  animation: cueDrop 2.1s var(--ease-io) infinite;
}
@keyframes cueDrop {
  0%   { transform: translateY(0); }
  60%  { transform: translateY(300%); }
  100% { transform: translateY(300%); }
}

/* ============================================================
   DAVETİYE BÖLÜMÜ
   ============================================================ */
.invite {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(5rem, 13vh, 9rem) 1.5rem clamp(4rem, 9vh, 7rem);
  background: var(--cream);
}
/* İnce ışıltı/derinlik için yumuşak vinyet */
.invite::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 18%, rgba(255, 255, 255, 0.5), transparent 60%);
}
.invite__wrap {
  position: relative;
  width: min(93vw, 680px);
  text-align: center;
}

/* Canva'da tasarlanan davetiye kartı (vektör SVG) — biraz büyütüldü, yazılar daha okunaklı */
.invite-card-wrap {
  position: relative;
  width: 100%;
  margin: 0 auto 2.6rem;
}
.invite-card {
  display: block;
  width: 100%;
  height: auto;
}
/* SVG export'unda kaybolan iç yatay çizgiler — Canva orijinalindeki konumlarda */
.card-line {
  position: absolute;
  left: 21%;
  right: 21%;
  height: 1px;
  background: rgba(92, 84, 73, 0.30);
}

.invite__eyebrow {           /* "— Davetlisiniz —" — çizgiyle eşit aralıkta, aşağıda */
  margin: 1.9rem 0 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.92rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.invite__mono {
  font-family: var(--script);          /* Allura — zarif ince el yazısı (görseldeki gibi) */
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 6rem);
  line-height: 1;
  margin-bottom: 0.2rem;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2) 52%, var(--gold-1));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.invite__mono span {
  font-size: 0.78em;
  vertical-align: 0.05em;
  padding: 0 0.05em;
  -webkit-text-fill-color: var(--seal);   /* gradyan değil, görünür kırmızı & */
  color: var(--seal);
}

.invite__names {
  margin: 0.6rem 0 0.3rem;
  font-weight: 300;
  font-size: clamp(2.8rem, 9vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.invite__names em {
  font-style: italic;
  color: var(--seal);
  padding: 0 0.08em;
}
.invite__sub {              /* "Nişan Töreni" — en üstte, altında zarif çizgi */
  margin: 0 0 0.9rem;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.98rem;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  color: var(--ink-2);
}
/* "Nişan Töreni" altındaki zarif ince çizgi (uçları sönen) */
.invite__subline {
  display: block;
  width: 80px;
  height: 1px;
  margin: 0 auto 1.6rem;
  background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
}
/* Monogramdaki kırmızı kalp (görseldeki gibi, A ile S arasında) */
.invite__mono .mono-heart {
  font-family: var(--sans);
  font-size: 0.38em;
  vertical-align: 0.36em;
  padding: 0 0.05em;
  -webkit-text-fill-color: var(--seal-3);   /* gradyan yerine kırmızı */
  color: var(--seal-3);
}

/* Ayraç (ortada küçük kırmızı eşkenar) */
.invite__rule {
  position: relative;
  display: block;
  width: min(66%, 240px);
  height: 1px;
  margin: 1.9rem auto;
  background: var(--line);
}
.invite__rule::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  background: var(--seal);
  transform: translate(-50%, -50%) rotate(45deg);
}

.invite__lead {
  margin: 0 auto 2.4rem;
  max-width: 30em;
  font-size: clamp(1.1rem, 2.6vw, 1.35rem);
  line-height: 1.7;
  color: var(--ink-2);
}

/* Tarih / Saat / Mekân */
.invite__details {
  list-style: none;
  margin: 0 auto 2.6rem;
  padding: 0;
  max-width: 30rem;
}
.invite__details li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line-soft);
}
.invite__details li:last-child { border-bottom: 1px solid var(--line-soft); }
.invite__details .lbl {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.64rem;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.invite__details .val {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--ink);
  line-height: 1.35;
}
.invite__details .val small {
  display: block;
  font-size: 0.78em;
  color: var(--ink-2);
  margin-top: 0.15rem;
}

/* Geri sayım */
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 5vw, 2.4rem);
  margin: 0 auto 2.6rem;
}
.cd { display: flex; flex-direction: column; align-items: center; }
.cd__n {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 7vw, 3.1rem);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cd__l {
  margin-top: 0.5rem;
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cd__done {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  color: var(--seal);
  text-align: center;
  margin: 0 auto 2.6rem;
}

/* Butonlar */
.invite__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 1.7rem;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease),
              border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.btn svg { flex: none; }
.btn:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.btn--primary {
  color: var(--paper);
  background: var(--seal);
  border-color: var(--seal);
}
.btn--primary:hover {
  background: var(--seal-2);
  border-color: var(--seal-2);
}

/* Dekoratif balmumu mührü */
.seal {
  width: 92px;
  height: 92px;
  margin: 2.6rem auto 0;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 47% 53% 52% 48% / 50% 47% 53% 50%;
  background: radial-gradient(circle at 38% 32%, var(--seal-3), var(--seal) 56%, var(--seal-2));
  box-shadow: 0 12px 26px rgba(110, 20, 20, 0.28),
              inset 0 2px 6px rgba(255, 255, 255, 0.22),
              inset 0 -7px 16px rgba(0, 0, 0, 0.28);
}
.seal::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 235, 230, 0.28);
  border-radius: inherit;
}
.seal__mono {
  font-family: var(--script);
  font-weight: 400;
  font-size: 2.7rem;
  line-height: 1;
  text-align: center;
  letter-spacing: 0.02em;
  color: rgba(255, 236, 231, 0.95);
  transform: translateY(-0.04em);   /* script taban çizgisini optik ortala */
}
.seal__mono span { font-size: 0.64em; vertical-align: 0.08em; padding: 0 0.02em; }

/* Gerçek balmumu mührü (Canva tasarımından, şeffaf PNG) */
.seal-img {
  display: block;
  width: clamp(94px, 22vw, 120px);
  height: auto;
  margin: 2.7rem auto 0;
  filter: drop-shadow(0 9px 16px rgba(110, 20, 20, 0.22));
}

.invite__foot {
  margin: 2.4rem 0 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Reveal (scroll ile beliren) — yalnız JS aktifken gizle ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  will-change: transform, opacity;
}

/* ============================================================
   MÜZİK DÜĞMESİ
   ============================================================ */
.music {
  position: fixed;
  right: clamp(1rem, 3vw, 1.8rem);
  bottom: clamp(1rem, 3vw, 1.8rem);
  z-index: 1300;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(251, 248, 242, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease),
              background 0.4s var(--ease);
}
.music:hover { transform: scale(1.06); border-color: var(--ink-3); }
.music__icon { display: none; line-height: 0; }
.music__icon--off { display: block; }          /* varsayılan: kapalı ikon */
.music.is-playing .music__icon--off { display: none; }
.music.is-playing .music__icon--on  { display: block; }
.music.is-playing { color: var(--seal); border-color: rgba(142, 27, 27, 0.35); }

/* ============================================================
   HAREKETSİZ FALLBACK (prefers-reduced-motion)
   ============================================================ */
.static { display: none; }

/* JS ile statik moda geçiş: reduced-motion VEYA kütüphaneler (GSAP/Lenis)
   yüklenemediğinde initStatic() <html>'e .reduced ekler. */
html.reduced .loader { display: none !important; }
html.reduced .stage  { display: none !important; }
html.reduced .static { display: block !important; }
/* Statik modda sıralama: önce hikâye kareleri (.static), sonra davetiye (main) */
html.reduced body   { display: flex; flex-direction: column; }
html.reduced .static { order: 1; }
html.reduced main    { order: 2; }

.static__hero {
  text-align: center;
  padding: clamp(5rem, 16vh, 9rem) 1.5rem clamp(2rem, 5vh, 3rem);
}
.static__eyebrow {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1.4rem;
}
.static__names {
  margin: 0;
  font-weight: 300;
  font-size: clamp(3rem, 12vw, 6rem);
  line-height: 1;
}
.static__names em { font-style: italic; color: var(--seal); padding: 0 0.1em; }
.static__sub {
  margin: 1rem 0 0;
  font-family: var(--sans);
  font-weight: 300;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--ink-2);
}
.static__fig {
  margin: 0 auto;
  max-width: 1000px;
  padding: 0.6rem 1rem;
}
.static__fig img {
  width: 100%;
  height: auto;
  border-radius: 3px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .intro { top: 46%; }
  .caption { top: 13%; }
  .invite__actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}

/* Yatay mobil / kısa ekran: introyu biraz yukarı al */
@media (max-height: 520px) and (orientation: landscape) {
  .intro { top: 44%; }
  .scrollcue { display: none; }
}

/* ============================================================
   PREFERS-REDUCED-MOTION — scrubbing kapalı, statik düzen
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .loader { display: none !important; }
  .stage  { display: none !important; }
  .static { display: block !important; }
  .fx     { display: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  body.is-loading { overflow: auto !important; height: auto !important; }
}
