:root {
  --bg-color: #af8e6d;
  --header-bg: rgba(44, 44, 46, 0.85);
  --footer-bg: rgba(44, 44, 46, 0.4);
  --text-primary: #1c1c1e;
  --text-secondary: #3a3a3c;
  --text-light: #f2f2f7;
  --text-muted: #aeaeab;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  padding-bottom: 70px;
}

html[dir="rtl"] body {
  text-align: right;
}

.main-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  height: 80px;
  padding: 0 40px;
  background-color: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
}

.nav-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 Auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  height: 100%;
}

.brand-logo img {
  width: auto;
  height: 40px !important;
  max-height: 40px !important;
  object-fit: contain;
  margin: 0;
  padding: 0;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--text-light);
}

.scroll-container {
  position: relative;
  width: 100%;
}

.visual-viewport {
  position: sticky;
  top: 80px;
  left: 0;
  width: 100%;
  height: calc(100vh - 150px);
  z-index: 1;
  overflow: hidden;
  background-color: var(--bg-color);
}

.visual-viewport::before,
.visual-viewport::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 12vh;
  z-index: 3;
  pointer-events: none;
}

.visual-viewport::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg-color), transparent);
}

.visual-viewport::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg-color), transparent);
}

.image-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.fade-img {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.fade-img.img-right:not(.work-cover) {
  right: 0;
  left: auto;
  object-position: right 15%;
  object-fit: cover !important;
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 35%),
                      linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 15%, rgba(0,0,0,1) 85%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 35%),
              linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 15%, rgba(0,0,0,1) 85%, rgba(0,0,0,0) 100%);
  -webkit-mask-composite: destination-in;
  mask-composite: intersect;
}

.fade-img.img-left:not(.work-cover) {
  left: 0;
  right: auto;
  object-position: left 15%;
  object-fit: cover !important;
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 35%),
                      linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 15%, rgba(0,0,0,1) 85%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to left, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 35%),
              linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 15%, rgba(0,0,0,1) 85%, rgba(0,0,0,0) 100%);
  -webkit-mask-composite: destination-in;
  mask-composite: intersect;
}

.image-stage .fade-img.work-cover {
  width: auto !important;
  height: 45vh !important;
  aspect-ratio: 1 / 1 !important;
  max-width: 440px !important;
  top: 50% !important;
  left: 12% !important;
  right: auto !important;
  transform: translateY(-50%) scale(1.02) !important;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 0 !important;
  object-fit: contain !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

.image-stage .fade-img.work-cover.active {
  transform: translateY(-50%) scale(1) !important;
}

.fade-img.active {
  opacity: 1;
  transform: scale(1);
}

.content-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.scroll-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 8%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.scroll-section.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

html[dir="ltr"] .scroll-section.align-left { justify-content: flex-start; }
html[dir="rtl"] .scroll-section.align-left { justify-content: flex-end; }

html[dir="ltr"] .scroll-section.align-right { justify-content: flex-end; }
html[dir="rtl"] .scroll-section.align-right { justify-content: flex-start; }

.text-block {
  max-width: 500px;
  width: 100%;
  transform: translateY(20px);
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.scroll-section.active .text-block {
  transform: translateY(0);
}

.section-label {
  display: block;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 600;
}

.section-title {
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 20px;
}

.section-desc {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  font-weight: 400;
}

.home-feature-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.event-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.scroll-trigger-area {
  position: relative;
  z-index: 20;
}

/* --- تنظیم دقیق زمان‌بندی اسکرول --- */
.trigger-zone:nth-child(1) {
  height: 100vh; /* اسلاید اول (عادی) */
}

.trigger-zone:nth-child(2) {
  height: 200vh; /* اسلاید دوم (طولانی‌تر برای جلوگیری از پرش) */
}

.trigger-zone:nth-child(3) {
  height: 120vh; /* اسلاید آخر (کمی بیشتر از عادی) */
}
/* ---------------------------------- */

.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background-color: var(--footer-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 90;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-logo-wrap {
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.center-logo {
  height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
}

@media (max-width: 992px) {
  body {
    padding-bottom: 56px;
  }
  .main-header {
    height: auto;
    min-height: 96px;
    padding: 10px 16px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-container {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }
  .brand-logo {
    height: auto;
  }
  .brand-logo img {
    height: 30px !important;
    max-height: 30px !important;
  }
  .nav-links {
    width: 100%;
    gap: 14px !important;
    justify-content: center;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-links a {
    flex: 0 0 auto;
    font-size: 11px;
    letter-spacing: .6px;
  }
  .visual-viewport {
    top: 96px;
    height: calc(100svh - 152px);
    min-height: 500px;
  }
  .fade-img {
    top: 48px;
    width: calc(100% - 32px);
    height: 43%;
    object-position: center center !important;
    object-fit: cover !important;
    left: 16px !important;
    right: 16px !important;
    opacity: 0 !important;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
    -webkit-mask-image: none !important;
    mask-image: none !important;
    -webkit-mask-composite: initial !important;
    mask-composite: initial !important;
  }
  .fade-img.active {
    opacity: 1 !important;
  }
  .image-stage .fade-img.work-cover {
    width: calc(100% - 32px) !important;
    height: 43% !important;
    max-width: none !important;
    max-height: none !important;
    top: 48px !important;
    left: 16px !important;
    right: 16px !important;
    transform: none !important;
    object-fit: cover !important;
    border: 0 !important;
    background: transparent;
  }
  .image-stage .fade-img.work-cover.active {
    opacity: 1 !important;
    transform: none !important;
  }
  .scroll-section {
    justify-content: center !important;
    align-items: flex-end;
    padding: 24px 16px 36px;
  }
  .text-block {
    max-width: 100%;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: rgba(175, 142, 109, .96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .section-label {
    margin-bottom: 8px;
    font-size: 10px;
  }
  .section-title {
    margin-bottom: 10px;
    font-size: clamp(27px, 8vw, 36px);
  }
  .section-desc {
    font-size: 14px;
    line-height: 1.55;
  }
  .trigger-zone:nth-child(1),
  .trigger-zone:nth-child(3) {
    height: 100svh;
  }
  .trigger-zone:nth-child(2) {
    height: 130svh;
  }
  .sticky-footer {
    height: 56px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .footer-logo-wrap {
    height: 34px;
  }
}

@media (max-width: 480px) {
  .visual-viewport {
    min-height: 460px;
  }
  .nav-links {
    justify-content: flex-start;
  }
  .scroll-section {
    padding-bottom: 24px;
  }
  .text-block {
    padding: 16px;
  }
}
