:root {
  --bg: #070c10;
  --ink: #f6f1e6;
  --muted: rgba(246, 241, 230, 0.72);
  --gold: #d4b37a;
  --gold-deep: #b88945;
  --teal: #7ee0d0;
  --shadow: rgba(0, 0, 0, 0.45);
  --font: "Vazirmatn", sans-serif;
  --display: "Aref Ruqaa", "Vazirmatn", serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: auto;
  background: var(--bg);
}

html,
body {
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

.progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transform-origin: right center;
  transform: scaleX(0);
  z-index: 50;
  pointer-events: none;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-content: center;
  gap: 14px;
  background: var(--bg);
  text-align: center;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-mark {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  color: var(--gold);
}

.loader-sub {
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.08em;
}

.loader-bar {
  width: min(240px, 60vw);
  height: 2px;
  margin: 12px auto 0;
  background: rgba(246, 241, 230, 0.12);
  overflow: hidden;
}

.loader-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--teal));
}

.story {
  height: 640vh;
  position: relative;
}

.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

.stage-canvas,
.stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-canvas {
  display: block;
  z-index: 0;
  transform: translateZ(0);
}

.stage-video {
  object-fit: cover;
  object-position: center;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

.stage.is-fallback .stage-video {
  opacity: 1;
}

.stage.is-fallback .stage-canvas {
  display: none;
}

.stage-shade,
.stage-vignette,
.stage-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.stage-shade {
  background:
    linear-gradient(180deg, rgba(7, 12, 16, 0.42) 0%, rgba(7, 12, 16, 0.12) 28%, rgba(7, 12, 16, 0.12) 62%, rgba(7, 12, 16, 0.55) 100%),
    linear-gradient(90deg, rgba(7, 12, 16, 0.28), transparent 18%, transparent 82%, rgba(7, 12, 16, 0.28));
}

.stage-vignette {
  box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.55);
}

.stage-grain {
  opacity: 0.14;
  mix-blend-mode: overlay;
  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='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.wordmark {
  position: absolute;
  top: max(22px, var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  direction: ltr;
  font-size: 11px;
  letter-spacing: 0.42em;
  color: rgba(246, 241, 230, 0.78);
  z-index: 3;
  white-space: nowrap;
}

.wordmark i {
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.scenes {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 0 22px;
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  will-change: opacity, transform;
}

.scene:first-child {
  opacity: 1;
  transform: none;
}

.scene-card {
  position: relative;
  z-index: 1;
  max-width: min(860px, 100%);
  padding: 28px 32px;
  border-radius: 28px;
  background: rgba(7, 12, 16, 0.22);
  border: 1px solid rgba(246, 241, 230, 0.08);
}

.kicker {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  margin-bottom: 16px;
}

.kicker.gold {
  display: inline-block;
}

.scene h1,
.scene h2 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}

.finale-title {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 10px 40px var(--shadow);
}

.scene h1 {
  font-size: clamp(2.6rem, 9vw, 7.4rem);
}

.scene h2 {
  font-size: clamp(1.7rem, 6.4vw, 5.2rem);
}

.scene-line {
  margin-top: 18px;
  font-weight: 300;
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  color: var(--muted);
}

.scroll-hint {
  position: absolute;
  bottom: max(28px, var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(320px, calc(100% - 32px));
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-align: center;
  transition: opacity 0.45s ease;
}

.scroll-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hint-mobile {
  display: none;
}

.scroll-mouse {
  width: 22px;
  height: 34px;
  border: 1px solid rgba(246, 241, 230, 0.45);
  border-radius: 12px;
  position: relative;
}

.scroll-mouse::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 7px;
  border-radius: 99px;
  background: var(--gold);
  transform: translateX(-50%);
  animation: wheel 1.4s ease-in-out infinite;
}

@keyframes wheel {
  0%,
  20% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
}

.finale {
  position: relative;
  z-index: 6;
  background:
    radial-gradient(circle at top, rgba(212, 179, 122, 0.12), transparent 34%),
    linear-gradient(180deg, #0b1318 0%, #070c10 100%);
  padding: 88px 20px calc(72px + var(--safe-bottom));
}

.finale-inner {
  width: min(980px, 100%);
  margin: 0 auto;
  text-align: center;
}

.finale-title {
  font-size: clamp(2.4rem, 8vw, 5.4rem);
  margin: 8px 0 18px;
}

.finale-lead {
  max-width: 640px;
  margin: 0 auto 36px;
  color: var(--muted);
  line-height: 2;
  font-size: 1.05rem;
  font-weight: 300;
}

.map-frame {
  position: relative;
  height: min(62vh, 520px);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(212, 179, 122, 0.35);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

#map {
  height: 100%;
  width: 100%;
  filter: saturate(0.85) contrast(1.05);
}

.map-pin-card {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 400;
  background: rgba(7, 12, 16, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 179, 122, 0.35);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 16px;
  text-align: right;
}

.map-pin-card strong,
.map-pin-card span {
  display: block;
}

.map-pin-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0 32px;
  direction: rtl;
}

.detail-card {
  padding: 22px 20px;
  border-radius: 22px;
  background: rgba(246, 241, 230, 0.04);
  border: 1px solid rgba(246, 241, 230, 0.08);
  text-align: right;
}

.detail-label {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
}

.detail-card p {
  line-height: 1.9;
}

.detail-card small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-card a {
  color: inherit;
  text-decoration: none;
}

.phone {
  display: block;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cta-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 48px;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #1b140c;
}

.btn-ghost {
  border: 1px solid rgba(246, 241, 230, 0.2);
  color: var(--ink);
}

.closing {
  margin-top: 42px;
  font-family: var(--display);
  font-size: clamp(1.3rem, 4vw, 2.1rem);
  color: var(--gold);
}

.leaflet-control-attribution {
  background: rgba(7, 12, 16, 0.55) !important;
  color: rgba(246, 241, 230, 0.7) !important;
}

@media (hover: none) and (pointer: coarse) {
  .hint-desktop {
    display: none;
  }

  .hint-mobile {
    display: block;
  }

  .scene-card {
    backdrop-filter: none;
    background: rgba(7, 12, 16, 0.38);
  }

  .btn:hover {
    transform: none;
  }
}

@media (max-width: 800px) {
  .story {
    height: 540vh;
  }

  .wordmark {
    letter-spacing: 0.22em;
    font-size: 9px;
    gap: 8px;
  }

  .wordmark i {
    width: 18px;
  }

  .scene {
    padding: 0 16px;
  }

  .scene-card {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .kicker {
    letter-spacing: 0.16em;
    font-size: 0.74rem;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .detail-card {
    padding: 18px 18px 18px 16px;
  }

  .phone {
    font-size: 1.28rem;
  }

  .map-frame {
    height: 52vh;
    min-height: 280px;
    border-radius: 22px;
  }

  .map-pin-card {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .finale {
    padding: 56px 16px calc(36px + var(--safe-bottom));
  }

  .finale-lead {
    font-size: 0.98rem;
    line-height: 1.9;
    margin-bottom: 24px;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    min-width: 0;
  }

  .scroll-hint {
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene,
  .loader,
  .scroll-hint,
  .progress,
  .scroll-mouse::after {
    transition: none !important;
    animation: none !important;
    filter: none !important;
  }
}
