/* =============================================================
   dnsplus — سیستمِ طراحی
   زبانِ بصری برگرفته از خودِ اپ: نیویِ تیره، کارت‌های شیشه‌ای،
   لهجه‌های فیروزه‌ای/بنفش، فارسیِ راست‌به‌چپ.
   ============================================================= */

/* ---------- فونت (محلی، بدون CDN) ---------- */
@font-face {
	font-family: 'Vazirmatn';
	src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
	font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Vazirmatn';
	src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
	font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Vazirmatn';
	src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
	font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- توکن‌ها ---------- */
:root {
	--bg:      #070B14;
	--bg-2:    #0B1220;
	--panel:   rgba(255,255,255,.045);
	--panel-2: rgba(255,255,255,.07);
	--stroke:  rgba(255,255,255,.09);
	--stroke-2:rgba(255,255,255,.16);

	--ink:   #E9EFF8;
	--muted: #8FA1BC;

	--teal:   #2DD4BF;
	--indigo: #6366F1;
	--violet: #A78BFA;
	--amber:  #FBBF24;
	--green:  #34D399;
	--red:    #F87171;

	--radius:  18px;
	--radius-s: 12px;
	--wrap: 1180px;

	--ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- پایه ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/*
 * ⚠️ هرگز `overflow-x: hidden` را روی <html> نگذار.
 *
 * تا وقتی <html> مقدارِ `visible` دارد، مرورگر overflowِ <body> را به ویوپورت
 * منتقل می‌کند و خودِ body عنصرِ عادی می‌ماند. ولی اگر <html> هم مقدار بگیرد،
 * این انتقال انجام نمی‌شود و <body> تبدیل به یک «scroll container» می‌شود؛
 * آن‌وقت `position: sticky`ِ استیجِ گوشی نسبت به bodyِ بی‌اسکرول می‌چسبد،
 * یعنی اصلاً پین نمی‌شود — و چون کدِ حرکت همچنان با اسکرولِ پنجره پیش
 * می‌رود، گوشی بالای کادر و بیرونِ دید انیمیت می‌شود. نتیجه: «هیچ انیمیشنی نمی‌آید».
 *
 * پس فقط روی body، و در عوض مطمئن شو هیچ عنصری واقعاً سرریز نمی‌کند.
 */

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: 'Vazirmatn', system-ui, 'Segoe UI', Tahoma, sans-serif;
	font-size: 16px;
	line-height: 1.85;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	-webkit-tap-highlight-color: transparent;
	text-size-adjust: 100%; -webkit-text-size-adjust: 100%;
}
body.nav-open { overflow: hidden; }

/* هیچ‌وقت کلمه‌ی بلند (URL، دستور) نباید صفحه را افقی بکشد. */
p, li, h1, h2, h3, td, th { overflow-wrap: anywhere; }

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3 { line-height: 1.35; margin: 0 0 .6rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
em { font-style: normal; color: var(--amber); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* پنهان‌سازیِ عمودی، نه افقی: در RTL، `inset-inline-start: -9999px` یعنی
   `right: -9999px` و لینک را ۱۰هزار پیکسل بیرونِ لبه‌ی راست پرت می‌کند — یک
   منبعِ سرریزِ افقیِ پنهان. بالا بردنش در هر دو جهت بی‌خطر است. */
.skip-link {
	position: absolute; inset-inline-start: 0; top: -100px; z-index: 999;
	background: var(--indigo); color: #fff; padding: .6rem 1rem; border-radius: 0 0 10px 0;
	transition: top .15s var(--ease);
}
.skip-link:focus { top: 0; }

.grad {
	background: linear-gradient(100deg, var(--teal), var(--violet) 55%, var(--indigo));
	-webkit-background-clip: text; background-clip: text; color: transparent;
}

.eyebrow {
	display: inline-flex; align-items: center; gap: .5rem;
	font-size: .85rem; color: var(--muted); margin: 0 0 1rem;
	border: 1px solid var(--stroke); background: var(--panel);
	padding: .35rem .8rem; border-radius: 999px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px var(--teal); }

/* ---------- دکمه‌ها ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
	border: 1px solid transparent; border-radius: 999px;
	padding: .7rem 1.3rem; font-weight: 500; font-size: .95rem;
	cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
	white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-sm { padding: .5rem 1rem; font-size: .875rem; }
.btn-lg { padding: .9rem 1.7rem; font-size: 1rem; }
.btn-primary {
	background: linear-gradient(100deg, var(--indigo), var(--violet));
	color: #fff; box-shadow: 0 10px 30px -10px rgba(99,102,241,.75);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(99,102,241,.9); }
.btn-ghost { background: var(--panel); border-color: var(--stroke); color: var(--ink); }
.btn-ghost:hover { background: var(--panel-2); transform: translateY(-2px); }
.btn.is-disabled {
	opacity: .58; cursor: not-allowed; pointer-events: none;
	box-shadow: none; filter: saturate(.5);
}

/* ---------- بومِ سه‌بعدی ---------- */
.bg3d {
	position: fixed; inset: 0; width: 100%; height: 100%;
	z-index: 0; pointer-events: none;
	opacity: .9;
}
.site-header, .site-main, .site-footer { position: relative; z-index: 1; }

/* ---------- هدر ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	background: linear-gradient(180deg, rgba(7,11,20,.85), rgba(7,11,20,.35));
	border-bottom: 1px solid var(--stroke);
}
body.admin-bar .site-header { top: 32px; }
.header-inner { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; }
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand-mark { filter: drop-shadow(0 0 14px rgba(45,212,191,.45)); }
.brand-text strong { font-size: 1.15rem; letter-spacing: -.02em; }
.brand-text .accent { color: var(--teal); }
.brand-text small { display: block; font-size: .68rem; color: var(--muted); line-height: 1; margin-top: 2px; }

.site-nav { margin-inline-start: auto; }
.nav-list { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.nav-list a { display: block; padding: .5rem .9rem; border-radius: 999px; color: var(--muted); font-size: .93rem; transition: .2s; }
.nav-list a:hover, .nav-list .current-menu-item > a { color: var(--ink); background: var(--panel); }

.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; margin: 4px 0; }

.mobile-nav { display: none; padding: 1rem 1.25rem 1.5rem; border-top: 1px solid var(--stroke); }
/* ویژگیِ `hidden` باید بر `display:block`ِ مدیا-کوئریِ پایین بچربد، وگرنه منو همیشه باز است. */
.mobile-nav[hidden] { display: none; }
.mobile-nav-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.mobile-nav-list a { display: block; padding: .8rem 0; border-bottom: 1px solid var(--stroke); color: var(--ink); }

/* ---------- هیرو ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 5rem 0 3rem; }
.hero-inner { max-width: 820px; }
.hero-title { font-size: clamp(2.3rem, 6vw, 4.4rem); margin-bottom: 1.2rem; }
.hero-sub { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 62ch; margin-inline: auto; }
.hero-sub strong { color: var(--ink); }
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.hero-cta.center { margin-top: 1.6rem; }

.trust-chips { list-style: none; display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; padding: 0; margin: 2.4rem 0 0; }
.trust-chips li {
	font-size: .85rem; color: var(--muted);
	border: 1px solid var(--stroke); background: var(--panel);
	padding: .4rem .9rem; border-radius: 999px;
}

.scroll-hint { position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: .78rem; text-align: center; }
.mouse { width: 24px; height: 38px; border: 1.5px solid var(--stroke-2); border-radius: 14px; margin: .5rem auto 0; position: relative; }
.mouse i { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 3px; height: 7px; background: var(--teal); border-radius: 2px; animation: wheel 1.7s infinite; }
@keyframes wheel { 0%{opacity:0;transform:translate(-50%,0)} 30%{opacity:1} 100%{opacity:0;transform:translate(-50%,14px)} }

/* =============================================================
   استیجِ گوشیِ سه‌بعدی
   ============================================================= */
.stage { height: 520vh; position: relative; }
.stage-pin {
	position: sticky; top: 0; height: 100vh; height: 100svh;
	display: grid; place-items: center;
	overflow: hidden;
}

/* کپشن‌های کنارِ گوشی.
   هر سه کپشن در یک سلولِ گرید روی هم می‌نشینند: ظرف ارتفاعِ بلندترین را می‌گیرد و
   کراس‌فید بدونِ position:absolute کار می‌کند. (با absolute، ظرف ارتفاعِ صفر می‌گرفت
   و بینِ ۸۶۱ تا ۱۰۲۴ پیکسل لایوت فرو می‌ریخت.) */
.stage-copy {
	position: absolute; inset-inline-end: 6vw; top: 50%; transform: translateY(-50%);
	width: min(38ch, 34vw);
	display: grid;
}
.cap {
	grid-area: 1 / 1;
	opacity: 0; transform: translateY(24px); pointer-events: none;
	transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.cap.is-active { opacity: 1; transform: none; pointer-events: auto; }
.cap-num { font-size: .8rem; color: var(--teal); letter-spacing: .2em; }
.cap h2 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); margin-top: .4rem; }
.cap p { color: var(--muted); font-size: .98rem; }

/* قابِ گوشی */
.phone-wrap { perspective: 1500px; perspective-origin: 50% 45%; position: relative; }
.phone-glow {
	position: absolute; inset: -18% -30%;
	background: radial-gradient(closest-side, rgba(99,102,241,.35), transparent 72%);
	filter: blur(24px); z-index: -1;
}
.phone {
	--scr-h: 620px;
	width: 320px;
	transform-style: preserve-3d;
	will-change: transform, opacity;
}
.phone-frame {
	position: relative;
	border-radius: 44px;
	padding: 11px;
	background: linear-gradient(160deg, #2A3350, #10162A 45%, #232B44);
	box-shadow:
		0 0 0 1.5px rgba(255,255,255,.10),
		0 50px 90px -30px rgba(0,0,0,.85),
		inset 0 1px 1px rgba(255,255,255,.18);
}
.phone-island {
	position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
	width: 86px; height: 22px; background: #05070D; border-radius: 999px; z-index: 3;
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.phone-screen {
	position: relative; overflow: hidden;
	height: var(--scr-h);
	border-radius: 34px;
	background: linear-gradient(180deg, #0C1526, #0A1120 55%, #0E1730);
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

/* محتوایی که داخلِ گوشی اسکرول می‌شود */
.screen-scroller { position: absolute; inset-inline: 0; top: 0; will-change: transform; }
.scr {
	height: var(--scr-h);
	padding: 46px 16px 78px;   /* بالا برای آیلند، پایین برای نویگیشن */
	display: flex; flex-direction: column; gap: 10px;
	font-size: 13px; line-height: 1.7;
	/* در پنجره‌های کوتاه، محتوا باید بریده شود نه اینکه به صفحه‌ی بعدی سرریز کند. */
	overflow: hidden;
}
.scr-tail { height: 1px; }

.scr-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.scr-title { font-weight: 700; font-size: 15px; }
.scr-label { color: var(--muted); font-size: 11.5px; margin: 6px 0 0; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--stroke); }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-on { color: var(--green); background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.35); }
.pill-off { color: var(--red); background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.35); }
.pill-ghost { color: var(--muted); background: var(--panel); }

.phone .card {
	background: var(--panel); border: 1px solid var(--stroke);
	border-radius: 14px; padding: 11px 12px;
}

/* صفحه ۱ — اتصال */
.connect-orb { position: relative; display: grid; place-items: center; margin: 10px auto 2px; width: 148px; height: 148px; }
.orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(45,212,191,.35); }
.orb-ring.r2 { inset: 14px; border-color: rgba(99,102,241,.35); }
.orb-btn {
	width: 92px; height: 92px; border-radius: 50%; border: 0; cursor: default;
	background: radial-gradient(circle at 35% 30%, #34D399, #0F766E 70%);
	color: #04140F; display: grid; place-items: center;
	box-shadow: 0 0 44px rgba(52,211,153,.55), inset 0 2px 6px rgba(255,255,255,.35);
}
.orb-btn svg { width: 34px; height: 34px; }
.connect-time { text-align: center; font-size: 20px; font-weight: 700; margin: 6px 0 0; letter-spacing: .04em; }
.connect-cap { text-align: center; color: var(--muted); font-size: 11.5px; margin: 0 0 4px; }

.srv-card { display: flex; align-items: center; gap: 10px; }
.srv-flag { font-size: 22px; }
.srv-meta { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.srv-meta strong { font-size: 13px; }
.srv-meta small { color: var(--muted); font-size: 10.5px; }
.ping { font-size: 11px; color: var(--teal); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { background: var(--panel); border: 1px solid var(--stroke); border-radius: 12px; padding: 9px; text-align: center; }
.tile-v { display: block; font-weight: 700; font-size: 16px; }
.tile-k { display: block; color: var(--muted); font-size: 10px; }

.row-toggle { display: flex; align-items: center; gap: 10px; }
.rt-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.rt-txt strong { font-size: 12.5px; }
.rt-txt small { color: var(--muted); font-size: 10.5px; }
.switch { width: 38px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.12); position: relative; flex: none; }
.switch i { position: absolute; top: 3px; inset-inline-end: 19px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .3s; }
.switch.on { background: linear-gradient(90deg, var(--green), var(--teal)); }
.switch.on i { inset-inline-end: 3px; }
.row-toggle.is-on { border-color: rgba(52,211,153,.3); background: rgba(52,211,153,.07); }

/* صفحه ۲ — مسیریابی هوشمند */
.iran-card { display: flex; align-items: center; gap: 10px; border-color: rgba(52,211,153,.32); background: rgba(52,211,153,.08); }
.modes { display: flex; flex-direction: column; gap: 9px; }
.mode { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.mode.is-sel { color: var(--ink); }
.radio { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--stroke-2); flex: none; }
.radio.on { border-color: var(--teal); box-shadow: inset 0 0 0 4px var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.phone .chip, .taxo .chip { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--stroke); color: var(--muted); }
.phone .note { margin-top: auto; font-size: 11px; color: var(--muted); background: var(--panel); border: 1px dashed var(--stroke-2); border-radius: 12px; padding: 9px 10px; }
.phone .note b { color: var(--teal); }

/* صفحه ۳ — سرویس‌ها */
.svc { display: flex; flex-direction: column; gap: 8px; }
.svc-head { display: flex; align-items: center; gap: 9px; }
.svc-flag { font-size: 19px; }
.svc-meta { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.svc-meta strong { font-size: 12.5px; }
.svc-meta small { color: var(--muted); font-size: 10px; }
.svc-days { font-size: 10.5px; color: var(--muted); background: var(--panel-2); padding: 2px 8px; border-radius: 999px; }
.phone .bar { height: 5px; border-radius: 999px; background: rgba(255,255,255,.09); overflow: hidden; }
.phone .bar i { display: block; height: 100%; border-radius: 999px; }
.phone .bar .teal   { background: linear-gradient(90deg, var(--teal), #0EA5A0); }
.phone .bar .violet { background: linear-gradient(90deg, var(--violet), var(--indigo)); }
.phone .bar .indigo { background: linear-gradient(90deg, var(--indigo), #4338CA); }

/* نویگیشنِ پایینِ گوشی */
.phone-nav {
	position: absolute; inset-inline: 0; bottom: 0; z-index: 2;
	display: grid; grid-template-columns: repeat(5, 1fr);
	padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0));
	background: linear-gradient(180deg, rgba(10,17,32,.35), rgba(10,17,32,.92));
	backdrop-filter: blur(10px);
	border-top: 1px solid var(--stroke);
}
.pn { display: grid; justify-items: center; gap: 3px; color: var(--muted); }
.pn svg { width: 18px; height: 18px; }
.pn b { font-size: 8.5px; font-weight: 500; }
.pn.is-on { color: var(--teal); }

/* نوارِ پیشرفتِ استیج */
.stage-progress { position: absolute; inset-inline: 0; bottom: 26px; height: 2px; width: min(280px, 40vw); margin-inline: auto; background: var(--stroke); border-radius: 999px; overflow: hidden; }
.stage-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--violet)); }

/* =============================================================
   بخش‌های محتوایی
   ============================================================= */
body:not(.elementor-page) .section { padding: clamp(4rem, 9vw, 8rem) 0; position: relative; }
.sec-head { text-align: center; max-width: 60ch; margin: 0 auto 3rem; }
.sec-title { font-size: clamp(1.7rem, 3.4vw, 2.8rem); }
.sec-sub { color: var(--muted); }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }

.fcard {
	background: var(--panel); border: 1px solid var(--stroke);
	border-radius: var(--radius); padding: 1.6rem 1.4rem;
	transition: transform .35s var(--ease), border-color .35s, background .35s;
	position: relative; overflow: hidden;
}
.fcard::after {
	content: ''; position: absolute; inset: -40% -40% auto auto; width: 220px; height: 220px;
	background: radial-gradient(closest-side, var(--tone, var(--indigo)), transparent 70%);
	opacity: .16; pointer-events: none;
}
.fcard:hover { transform: translateY(-6px); border-color: var(--stroke-2); background: var(--panel-2); }
.fcard-icon { font-size: 1.9rem; margin-bottom: .7rem; }
.fcard h3 { font-size: 1.06rem; }
.fcard p { color: var(--muted); font-size: .93rem; margin: 0; }
.tone-teal   { --tone: var(--teal); }
.tone-violet { --tone: var(--violet); }
.tone-indigo { --tone: var(--indigo); }
.tone-amber  { --tone: var(--amber); }

/* عمیق‌تر */
.deep-row { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.deep.alt .deep-row { grid-template-columns: .95fr 1.05fr; }
.deep-copy p { color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .7rem; }
.ticks li { position: relative; padding-inline-start: 1.9rem; color: var(--muted); font-size: .95rem; }
.ticks li::before {
	content: '✓'; position: absolute; inset-inline-start: 0; top: 0;
	width: 1.3rem; height: 1.3rem; display: grid; place-items: center;
	border-radius: 50%; background: rgba(52,211,153,.14); color: var(--green); font-size: .75rem;
}

.deep-art { display: grid; place-items: center; }
.mini-card {
	width: min(420px, 100%);
	background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius);
	padding: 1.2rem; box-shadow: 0 30px 60px -30px rgba(0,0,0,.8);
}
.mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.mini-body { display: grid; gap: .6rem; }
.leakrow, .routerow {
	display: flex; align-items: center; justify-content: space-between; gap: .6rem;
	background: rgba(255,255,255,.03); border: 1px solid var(--stroke);
	border-radius: var(--radius-s); padding: .65rem .9rem; font-size: .92rem; color: var(--muted);
}
.blocked { color: var(--red); }
.direct  { color: var(--green); }
.via     { color: var(--violet); }
.is-landing .tag { font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--stroke); }
.is-landing .tag.ir { color: var(--green); background: rgba(52,211,153,.1); }
.is-landing .tag.ww { color: var(--violet); background: rgba(167,139,250,.1); }
.arrow { color: var(--stroke-2); }

/* آمار */
.stat-grid { text-align: center; }
.stat { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 1.6rem 1rem; }
.stat b { display: block; font-size: clamp(1.5rem, 2.6vw, 2.1rem); background: linear-gradient(100deg, var(--teal), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: .88rem; }

/* دانلود */
.dl-card {
	text-align: center; border-radius: 28px; padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
	background: radial-gradient(120% 140% at 50% 0%, rgba(99,102,241,.20), transparent 62%), var(--panel);
	border: 1px solid var(--stroke);
}
.dl-note { color: var(--muted); font-size: .88rem; margin-top: 1.6rem; }
.dl-note a { color: var(--teal); }

/* ---------- برگه‌های داخلی ---------- */
.page-aura { position: absolute; inset: 0 0 auto; height: 420px; background: radial-gradient(70% 100% at 50% 0%, rgba(99,102,241,.18), transparent 70%); pointer-events: none; }
.page-section { padding-top: clamp(3rem, 6vw, 5rem); }
.page-wrap { max-width: 820px; }
.page-head { text-align: center; margin-bottom: 2.5rem; }
.prose { color: var(--muted); }
.prose h2, .prose h3 { color: var(--ink); margin-top: 2.2rem; }
.prose a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose li { margin-bottom: .5rem; }
.prose blockquote { margin: 1.5rem 0; padding: 1rem 1.2rem; border-inline-start: 3px solid var(--teal); background: var(--panel); border-radius: var(--radius-s); }

/* =============================================================
   بلاگ
   ============================================================= */
.post-list { display: grid; gap: 1rem; }
.post-card {
	background: var(--panel); border: 1px solid var(--stroke);
	border-radius: var(--radius); padding: 1.4rem;
	transition: border-color .3s, background .3s, transform .3s var(--ease);
}
.post-card:hover { border-color: var(--stroke-2); background: var(--panel-2); transform: translateY(-3px); }
.post-card-title { font-size: 1.2rem; margin-bottom: .35rem; }
.post-card-title a:hover { color: var(--teal); }
.post-card-meta { color: var(--muted); font-size: .82rem; margin: 0 0 .6rem; }
.post-card-excerpt { color: var(--muted); margin-bottom: .8rem; }
.dotsep { margin: 0 .45rem; opacity: .5; }
.more { color: var(--teal); font-size: .9rem; display: inline-flex; gap: .35rem; align-items: center; }
.more:hover { gap: .6rem; transition: gap .2s; }

/* مسیرِ راهنما */
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 1.2rem; }
.crumbs a:hover { color: var(--teal); }
.crumbs .sep { margin: 0 .45rem; opacity: .45; }
.crumbs [aria-current] { color: var(--ink); }

/* سرصفحه‌ی مقاله */
.single-head { padding: clamp(2rem, 5vw, 4rem) 0 1rem; text-align: center; }
.single-title { font-size: clamp(1.7rem, 3.6vw, 2.9rem); margin-bottom: .8rem; }
.single-meta { color: var(--muted); font-size: .85rem; }
.single-lede { color: var(--muted); max-width: 62ch; margin-inline: auto; font-size: 1.05rem; }
.taxo { list-style: none; display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; padding: 0; margin: 1.2rem 0 0; }
.chip-cat { color: var(--teal); border-color: rgba(45,212,191,.35); background: rgba(45,212,191,.1); }
.taxo .chip { font-size: .78rem; padding: .3rem .8rem; }
.taxo .chip:hover { border-color: var(--stroke-2); color: var(--ink); }

/* بدنه‌ی مقاله: فهرست کنار، متن وسط */
.single-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; padding-top: 1.5rem; }
.single-body .prose { min-width: 0; }   /* اجازه‌ی کوچک‌شدن به ستونِ گرید */

.toc {
	position: sticky; top: 90px;
	background: var(--panel); border: 1px solid var(--stroke);
	border-radius: var(--radius); padding: 1.1rem 1.2rem;
	max-height: calc(100vh - 120px); max-height: calc(100svh - 120px); overflow-y: auto;
}
.toc-title {
	font-size: .95rem; font-weight: 700; margin-bottom: .7rem;
	display: flex; align-items: center; justify-content: space-between; gap: .5rem;
	list-style: none; cursor: default;
}
.toc-title::-webkit-details-marker { display: none; }
.toc-count { font-size: .75rem; color: var(--muted); font-weight: 400; }
/* روی دسکتاپ فهرست همیشه باز است و تیترش دکمه نیست. */
@media (min-width: 961px) {
	.toc-title { pointer-events: none; }
}
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-list li { margin-bottom: .45rem; }
.toc-list a { color: var(--muted); font-size: .87rem; line-height: 1.6; display: block; border-inline-start: 2px solid transparent; padding-inline-start: .6rem; }
.toc-list a:hover { color: var(--ink); border-inline-start-color: var(--teal); }
.toc-l3 { padding-inline-start: .9rem; }
.toc-l3 a { font-size: .82rem; opacity: .85; }
.toc-list a.is-current { color: var(--teal); border-inline-start-color: var(--teal); }

/* لنگرِ کنارِ عنوان‌ها */
.prose h2, .prose h3 { position: relative; scroll-margin-top: 88px; }
.prose .anchor {
	position: absolute; inset-inline-end: 100%; padding-inline-end: .4rem;
	color: var(--stroke-2); opacity: 0; text-decoration: none; font-weight: 400;
}
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }

/* جدول‌ها — روی دسکتاپ جدولِ عادی، روی موبایل کارتِ عمودی (بدونِ اسکرول افقی) */
.table-wrap {
	margin: 1.6rem 0; border: 1px solid var(--stroke); border-radius: var(--radius-s);
	overflow: hidden;
}
.table-wrap:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.prose table {
	width: 100%; border-collapse: collapse; margin: 0;
	font-size: .92rem;
}
.prose td, .prose th { white-space: normal; overflow-wrap: anywhere; }
.prose thead th {
	background: var(--panel-2); color: var(--ink); font-weight: 500;
	text-align: start; padding: .7rem .9rem; border-bottom: 1px solid var(--stroke-2);
}
.prose td { padding: .65rem .9rem; border-bottom: 1px solid var(--stroke); color: var(--muted); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: rgba(255,255,255,.02); }

.prose pre {
	background: #05070E; border: 1px solid var(--stroke);
	border-radius: var(--radius-s); padding: 1rem 1.1rem;
	overflow-x: auto; -webkit-overflow-scrolling: touch;
	direction: ltr; text-align: left;
	font-size: .85rem; line-height: 1.7; margin: 1.6rem 0;
}
.prose pre code { background: none; padding: 0; color: #C6D3E6; }
.prose code {
	background: var(--panel-2); border: 1px solid var(--stroke);
	border-radius: 6px; padding: .1rem .4rem; font-size: .88em;
	direction: ltr; unicode-bidi: embed; display: inline-block;
}
.prose figure { margin: 2rem 0; }
.prose figcaption { color: var(--muted); font-size: .84rem; text-align: center; margin-top: .7rem; }
.prose strong { color: var(--ink); }

/* تصویرهای درون‌خطیِ SVG مقاله‌ها.
   چون داخلِ سند هستند (نه <img>)، فونتِ وزیرمتن و رنگ‌های قالب را به ارث می‌برند
   و در هر تراکمِ پیکسلی برنده‌اند.

   نمودار همیشه به عرضِ ظرف fit می‌شود — هیچ اسکرولِ افقی‌ای ندارد. متنِ نمودارها
   عمداً درشت طراحی شده تا حتی وقتی روی گوشی کوچک می‌شود هم خوانا بماند. */
.prose .figure-svg {
	background: linear-gradient(180deg, rgba(255,255,255,.03), transparent);
	border: 1px solid var(--stroke);
	border-radius: var(--radius);
	padding: 1.2rem 1rem;
	overflow: hidden;              /* هیچ‌وقت صفحه را افقی نکشد */
	/* روی دسکتاپ پهن نمی‌شود تا فونتِ درشتِ نمودار غول‌پیکر نشود؛ روی موبایل
	   خودِ ستون از این باریک‌تر است، پس تمام‌عرض می‌ماند. */
	max-width: 660px; margin-inline: auto;
}
.prose .figure-svg svg {
	display: block; width: 100%; height: auto;
	max-width: 100%;
	font-family: inherit;
	overflow: visible;
}
.prose .figure-svg svg text { font-family: inherit; }

@media (max-width: 560px) {
	.prose .figure-svg { padding: .7rem .55rem; border-radius: 12px; }
	.prose figcaption { font-size: .78rem; }
}

/* CTA میانِ مقاله */
.cta-inline {
	margin: 3rem 0; text-align: center; padding: 2rem 1.5rem;
	border-radius: var(--radius); border: 1px solid var(--stroke);
	background: radial-gradient(120% 140% at 50% 0%, rgba(99,102,241,.18), transparent 65%), var(--panel);
}
.cta-inline h2 { font-size: 1.35rem; }
.cta-inline p { color: var(--muted); margin-bottom: 1.2rem; }

/* قبلی / بعدی */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 3rem; }
.post-nav-item {
	background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius);
	padding: 1rem 1.2rem; display: grid; gap: .25rem; transition: .25s;
}
.post-nav-item:hover { border-color: var(--stroke-2); background: var(--panel-2); }
.post-nav-item span { color: var(--muted); font-size: .78rem; }
.post-nav-item strong { font-size: .95rem; font-weight: 500; }
.post-nav-item.next { text-align: end; }

.related { margin-bottom: 3rem; }
.related .sec-title { font-size: 1.5rem; margin-bottom: 1.2rem; }

/* صفحه‌بندی */
.pagination { display: flex; justify-content: center; gap: .4rem; margin-top: 2.5rem; }
.pagination .page-numbers {
	display: grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding: 0 .7rem;
	border-radius: 10px; border: 1px solid var(--stroke); background: var(--panel);
	color: var(--muted); font-size: .9rem;
}
.pagination .page-numbers:hover { color: var(--ink); border-color: var(--stroke-2); }
.pagination .current { background: linear-gradient(100deg, var(--indigo), var(--violet)); color: #fff; border-color: transparent; }

/* ---------- فوتر ---------- */
.site-footer { position: relative; border-top: 1px solid var(--stroke); padding-top: 4rem; margin-top: 2rem; overflow: hidden; }
.footer-glow { position: absolute; inset: -60% 20% auto; height: 320px; background: radial-gradient(closest-side, rgba(45,212,191,.18), transparent 72%); filter: blur(30px); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.footer-desc { color: var(--muted); font-size: .92rem; margin-top: 1rem; max-width: 46ch; }
.footer-col h3 { font-size: .95rem; margin-bottom: 1rem; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.footer-list a { color: var(--muted); font-size: .92rem; transition: .2s; }
.footer-list a:hover { color: var(--teal); }

.footer-bottom {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	flex-wrap: wrap; border-top: 1px solid var(--stroke); padding: 1.4rem 0 2rem;
}
.made-with-love { margin: 0; display: inline-flex; align-items: center; gap: .45rem; font-size: .95rem; }
.made-with-love a { color: var(--teal); font-weight: 500; }
.heart { color: var(--red); display: inline-grid; place-items: center; animation: beat 1.6s infinite var(--ease); }
@keyframes beat { 0%,100%{transform:scale(1)} 15%{transform:scale(1.22)} 30%{transform:scale(1)} 45%{transform:scale(1.14)} }
.copy { margin: 0; color: var(--muted); font-size: .82rem; }

/* ---------- ظهورِ اسکرولی ---------- */
.reveal-ready [data-reveal] { opacity: 0; transform: translateY(26px); }
.reveal-ready [data-reveal].revealed { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); }

/* If browser motion support is unavailable, keep every app screen readable and avoid a 520vh blank stage. */
.motion-fallback .bg3d { display: none; }
.motion-fallback .stage { height: auto; }
.motion-fallback .stage-pin { position: static; height: auto; padding: 3rem 0; }
.motion-fallback .phone { transform: none !important; opacity: 1 !important; }
.motion-fallback .screen-scroller { position: static; transform: none !important; }
.motion-fallback .phone-screen, .motion-fallback .scr { height: auto; }
.motion-fallback .scr { padding-bottom: 16px; }
.motion-fallback .phone-nav, .motion-fallback .cap, .motion-fallback .stage-copy { position: static; }
.motion-fallback .cap { opacity: 1; transform: none; margin-bottom: 2rem; }
.motion-fallback .stage-copy { transform: none; width: auto; }
.motion-fallback .stage-progress { display: none; }

/* =============================================================
   واکنش‌گرایی
   ============================================================= */
/* ≤۱۰۲۴: دیگر جا برای کپشنِ کنارِ گوشی نیست. کپشن به یک نوارِ فشرده‌ی پایینِ
   استیج تبدیل می‌شود (فقط تیتر) و متنِ کاملش در بخشِ «قابلیت‌ها» پایین‌تر می‌آید. */
@media (max-width: 1024px) {
	.grid-4 { grid-template-columns: repeat(2, 1fr); }
	.deep-row, .deep.alt .deep-row { grid-template-columns: 1fr; }
	.deep-art { order: -1; }

	/* گوشی و کپشن در دو ردیفِ صریحِ گرید می‌نشینند (نه absolute)، پس
	   هرقدر هم ارتفاعِ ویوپورت عوض شود، هیچ‌وقت روی هم نمی‌افتند.
	   ترتیبِ DOM برعکس است، ولی grid-row جای هرکدام را تعیین می‌کند. */
	.stage-pin { grid-template-rows: 1fr auto; place-items: center; }
	.phone-wrap { grid-row: 1; align-self: center; }
	.stage-copy {
		position: static; grid-row: 2;
		inset: auto; transform: none;
		width: min(46ch, 90vw); text-align: center;
		margin-bottom: 44px;
	}
	.cap p { display: none; }
	.cap-num { font-size: .7rem; letter-spacing: .18em; }
	.cap h2 { font-size: clamp(1rem, 3.2vw, 1.4rem); margin-top: .2rem; }
}

/* ≤۹۶۰: فهرستِ مطالب از کنار به بالای مقاله می‌آید، جمع‌شدنی می‌شود و
   دیگر چسبان نیست. */
@media (max-width: 960px) {
	.single-body { grid-template-columns: minmax(0, 1fr); }
	.toc { position: static; max-height: none; margin-bottom: 1.5rem; padding: .9rem 1rem; }
	.toc-title { cursor: pointer; margin-bottom: 0; }
	.toc[open] .toc-title { margin-bottom: .8rem; }
	.toc-title::after {
		content: '▾'; color: var(--muted); font-size: .8rem;
		transition: transform .25s var(--ease);
	}
	.toc[open] .toc-title::after { transform: rotate(180deg); }
	.toc-list { columns: 2; column-gap: 1.2rem; }
	.post-nav { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
	.site-nav, .header-cta { display: none; }
	.nav-toggle { display: block; margin-inline-start: auto; }
	.no-js .nav-toggle { display: none; }
	.no-js .mobile-nav, .js .mobile-nav.is-open { display: block; }
	.js .mobile-nav:not(.is-open) { display: none; }
	.footer-grid { grid-template-columns: 1fr; gap: 2rem; }
	.footer-bottom { flex-direction: column; align-items: flex-start; }

	.stage { height: 420vh; }
	/* ماکِ گوشی خودش «محتوا»ست — روی موبایل باید تا جای ممکن بزرگ بماند،
	   وگرنه متنِ ۱۳ پیکسلیِ داخلش خوانا نیست. */
	.phone { width: min(300px, 80vw); }

	/* بالا: هدرِ چسبان روی متن نیفتد.
	   پایین: «اسکرول کنید» با position:absolute کفِ هیرو می‌نشیند و ~۶۹px قد دارد؛
	   اگر padding کمتر از آن باشد، روی چیپ‌ها می‌افتد — دقیقاً چیزی که روی
	   گوشی‌های کوتاه دیده می‌شد. */
	.hero { padding-top: 6.5rem; padding-bottom: 7rem; }
	.trust-chips { gap: .45rem; }
	.trust-chips li { font-size: .78rem; padding: .35rem .7rem; }
	.scroll-hint { bottom: 1rem; }
	body:not(.elementor-page) .section { padding: 3.5rem 0; }
	.sec-head { margin-bottom: 2rem; }
}

/* ویوپورتِ کوتاه (موبایلِ افقی، پنجره‌ی کوچک): کپشن جا ندارد — کنارش می‌گذاریم
   تا گوشی له نشود. همان سه نکته پایین‌تر در بخشِ «قابلیت‌ها» هم آمده‌اند. */
@media (max-width: 1024px) and (max-height: 640px) {
	.stage-copy { display: none; }
}

@media (max-width: 560px) {
	.grid-4 { grid-template-columns: 1fr; }
	.wrap { width: min(100% - 1.75rem, var(--wrap)); }
	.hero-cta .btn { flex: 1 1 100%; }   /* دکمه‌های تمام‌عرض، هدفِ لمسِ بزرگ‌تر */
	.brand-text small { display: none; }
	.mini-card { padding: 1rem; }
	.leakrow, .routerow { font-size: .85rem; padding: .55rem .7rem; }

	.toc-list { columns: 1; }
	.prose { font-size: .96rem; }
	.prose pre { font-size: .74rem; padding: .8rem; border-radius: 10px; }

	/* ── جدولِ کارتی ──
	   روی صفحه‌های باریک، جدولِ چندستونی به مجموعه‌ای از کارت‌های عمودی تبدیل
	   می‌شود: هر ردیف یک کارت، و هر سلول یک سطر با برچسبِ ستونش. این‌طور هیچ
	   ستونی از عرضِ صفحه بیرون نمی‌زند و اسکرولِ چپ‌وراست کاملاً حذف می‌شود.
	   فقط برای جدول‌هایی که سرآیند دارند (data-label دارند). */
	.has-labels table,
	.has-labels thead,
	.has-labels tbody,
	.has-labels tr,
	.has-labels td { display: block; width: auto; }

	.has-labels thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

	.has-labels tr {
		border: 1px solid var(--stroke); border-radius: 12px;
		margin: 0 0 .8rem; padding: .3rem .2rem; background: rgba(255,255,255,.02);
	}
	.has-labels tr:last-child { margin-bottom: 0; }

	.has-labels td {
		display: flex; gap: .8rem; align-items: baseline; justify-content: space-between;
		padding: .5rem .8rem; border: 0; border-bottom: 1px solid var(--stroke);
		font-size: .9rem; text-align: end;
	}
	.has-labels tr td:last-child { border-bottom: 0; }
	.has-labels td::before {
		content: attr(data-label);
		color: var(--muted); font-size: .8rem; font-weight: 500;
		text-align: start; flex: 0 0 40%; min-width: 0; overflow-wrap: anywhere;
	}
	/* سلولی که data-label ندارد (مثلِ سلولِ اولِ برخی جدول‌ها) تمام‌عرض و پررنگ */
	.has-labels td:not([data-label]) {
		justify-content: flex-start; color: var(--ink); font-weight: 600;
		background: var(--panel); border-radius: 8px; text-align: start;
	}
	.has-labels td:not([data-label])::before { content: none; }

	/* جدولِ بدونِ سرآیند: کوچک و ساده بماند (نادر) */
	.prose table:not(.has-labels *) { font-size: .82rem; }
	.prose td, .prose th { padding: .5rem .6rem; }

	.post-card { padding: 1.1rem; }
	.single-lede { font-size: .98rem; }
	.single-head { padding-top: 1.5rem; text-align: start; }
	.taxo { justify-content: flex-start; }
	.cta-inline { padding: 1.5rem 1rem; }
	.cta-inline h2 { font-size: 1.15rem; }
	/* لنگرِ «#» روی موبایل جا ندارد و بیرونِ کادر می‌افتد */
	.prose .anchor { display: none; }
}

@media (max-width: 380px) {
	.phone { width: min(272px, 84vw); }
	.hero-title { font-size: 2.05rem; }
	.single-title { font-size: 1.5rem; }
	.crumbs { font-size: .76rem; }
}

/* ---------- احترام به کاهشِ حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
	.bg3d { display: none; }
	.stage { height: auto; }
	.stage-pin { position: static; height: auto; padding: 3rem 0; }
	.phone { transform: none !important; opacity: 1 !important; }
	.screen-scroller { position: static; transform: none !important; }
	.phone-screen { height: auto; }
	.scr { height: auto; padding-bottom: 16px; }
	/* سه صفحه پشتِ سرِ هم می‌آیند؛ نویگیشن باید یک‌بار و در انتها باشد،
	   نه چسبیده به کفِ کلِ ستون. */
	.phone-nav { position: static; }
	.stage-progress { display: none; }
	.cap { position: static; opacity: 1; transform: none; margin-bottom: 2rem; }
	.stage-copy { position: static; transform: none; width: auto; }
	.reveal-ready [data-reveal] { opacity: 1; transform: none; }
	.heart, .mouse i { animation: none; }
}

@media (max-width: 782px) {
	body.admin-bar .site-header { top: 46px; }
}
