/* ==========================================================================
   07 — Hero: نخلستان زنده (Canvas) + تایپوگرافی متحرک + نوار محصولات
   ========================================================================== */

.hero {
	--hero-h: max(640px, min(calc(100svh - var(--header-h) - var(--topbar-h)), 940px));
	position: relative; isolation: isolate; overflow: hidden;
	min-height: var(--hero-h);
	display: flex; flex-direction: column;
	background: linear-gradient(180deg, #EED9A0 0%, #F5E8C6 38%, #F8F1E0 72%, var(--cream) 100%);
}
@media (max-width: 899px) { .hero { --hero-h: auto; --palm-h: min(115vw, 470px); } }

/* ---------- Scene ---------- */
.hero__scene { position: absolute; inset: 0; z-index: -2; opacity: 0; transform: scale(1.04); transition: opacity 1.2s var(--ease), transform 2.4s var(--ease); }
.hero__scene.is-ready { opacity: 1; transform: none; }
.hero__scene canvas { display: block; width: 100%; height: 100%; }

/* پرده نوری برای خوانایی متن */
.hero__veil { position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background:
		radial-gradient(55% 70% at 100% 45%, rgba(248,243,232,.92) 0%, rgba(248,243,232,.7) 45%, rgba(248,243,232,0) 75%),
		linear-gradient(0deg, var(--cream) 0%, rgba(248,243,232,0) 14%);
}
@media (max-width: 899px) {
	.hero__veil { background: linear-gradient(180deg, rgba(248,243,232,0) 0, rgba(248,243,232,0) calc(var(--palm-h) - 90px), rgba(248,243,232,.9) calc(var(--palm-h) - 10px), var(--cream) calc(var(--palm-h) + 40px)); }
}

/* ---------- Layout ---------- */
.hero__in { flex: 1; display: grid; align-items: center; padding-block: 40px 96px; }
.hero__text { display: flex; flex-direction: column; align-items: flex-start; max-width: 600px; }
@media (min-width: 900px) {
	.hero__in { grid-template-columns: 1fr 1fr; }
	.hero__text { grid-column: 1; } /* RTL: ستون راست */
}
@media (max-width: 899px) {
	.hero__in { align-items: start; padding-block: calc(var(--palm-h) - 50px) 104px; }
	.hero__text { align-items: center; text-align: center; margin-inline: auto; }
}

/* ---------- Location label ---------- */
.hero__loc { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: var(--r-pill); background: rgba(255,255,255,.66); border: 1px solid rgba(201,154,39,.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: var(--fs-sm); font-weight: 700; color: var(--green-deep); animation: heroUp .9s .1s var(--ease) both; }
.hero__pin { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: var(--gold-light); }
.hero__pin .ico { width: 16px; height: 16px; }
.hero__sep { width: 18px; height: 1.5px; background: var(--gold); }
.hero__loc-sub { color: var(--brown); font-weight: 600; }
@media (max-width: 480px) { .hero__loc-sub, .hero__sep { display: none; } }

/* ---------- Title: کلمه‌به‌کلمه از زیر ماسک ---------- */
.hero__title { margin: 22px 0 18px; font-size: clamp(2.3rem, 1.2rem + 4.6vw, 4.7rem); font-weight: 900; line-height: 1.22; letter-spacing: -.02em; color: var(--green-deep); }
.hero__ln { display: block; }
.hero__w { position: relative; display: inline-block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; vertical-align: top; }
.hero__w > span { display: inline-block; transform: translateY(110%) rotate(4deg); animation: wordUp 1s calc(.25s + var(--i) * .09s) var(--ease) forwards; }
.hero__w--gold { overflow: visible; }
.hero__w--gold > span {
	background: linear-gradient(100deg, #A87A12 0%, #C99A27 30%, #F1D27A 50%, #C99A27 70%, #8C640E 100%);
	background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
	animation: wordUp 1s calc(.25s + var(--i) * .09s) var(--ease) forwards, goldShift 6s 2s linear infinite;
	padding-inline: .04em;
}
.hero__brush { position: absolute; right: -2%; left: -2%; bottom: -.02em; width: 104%; height: .32em; overflow: visible; }
.hero__brush path { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; opacity: .55; stroke-dasharray: 320; stroke-dashoffset: 320; animation: draw 1.1s 1.15s var(--ease) forwards; }

.hero__lead { max-width: 480px; font-size: clamp(1.02rem, .95rem + .4vw, 1.25rem); color: var(--ink-2); line-height: 1.9; animation: heroUp 1s .85s var(--ease) both; }

/* ---------- CTA ---------- */
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; animation: heroUp 1s 1s var(--ease) both; }
@media (max-width: 899px) { .hero__cta { justify-content: center; } .hero__cta .btn { flex: 1 1 180px; } }
.btn--glass { background: rgba(255,255,255,.6); color: var(--green-deep); border-color: rgba(7,85,43,.18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn--glass:hover { background: #fff; color: var(--green); border-color: var(--green); }
.hero__play { width: 34px; height: 34px; margin-inline-start: -14px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: var(--gold-light); transition: transform .5s var(--ease); }
.hero__play .ico { width: 18px; height: 18px; }
.btn--glass:hover .hero__play { transform: rotate(-18deg) scale(1.08); }

/* درخشش دوره‌ای روی دکمه اصلی */
.btn--shine { overflow: hidden; isolation: isolate; }
.btn--shine::before {
	content: ""; position: absolute; inset: -2px; z-index: -1; pointer-events: none;
	background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.7) 48%, transparent 66%);
	transform: translateX(120%); animation: shine 4.5s 2.2s var(--ease-io) infinite;
}

/* ---------- Category mini cards ---------- */
.hero__cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 34px; width: 100%; }
@media (min-width: 640px) { .hero__cats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hero__cats li { animation: heroUp .9s calc(.9s + (var(--i) - 6) * .08s) var(--ease) both; }
.hero__cats a {
	display: flex; align-items: center; gap: 10px; height: 100%; padding: 10px 12px; border-radius: var(--r);
	background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
	box-shadow: 0 10px 24px -18px rgba(6,61,33,.5); text-align: right;
	transition: transform .45s var(--ease), background var(--t), box-shadow var(--t);
}
.hero__cats a:hover { transform: translateY(-4px); background: #fff; box-shadow: 0 18px 30px -20px rgba(6,61,33,.6); }
.hero__cat-ico { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: var(--green); color: var(--gold-light); transition: transform .5s var(--ease); }
.hero__cat-ico .ico { width: 20px; height: 20px; }
.hero__cats a:hover .hero__cat-ico { transform: rotate(-10deg) scale(1.08); }
.hero__cat-txt { min-width: 0; line-height: 1.4; }
.hero__cat-txt b { display: block; font-size: var(--fs-sm); color: var(--green-deep); }
.hero__cat-txt small { display: none; font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Tools ---------- */
.hero__tools { position: absolute; z-index: 2; bottom: 74px; left: var(--gutter); display: flex; align-items: center; gap: 10px; }
.hero__motion {    opacity: 0; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.75); border: 1px solid var(--line); display: grid; place-items: center; backdrop-filter: blur(6px); transition: background var(--t); }
.hero__motion:hover { background: #fff; }
.hero__motion-pause { width: 10px; height: 12px; border-inline: 3px solid var(--green); }
.hero__motion[aria-pressed="true"] .hero__motion-pause { width: 0; height: 0; border: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-right: 11px solid var(--green); margin-right: 3px; }
.hero__hint { display: none; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--brown); opacity: .75; animation: heroUp 1s 2.4s var(--ease) both; }
.hero__hint .ico { width: 16px; height: 16px; animation: wave 2.2s 3s ease-in-out infinite; transform-origin: 70% 90%; }
@media (hover: hover) and (min-width: 900px) { .hero__hint { display: inline-flex; } }

.hero__scroll { display: none; position: absolute; z-index: 2; bottom: 74px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(104,58,32,.35); border-radius: 14px; }
.hero__scroll span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold); animation: scrollHint 1.8s var(--ease-io) infinite; }
@media (min-width: 900px) { .hero__scroll { display: block; } }

/* ---------- Marquee ---------- */
.marquee { position: relative; z-index: 1; overflow: hidden; background: var(--green-deep); color: #F1E6C6; padding: 14px 0; border-top: 1px solid rgba(232,198,106,.25); }
.marquee::before, .marquee::after { content: ""; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 1; pointer-events: none; }
.marquee::before { right: 0; background: linear-gradient(270deg, var(--green-deep), transparent); }
.marquee::after { left: 0; background: linear-gradient(90deg, var(--green-deep), transparent); }
.marquee__track { display: flex; align-items: center; gap: 28px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { font-size: clamp(1rem, .9rem + .5vw, 1.3rem); font-weight: 800; white-space: nowrap; }
.marquee__item:nth-child(4n+1) { color: var(--gold-light); }
.marquee__dot { width: 11px; height: 16px; flex-shrink: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #E2733A, #6B2510); transform: rotate(25deg); }

/* ---------- Keyframes ---------- */
@keyframes wordUp { to { transform: none; } }
@keyframes heroUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes goldShift { from { background-position: 0 0; } to { background-position: -220% 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes shine { 0% { transform: translateX(120%); } 28%, 100% { transform: translateX(-120%); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(50%); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 15% { transform: rotate(-18deg); } 30% { transform: rotate(12deg); } 45% { transform: rotate(-8deg); } }
@keyframes scrollHint { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
	.marquee__track { animation-duration: 70s; }
}


@media (max-width: 899px) { .hero__tools { top: 12px; bottom: auto; } .hero__hint { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.7); } }
