/* ==========================================================================
   دارالقرآن احمدانی — طراحی سه‌بعدی
   ستاره حجیم، هیرو WebGL، قاب خبر، کارت‌های چرخان، مکعب‌ها، کاروسل Coverflow،
   قفسه کتاب، گالری استوانه‌ای، تونل محراب و سکه
   طراحی و برنامه‌نویسی: mnr
   ========================================================================== */

:root {
	--star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 2 61.5 22.3 84 16 77.7 38.5 98 50 77.7 61.5 84 84 61.5 77.7 50 98 38.5 77.7 16 84 22.3 61.5 2 50 22.3 38.5 16 16 38.5 22.3Z'/%3E%3C/svg%3E");
	--arch-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 520' preserveAspectRatio='none'%3E%3Cpath d='M0 520V230C0 115 95 55 200 0c105 55 200 115 200 230v290z'/%3E%3C/svg%3E");
	--depth-shadow: 0 40px 80px -40px rgba(3, 26, 20, .65);
}

/* ---------- ستاره هشت‌پر حجیم (لایه‌های CSS) ---------- */
.star3d {
	--s: 120px; --n: 12;
	--t: calc(var(--s) / 90);
	display: inline-block;
	width: var(--s); height: var(--s);
	perspective: calc(var(--s) * 6);
	flex: none;
	pointer-events: none;
}
.star3d__body {
	position: relative; display: block;
	width: 100%; height: 100%;
	transform-style: preserve-3d;
	animation: star3dSpin 14s linear infinite;
}
.star3d__body i,
.star3d__body b,
.star3d__body::after {
	position: absolute; inset: 0;
	-webkit-mask: var(--star-mask) center / contain no-repeat;
	mask: var(--star-mask) center / contain no-repeat;
}
.star3d__body i {
	background: linear-gradient(135deg, #a78231, #5c4612);
	transform: translateZ(calc((var(--k) - var(--n) / 2) * var(--t)));
}
.star3d__body b {
	background:
		radial-gradient(circle, var(--em-800) 0 17%, #f6e3a4 18% 21%, transparent 22%),
		var(--gold-grad);
	transform: translateZ(calc(var(--n) / 2 * var(--t)));
}
.star3d__body::after {
	content: "";
	background:
		radial-gradient(circle, var(--em-700) 0 17%, #f6e3a4 18% 21%, transparent 22%),
		linear-gradient(135deg, #e8cd85, #b8902f);
	transform: translateZ(calc(var(--n) / -2 * var(--t))) rotateY(180deg);
}
@keyframes star3dSpin {
	from { transform: rotateX(14deg) rotateY(0deg); }
	to { transform: rotateX(14deg) rotateY(360deg); }
}
@keyframes star3dWobble {
	from { transform: rotateX(24deg) rotateY(-30deg) rotateZ(0deg); }
	to { transform: rotateX(24deg) rotateY(-30deg) rotateZ(360deg); }
}
.star3d--sm { --s: 64px; }
.star3d--sm .star3d__body, .star3d--tunnel .star3d__body { animation-name: star3dWobble; animation-duration: 24s; }
.star3d--btn { --s: 20px; margin-inline-end: 2px; }
.star3d--btn .star3d__body { animation-duration: 6s; }
.star3d--hero { --s: 190px; }
.star3d--tunnel { --s: 110px; }

/* ---------- بوم‌های جلوه (بدون fx.js پنهان می‌شوند) ---------- */
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
html:not(.fx-on) .fx-canvas { display: none; }

/* ---------- هیرو سه‌بعدی (WebGL) ---------- */
.hero--3d { min-height: min(920px, 100vh); display: flex; flex-direction: column; justify-content: center; }
.hero--3d .hero__grid { position: relative; z-index: 2; width: 100%; }
.hero3d { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero3d__canvas { display: block; width: 100% !important; height: 100% !important; opacity: 0; transition: opacity 1.4s var(--ease); }
.hero3d__canvas.is-on { opacity: 1; }
.hero.is-3d .mihrab { opacity: 0; visibility: hidden; pointer-events: none; }
.hero.is-3d .hero__neural { display: none; }
.hero.is-3d .hero__glow { left: 14%; top: 18%; opacity: .55; }
.hero.is-3d .hero__visual { min-height: 520px; cursor: grab; }
.hero.is-3d.is-grabbing .hero__visual { cursor: grabbing; }
.hero__visual .float-card { z-index: 2; color: #fff; }
.hero__visual .float-card:hover { background: rgba(255, 255, 255, .16); border-color: var(--gold-2); }
.hero__visual .float-card small { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.hero.is-3d .float-card--a { top: 8%; right: 2%; }
.hero.is-3d .float-card--b { bottom: 10%; left: 0; }
.hero3d__hint {
	position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 12.5px; color: rgba(246, 232, 189, .6);
	opacity: 0; transition: opacity .6s;
	white-space: nowrap;
}
.hero3d__hint .ahm-ico { width: 18px; height: 18px; }
.hero.is-3d .hero3d__hint { opacity: 1; animation: hintNudge 3s ease-in-out infinite; }
@keyframes hintNudge { 50% { transform: translateX(calc(-50% - 8px)); } }

/* عنوان حجیم هیرو */
.hero__title3d {
	position: relative;
	color: #fff;
	text-shadow:
		0 1px 0 #d9b45c, 0 2px 0 #c9a24a, 0 3px 0 #b8902f, 0 4px 0 #a07d28,
		0 5px 0 #8a6a22, 0 6px 0 #6f551b, 0 7px 1px rgba(0, 0, 0, .25),
		0 12px 18px rgba(0, 0, 0, .35), 0 22px 40px rgba(0, 0, 0, .3);
	transform: perspective(700px) rotateX(10deg);
	transform-origin: 50% 100%;
}

/* ---------- ورود سه‌بعدی عناصر ---------- */
.js .section [data-reveal]:not(.card3d):not(.news3d__lead):not(.tunnel3d) {
	transform: perspective(1000px) rotateX(16deg) translateY(36px);
	transform-origin: 50% 100%;
}
.js .section [data-reveal].is-in:not(.card3d):not(.news3d__lead):not(.tunnel3d) { transform: none; }

/* ---------- کارت نوشته با لایه‌های عمق ---------- */
.card3d {
	--rx: 0deg; --ry: 0deg; --lift: 0px;
	transform-style: preserve-3d;
	overflow: visible !important;
}
.js .card3d[data-reveal] { transform: perspective(1000px) rotateX(16deg) translateY(36px); }
.js .card3d[data-reveal].is-in,
.card3d:not([data-reveal]) {
	transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
	transition: opacity .9s var(--ease) var(--d, 0ms), transform .35s ease-out, box-shadow .5s;
}
.card3d.is-tilt:hover { --lift: -6px; transition: transform .12s linear, box-shadow .5s; }
.card3d .ahm-card__media { border-radius: var(--radius) var(--radius) 0 0; transform-style: preserve-3d; overflow: visible; }
.card3d .ahm-card__media > img, .card3d .ahm-card__media > .thumb-ph { border-radius: var(--radius) var(--radius) 0 0; }
.card3d .ahm-card__media::after { border-radius: var(--radius) var(--radius) 0 0; }
.card3d [data-z] { transform: translateZ(var(--z, 0px)); transition: transform .4s var(--ease); }
.card3d__play {
	position: absolute; top: 14px; left: 14px; z-index: 2;
	display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
	background: var(--gold-grad); color: var(--em-900);
	box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .6);
}
.card3d__play .ahm-ico { width: 18px; height: 18px; fill: currentColor; margin-left: -2px; }
.card3d .ahm-card__media img { aspect-ratio: 3 / 2; }
.thumb-ph {
	display: grid; place-items: center; width: 100%; height: 100%; min-height: 100%;
	background: radial-gradient(circle at 50% 40%, var(--em-600), var(--em-900));
	position: relative;
}
.thumb-ph::before { content: ""; position: absolute; inset: 0; background: var(--pattern); background-size: 60px; opacity: .2; }
.thumb-ph .ahm-star { position: relative; width: 34%; color: var(--gold); opacity: .85; animation: spin 40s linear infinite; }

/* ---------- ۱) تازه‌ترین اخبار: قاب سه‌بعدی ---------- */
.news3d__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 34px; align-items: stretch; }
.news3d__lead {
	--rx: 0deg; --ry: 0deg;
	position: relative;
	min-height: 520px;
	border-radius: 30px;
	transform-style: preserve-3d;
	transform: perspective(1400px) rotateX(var(--rx)) rotateY(var(--ry));
	transition: transform .4s ease-out, opacity .9s var(--ease);
	box-shadow: var(--depth-shadow);
	isolation: isolate;
}
.js .news3d__lead[data-reveal]:not(.is-in) { transform: perspective(1400px) rotateY(-22deg) translateX(-40px); }
.news3d__media { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: var(--em-800); }
.news3d__media img, .news3d__media .thumb-ph { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.news3d__lead:hover .news3d__media img { transform: scale(1.06); }
.news3d__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(3, 26, 20, .94) 0%, rgba(3, 26, 20, .55) 42%, transparent 75%); }
.news3d__frame {
	position: absolute; inset: 18px; border-radius: 22px;
	border: 1.5px solid rgba(246, 227, 164, .45);
	transform: translateZ(var(--z, 30px));
	pointer-events: none;
}
.news3d__frame::before, .news3d__frame::after {
	content: ""; position: absolute; width: 40px; height: 40px; border: 3px solid var(--gold-2);
}
.news3d__frame::before { top: -3px; right: -3px; border-width: 3px 3px 0 0; border-radius: 0 22px 0 0; }
.news3d__frame::after { bottom: -3px; left: -3px; border-width: 0 0 3px 3px; border-radius: 0 0 0 22px; }
.news3d__body {
	position: absolute; right: 0; left: 0; bottom: 0;
	padding: 40px clamp(24px, 4vw, 46px);
	color: #fff;
	transform: translateZ(var(--z, 70px));
}
.news3d__badge {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 14px; border-radius: 99px;
	background: var(--gold-grad); color: var(--em-900);
	font-size: 13px; font-weight: 800; margin-bottom: 14px;
	box-shadow: 0 10px 22px -10px rgba(201, 162, 74, .9);
}
.news3d__badge .ahm-star { width: 15px; height: 15px; animation: spin 8s linear infinite; }
.news3d__body h3 { font-size: clamp(21px, 2.3vw, 30px); line-height: 1.6; margin-bottom: 10px; }
.news3d__body h3 a { color: #fff !important; text-shadow: 0 4px 20px rgba(0, 0, 0, .5); }
.news3d__body p { color: rgba(255, 255, 255, .8); font-size: 15px; margin-bottom: 14px; }
.news3d__meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13.5px; color: var(--gold-3); }
.news3d__meta span { display: inline-flex; align-items: center; gap: 6px; }
.news3d__meta .ahm-ico { width: 16px; height: 16px; color: var(--gold); }

.news3d__stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; perspective: 1200px; align-content: start; }
.news3d__item a {
	display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 16px;
	padding: 12px; padding-left: 16px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 20px;
	color: var(--text) !important;
	transform-origin: 100% 50%;
	transform: rotateY(calc(var(--i, 0) * -1.2deg));
	transition: transform .5s var(--ease), box-shadow .5s, border-color .4s, background .4s;
	box-shadow: 0 12px 26px -24px rgba(6, 41, 31, .7);
}
.news3d__item a:hover {
	transform: translateZ(40px) rotateY(-6deg) translateX(-6px);
	border-color: var(--line-gold);
	box-shadow: 30px 24px 46px -30px rgba(6, 41, 31, .55);
}
.news3d__thumb { display: block; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--em-800); }
.news3d__thumb img, .news3d__thumb .thumb-ph { width: 100%; height: 100%; object-fit: cover; }
.news3d__txt { display: grid; gap: 4px; min-width: 0; }
.news3d__txt b { font-size: 15px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news3d__txt small { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; }
.news3d__txt small .ahm-ico { width: 14px; height: 14px; color: var(--gold); }
.news3d__go { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(201, 162, 74, .14); color: var(--gold-d); transition: background .3s, color .3s, transform .4s var(--ease); }
.news3d__go .ahm-ico { width: 16px; height: 16px; }
.news3d__item a:hover .news3d__go { background: var(--gold); color: var(--em-900); transform: translateX(-4px); }
[data-mode="dark"] .news3d__go { color: var(--gold-2); }

/* ---------- ۲) کارت‌های چرخان فعالیت‌ها ---------- */
.units__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.flip3d { perspective: 1200px; min-height: 290px; outline: none; cursor: pointer; }
.flip3d__inner {
	position: relative; height: 100%; min-height: inherit;
	transform-style: preserve-3d;
	transition: transform .9s cubic-bezier(.3, 1.3, .4, 1);
}
.flip3d.is-flipped .flip3d__inner, .flip3d:focus-within .flip3d__inner { transform: rotateY(180deg); }
.flip3d:focus-visible .flip3d__inner { box-shadow: 0 0 0 3px var(--gold); border-radius: 26px; }
.flip3d__face {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
	padding: 30px 26px;
	border-radius: 26px;
	-webkit-backface-visibility: hidden; backface-visibility: hidden;
	overflow: hidden;
}
.flip3d__front {
	background: var(--surface);
	border: 1px solid var(--line);
	box-shadow: 0 20px 40px -32px rgba(6, 41, 31, .7);
}
.flip3d__front::before {
	content: ""; position: absolute; inset: 0;
	background: radial-gradient(120% 70% at 50% 110%, rgba(201, 162, 74, .2), transparent 60%);
	pointer-events: none;
}
.flip3d__num { position: absolute; top: 16px; right: 22px; font-family: var(--f-kufi); font-size: 30px; line-height: 1; color: rgba(201, 162, 74, .28); }
.flip3d__ico { position: relative; display: grid; place-items: center; width: 92px; height: 92px; margin-bottom: 16px; transform: translateZ(50px); }
.flip3d__ico .star3d { position: absolute; inset: 0; --s: 92px; }
.flip3d__ico .star3d__body { animation-duration: 18s; }
.flip3d__ico > .ahm-ico {
	position: relative; z-index: 2;
	width: 46px; height: 46px; padding: 11px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, var(--em-500), var(--em-900));
	color: var(--gold-2);
	box-shadow: 0 0 0 2px var(--gold-2), 0 10px 20px -6px rgba(3, 26, 20, .7);
	transform: translateZ(30px);
}
.flip3d__ico .star3d__body b { background: var(--gold-grad); }
.flip3d__front h3 { font-size: 21px; margin: 0 0 10px; }
.flip3d__hint { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.flip3d__hint .ahm-ico { width: 15px; height: 15px; color: var(--gold); }
.flip3d__back {
	transform: rotateY(180deg);
	background:
		radial-gradient(circle at 80% 0%, rgba(201, 162, 74, .28), transparent 55%),
		linear-gradient(150deg, var(--em-700), var(--em-950));
	color: #fff;
	border: 1px solid rgba(246, 227, 164, .3);
	box-shadow: var(--depth-shadow);
}
.flip3d__back::before { content: ""; position: absolute; inset: 0; background: var(--pattern); background-size: 64px; opacity: .1; }
.flip3d__back > * { position: relative; }
.flip3d__back h3 { color: var(--gold-2); font-size: 20px; margin-bottom: 8px; }
.flip3d__back p { color: rgba(255, 255, 255, .82); font-size: 14.5px; line-height: 2; margin-bottom: 16px; }

/* ---------- ۳) مکعب‌های دسته‌ها ---------- */
.explore { overflow: hidden; background: linear-gradient(170deg, var(--em-800), var(--em-950)); color: #fff; }
.explore .sec-title { color: #fff; }
.explore .sec-kicker { color: var(--gold-2); }
.explore__pattern { position: absolute; inset: 0; background: var(--pattern); background-size: 88px; opacity: .07; }
.explore > .ahm-container { position: relative; }
.explore__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; justify-items: center; padding-top: 10px; }
.cube3d { --c: 200px; display: flex; flex-direction: column; align-items: center; gap: 26px; color: #fff !important; outline: none; }
.cube3d__scene { position: relative; display: block; width: var(--c); height: var(--c); perspective: 900px; }
.cube3d__box {
	position: absolute; inset: 0;
	transform-style: preserve-3d;
	transform: translateZ(calc(var(--c) / -2)) rotateX(-24deg) rotateY(-30deg);
	transition: transform 1s cubic-bezier(.3, 1.2, .4, 1);
	animation: cubeFloat 6s ease-in-out infinite;
}
.cube3d:nth-child(2) .cube3d__box { animation-delay: -2s; }
.cube3d:nth-child(3) .cube3d__box { animation-delay: -4s; }
@keyframes cubeFloat { 50% { translate: 0 -12px; } }
.cube3d:hover .cube3d__box, .cube3d:focus-visible .cube3d__box, .cube3d.is-turned .cube3d__box {
	transform: translateZ(calc(var(--c) / -2)) rotateX(-16deg) rotateY(-100deg);
}
.cube3d__f {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
	padding: 18px;
	border: 1px solid rgba(246, 227, 164, .5);
	border-radius: 6px;
	-webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.cube3d__f--front { transform: rotateY(0) translateZ(calc(var(--c) / 2)); background: linear-gradient(145deg, var(--em-600), var(--em-800)); }
.cube3d__f--side { transform: rotateY(90deg) translateZ(calc(var(--c) / 2)); background: var(--gold-grad); color: var(--em-900); }
.cube3d__f--back { transform: rotateY(180deg) translateZ(calc(var(--c) / 2)); background: var(--em-900); }
.cube3d__f--left { transform: rotateY(-90deg) translateZ(calc(var(--c) / 2)); background: linear-gradient(145deg, #0f5a45, #073326); }
.cube3d__f--top { transform: rotateX(90deg) translateZ(calc(var(--c) / 2)); background: linear-gradient(135deg, #f6e3a4, #c9a24a); color: var(--em-900); }
.cube3d__f--bottom { transform: rotateX(-90deg) translateZ(calc(var(--c) / 2)); background: #021510; }
.cube3d__f--front::before { content: ""; position: absolute; inset: 0; background: var(--pattern); background-size: 50px; opacity: .14; }
.cube3d__f--front .ahm-ico { position: relative; width: 50px; height: 50px; color: var(--gold-2); filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .35)); }
.cube3d__f--front b { position: relative; font-family: var(--f-kufi); font-size: 19px; line-height: 1.5; }
.cube3d__f--side small { font-size: 12px; font-weight: 700; opacity: .75; }
.cube3d__f--side b { font-size: 14.5px; line-height: 1.8; }
.cube3d__f--side i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--em-900); color: var(--gold-2); }
.cube3d__f--side i .ahm-ico { width: 16px; height: 16px; }
.cube3d__f--top b { font-family: var(--f-kufi); font-size: 44px; line-height: 1; }
.cube3d__f--top small { font-size: 13px; font-weight: 700; }
.cube3d__shadow {
	position: absolute; left: 6%; right: 6%; bottom: -46px; height: 30px;
	background: radial-gradient(ellipse, rgba(0, 0, 0, .55), transparent 70%);
	filter: blur(6px);
	animation: cubeShadow 6s ease-in-out infinite;
}
.cube3d:nth-child(2) .cube3d__shadow { animation-delay: -2s; }
.cube3d:nth-child(3) .cube3d__shadow { animation-delay: -4s; }
@keyframes cubeShadow { 50% { transform: scale(.85); opacity: .7; } }
.cube3d__label { font-weight: 700; font-size: 15.5px; color: var(--gold-3); margin-top: 12px; }

/* ---------- ۴) کاروسل سه‌بعدی رسانه ---------- */
.media3d { overflow: hidden; background: #03140f; color: #fff; padding-bottom: 90px; }
.media3d .sec-title { color: #fff; }
.media3d .sec-kicker { color: var(--gold-2); }
.media3d .sec-desc { color: rgba(255, 255, 255, .65); }
.media3d__bg {
	position: absolute; inset: 0;
	background:
		radial-gradient(800px 400px at 50% 62%, rgba(26, 122, 94, .45), transparent 70%),
		radial-gradient(600px 300px at 50% 100%, rgba(201, 162, 74, .18), transparent 70%);
}
.media3d__bg::after {
	content: ""; position: absolute; left: -10%; right: -10%; bottom: 0; height: 46%;
	background:
		linear-gradient(rgba(201, 162, 74, .22) 1px, transparent 1px) 0 0 / 60px 60px,
		linear-gradient(90deg, rgba(201, 162, 74, .22) 1px, transparent 1px) 0 0 / 60px 60px;
	transform: perspective(500px) rotateX(62deg);
	transform-origin: 50% 100%;
	-webkit-mask-image: linear-gradient(transparent, #000 60%);
	mask-image: linear-gradient(transparent, #000 60%);
}
.media3d > .ahm-container { position: relative; }
.coverflow { position: relative; }
.coverflow__stage {
	position: relative;
	height: clamp(300px, 34vw, 420px);
	perspective: 1300px;
	transform-style: preserve-3d;
	touch-action: pan-y;
	user-select: none; -webkit-user-select: none;
	outline: none;
}
.coverflow__item {
	--shade: 0;
	position: absolute; top: 0; left: 50%;
	width: clamp(240px, 30vw, 400px);
	margin-left: calc(clamp(240px, 30vw, 400px) / -2);
	transform-style: preserve-3d;
	transition: opacity .3s;
	will-change: transform;
}
.coverflow:not(.is-ready) .coverflow__item:not(:first-child) { opacity: 0; }
.coverflow__card {
	position: relative; display: block;
	aspect-ratio: 16 / 10;
	border-radius: 20px;
	overflow: hidden;
	background: var(--em-800);
	box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .8);
	border: 1px solid rgba(246, 227, 164, .2);
	color: #fff !important;
}
.coverflow__card::after { content: ""; position: absolute; inset: 0; background: rgba(2, 14, 10, var(--shade)); transition: background .3s; pointer-events: none; }
.coverflow__img, .coverflow__img img, .coverflow__img .thumb-ph { display: block; width: 100%; height: 100%; object-fit: cover; }
.coverflow__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(3, 26, 20, .92), transparent 60%); }
.coverflow__play {
	position: absolute; top: 50%; left: 50%; z-index: 2;
	width: 64px; height: 64px; margin: -32px 0 0 -32px;
	display: grid; place-items: center; border-radius: 50%;
	background: rgba(255, 255, 255, .14); border: 1.5px solid rgba(246, 227, 164, .6);
	backdrop-filter: blur(6px);
	color: var(--gold-2);
	transform: scale(.7); opacity: 0;
	transition: transform .5s var(--ease), opacity .4s, background .3s;
}
.coverflow__play .ahm-ico { width: 24px; height: 24px; fill: currentColor; margin-left: -3px; }
.coverflow__item.is-active .coverflow__play { transform: none; opacity: 1; }
.coverflow__item.is-active .coverflow__card:hover .coverflow__play { background: var(--gold); color: var(--em-900); }
.coverflow__item.is-active .coverflow__play::before {
	content: ""; position: absolute; inset: -8px; border-radius: 50%;
	border: 1px solid rgba(246, 227, 164, .5);
	animation: ping 2s ease-out infinite;
}
@keyframes ping { to { transform: scale(1.6); opacity: 0; } }
.coverflow__cap { position: absolute; right: 0; left: 0; bottom: 0; z-index: 2; padding: 18px 20px; display: grid; gap: 2px; }
.coverflow__cap small { font-size: 12px; color: var(--gold-2); font-weight: 700; }
.coverflow__cap b { font-size: 15.5px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.coverflow__reflect {
	position: absolute; left: 0; right: 0; top: 100%; height: 40%;
	margin-top: 6px; border-radius: 20px;
	background: linear-gradient(rgba(201, 162, 74, .16), transparent);
	transform: scaleY(-1);
	opacity: .5;
	-webkit-mask-image: linear-gradient(#000, transparent 70%);
	mask-image: linear-gradient(#000, transparent 70%);
	pointer-events: none;
}
.coverflow__nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 40px; position: relative; z-index: 5; }
.coverflow__nav .icon-btn { color: #fff; border-color: rgba(246, 227, 164, .35); }
.coverflow__nav .icon-btn:hover { background: var(--gold); color: var(--em-900); border-color: var(--gold); }
.coverflow__dots { display: flex; gap: 8px; }
.coverflow__dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: rgba(246, 227, 164, .3); cursor: pointer; transition: width .4s var(--ease), background .3s; }
.coverflow__dots button.is-active { width: 28px; background: var(--gold); }
.media3d .sec-more { margin-top: 34px; }

/* ---------- ۵) آمار با اعداد حجیم ---------- */
.stats--3d .stat__num--3d {
	position: relative;
	background: none; -webkit-background-clip: initial; background-clip: initial;
	color: #f6e3a4;
	text-shadow:
		0 1px 0 #e3c67a, 0 2px 0 #d9b45c, 0 3px 0 #c9a24a, 0 4px 0 #b8902f,
		0 5px 0 #a07d28, 0 6px 0 #8a6a22, 0 7px 0 #6f551b,
		0 10px 14px rgba(0, 0, 0, .45), 0 20px 30px rgba(0, 0, 0, .3);
	transform: perspective(500px) rotateX(18deg);
	transition: transform .6s var(--ease);
}
.stats--3d .stat:hover .stat__num--3d { transform: perspective(500px) rotateX(0deg) translateY(-4px); }
.stats--3d .stat__ico { transform: perspective(300px) rotateY(0); transition: transform .8s var(--ease); }
.stats--3d .stat:hover .stat__ico { transform: perspective(300px) rotateY(180deg); }

/* ---------- ۶) قفسه مقالات: کتاب‌های سه‌بعدی ---------- */
.shelf__row {
	display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 34px;
	align-items: end;
	padding: 0 20px;
	perspective: 1600px;
	position: relative; z-index: 2;
}
.book3d { --bw: 100%; --bd: 34px; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--text) !important; }
.book3d__obj {
	position: relative; display: block;
	width: 100%; aspect-ratio: 7 / 10;
	transform-style: preserve-3d;
	transform: rotateY(-30deg) rotateX(3deg);
	transition: transform .8s cubic-bezier(.3, 1.2, .4, 1);
}
.book3d:hover .book3d__obj, .book3d:focus-visible .book3d__obj { transform: rotateY(-8deg) rotateX(0deg) translateY(-14px) translateZ(30px); }
.book3d__cover, .book3d__back, .book3d__spine, .book3d__pages { position: absolute; }
.book3d__cover {
	inset: 0;
	border-radius: 10px 3px 3px 10px;
	overflow: hidden;
	transform: translateZ(calc(var(--bd) / 2));
	background: linear-gradient(150deg, var(--em-600), var(--em-900));
	box-shadow: inset -6px 0 10px -4px rgba(0, 0, 0, .45);
}
.book3d:nth-child(3n + 2) .book3d__cover { background: linear-gradient(150deg, #8f2027, #4a0d12); }
.book3d:nth-child(3n + 3) .book3d__cover { background: linear-gradient(150deg, #1d3c5a, #0b1b2b); }
.book3d__img { position: absolute; inset: 0; opacity: .5; mix-blend-mode: luminosity; }
.book3d__img img, .book3d__img .thumb-ph { width: 100%; height: 100%; object-fit: cover; }
.book3d__cover::before {
	content: ""; position: absolute; inset: 10px; z-index: 1;
	border: 1.5px solid rgba(246, 227, 164, .7);
	border-radius: 6px 2px 2px 6px;
	box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .12), inset 0 0 0 5px rgba(246, 227, 164, .35);
}
.book3d__cover::after {
	content: ""; position: absolute; inset: 0; z-index: 3;
	background: linear-gradient(260deg, rgba(255, 255, 255, .28) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, .2));
	pointer-events: none;
}
.book3d__title {
	position: absolute; inset: 0; z-index: 2;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	padding: 24px 18px; text-align: center;
	background: radial-gradient(circle at 50% 45%, rgba(3, 26, 20, .15), rgba(3, 26, 20, .65));
}
.book3d__title .ahm-star { width: 34px; height: 34px; color: var(--gold-2); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.book3d__title b { font-family: var(--f-kufi); font-size: 15px; line-height: 1.8; color: #fff6dc; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.book3d__spine {
	top: 0; bottom: 0; left: 100%;
	width: var(--bd);
	transform-origin: 0 50%;
	transform: rotateY(90deg) translateX(calc(var(--bd) / -2));
	background: linear-gradient(90deg, #04241b, var(--em-700), #04241b);
	display: flex; align-items: center; justify-content: center;
	border-radius: 0 3px 3px 0;
	overflow: hidden;
}
.book3d:nth-child(3n + 2) .book3d__spine { background: linear-gradient(90deg, #3a0a0e, #8f2027, #3a0a0e); }
.book3d:nth-child(3n + 3) .book3d__spine { background: linear-gradient(90deg, #08131f, #1d3c5a, #08131f); }
.book3d__spine::before, .book3d__spine::after { content: ""; position: absolute; left: 4px; right: 4px; height: 2px; background: var(--gold); }
.book3d__spine::before { top: 14%; }
.book3d__spine::after { bottom: 14%; }
.book3d__spine b { writing-mode: vertical-rl; font-size: 11px; font-weight: 700; color: var(--gold-3); white-space: nowrap; overflow: hidden; max-height: 64%; }
.book3d__pages {
	top: 4px; bottom: 4px; right: 100%;
	width: calc(var(--bd) - 6px);
	transform-origin: 100% 50%;
	transform: rotateY(-90deg) translateX(calc(var(--bd) / 2 - 3px));
	background: repeating-linear-gradient(90deg, #fffaf0 0 2px, #e8dcc2 2px 3px);
}
.book3d__back {
	inset: 0;
	border-radius: 3px 10px 10px 3px;
	transform: translateZ(calc(var(--bd) / -2)) rotateY(180deg);
	background: #021510;
	box-shadow: 0 0 0 0 transparent;
}
.book3d__obj::after {
	content: ""; position: absolute; left: 4%; right: -6%; bottom: -16px; height: 26px;
	background: radial-gradient(ellipse, rgba(0, 0, 0, .45), transparent 70%);
	transform: translateZ(-40px) rotateX(90deg);
	filter: blur(4px);
}
.book3d__meta { font-size: 12.5px; color: var(--muted); text-align: center; }
.shelf__board {
	position: relative; z-index: 1;
	height: 26px; margin: -6px 0 0;
	border-radius: 6px;
	background: linear-gradient(180deg, #b48a4a, #7a5426 60%, #5b3d1b);
	box-shadow: 0 30px 40px -20px rgba(60, 40, 10, .7), inset 0 2px 0 rgba(255, 230, 180, .5);
	transform: perspective(800px) rotateX(38deg);
	transform-origin: 50% 0;
}
[data-mode="dark"] .shelf__board { background: linear-gradient(180deg, #6b4a22, #3e2a12 60%, #2a1c0c); }

/* ---------- ۷) گالری استوانه‌ای ---------- */
.ring3d-sec { overflow: hidden; padding-bottom: 60px; }
.ring3d { position: relative; padding: 10px 0 30px; }
.ring3d__stage {
	position: relative;
	height: clamp(260px, 26vw, 340px);
	perspective: 1100px;
	perspective-origin: 50% 20%;
	touch-action: pan-y;
	user-select: none; -webkit-user-select: none;
	cursor: grab;
}
.ring3d.is-grab .ring3d__stage { cursor: grabbing; }
.ring3d__spin { position: absolute; top: 0; left: 50%; width: 0; height: 100%; transform-style: preserve-3d; }
.ring3d__item {
	position: absolute; top: 10px; left: clamp(-120px, -9vw, -90px);
	width: clamp(180px, 18vw, 240px);
	aspect-ratio: 4 / 3;
	border-radius: 16px;
	overflow: hidden;
	background: var(--em-800);
	border: 2px solid rgba(201, 162, 74, .5);
	box-shadow: 0 20px 40px -20px rgba(3, 26, 20, .6);
	-webkit-backface-visibility: hidden; backface-visibility: hidden;
	transition: border-color .4s, box-shadow .4s;
	color: #fff !important;
}
.ring3d__item img { width: 100%; height: 100%; object-fit: cover; }
.ring3d__item span {
	position: absolute; right: 0; left: 0; bottom: 0;
	padding: 26px 12px 10px;
	font-size: 12.5px; font-weight: 700; line-height: 1.7;
	background: linear-gradient(0deg, rgba(3, 26, 20, .9), transparent);
	opacity: 0; transform: translateY(8px);
	transition: opacity .4s, transform .4s;
}
.ring3d__item.is-front { border-color: var(--gold-2); box-shadow: 0 30px 60px -24px rgba(201, 162, 74, .6); }
.ring3d__item.is-front span, .ring3d__item:hover span { opacity: 1; transform: none; }
.ring3d__floor {
	position: absolute; left: 50%; bottom: 0;
	width: min(900px, 92vw); height: 90px;
	transform: translateX(-50%);
	border-radius: 50%;
	background: radial-gradient(ellipse, rgba(201, 162, 74, .25), transparent 65%);
	display: grid; place-items: center;
}
.ring3d__floor .ahm-star { width: 90px; height: 90px; color: var(--gold); opacity: .4; transform: scaleY(.3); animation: floorSpin 30s linear infinite; }
@keyframes floorSpin { to { transform: scaleY(.3) rotate(360deg); } }

/* ---------- ۸) آیه روز: ورق‌خوردن ---------- */
.daily__card--3d { transform-style: preserve-3d; }
.daily__card--3d .daily__ayah, .daily__card--3d .daily__tr {
	transform-origin: 50% 0;
	transition: opacity .38s, transform .38s var(--ease);
}
.daily__card--3d.is-swapping .daily__ayah, .daily__card--3d.is-swapping .daily__tr {
	transform: perspective(900px) rotateX(-75deg);
}

/* ---------- ۹) آکادمی: تونل محراب ---------- */
.academy3d {
	overflow: hidden;
	background:
		radial-gradient(700px 400px at 20% 50%, rgba(26, 122, 94, .5), transparent 70%),
		linear-gradient(160deg, var(--em-800), var(--em-950));
	color: #fff;
}
.academy3d::before { content: ""; position: absolute; inset: 0; background: var(--pattern); background-size: 88px; opacity: .06; }
.academy3d__grid { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.academy3d__title { color: #fff; }
.academy3d__text p { color: rgba(255, 255, 255, .8); font-size: 16.5px; max-width: 560px; }
.academy3d__list { list-style: none; margin: 0 0 30px; padding: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 12px 26px; }
.academy3d__list li { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-3); }
.academy3d__list .ahm-ico { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: rgba(201, 162, 74, .16); color: var(--gold-2); }
.tunnel3d {
	--rx: 0deg; --ry: 0deg;
	display: block; position: relative;
	width: min(420px, 100%); aspect-ratio: 4 / 5; margin-inline: auto;
	perspective: 900px;
}
.tunnel3d__scene {
	position: absolute; inset: 0;
	transform-style: preserve-3d;
	transform: rotateX(var(--rx)) rotateY(var(--ry));
	transition: transform .4s ease-out;
}
.tunnel3d__scene::before {
	content: ""; position: absolute; inset: 0;
	-webkit-mask: var(--arch-mask) center / 100% 100% no-repeat;
	mask: var(--arch-mask) center / 100% 100% no-repeat;
	background: radial-gradient(circle at 50% 45%, rgba(246, 227, 164, .35), rgba(17, 96, 74, .6) 35%, rgba(3, 26, 20, .95) 75%);
	transform: translateZ(-660px) scale(.72);
}
.tunnel3d__arch {
	position: absolute; inset: 0;
	-webkit-mask: var(--arch-mask) 50% 100% / 100% 100% no-repeat, var(--arch-mask) 50% 100% / 90% 95% no-repeat;
	-webkit-mask-composite: xor;
	mask: var(--arch-mask) 50% 100% / 100% 100% no-repeat, var(--arch-mask) 50% 100% / 90% 95% no-repeat;
	mask-composite: exclude;
	background: linear-gradient(180deg, #f6e3a4, #c9a24a 50%, #8a6a22);
	transform: translateZ(calc(var(--a) * -95px)) scale(calc(1 - var(--a) * .035));
	opacity: calc(1 - var(--a) * .12);
	animation: tunnelPulse 4s ease-in-out infinite;
	animation-delay: calc(var(--a) * -.4s);
}
@keyframes tunnelPulse { 50% { opacity: calc(1 - var(--a) * .12 - .25); } }
.tunnel3d__core {
	position: absolute; inset: 30% 20% 16%;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	transform: translateZ(calc(var(--z, 40px) - 300px));
	transform-style: preserve-3d;
}
.tunnel3d__core b { font-size: clamp(34px, 4vw, 50px); color: var(--gold-3); text-shadow: 0 0 20px rgba(246, 227, 164, .6); line-height: 1.4; }
.tunnel3d:hover .tunnel3d__core b { color: #fff; }

/* ---------- ۱۰) حمایت مالی: سکه سه‌بعدی ---------- */
.cta--donate { grid-template-columns: auto minmax(0, 1.4fr) auto; gap: 40px; }
.coin3d { --cs: 150px; width: var(--cs); height: var(--cs); perspective: 800px; }
.coin3d__body { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; animation: coinSpin 7s cubic-bezier(.45, .05, .55, .95) infinite; }
.coin3d__body i {
	position: absolute; inset: 0; border-radius: 50%;
	background: linear-gradient(90deg, #6f551b, #c9a24a 50%, #6f551b);
	transform: translateZ(calc((var(--k) - 7) * 1.1px));
}
.coin3d__face {
	position: absolute; inset: 0; border-radius: 50%;
	display: grid; place-items: center;
	background: radial-gradient(circle at 35% 30%, #fff3c9, #e3c67a 30%, #b8902f 70%, #8a6a22);
	box-shadow: inset 0 0 0 6px rgba(138, 106, 34, .6), inset 0 0 0 9px rgba(246, 227, 164, .7);
	color: var(--em-900);
}
.coin3d__face--front { transform: translateZ(8px); }
.coin3d__face--back { transform: translateZ(-8px) rotateY(180deg); }
.coin3d__face .ahm-star { position: absolute; inset: 16%; width: 68%; height: 68%; color: rgba(111, 85, 27, .35); }
.coin3d__face b { position: relative; font-size: 34px; line-height: 1; color: var(--em-800); text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
@keyframes coinSpin {
	0% { transform: rotateY(0) rotateX(8deg) translateY(0); }
	50% { transform: rotateY(180deg) rotateX(8deg) translateY(-10px); }
	100% { transform: rotateY(360deg) rotateX(8deg) translateY(0); }
}
.cta--donate .cta__btns { justify-self: end; }

/* ---------- سربرگ صفحات داخلی: ستاره حجیم ---------- */
.page-hero__stage { position: absolute; z-index: -1; left: 6%; top: 50%; transform: translateY(-58%); opacity: .9; }
.page-hero__stage .star3d--hero .star3d__body { animation-duration: 22s; }
.page-hero__orbit {
	position: absolute; inset: -34px;
	border: 1px dashed rgba(246, 227, 164, .35);
	border-radius: 50%;
	transform: rotateX(70deg);
	animation: orbitSpin 16s linear infinite;
}
.page-hero__orbit i { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 14px var(--gold-2); }
@keyframes orbitSpin { to { transform: rotateX(70deg) rotateZ(360deg); } }

/* ---------- اجزای سراسری ---------- */
.cta3d { gap: .4em; }
.topbar__donate { color: var(--gold-2) !important; font-weight: 700; }
.footer__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.footer__links li.is-sub a { padding-right: 14px; font-size: .93em; opacity: .8; }
.video-frame { position: relative; aspect-ratio: 16 / 9; margin: 0 0 1.6em; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow-lg); }
.video-frame iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.prose iframe[src*="aparat"] { max-width: 100%; }

/* ---------- حالت شب ---------- */
[data-mode="dark"] .flip3d__front { background: var(--surface); }
[data-mode="dark"] .news3d__item a { background: var(--surface); }
[data-mode="dark"] .ring3d__floor { background: radial-gradient(ellipse, rgba(201, 162, 74, .18), transparent 65%); }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1180px) {
	.shelf__row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.shelf__row .book3d:nth-child(n + 5) { display: none; }
	.cta--donate { grid-template-columns: auto 1fr; }
	.cta--donate .cta__btns { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 980px) {
	.hero--3d { min-height: 0; }
	.hero.is-3d .hero__grid { grid-template-columns: 1fr; }
	.hero.is-3d .hero__visual { order: -1; min-height: 340px; margin-bottom: -10px; }
	.hero.is-3d .float-card--a { top: 2%; right: 0; }
	.hero.is-3d .float-card--b { bottom: 4%; left: 0; }
	.news3d__grid { grid-template-columns: 1fr; }
	.news3d__lead { min-height: 440px; }
	.units__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.explore__grid { grid-template-columns: 1fr; gap: 70px; }
	.academy3d__grid { grid-template-columns: 1fr; }
	.tunnel3d { width: min(340px, 100%); }
	.page-hero__stage { left: 50%; transform: translate(-50%, -50%); opacity: .25; }
}
@media (max-width: 760px) {
	.hero.is-3d .hero__visual { min-height: 300px; }
	.hero.is-3d .float-card { transform: scale(.86); }
	.hero.is-3d .float-card--a { transform-origin: 100% 0; }
	.hero.is-3d .float-card--b { transform-origin: 0 100%; }
	.hero3d__hint { display: none; }
	.hero__title3d { text-shadow: 0 1px 0 #d9b45c, 0 2px 0 #b8902f, 0 3px 0 #8a6a22, 0 8px 16px rgba(0, 0, 0, .35); }
	.units__grid { grid-template-columns: 1fr; }
	.flip3d { min-height: 250px; }
	.news3d__item a { grid-template-columns: 86px 1fr; }
	.news3d__go { display: none; }
	.shelf__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 26px; }
	.shelf__row .book3d:nth-child(n + 3) { display: flex; }
	.shelf__row .book3d:nth-child(n + 5) { display: none; }
	.shelf__board { display: none; }
	.book3d__obj { width: 82%; }
	.cube3d { --c: 170px; }
	.cta--donate { grid-template-columns: 1fr; text-align: center; justify-items: center; }
	.cta--donate .cta__btns { justify-self: center; align-items: center; }
	.coin3d { --cs: 120px; }
	.academy3d__list { grid-template-columns: 1fr 1fr; }
	.coverflow__stage { height: 300px; }
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
	.star3d__body, .cube3d__box, .cube3d__shadow, .coin3d__body, .tunnel3d__arch, .page-hero__orbit, .ring3d__floor .ahm-star, .hero3d__hint { animation: none !important; }
	.star3d__body { transform: rotateX(14deg) rotateY(-30deg); }
	.coin3d__body { transform: rotateY(-25deg); }
	.hero3d__hint { display: none; }
}
