/* Additive home-page visuals. The existing application bundle stays untouched. */
body.forest-preview main > section:has([aria-label="تصاویر فضای هیلان"]) {
  background-image:
    linear-gradient(to left,
      rgba(250, 246, 234, .94) 0%,
      rgba(250, 246, 234, .79) 48%,
      rgba(250, 246, 234, .60) 100%),
    url('/images/hero-new.webp');
  background-size: cover;
  background-position: center 48%;
  background-repeat: no-repeat;
}
body.forest-preview main { overflow-x: clip; }

/* Branches live inside the content sections, away from the hero and footer. */
body.forest-preview main > section.forest-scene {
  position: relative;
  isolation: isolate;
}
body.forest-preview main > section.forest-scene > :not(.forest-branch):not(.absolute) {
  position: relative;
  z-index: 1;
}
body.forest-preview main > section.forest-scene > .forest-branch {
  position: absolute;
  z-index: 0;
  display: block;
  width: var(--size);
  height: auto;
  transform-origin: var(--origin);
  transform-style: flat;
  will-change: transform;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(16px 20px 17px rgba(23, 44, 37, .2));
}
body.forest-preview main > section.forest-scene > .forest-branch.far {
  opacity: .29;
  filter: blur(.7px) drop-shadow(12px 16px 15px rgba(23, 44, 37, .13));
}
body.forest-preview main > section.forest-scene > .forest-branch.mid { opacity: .4; }
body.forest-preview main > section.forest-scene > .forest-branch.near { opacity: .48; }

/* The left branch has its stem beyond the page edge and foliage within it. */
body.forest-preview main > section.forest-scene > .b1 {
  --size: clamp(430px, 42vw, 590px);
  --origin: 50% 50%;
  top: 240px;
}
body.forest-preview main > section.forest-scene > .b2 {
  --size: clamp(370px, 38vw, 520px);
  --origin: 95% 3%;
  top: 205px;
}
body.forest-preview main > section.forest-scene > .b3 {
  --size: clamp(350px, 36vw, 490px);
  --origin: 50% 50%;
  top: 125px;
}
body.forest-preview main > section.forest-scene > .b4 {
  --size: clamp(420px, 40vw, 560px);
  --origin: 95% 3%;
  top: 175px;
}

/* A light card keeps the Farzad text above the foliage. */
body.forest-preview #farzad > div.relative.max-w-6xl > div:last-child {
  position: relative;
  z-index: 1;
  background: rgba(250, 246, 234, .88);
  border-radius: 32px;
  padding: clamp(20px, 2.5vw, 36px);
}
body.forest-preview main > section.forest-scene > .space-y-3 > div {
  position: relative;
  z-index: 2;
  isolation: isolate;
  background: #fff;
}

@media (max-width: 767px) {
  body.forest-preview main > section:has([aria-label="تصاویر فضای هیلان"]) {
    background-image:
      linear-gradient(rgba(250, 246, 234, .89), rgba(250, 246, 234, .84)),
      url('/images/hero-new.webp');
    background-position: 58% center;
  }
  body.forest-preview main > section.forest-scene > .forest-branch.far {
    filter: drop-shadow(12px 15px 14px rgba(23, 44, 37, .2));
  }
  body.forest-preview main > section.forest-scene > .forest-branch.b1 { --size: 360px; top: 255px; opacity: .55; }
  body.forest-preview main > section.forest-scene > .forest-branch.b2 { --size: 330px; top: 330px; opacity: .52; }
  body.forest-preview main > section.forest-scene > .forest-branch.b3 { --size: 330px; top: 560px; opacity: .42; }
  body.forest-preview main > section.forest-scene > .forest-branch.b4 { --size: 320px; top: 130px; opacity: .45; }
  body.forest-preview #about > div:last-child {
    background: linear-gradient(to left, rgba(250, 246, 234, .95), rgba(250, 246, 234, .7));
    border-radius: 28px;
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.forest-preview .forest-branch { will-change: auto; transition: none !important; }
}
