/* ==========================================================================
   آکادمی احمدانی — جلوه‌های متحرک (هوش مصنوعی × قرآنی)
   طراحی و برنامه‌نویسی: mnr
   ========================================================================== */

@property --fx-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes fxSpin { to { --fx-a: 360deg; } }
@keyframes fxShine { to { background-position: -200% center; } }
@keyframes fxFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- بوم‌ها ---------- */
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.stats { isolation: isolate; }
.stats__pattern { z-index: -2; }
.stats .fx-canvas { opacity: .9; -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.page-hero .fx-canvas, .site-footer .fx-canvas { opacity: .75; }
.cta .fx-canvas { opacity: .55; }

/* ---------- هیرو ---------- */
.hero__neural { opacity: .85; -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 85%); mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 85%); }
.hero__scanline {
	position: absolute; inset: 0 0 auto; height: 160px; z-index: -1; pointer-events: none;
	background: linear-gradient(180deg, transparent, rgba(246, 232, 189, .06) 70%, rgba(246, 232, 189, .22) 99%, transparent);
	animation: fxScan 7s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes fxScan { 0% { transform: translateY(-170px); } 100% { transform: translateY(110vh); } }

.hero__bism { background-size: 200% auto; animation: fxShine 6s linear infinite; }
.hero__title em .dc { display: inline; color: var(--gold-3); opacity: .55; text-shadow: 0 0 12px rgba(246, 232, 189, .8); }
.hero__visual { translate: 0 var(--py, 0px); }

/* نور در حال حرکت روی قوس محراب */
.mihrab__runner { fill: none; stroke: #fff6d6 !important; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 70 1112; stroke-dashoffset: 0; animation: fxRun 5.5s linear infinite; opacity: .95; will-change: stroke-dashoffset; }
.mihrab__runner--glow { stroke: rgba(246, 227, 164, .28) !important; stroke-width: 12; }
.mihrab__runner--b { animation-delay: -2.75s; stroke-dasharray: 40 1142; opacity: .7; }
@keyframes fxRun { to { stroke-dashoffset: -1182; } }

/* رادار و مدار گل‌نقش */
.rosette__scan {
	position: absolute; inset: 3%; border-radius: 50%;
	background: conic-gradient(from 0deg, rgba(246, 232, 189, .42), rgba(246, 232, 189, 0) 22%, transparent 100%);
	-webkit-mask: radial-gradient(circle, transparent 38%, #000 40%, #000 69%, transparent 71%);
	mask: radial-gradient(circle, transparent 38%, #000 40%, #000 69%, transparent 71%);
	animation: spin 3.8s linear infinite;
}
.rosette__orbit { position: absolute; inset: -5%; animation: spin 10s linear infinite; }
.rosette__orbit i { position: absolute; inset: 0; }
.rosette__orbit i::before { content: ""; position: absolute; top: -3px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: #fff6d6; box-shadow: 0 0 10px 3px rgba(246, 227, 164, .9); }
.rosette__orbit i:nth-child(2) { transform: rotate(120deg) scale(.82); }
.rosette__orbit i:nth-child(3) { transform: rotate(240deg) scale(.64); }
.rosette__orbit i:nth-child(3)::before { width: 5px; height: 5px; }

/* اکولایزر کارت کلاس آنلاین */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; margin-right: 6px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--gold-2); transform-origin: bottom; animation: fxEq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.2s; } .eq i:nth-child(3) { animation-delay: -.45s; } .eq i:nth-child(4) { animation-delay: -.7s; } .eq i:nth-child(5) { animation-delay: -.35s; }
@keyframes fxEq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ---------- تلاوت کلمه‌به‌کلمه ---------- */
[data-recite] .rw { transition: color .45s, text-shadow .45s, opacity .45s; }
[data-recite] .rw.is-lit { color: var(--gold); text-shadow: 0 0 18px rgba(201, 162, 74, .7); }
[data-recite] .rw.was-lit { opacity: .92; }
.mihrab__ayah .rw.is-lit, .site-footer [data-recite] .rw.is-lit { color: #fff; text-shadow: 0 0 10px #f6e3a4, 0 0 26px rgba(246, 227, 164, .8); }
[data-mode="dark"] .daily__ayah .rw.is-lit { color: #fff; text-shadow: 0 0 10px var(--gold-2), 0 0 24px rgba(227, 198, 122, .6); }

/* ---------- عناوین: نمایش واژه‌به‌واژه ---------- */
.fx-on .tw { display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(16px) scale(.96); }
.fx-on .is-in .tw, .fx-on .page-hero .tw { animation: fxWord .9s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
@keyframes fxWord { to { opacity: 1; filter: blur(0); transform: none; } }
.fx-on .sec-title { position: relative; }
.fx-on .sec-head.is-in .sec-orn i { animation: fxLine 1.2s var(--ease) both; }
@keyframes fxLine { from { transform: scaleX(0); } }
.fx-on .sec-head.is-in .sec-orn i:last-child { animation-name: fxLineR; }
@keyframes fxLineR { from { transform: scaleX(0); } to { transform: scaleX(-1); } }
.fx-on .sec-head.is-in .sec-orn .ahm-star { animation: spin 6s linear infinite; }

/* ---------- کارت‌های نورانی ---------- */
.fx-card { position: relative; }
.fx-edge {
	position: absolute; inset: 0; z-index: 3; pointer-events: none;
	border-radius: inherit; padding: 1.6px;
	background: conic-gradient(from var(--fx-a), transparent 0 62%, rgba(246, 227, 164, .2) 72%, #f6e3a4 84%, #c9a24a 90%, transparent 100%);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	opacity: 0; transition: opacity .5s;
}
.fx-card:hover .fx-edge, .fx-card:focus-within .fx-edge, .daily__card .fx-edge { animation: fxSpin 4.5s linear infinite; }
.fx-spot {
	position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
	background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(201, 162, 74, .17), transparent 62%);
	opacity: 0; transition: opacity .45s;
}
.fx-card:hover .fx-edge, .fx-card:focus-within .fx-edge { opacity: 1; }
.fx-card:hover .fx-spot { opacity: 1; }
.daily__card .fx-edge { opacity: .9; animation-duration: 9s; }
.fx-on .fx-tilt.is-in, .fx-on .fx-tilt:not([data-reveal]) {
	transform: perspective(1000px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)) translateY(var(--lift, 0px));
	transition: opacity .9s var(--ease), transform .25s ease-out, box-shadow .5s, border-color .5s;
}
.fx-on .fx-tilt.is-in:hover, .fx-on .fx-tilt:not([data-reveal]):hover { --lift: -8px; }
.course__body, .ahm-card__body { position: relative; z-index: 2; }

/* ---------- مراحل: جریان داده روی خط ---------- */
.fx-on .steps__list::before { animation: fxDash 1.1s linear infinite; }
@keyframes fxDash { to { background-position: -18px 0; } }
.fx-on .steps__list::after {
	content: ""; position: absolute; top: 43px; right: 12%; width: 90px; height: 8px; border-radius: 4px;
	background: radial-gradient(ellipse at center, #fff6d6 0, rgba(246, 227, 164, .8) 25%, transparent 70%);
	filter: blur(1px);
	animation: fxFlow 4.5s cubic-bezier(.6, 0, .4, 1) infinite;
}
@keyframes fxFlow { 0% { right: 12%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { right: calc(88% - 90px); opacity: 0; } }
.fx-on .step:hover .step__badge .ahm-ico { animation: fxPop .6s var(--ease); }
@keyframes fxPop { 50% { transform: scale(1.25) rotate(-8deg); } }

/* ---------- اساتید ---------- */
.fx-on .teacher__frame::after {
	content: ""; position: absolute; inset: 9%; border-radius: 50%;
	border: 1px dashed rgba(201, 162, 74, .55);
	animation: spin 22s linear infinite; pointer-events: none;
}
.fx-on .teacher__frame::before {
	content: ""; position: absolute; inset: 9%; border-radius: 50%; z-index: 2; pointer-events: none;
	background: radial-gradient(circle at 50% 0, #fff6d6 0 3px, rgba(246, 227, 164, .6) 4px, transparent 7px);
	animation: spin 5s linear infinite;
	opacity: 0; transition: opacity .4s;
}
.fx-on .teacher:hover .teacher__frame::before { opacity: 1; }

/* ---------- نوار آیات ---------- */
.marquee::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
	background-size: 200% 100%;
	animation: fxShine 5s linear infinite;
	mix-blend-mode: soft-light;
}

/* ---------- بخش ذرات نور ---------- */
.nur {
	position: relative; overflow: hidden; isolation: isolate;
	padding: 100px 0;
	color: #fff;
	background: radial-gradient(700px 420px at 30% 50%, rgba(26, 122, 94, .45), transparent 70%), linear-gradient(140deg, var(--em-900), var(--em-950));
}
.nur__pattern { position: absolute; inset: 0; z-index: -1; background: var(--pattern); background-size: 88px; opacity: .06; }
.nur__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 50px; align-items: center; }
.sec-kicker--light { color: var(--gold-2) !important; }
.nur__title { color: #fff; }
.nur__desc { color: rgba(255, 255, 255, .75); font-size: 16.5px; line-height: 2.1; }
.nur__caption { min-height: 3.8em; margin: 22px 0 14px; padding: 14px 18px; border-right: 3px solid var(--gold); background: rgba(255, 255, 255, .05); border-radius: 12px; color: var(--gold-3); font-weight: 500; opacity: 0; transform: translateY(8px); transition: opacity .45s, transform .45s; }
.nur__caption.is-in { opacity: 1; transform: none; }
.nur__dots { display: flex; gap: 10px; }
.nur__dots button { width: 12px; height: 12px; padding: 0; border: 1.5px solid var(--gold); background: transparent; transform: rotate(45deg); cursor: pointer; transition: background .3s, transform .3s; border-radius: 2px; }
.nur__dots button.is-active { background: var(--gold); transform: rotate(45deg) scale(1.25); box-shadow: 0 0 12px rgba(246, 227, 164, .8); }
.nur__stage { position: relative; aspect-ratio: 16 / 10; min-height: 320px; border-radius: 28px; background: radial-gradient(circle at 50% 50%, rgba(201, 162, 74, .1), transparent 65%); border: 1px solid rgba(201, 162, 74, .2); overflow: hidden; }
.nur__canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.nur__ring { position: absolute; inset: 8% 20%; border-radius: 50%; border: 1px dashed rgba(201, 162, 74, .22); animation: spin 40s linear infinite; pointer-events: none; }
.nur__ring::before { content: ""; position: absolute; inset: -12%; border-radius: 50%; border: 1px solid rgba(201, 162, 74, .1); }
.nur__hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font-size: 12px; color: rgba(255, 255, 255, .45); white-space: nowrap; }

/* ---------- نشانگر طلایی ---------- */
.fx-cursor-dot, .fx-cursor-ring { position: fixed; top: 0; left: 0; z-index: 99998; pointer-events: none; will-change: transform; }
.fx-cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px rgba(201, 162, 74, .9); transition: width .2s, height .2s, margin .2s; }
.fx-cursor-dot.is-hover { width: 0; height: 0; margin: 0; }
.fx-cursor-ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; transition: opacity .3s; }
.fx-cursor-ring svg { width: 100%; height: 100%; fill: none; stroke: var(--gold); stroke-width: 3; opacity: .7; animation: spin 8s linear infinite; transition: transform .3s var(--ease), fill .3s, opacity .3s; }
.fx-cursor-ring.is-hover svg { transform: scale(1.55); fill: rgba(201, 162, 74, .15); opacity: 1; }
.fx-cursor-ring.is-down svg { transform: scale(.8); }

/* ---------- دکمه‌های مغناطیسی و موج کلیک ---------- */
.fx-on .ahm-btn { translate: var(--mgx, 0px) var(--mgy, 0px); transition: transform .3s var(--ease), box-shadow .3s, background .3s, color .3s, border-color .3s, translate .3s var(--ease); }
.fx-on .socials a, .fx-on .to-top { translate: var(--mgx, 0px) var(--mgy, 0px); }
.fx-ripple { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: rgba(255, 255, 255, .55); transform: scale(0); animation: fxRipple .7s ease-out forwards; pointer-events: none; z-index: -1; }
@keyframes fxRipple { to { transform: scale(30); opacity: 0; } }

/* ---------- پیش‌بارگذار ---------- */
.fx-preloader {
	position: fixed; inset: 0; z-index: 99999;
	display: grid; place-items: center;
	background: radial-gradient(circle at 50% 45%, var(--em-800), var(--em-950) 70%);
	transition: opacity .7s, visibility .7s;
	animation: fxAutoHide .01s 3.2s forwards;
}
.pl-seen .fx-preloader { display: none; }
.fx-preloader.is-done { opacity: 0; visibility: hidden; }
@keyframes fxAutoHide { to { opacity: 0; visibility: hidden; } }
.fx-preloader__in { text-align: center; }
.fx-preloader svg { width: 110px; height: 110px; fill: none; stroke: var(--gold-2); stroke-width: 1.4; overflow: visible; filter: drop-shadow(0 0 10px rgba(246, 227, 164, .7)); animation: spin 6s linear infinite; }
.fx-preloader svg path, .fx-preloader svg circle { stroke-dasharray: 520; stroke-dashoffset: 520; animation: draw 1.6s var(--ease) forwards; }
.fx-preloader svg circle { animation-delay: .4s; }
.fx-preloader span { display: block; margin-top: 14px; font-family: var(--f-quran); font-size: 30px; color: var(--gold-2); opacity: 0; animation: fxFade .8s .6s forwards; }

/* دستگاه‌های ضعیف (تشخیص خودکار) */
.fx-low .hero__scanline, .fx-low .rosette__scan, .fx-low .marquee::after, .fx-low .mihrab__runner--glow { display: none; }
.fx-low .hero__bism { animation: none; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 960px) {
	.nur { padding: 76px 0; }
	.nur__grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
	.nur__dots { justify-content: center; }
	.nur__caption { border-right: 0; border-top: 2px solid var(--gold); }
	.fx-on .steps__list::after { display: none; }
}
@media (max-width: 640px) {
	.nur__stage { min-height: 240px; aspect-ratio: 4 / 3; }
	.hero__scanline { display: none; }
}
@media (hover: none) {
	.nur__hint { display: none; }
	.fx-edge { display: none; }
	.daily__card .fx-edge { display: block; }
}
@media (prefers-reduced-motion: reduce) {
	.fx-preloader { display: none !important; }
	.fx-on .tw { opacity: 1 !important; filter: none !important; transform: none !important; }
	.mihrab__runner, .rosette__scan, .rosette__orbit, .hero__scanline { display: none; }
}
