.demo-page {
  margin: 0;
  background: #0d1716;
  overflow-x: clip;
}

.scroll-story,
.scroll-story * { box-sizing: border-box; }

.scroll-story a { color: inherit; text-decoration: none; }

.scroll-story {
  --ydc-ink: #0d1716;
  --ydc-brand: #324648;
  --ydc-cream: #f4f1ea;
  --ydc-peach: #ffc6b0;
  --ydc-white: #fff;
  --ydc-ease-out: cubic-bezier(.16, 1, .3, 1);
  position: relative;
  height: 680vh;
  min-height: 3800px;
  color: var(--ydc-white);
  background: var(--ydc-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.story-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  background: #d8ddd9;
}

.story-video {
  position: absolute;
  inset: 0;
  z-index: -4;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.012);
  filter: saturate(.92) contrast(1.03);
  will-change: contents;
}

.story-scrim {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(8, 18, 17, .68) 0%, rgba(8, 18, 17, .34) 34%, transparent 68%),
    linear-gradient(180deg, rgba(8, 18, 17, .48) 0%, transparent 26%, transparent 68%, rgba(8, 18, 17, .44) 100%);
  pointer-events: none;
}

.story-grain {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .055;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.story-header {
  position: absolute;
  inset: max(24px, env(safe-area-inset-top)) clamp(22px, 5vw, 78px) auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 8;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: .96rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.brand b { font-weight: 400; opacity: .72; }

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  align-items: end;
  gap: 3px;
  width: 21px;
  height: 22px;
}

.brand-mark i { display: block; border-radius: 6px; background: var(--ydc-peach); }
.brand-mark i:nth-child(1) { height: 11px; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 14px; }

.header-label {
  font-size: .69rem;
  font-weight: 650;
  letter-spacing: .22em;
  opacity: .78;
}

.story-copy {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.scene {
  --scene-opacity: 0;
  --scene-y: 28px;
  --scene-blur: 12px;
  --scene-scale: .985;
  position: absolute;
  left: clamp(24px, 8vw, 124px);
  bottom: clamp(98px, 17vh, 176px);
  width: min(680px, calc(100vw - 48px));
  opacity: var(--scene-opacity);
  transform: translate3d(0, var(--scene-y), 0) scale(var(--scene-scale));
  filter: blur(var(--scene-blur));
  transform-origin: left bottom;
  will-change: opacity, transform, filter;
}

.scene-kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  font-size: clamp(.68rem, 1vw, .78rem);
  font-weight: 720;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.scene-kicker span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.54);
  border-radius: 50%;
  font-size: .62rem;
  letter-spacing: 0;
}

.scene h1,
.scene h2 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(3rem, 6.4vw, 6.8rem);
  font-weight: 520;
  line-height: .91;
  letter-spacing: -.065em;
  text-wrap: balance;
}

.scene-body {
  max-width: 530px;
  margin: 27px 0 0;
  font-size: clamp(1rem, 1.42vw, 1.25rem);
  line-height: 1.55;
  letter-spacing: -.012em;
  color: rgba(255,255,255,.82);
}

.story-progress {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: clamp(18px, 3.2vw, 54px);
  display: grid;
  justify-items: center;
  gap: 12px;
  transform: translateY(-50%);
  font-size: .62rem;
  font-weight: 720;
  letter-spacing: .1em;
}

.progress-total { opacity: .46; }

.progress-track {
  position: relative;
  width: 1px;
  height: 118px;
  overflow: hidden;
  background: rgba(255,255,255,.26);
}

.progress-track i {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--ydc-white);
  transform: scaleY(var(--story-progress, 0));
  transform-origin: top;
  will-change: transform;
}

.scroll-hint {
  position: absolute;
  z-index: 5;
  right: clamp(28px, 5vw, 78px);
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: var(--hint-opacity, .8);
  transition: opacity .25s linear;
}

.scroll-hint i {
  width: 42px;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  animation: hint-pulse 1.8s var(--ydc-ease-out) infinite;
}

@keyframes hint-pulse {
  0%, 100% { transform: scaleX(.28); opacity: .42; }
  50% { transform: scaleX(1); opacity: 1; }
}

.loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 17px;
  background: #111c1b;
  transition: opacity .8s var(--ydc-ease-out), visibility .8s;
}

.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-word { font-size: 1.1rem; font-weight: 760; letter-spacing: .2em; }
.loader-line { width: 130px; height: 1px; background: rgba(255,255,255,.16); }
.loader-line i { display: block; width: var(--load-progress, 0%); height: 100%; background: var(--ydc-peach); transition: width .22s; }
.loader span { font-size: .61rem; letter-spacing: .16em; text-transform: uppercase; opacity: .5; }

.story-outro {
  min-height: 74vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  padding: 80px 24px;
  color: #0d1716;
  background: #f4f1ea;
  text-align: center;
}

.story-outro p { margin: 0; font-size: clamp(2.4rem, 6vw, 6.8rem); font-weight: 520; letter-spacing: -.06em; }
.story-outro span { font-size: .7rem; font-weight: 720; letter-spacing: .22em; color: #324648; }

@media (max-width: 700px) {
  .scroll-story { height: 580vh; min-height: 3000px; }
  .story-stage { min-height: 500px; }
  .story-video { object-position: 58% center; }
  .story-scrim {
    background:
      linear-gradient(180deg, rgba(8,18,17,.5) 0%, transparent 30%, rgba(8,18,17,.18) 52%, rgba(8,18,17,.86) 100%);
  }
  .header-label { display: none; }
  .scene { left: 24px; bottom: max(80px, calc(env(safe-area-inset-bottom) + 64px)); width: calc(100vw - 70px); }
  .scene h1, .scene h2 { font-size: clamp(2.8rem, 13vw, 4.5rem); line-height: .93; }
  .scene-body { max-width: 34rem; margin-top: 20px; font-size: .98rem; line-height: 1.48; }
  .scene-kicker { margin-bottom: 15px; }
  .story-progress { right: 13px; }
  .progress-track { height: 86px; }
  .scroll-hint { left: 24px; right: auto; bottom: 24px; }
  .scroll-hint span { display: none; }
}

@media (max-height: 650px) and (orientation: landscape) {
  .scene { bottom: 54px; }
  .scene h1, .scene h2 { font-size: clamp(2.4rem, 7vw, 4.4rem); }
  .scene-body { margin-top: 14px; font-size: .92rem; }
  .scene-kicker { margin-bottom: 10px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint i { animation: none; }
  .loader, .scene { transition: none; }
}

/* === overrides برای z-index (با کدهای قبلی ادغام می‌شود) === */
.story-stage    { z-index: 10;  } /* پایین‌تر از منو و navbar */
.story-header   { z-index: 60;  }
.loader         { z-index: 70;  }
.story-progress { z-index: 60;  }