@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;900&display=swap');

:root {
  --gold: #d4af37;
  --gold-light: #f0d878;
  --dark: #0f1419;
  --cream: #f7f4ee;
  --text-muted: #c7cdd4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: 'Tajawal', sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-phone {
  position: relative;
  width: 100vw;
  height: 100dvh;
  max-width: 460px;
  max-height: 940px;
  background: var(--dark);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,0.6);
}

@media (min-width: 480px) and (min-height: 760px) {
  .story-phone { border-radius: 30px; border: 1px solid rgba(212,175,55,0.25); }
}

.story-progress {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  z-index: 20;
  display: flex;
  gap: 5px;
}
.bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.bar::before {
  /* enlarges the tap target well beyond the thin visual bar, without affecting layout */
  content: "";
  position: absolute;
  top: -12px; bottom: -12px;
  left: 0; right: 0;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 3px;
}
.bar-fill.playing {
  animation-name: storyfill;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-duration: var(--dur, 4000ms);
}
.bar-fill.filled { width: 100%; }
@keyframes storyfill { from { width: 0%; } to { width: 100%; } }

.close-btn {
  position: absolute;
  top: 30px; right: 16px;
  z-index: 20;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-decoration: none;
}

/* ---------- Slide stack & transitions ---------- */
.slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transform: scale(1.05);
  z-index: 1;
  pointer-events: none;
  transition: opacity .5s ease, transform .6s ease;
  direction: rtl;
}
.slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
  pointer-events: auto;
}

/* Blurred full-bleed backdrop layer (always cover, never cropping the real subject since the sharp copy sits on top uncropped) */
.slide-bg {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(16px) brightness(.55) saturate(1.1);
  transform: scale(1.15);
  will-change: transform;
}
.slide-bg.kenburns {
  animation-name: kenburns;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-duration: var(--dur, 4000ms);
}
@keyframes kenburns { from { transform: scale(1.15); } to { transform: scale(1.32); } }

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,20,25,.1) 0%, rgba(15,20,25,.35) 45%, rgba(15,20,25,.92) 100%);
  z-index: 1;
}

/* Sharp, un-cropped subject image on top of the blur */
.slide-fg {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  max-height: 56%;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  z-index: 1;
}
.slide.no-fg .slide-fg { display: none; }

.slide-content {
  position: absolute;
  z-index: 2;
  bottom: 0; left: 0; right: 0;
  padding: 24px 24px 92px;
  text-align: center;
}

/* Staggered entrance for text content each time a slide becomes active */
.slide.active .eyebrow,
.slide.active h1,
.slide.active .sub,
.slide.active .price-chip,
.slide.active .mini-stats,
.slide.active .caption-card,
.slide.active .amenity-list,
.slide.active .cta-row,
.slide.active .phone-number {
  animation: contentIn .55s ease both;
  animation-delay: .18s;
}
.slide.active .mini-stats { animation-delay: .3s; }
.slide.active .cta-row { animation-delay: .3s; }
@keyframes contentIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  display: inline-block;
  color: var(--gold-light);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.slide h1 {
  font-size: clamp(1.6rem, 8vw, 2.2rem);
  font-weight: 900;
  color: var(--cream);
  margin-bottom: 8px;
}
.slide h1 span { color: var(--gold); }
.slide .sub {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 18px;
}

.price-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: rgba(212,175,55,0.12);
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  padding: 10px 20px;
  margin-bottom: 18px;
}
.price-chip .label { font-size: 0.82rem; color: var(--text-muted); font-weight: 700; }
.price-chip .value { font-size: 1.3rem; font-weight: 900; color: var(--gold-light); }

.mini-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mini-stat {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.8rem;
}
.mini-stat b { display: block; color: var(--gold-light); font-size: 1.05rem; }

.caption-card {
  display: inline-block;
  background: rgba(10,10,10,0.68);
  border-inline-start: 4px solid var(--gold);
  border-radius: 14px;
  padding: 16px 22px;
  text-align: start;
  max-width: 92%;
}
.caption-card .title { font-weight: 900; font-size: 1.15rem; color: var(--cream); margin-bottom: 6px; }
.caption-card .desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 8px; }
.caption-card .price { color: var(--gold-light); font-weight: 900; font-size: 1.05rem; }

.amenity-list { list-style: none; text-align: start; display: inline-block; }
.amenity-list li { color: var(--cream); font-size: 0.98rem; padding: 6px 0; display: flex; align-items: center; gap: 10px; }
.amenity-list li .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }

.cta-row { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}
.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #14100a; }
.btn-outline { border: 1.5px solid var(--gold); color: var(--gold-light); }

.phone-number {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold-light);
  direction: ltr;
  display: inline-block;
  margin: 10px 0;
}

.pause-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 15;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.pause-icon.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tap-zone {
  position: absolute;
  top: 0; bottom: 0;
  z-index: 10;
  width: 35%;
}
.tap-prev { left: 0; }
.tap-next { right: 0; width: 65%; }
