/* Site viewer frame — modern bezel + looping BG.mp4 backdrop */

html:has([data-site-viewer]),
body:has([data-site-viewer]) {
  background: #050505;
}

.fargah-viewer-stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(22px, 3.6vh, 42px) clamp(14px, 2vw, 22px);
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.72), rgba(5, 5, 5, 0.9)),
    url("../images/fargah/backgrounds/gold-ambient-poster-1080.jpg") center / cover no-repeat,
    #050505;
}

@media (min-width: 1600px) {
  .fargah-viewer-stage {
    background:
      linear-gradient(180deg, rgba(5, 5, 5, 0.72), rgba(5, 5, 5, 0.9)),
      url("../images/fargah/backgrounds/gold-ambient-poster-1080.jpg") center / cover no-repeat,
      #050505;
  }
}

.fargah-viewer-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 74% 70% at 50% 48%,
    transparent 36%,
    rgba(0, 0, 0, 0.22) 62%,
    rgba(0, 0, 0, 0.48) 100%
  );
}

.fargah-viewer__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
  opacity: 0.92;
}

.fargah-viewer__bg-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.32) 72%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.1) 42%, rgba(0, 0, 0, 0.28));
}

.fargah-viewer__device {
  position: relative;
  z-index: 2;
  width: min(100%, 1640px);
  min-height: calc(100svh - clamp(44px, 7.2vh, 84px));
  margin: 0 auto;
  padding: 3px;
  border-radius: clamp(24px, 2.6vw, 36px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(200, 164, 93, 0.34) 38%, rgba(255, 255, 255, 0.08) 68%, rgba(120, 120, 120, 0.18));
  box-shadow:
    0 70px 160px rgba(0, 0, 0, 0.78),
    0 36px 72px rgba(0, 0, 0, 0.58),
    0 16px 36px rgba(0, 0, 0, 0.42),
    0 4px 12px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.fargah-viewer__device::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  transform: translateY(6%);
  filter: blur(42px);
  background: rgba(0, 0, 0, 0.55);
  opacity: 0.82;
}

.fargah-viewer__device::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.04));
  z-index: 3;
}

.fargah-viewer__bezel {
  position: absolute;
  inset: 3px;
  border-radius: calc(clamp(24px, 2.6vw, 36px) - 3px);
  pointer-events: none;
  z-index: 4;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 20px 48px rgba(255, 255, 255, 0.03);
}

.fargah-viewer__screen {
  position: relative;
  min-height: calc(100svh - clamp(44px, 7.2vh, 84px) - 6px);
  border-radius: calc(clamp(24px, 2.6vw, 36px) - 4px);
  overflow: clip;
  background: var(--bg-primary);
  color: var(--text-primary);
  isolation: isolate;
}

.fargah-viewer__screen > .motion-particles,
.fargah-viewer__screen > .motion-grid,
.fargah-viewer__screen > .motion-vignette,
.fargah-viewer__screen > .motion-cursor-glow,
.fargah-viewer__screen > .fargah-ambient {
  position: absolute;
  inset: 0;
}

.fargah-viewer__screen > .motion-scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
}

.fargah-viewer__screen > main {
  position: relative;
  z-index: 3;
}

.fargah-viewer__screen .fargah-header {
  margin: 0;
  width: 100%;
  border-radius: 0;
}

.fargah-viewer__screen .fargah-header--overlay {
  position: absolute;
  top: 0;
  inset-inline: 0;
}

.fargah-viewer__screen .fargah-header--scrolled,
.fargah-viewer__screen .fargah-header--overlay.fargah-header--scrolled {
  position: sticky;
  top: 0;
}

.fargah-viewer__screen .ai-support {
  z-index: 1085;
}

@media (max-width: 992px) {
  .fargah-viewer-stage {
    padding: 0;
  }

  .fargah-viewer__bg,
  .fargah-viewer__bg-veil {
    display: none;
  }

  .fargah-viewer__device {
    width: 100%;
    min-height: 100svh;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .fargah-viewer__device::before,
  .fargah-viewer__bezel,
  .fargah-viewer__device::after {
    display: none;
  }

  .fargah-viewer__screen {
    min-height: 100svh;
    border-radius: 0;
    background:
      radial-gradient(circle at 50% 44%, rgba(200, 164, 93, 0.08), transparent 42%),
      linear-gradient(180deg, rgba(5, 5, 5, 0.56), rgba(5, 5, 5, 0.94)),
      url("../images/fargah/backgrounds/gold-ambient-poster-1080.jpg") center top / cover no-repeat,
      var(--bg-primary);
  }

  .fargah-viewer__screen .fargah-header {
    margin: 0;
    width: 100%;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fargah-viewer__bg {
    display: none;
  }
}
