/* =========================================================
   قالب ایمن تاش — صفحه اصلی (Industrial.dc.html و MobileHome.dc.html)
   فقط در صفحه اصلی بارگذاری می‌شود. توکن‌ها در :root فایل main.css.
   ========================================================= */

@keyframes em-up{from{transform:translateY(115%)}to{transform:translateY(0)}}
@keyframes em-kb{from{transform:scale(1.08)}to{transform:scale(1)}}

/* ورود با محو شدن؛ تأخیر هر جزء جدا تعریف می‌شود.
   شروع از opacity .01 (نه صفر) با fill backwards: از نظر چشم همان است، ولی مرورگر متن را از اولین
   رنگ‌آمیزی «دیده‌شده» حساب می‌کند و LCP منتظر پایان انیمیشن نمی‌ماند. */
@keyframes em-rise{from{opacity:.01;transform:translateY(16px)}to{opacity:1;transform:none}}
.em-rise{animation:em-rise 1s var(--ease-out) both}

/* ---------- هیرو ---------- */
.em-hero{position:relative;overflow:hidden;height:min(100vh,920px);min-height:700px;background:var(--navy-900);color:var(--white)}
.em-hero__media{position:absolute;inset:0;z-index:0;background-color:var(--ph-bg-color);background-image:var(--ph-bg);animation:em-kb 2.4s var(--ease-media) both}
.em-hero__media > img,.em-hero__media > video{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover}
.em-hero__live{opacity:0;transition:opacity .6s ease}
.em-hero__live--on{opacity:1}
/* لودر: حلقه‌های ثابت برند + سه موج که از مرکز باز و محو می‌شوند؛ فقط transform و opacity.
   فقط اندازه‌ای که ویدئو دارد نشانش می‌دهد؛ JS بعد از آماده شدن ویدئو محوش می‌کند و
   اگر JS نرسید، بعد از --loader-wait خودش محو می‌شود تا پوستر دیده شود. */
@keyframes em-pulse{0%{transform:scale(.2);opacity:0}15%{opacity:1}100%{transform:scale(1);opacity:0}}
@keyframes em-breath{to{transform:scale(1.6);opacity:.5}}
@keyframes em-loader-out{to{opacity:0;visibility:hidden}}
.em-hero__loader{--rings-at:var(--loader-x) var(--loader-y);display:none;position:absolute;inset:0;z-index:0;pointer-events:none;background-color:var(--navy-900);animation:em-loader-out var(--loader-fade) ease var(--loader-wait) forwards;transition:opacity var(--loader-fade) ease}
.em-hero__loader--done{opacity:0}
.em-hero__pulse,.em-hero__core{position:absolute;left:var(--loader-x);top:var(--loader-y);border-radius:50%}
.em-hero__pulse{width:calc(var(--ring-r) * 8);height:calc(var(--ring-r) * 8);margin:calc(var(--ring-r) * -4) 0 0 calc(var(--ring-r) * -4);border:1px solid var(--line-on-dark-5);opacity:0;will-change:transform,opacity;animation:em-pulse var(--loader-dur) var(--ease-out) infinite}
.em-hero__pulse:nth-child(2){animation-delay:calc(var(--loader-dur) / 3)}
.em-hero__pulse:nth-child(3){animation-delay:calc(var(--loader-dur) * 2 / 3)}
.em-hero__core{width:10px;height:10px;margin:-5px 0 0 -5px;background:var(--blue-light);animation:em-breath calc(var(--loader-dur) / 2) ease-in-out infinite alternate}
@media (min-width:768px){.em-hero__loader--desktop{display:block}}
@media (max-width:767px){.em-hero__loader--mobile{display:block}}
.em-hero__shade{position:absolute;inset:0;z-index:1;background:var(--hero-shade-y) left bottom/100% 45% no-repeat,var(--hero-shade-x)}

.em-hero__in{position:relative;z-index:2;height:100%;max-width:var(--container);margin:0 auto;padding:110px var(--gutter) 40px;display:flex;flex-direction:column;justify-content:center}
.em-hero__body{max-width:680px}

/* برچسب کوچک بالای تیتر، روی ویدئو سفید است. */
.em-hero__eyebrow{margin-bottom:18px;color:var(--white);font-family:var(--font-display);font-size:var(--fs-section-title);font-weight:var(--fw-display);text-wrap:balance;animation-delay:.15s}
.em-hero__title{margin:0 0 30px;inline-size:min(var(--container) - 2 * var(--gutter),100vw - 2 * var(--gutter));font-family:var(--font-display);font-weight:var(--fw-display);font-size:var(--fs-display);line-height:1.36;text-align:center}
.em-hero__line{display:block}
/* ادامه تیتر از ستون ۶۸۰ پیکسلی بیرون می‌زند تا در دسکتاپ یک خط بماند؛ در صفحه باریک به عرض محتوا محدود و چندخطی است. */
.em-hero__detail{display:block;max-inline-size:100%;margin-block-start:.45em;color:var(--white);font-family:var(--font-head);font-size:var(--fs-why-lead);font-weight:500;line-height:var(--lh-body);text-wrap:balance}
/* پژوهشگاه (سبک سایت قبلی): نوار سرمه‌ای باریک بالا با زبانه تیتر و گوشه‌های مقعر،
   عکس و متن کنار هم، گوه مورب سرمه‌ای پایین. گوشه‌های مقعر با radial-gradient ساخته می‌شوند. */
.em-research{position:relative;padding-block:0 calc(var(--section-y) + var(--research-wedge));background:var(--bg-soft)}
.em-research::before{content:"";position:absolute;inset:0 0 auto;block-size:var(--research-band);background:var(--navy-900)}
.em-research::after{content:"";position:absolute;inset:auto 0 0;block-size:var(--research-wedge);background:var(--navy-900);clip-path:polygon(0 100%,100% 0,100% 100%)}
.em-research__tab{position:relative;inline-size:fit-content;max-inline-size:calc(100% - 2 * var(--research-flare) - 2 * var(--gutter,20px));margin:0 auto var(--research-gap);padding:calc(var(--research-band) + 10px) var(--research-tab-x) 16px;border-radius:0 0 var(--radius-lg) var(--radius-lg);background:var(--navy-900);color:var(--white)}
.em-research__tab::before,.em-research__tab::after{content:"";position:absolute;inset-block-start:var(--research-band);inline-size:var(--research-flare);block-size:var(--research-flare)}
.em-research__tab::before{right:100%;background:radial-gradient(circle at 0 100%,transparent calc(var(--research-flare) - .5px),var(--navy-900) var(--research-flare))}
.em-research__tab::after{left:100%;background:radial-gradient(circle at 100% 100%,transparent calc(var(--research-flare) - .5px),var(--navy-900) var(--research-flare))}
.em-research__title{margin:0;color:var(--white);font-size:var(--fs-research-tab);line-height:1.5;text-align:center;text-wrap:balance}
.em-research__layout{display:grid;gap:var(--research-gap);align-items:center}
.em-research__media{position:relative;margin:0;overflow:hidden;border-radius:var(--radius-lg);aspect-ratio:3/2;background:var(--navy-800);box-shadow:var(--shadow-photo)}
.em-research__media .em-duo > img{object-position:var(--research-photo-pos)}
.em-research__body{display:flex;flex-direction:column;align-items:flex-start;gap:var(--research-stack);min-inline-size:0}
.em-research__subtitle{margin:0;color:var(--navy-900);font-weight:700;font-size:var(--fs-research-sub);line-height:1.6}
.em-research__subtitle::before{content:"";display:block;inline-size:var(--research-accent);block-size:var(--research-rule);margin-block-end:12px;background:var(--blue);border-radius:var(--radius-pill)}
.em-research__text{font-size:var(--fs-body);line-height:var(--lh-body);color:var(--ink)}
.em-research__text p{margin:0 0 var(--research-stack)}
.em-research__text > :last-child{margin-block-end:0}
.em-research__details{border-block-start:1px solid var(--line)}
.em-research__details summary{display:flex;align-items:center;gap:10px;min-block-size:var(--hbtn);cursor:pointer;color:var(--blue);font-weight:600;list-style:none}
.em-research__details summary:hover{color:var(--blue-hover)}
.em-research__details summary::-webkit-details-marker{display:none}
.em-research__details summary svg{inline-size:1em;block-size:1em;transition:transform .25s var(--ease-out)}
.em-research__details[open] summary svg{transform:rotate(180deg)}
.em-research__less,.em-research__details[open] .em-research__more{display:none}
.em-research__details[open] .em-research__less{display:inline}
.em-research__details > :last-child{margin-block-end:0}
.em-research__quote{margin:0;padding-inline-start:var(--research-stack);border-inline-start:var(--research-rule) solid var(--blue)}
.em-research__quote p{margin:0;font-family:var(--font-display);font-weight:var(--fw-display);font-size:var(--fs-research-quote);line-height:1.6;color:var(--navy-900);text-wrap:balance}
.em-research__actions{display:flex;flex-wrap:wrap;gap:12px}
@media (min-width:900px){
  .em-research__layout--photo{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
}
@media (max-width:899px){
  .em-research__actions{inline-size:100%}
  .em-research__actions .em-btn{flex:1 1 0;justify-content:center}
}
@media (prefers-reduced-motion:reduce){
  .em-research__details summary svg{transition:none}
}

.em-w{display:inline-block;overflow:hidden;vertical-align:top;padding-bottom:.12em;margin-bottom:-.12em}
.em-wi{display:inline-block;transform:translateY(115%);animation:em-up 1s var(--ease-out) var(--em-d,0s) forwards}

.em-hero__words{display:flex;flex-wrap:wrap;align-items:baseline;gap:.45em;margin:0 0 22px;font-size:22px;line-height:1.6;animation-delay:1.35s}
.em-hero__lead{color:var(--on-dark-2)}
.em-hero__rot{display:inline-block;height:1.6em;overflow:hidden;border-bottom:2px solid var(--blue-light)}
.em-hero__track{display:flex;flex-direction:column;font-weight:600;transition:transform .55s var(--ease-swap)}
.em-hero__track > span{height:1.6em;line-height:1.6em;white-space:nowrap}

.em-hero__text{max-width:540px;margin:0 0 38px;font-size:18px;color:var(--on-dark);animation-delay:1.55s}
.em-hero__actions{display:flex;flex-wrap:wrap;gap:14px;animation-delay:1.75s}

@media (max-width:767px){
  .em-hero{height:100svh;min-height:620px}
  .em-hero__shade{background:var(--hero-shade-mobile)}
  /* متن پایین هیرو؛ فاصله پایین شامل نوار ثابت تماس هم هست */
  .em-hero__in{justify-content:flex-end;padding:0 var(--gutter) calc(40px + var(--mbar-space))}
  .em-hero__eyebrow {margin-bottom: 10px;font-size: 16px;gap: 6px;}
  .em-hero__eyebrow::before {width: 16px;}
  .em-hero__title{margin-bottom:14px;font-size:var(--fs-display-mobile);line-height:1.4}
  .em-hero__words{gap:.4em;margin-bottom:10px;font-size:15px}
  .em-hero__text{margin-bottom:20px;font-size:var(--fs-xs);line-height:1.85}
  .em-hero__actions{flex-direction:column;gap:10px}
  .em-hero__actions .em-btn{justify-content:center;min-height:46px;padding:0 20px;font-size:var(--fs-sm)}
  .em-hero__actions .em-btn__icon{display:none}
}

/* ---------- درباره ما ---------- */
.em-about__grid{display:grid;grid-template-columns:minmax(0,6fr) minmax(0,5fr);gap:64px;align-items:center;margin-bottom:44px}
.em-about__text{margin:0 0 28px;font-family:var(--font-head);font-weight:500;font-size:clamp(19px,1.7vw,25px);line-height:1.8;color:var(--ink)}

.em-frame{position:relative;margin:0;padding:0 0 22px 22px}
.em-frame__caption{position:relative;margin-block-start:.5em;color:var(--ink);font-size:var(--fs-why-lead);font-weight:700;text-align:center}
.em-frame::before{content:"";position:absolute;left:0;bottom:0;width:calc(100% - 22px);height:calc(100% - 22px);border:2px solid var(--blue);border-radius:var(--radius-md)}
.em-frame__img{position:relative;aspect-ratio:var(--em-ratio,4/3);overflow:hidden;border-radius:var(--radius-md);box-shadow:var(--shadow-photo)}
.em-frame__img img{display:block;width:100%;height:100%;object-fit:cover}

/* دکمه نمایش بزرگ: کل عکس قابل کلیک، برچسب کوچک گوشه عکس */
.em-frame__zoom{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:flex-start;padding:12px;border:0;background:transparent;color:var(--white);cursor:zoom-in}
.em-frame__zoom span{display:inline-flex;align-items:center;min-block-size:36px;padding:0 14px;border-radius:var(--radius-pill);background:var(--lightbox-chip);font-size:var(--fs-sm);font-weight:500}
.em-frame__zoom svg{position:absolute;inset-block-end:12px;inset-inline-start:12px;inline-size:36px;block-size:36px;padding:9px;border-radius:50%;background:var(--lightbox-chip)}
.em-frame__zoom span{margin-inline-start:44px;opacity:0;transform:translateX(6px);transition:opacity .25s ease,transform .25s ease}
.em-frame__zoom:hover span,.em-frame__zoom:focus-visible span{opacity:1;transform:none}
.em-frame__zoom:focus-visible{outline:3px solid var(--blue);outline-offset:-3px;border-radius:var(--radius-md)}

/* پنجره نمایش بزرگ عکس */
.em-lightbox{inline-size:min(96vw,1400px);max-block-size:94vh;max-block-size:94dvh;padding:16px;border:0;border-radius:var(--radius-lg);background:var(--navy-900);color:var(--white);overflow:hidden}
.em-lightbox::backdrop{background:var(--lightbox-backdrop)}
.em-lightbox__img{display:block;inline-size:auto;max-inline-size:100%;block-size:auto;max-block-size:calc(94vh - 90px);max-block-size:calc(94dvh - 90px);margin:0 auto;border-radius:var(--radius-md);object-fit:contain}
.em-lightbox__caption{margin:10px 0 0;text-align:center;color:var(--on-dark-2);font-size:var(--fs-sm)}
.em-lightbox__close{position:absolute;inset-block-start:24px;inset-inline-end:24px;z-index:1;display:inline-flex;align-items:center;justify-content:center;inline-size:40px;block-size:40px;padding:0;border:1px solid var(--white-a55);border-radius:50%;background:var(--navy-900);color:var(--white);cursor:pointer}
.em-lightbox__close:hover{background:var(--white);color:var(--navy-900)}
.em-lightbox__close svg{inline-size:18px;block-size:18px}

/* عکس پهن (کلاژ تاریخچه): ستون عکس پهن‌تر از متن تا عکس بزرگ‌تر دیده شود */
.em-about__grid--wide{grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:48px}
@media (max-width:900px){
  .em-about__grid{grid-template-columns:minmax(0,1fr);gap:36px}
}
@media (max-width:767px){
  .em-about__grid{gap:28px;margin-bottom:28px}
  .em-about__text{font-size:22px;line-height:1.7}
  .em-about .em-btn{display:flex;justify-content:center;width:100%}
  .em-frame{padding:0 0 14px 14px}
  .em-frame::before{width:calc(100% - 14px);height:calc(100% - 14px)}
  .em-frame__zoom span{opacity:1;transform:none}
  .em-lightbox{inline-size:calc(100vw - 16px);padding:10px}
  .em-lightbox__close{inset-block-start:16px;inset-inline-end:16px}
}
@media (prefers-reduced-motion:reduce){
  .em-frame__zoom span{transition:none}
}

/* ---------- کارت تصویری (صنایع، خدمات) ---------- */
.em-card{position:relative;overflow:hidden;display:flex;color:var(--white)}
.em-card:hover{color:var(--white)}
.em-card__img{position:absolute;inset:0;transition:transform .8s var(--ease-media)}
.em-card__img img{display:block;width:100%;height:100%;object-fit:cover}
a.em-card:hover .em-card__img{transform:scale(1.06)}
a.em-card:hover .em-btn__icon{transform:translateX(-5px)}
.em-card__shade{position:absolute;inset:0;background:var(--card-shade)}

/* ---------- صنایع ---------- */
.em-inds{display:grid;grid-template-columns:repeat(var(--em-ind-cols,4),minmax(0,1fr));gap:16px;list-style:none;margin:0;padding:0}
.em-ind{height:100%;min-height:280px;flex-direction:column;justify-content:flex-end;padding:24px;border-radius:var(--radius-sm)}
.em-ind__foot{position:relative;z-index:2;display:flex;align-items:flex-end;justify-content:space-between;gap:14px}
.em-ind__title{margin:0;font-family:var(--font-head);font-weight:600;font-size:22px;line-height:1.45;color:var(--white)}
.em-ind__arrow{flex:0 0 auto;width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--white-a60);border-radius:50%}
.em-ind__arrow .em-btn__icon{width:16px;height:16px}
.em-ind__text{min-width:0}
/* «مشاهده محصولات» با هاور از پایین بالا می‌آید */
.em-ind__more{display:block;max-height:0;overflow:hidden;opacity:0;transform:translateY(8px);color:var(--white);font-size:var(--fs-sm);font-weight:600;transition:max-height .4s var(--ease-out),opacity .4s ease,transform .4s var(--ease-out),margin .4s var(--ease-out)}
a.em-ind:hover .em-ind__more,a.em-ind:focus-visible .em-ind__more{max-height:2em;margin-top:6px;opacity:1;transform:none}
a.em-ind:hover .em-ind__arrow{background:var(--white);color:var(--navy-900);border-color:var(--white)}
.em-ind__arrow{transition:background-color .3s ease,color .3s ease,border-color .3s ease}

/* عکس‌ها (از منابع مختلف) با ته‌رنگ سرمه‌ای و رنگ کمتر یکدست می‌شوند؛ با هاور رنگ کامل برمی‌گردد */
.em-ind .em-card__img img{filter:saturate(var(--ind-sat));transition:filter .6s ease}
.em-ind .em-card__img::after{content:"";position:absolute;inset:0;background:var(--navy-900);opacity:var(--ind-tint);transition:opacity .6s ease}
a.em-ind:hover .em-card__img img{filter:none}
a.em-ind:hover .em-card__img::after{opacity:0}

/* بنتو: کارت اول (صنعت اصلی) دو ستون و دو ردیف؛ فقط دسکتاپ */
@media (min-width:901px){
  .em-inds--bento{grid-auto-rows:var(--ind-row)}
  .em-inds--bento .em-ind{min-height:0}
  .em-inds__item--big{grid-column:span 2;grid-row:span 2}
  .em-inds__item--big .em-ind{padding:32px}
  .em-inds__item--big .em-ind__title{font-weight:var(--fw-display-sm);font-size:clamp(26px,2.4vw,36px);line-height:1.35}
  .em-inds__item--big .em-ind__arrow{width:52px;height:52px}
}
.em-rail-hint{display:none}

@media (max-width:900px){
  .em-inds{grid-template-columns:repeat(2,minmax(0,1fr))}
  /* تعداد فرد: کارت اول تمام‌عرض تا کارت آخر تنها نماند (۹ = ۱ + ۴×۲) */
  .em-inds__item:first-child:nth-last-child(odd){grid-column:1 / -1}
}
/* موبایل: اسلایدر افقی با اسکرول بومی (MobileHome.dc.html) */
@media (max-width:767px){
  .em-inds{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:var(--gutter);margin:0 calc(var(--gutter) * -1);padding:0 var(--gutter) 6px;scrollbar-width:none}
  .em-inds::-webkit-scrollbar{display:none}
  .em-inds__item{flex:0 0 250px;scroll-snap-align:start}
  .em-ind{height:300px;min-height:0;padding:18px;border-radius:var(--radius-card)}
  .em-ind__title{font-size:19px;line-height:1.5}
  .em-ind__arrow{display:none}
  .em-rail-hint{display:block;margin:10px 0 0;font-size:var(--fs-xs);color:var(--muted)}
}

/* ---------- مشتریان: زمینه سرمه‌ای، دو ردیف خلاف هم، لوگوی سفید روی کارت تیره ---------- */
.em-clients{background-color:var(--navy-900);color:var(--white)}
.em-clients__title{margin:0 0 28px;text-align:center;font-family:var(--font-display);font-weight:var(--fw-display);font-size:28px;line-height:1.5;color:var(--white)}
.em-clients__text{max-inline-size:75ch;margin:0 auto var(--client-gap);color:var(--on-dark)}
.em-clients__rows{display:grid;row-gap:var(--client-gap)}
.em-clients__wrap{overflow:hidden;-webkit-mask-image:var(--mask-edges);mask-image:var(--mask-edges)}
/* سرعت ثابت برای هر لوگو، هرچقدر تعداد */
.em-clients__track{display:flex;width:max-content;animation:em-marquee calc(var(--em-clients-n, 10) * 3.2s) linear infinite}
.em-clients__track--rev{animation-direction:reverse}
.em-clients__wrap:hover .em-clients__track{animation-play-state:paused}
@keyframes em-marquee{from{transform:translateX(0)}to{transform:translateX(50%)}}
.em-clients__list{display:flex;list-style:none;margin:0;padding:0}
.em-client{flex:0 0 auto;margin-left:var(--client-gap)}
.em-client__logo{display:flex;align-items:center;justify-content:center;width:var(--client-w);height:var(--client-h);padding:12px 16px;border:1px solid var(--white-a08);border-radius:var(--radius-card);background:var(--client-card-bg)}
/* لوگوی رنگی ← سفید یک‌رنگ (بدون قرمز و نارنجی روی زمینه تیره) */
.em-client__logo img{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;filter:brightness(0) invert(1);opacity:.78;transition:opacity .2s ease}
.em-client:hover .em-client__logo img{opacity:1}

@media (max-width:767px){
  .em-clients__title{margin-bottom:18px;font-size:22px}
  .em-clients__wrap{margin:0 calc(var(--gutter) * -1);-webkit-mask-image:none;mask-image:none}
  .em-client__logo{padding:8px 10px;border-radius:var(--radius-sm)}
}

/* ---------- خدمات ---------- */
.em-svcs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;list-style:none;margin:0;padding:0}
.em-svc{height:100%;min-height:260px;flex-direction:column;align-items:flex-start;padding:30px 32px;border-radius:var(--radius-lg);background:var(--navy-800)}
.em-svc .em-svc__img{right:auto;width:var(--svc-img-w)}
.em-svc__shade{position:absolute;inset:0;background:var(--svc-shade)}
.em-svc__icon{position:relative;z-index:2;width:54px;height:54px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line-on-dark-5);border-radius:50%;color:var(--blue-light)}
.em-svc__icon svg{width:26px;height:26px}
.em-svc__title{position:relative;z-index:2;max-width:52%;margin:22px 0 20px;font-family:var(--font-head);font-weight:600;font-size:24px;line-height:1.5;color:var(--white)}
.em-svc__arrow{position:relative;z-index:2;width:44px;height:44px;margin-top:auto;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--white-a55);border-radius:50%;transition:background-color .25s ease,color .25s ease}
a.em-svc:hover .em-svc__arrow{background:var(--white);color:var(--navy-800)}

@media (max-width:900px){
  .em-svcs{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:767px){
  .em-svcs{gap:12px}
  .em-svc{min-height:170px;padding:20px;border-radius:var(--radius-md)}
  .em-svc__icon{width:44px;height:44px}
  .em-svc__icon svg{width:22px;height:22px}
  .em-svc__title{max-width:60%;margin:12px 0 0;font-size:18px;line-height:1.55}
  .em-svc__arrow{display:none}
}

/* ---------- بنر تصویری تمام‌عرض ---------- */
@keyframes em-parallax{from{transform:translate3d(0,calc(var(--banner-parallax) * -1),0) scale(1.18)}to{transform:translate3d(0,var(--banner-parallax),0) scale(1.18)}}

.em-banner{position:relative;overflow:hidden;display:flex;align-items:center;min-height:var(--banner-h);background:var(--navy-900);color:var(--white)}
.em-banner__shade{position:absolute;inset:0;z-index:1;background:var(--banner-shade)}
.em-banner__in{position:relative;z-index:2;width:100%;padding-block:var(--section-y)}
.em-banner__body{max-width:620px}
.em-banner__eyebrow{color:var(--blue-light)}
.em-banner__title{margin-bottom:18px;font-size:var(--fs-section-title);line-height:1.45} /* هم‌اندازه تیتر سکشن‌ها (مثل «محصولات») */
/* هر خط تیتر یک سطر کامل؛ بعد از تقسیم کلمه‌ها (main.js) هم */
.em-banner__line,.em-banner__title > .em-rw{display:block}
.em-banner__text{max-width:520px;margin:0 0 30px;font-size:18px;color:var(--on-dark)}
@supports (animation-timeline: view()){
  .em-banner__img{animation:em-parallax linear both;animation-timeline:view(block)}
}

@media (max-width:767px){
  .em-banner{align-items:flex-end}
  .em-banner__title{margin-bottom:10px}
  .em-banner__text{margin-bottom:20px;font-size:var(--fs-sm)}
  .em-banner__btn{display:flex;justify-content:center;width:100%;min-height:48px;padding-block:0}
}

/* ---------- محصولات: تب دسته‌ها + پنل تصویری ---------- */
@keyframes em-pswap{from{opacity:0;transform:scale(1.06)}to{opacity:1;transform:scale(1)}}

.em-prod{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:32px;align-items:stretch}
.em-pcats{border-top:1px solid var(--line)}
.em-pcat{width:100%;display:flex;align-items:center;gap:16px;padding:18px 20px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--muted);font:inherit;text-align:start;cursor:pointer;transition:background-color .25s ease,color .25s ease}
.em-pcat:hover{color:var(--navy-900)}
.em-pcat[aria-selected="true"]{border-radius:var(--radius-sm);background:var(--white);color:var(--navy-900)}
.em-pcat__bar{flex:0 0 auto;width:6px;height:34px;border-radius:var(--radius-pill)}
.em-pcat[aria-selected="true"] .em-pcat__bar{background:var(--blue)}
.em-pcat__thumb{position:relative;flex:0 0 auto;width:64px;height:48px;overflow:hidden;border-radius:var(--radius-sm);opacity:.55;filter:saturate(.6);transition:opacity .25s ease}
.em-pcat__thumb img{display:block;width:100%;height:100%;object-fit:cover}
.em-pcat__thumb .em-ph{background-size:12px 12px,12px 12px,100% 100%}
.em-pcat[aria-selected="true"] .em-pcat__thumb,.em-pcat:hover .em-pcat__thumb{opacity:1;filter:none}
.em-pcat__name{flex:1;min-width:0;font-family:var(--font-head);font-weight:400;font-size:28px;line-height:1.4}
.em-pcat[aria-selected="true"] .em-pcat__name{font-weight:600}
.em-pcat__count{font-size:var(--fs-nav)}
.em-pcat[aria-selected="true"] .em-pcat__count{color:var(--blue);font-weight:600}

.em-ppanel{height:100%}
.em-ppanel__card{height:100%;min-height:500px;flex-direction:column;justify-content:flex-end;padding:40px;border-radius:var(--radius-lg)}
.em-ppanel__img{transform-origin:center top}
.em-ppanel__img img,.em-pcat__thumb img{object-position:center top}
.em-ppanel:not([hidden]) .em-ppanel__img{animation:em-pswap .6s var(--ease-media)}
.em-ppanel__shade{position:absolute;inset:0;background:var(--panel-shade)}
.em-ppanel__body{position:relative;z-index:2;display:flex;flex-direction:column;align-items:flex-start}
.em-ppanel__count{margin-bottom:6px;color:var(--on-dark-3);font-size:var(--fs-nav)}
.em-ppanel__title{margin:0 0 12px;font-family:var(--font-display);font-weight:600;font-size:clamp(34px,3.4vw,52px);line-height:1.3}
.em-ppanel__desc{max-width:520px;margin-bottom:22px;color:var(--on-dark);font-size:18px}
.em-ppanel__btn{padding:13px 26px}

@media (max-width:900px){
  .em-prod{grid-template-columns:minmax(0,1fr)}
  .em-ppanel__card{min-height:440px}
}
/* موبایل: تب‌ها اسلایدر قرصی افقی، بدون تصویر کوچک و تعداد (MobileHome.dc.html) */
@media (max-width:767px){
  .em-products__all{display:none}
  .em-prod{gap:14px}
  .em-pcats{display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:var(--gutter);margin:0 calc(var(--gutter) * -1);padding:0 var(--gutter) 6px;border-top:0;scrollbar-width:none}
  .em-pcats::-webkit-scrollbar{display:none}
  .em-pcat{flex:0 0 auto;width:auto;min-height:40px;padding:6px 16px;border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--white);color:var(--ink);white-space:nowrap;scroll-snap-align:start}
  .em-pcat[aria-selected="true"]{border-color:var(--navy-900);border-radius:var(--radius-pill);background:var(--navy-900);color:var(--white)}
  .em-pcat__bar,.em-pcat__thumb,.em-pcat__count{display:none}
  .em-pcat__name{font-family:var(--font-body);font-size:var(--fs-sm);line-height:1.6}
  .em-ppanel__card{min-height:420px;padding:22px;border-radius:var(--radius-md)}
  .em-ppanel__count{margin-bottom:0;font-size:var(--fs-xs)}
  .em-ppanel__title{margin:0 0 6px;font-size:28px;line-height:1.35}
  .em-ppanel__desc{margin-bottom:16px;font-size:var(--fs-sm)}
  .em-ppanel__btn .em-btn__icon{display:none}
  .em-ppanel__btn{min-height:44px;padding:0 20px;font-size:var(--fs-sm)}
}

/* ---------- خط تولید: نقشه با انیمیشن ترسیم ---------- */
@keyframes em-draw{to{stroke-dashoffset:0}}
@keyframes em-flow{to{stroke-dashoffset:-40}}
@keyframes em-needle{0%,100%{transform:rotate(-50deg)}50%{transform:rotate(40deg)}}
@keyframes em-blink{0%,100%{opacity:1}50%{opacity:.15}}
@keyframes em-fall{from{transform:translateY(0);opacity:1}to{transform:translateY(58px);opacity:0}}

.em-pl{background-color:var(--navy-800);background-image:var(--bg-dots);background-size:var(--dots-size) var(--dots-size);color:var(--white)}
.em-pl__h2{margin-bottom:10px}
.em-pl__intro{max-width:600px;margin:0 0 20px;color:var(--on-dark-2)}
/* نقشه در ستون اول (راست)، سربرگ و مراحل روی هم در ستون دوم */
.em-pl__grid{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);grid-template-areas:"map head" "map steps";grid-template-rows:auto 1fr;gap:0 56px;align-items:center}
.em-pl__head{grid-area:head;align-self:end}
.em-pl__side{grid-area:steps;align-self:start}
/* برچسب‌ها از x به راست نوشته شوند؛ ویژگی dir روی svg درون‌خطی کافی نیست */
.em-pl__map{grid-area:map;display:block;width:100%;height:auto;max-height:var(--pl-map-max);direction:ltr}

.em-pl__d,.em-pl__d2{fill:none;stroke-dasharray:1;stroke-dashoffset:1;animation:em-draw 2.2s cubic-bezier(.45,.05,.2,1) forwards}
.em-pl__d{stroke:var(--blue-light);stroke-width:var(--pl-stroke);stroke-linejoin:round;stroke-linecap:round}
.em-pl__d2{stroke:var(--line-on-dark-6);stroke-width:var(--pl-stroke-2)}
.em-pl__fl{fill:none;stroke:var(--white);stroke-width:var(--pl-stroke-flow);stroke-linecap:round;stroke-dasharray:4 16;opacity:0;animation:em-fadein .6s ease 2.6s forwards,em-flow 1.4s linear infinite}
.em-pl__fl--dim{stroke-opacity:.6}
.em-pl__lb{fill:var(--blue-light);font-family:var(--font-body);font-size:13px;letter-spacing:.08em;opacity:0;animation:em-fadein .8s ease forwards}
.em-pl__fi{opacity:0;animation:em-fadein .8s ease forwards}
.em-pl__nd{fill:none;stroke:var(--white);stroke-width:var(--pl-stroke-flow);stroke-linecap:round;transform-box:view-box;transform-origin:330px 210px;animation:em-needle 5s ease-in-out infinite}
.em-pl__bl{fill:var(--white);animation:em-blink 1.4s ease-in-out infinite}
.em-pl__pd{fill:var(--white);animation:em-fall 1.6s ease-in infinite}
/* تا وقتی سکشن دیده نشده (home.js) */
.em-pl[data-em-pl="wait"] :is(.em-pl__d,.em-pl__d2,.em-pl__fl,.em-pl__lb,.em-pl__fi,.em-pl__nd,.em-pl__bl,.em-pl__pd){animation-play-state:paused}

.em-pl__steps{list-style:none;margin:0;padding:0;border-top:1px solid var(--line-on-dark-4)}
.em-pl__step{display:flex;gap:20px;padding:12px 0;border-bottom:1px solid var(--line-on-dark-2)}
.em-pl__code{flex:0 0 96px;padding-top:4px;color:var(--blue-light);font-size:var(--fs-nav);font-weight:600}
.em-pl__title{margin:0 0 2px;font-family:var(--font-head);font-weight:600;font-size:19px;line-height:1.5}
.em-pl__text{margin:0;color:var(--on-dark-2);font-size:var(--fs-nav)}

/* روایت اسکرولی: فقط دسکتاپ با ارتفاع کافی و فقط وقتی home.js کلاس em-pl--story را گذاشته
   (بدون JS، با کاهش حرکت و در موبایل همان چیدمان ثابت بالا). محتوا می‌چسبد، سکشن به‌اندازه
   هر مرحله یک --pl-step-scroll بلندتر می‌شود و مرحله فعال روی نقشه روشن می‌ماند. */
.em-pl__count{display:none}
@media (min-width:901px) and (min-height:700px){
  .em-pl--story{height:calc(100vh + var(--em-pl-n) * var(--pl-step-scroll));padding-block:0}
  .em-pl--story > .em-container{position:sticky;top:0;display:flex;align-items:center;min-height:100vh;padding-block:var(--section-y)}
  .em-pl--story .em-pl__grid{width:100%}

  .em-pl--story .em-pl__count{display:flex;align-items:baseline;gap:8px;margin:0 0 14px;font-family:var(--font-head);font-weight:var(--fw-display);color:var(--on-dark-4)}
  .em-pl--story .em-pl__now{font-size:44px;line-height:1;color:var(--white)}

  /* ریل پیشرفت کنار مراحل؛ پر شدنش از --em-pl-p (۰ تا ۱) که JS با اسکرول می‌نویسد */
  .em-pl--story .em-pl__steps{position:relative;padding-inline-start:22px;border-top:0}
  .em-pl--story .em-pl__steps::before,.em-pl--story .em-pl__steps::after{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:2px;border-radius:2px;background:var(--line-on-dark-2)}
  .em-pl--story .em-pl__steps::after{background:var(--blue-light);transform:scaleY(var(--em-pl-p,0));transform-origin:top}
  .em-pl--story .em-pl__step{opacity:.4;transition:opacity .45s ease}
  .em-pl--story .em-pl__step.is-done{opacity:.65}
  .em-pl--story .em-pl__step.is-active{opacity:1}
  .em-pl--story .em-pl__step.is-active .em-pl__code{color:var(--white)}

  /* نقشه: بقیه مراحل کم‌رنگ، مرحله فعال سفید. stroke/fill-opacity چون opacity در انیمیشن ورود است. */
  .em-pl--story .em-pl__map [data-em-stage]{stroke-opacity:var(--pl-dim);fill-opacity:var(--pl-dim);transition:stroke-opacity .5s ease,fill-opacity .5s ease,stroke .5s ease,fill .5s ease}
  .em-pl--story[data-em-step="1"] .em-pl__map [data-em-stage="1"],
  .em-pl--story[data-em-step="2"] .em-pl__map [data-em-stage="2"],
  .em-pl--story[data-em-step="3"] .em-pl__map [data-em-stage="3"],
  .em-pl--story[data-em-step="4"] .em-pl__map [data-em-stage="4"]{stroke-opacity:1;fill-opacity:1}
  .em-pl--story[data-em-step="1"] .em-pl__map .em-pl__d[data-em-stage="1"],
  .em-pl--story[data-em-step="2"] .em-pl__map .em-pl__d[data-em-stage="2"],
  .em-pl--story[data-em-step="3"] .em-pl__map .em-pl__d[data-em-stage="3"],
  .em-pl--story[data-em-step="4"] .em-pl__map .em-pl__d[data-em-stage="4"]{stroke:var(--white)}
  .em-pl--story[data-em-step="1"] .em-pl__map .em-pl__lb[data-em-stage="1"],
  .em-pl--story[data-em-step="2"] .em-pl__map .em-pl__lb[data-em-stage="2"],
  .em-pl--story[data-em-step="3"] .em-pl__map .em-pl__lb[data-em-stage="3"],
  .em-pl--story[data-em-step="4"] .em-pl__map .em-pl__lb[data-em-stage="4"]{fill:var(--white)}
}

@media (max-width:900px){
  .em-pl__grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "map" "steps";grid-template-rows:auto;gap:24px}
}
@media (max-width:767px){
  .em-pl__h2{margin-bottom:6px}
  .em-pl__intro{margin-bottom:18px;font-size:var(--fs-sm)}
  .em-pl__grid{gap:10px}
  .em-pl__lb{font-size:22px;letter-spacing:.06em}
  .em-pl__step{gap:14px;padding:12px 0}
  .em-pl__code{flex-basis:74px;padding-top:3px;font-size:var(--fs-xs)}
  .em-pl__title{font-family:var(--font-body);font-size:16px}
  .em-pl__text{font-size:var(--fs-xs)}
}

/* ---------- گالری کارخانه ---------- */
@media (min-width:768px){
  .em-gallery{padding-block:calc(var(--section-y) + 20px) calc(var(--section-y) + 16px)}
}
.em-gal{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-areas:"a a b c" "a a d e";grid-auto-rows:var(--gallery-row);gap:16px;list-style:none;margin:0;padding:0}
.em-gal__item{position:relative;overflow:hidden;border-radius:var(--radius-sm)}
.em-gal__item--1{grid-area:a}
.em-gal__item--2{grid-area:b}
.em-gal__item--3{grid-area:c}
.em-gal__item--4{grid-area:d}
.em-gal__item--5{grid-area:e}
.em-gal__img{position:absolute;inset:0;transition:transform .8s var(--ease-media)}
.em-gal__img img{display:block;width:100%;height:100%;object-fit:cover}
.em-gal__item:hover .em-gal__img{transform:scale(1.05)}

@media (max-width:900px){
  .em-gal{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"a a" "b c" "d e"}
}
@media (max-width:767px){
  .em-gallery__all{display:none}
  .em-gal__item{width:300px;height:220px;border-radius:var(--radius-card)}
}

/* ---------- کمک‌نساجی ---------- */
.em-textile__in{display:flex;flex-wrap:wrap;gap:48px;align-items:center}
.em-textile__body{flex:1 1 420px;min-width:0}
.em-textile__h2{margin-bottom:16px;line-height:1.35}
.em-textile__text{max-width:480px;margin:0 0 24px;color:var(--muted)}
.em-textile__packs{display:flex;flex-wrap:wrap;gap:10px;list-style:none;margin:0 0 32px;padding:0}
.em-textile__packs li{padding:6px 16px;border:1px solid var(--line);border-radius:var(--radius-pill);font-size:var(--fs-nav)}
.em-textile__media{position:relative;flex:1 1 460px;min-width:0;min-height:320px;overflow:hidden;border-radius:var(--radius-sm)}
.em-textile__media img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover}
/* کد بزرگ توخالی روی عکس */
.em-textile__media--photo .em-textile__badge{inset:auto;inset-block-end:16px;inset-inline-start:16px;padding:6px 14px;border-radius:var(--radius-pill);background:var(--navy-900);font-size:var(--fs-sm);font-weight:700;color:var(--white);-webkit-text-stroke:0}
.em-textile__badge{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:var(--font-head);font-weight:700;font-size:clamp(64px,8vw,130px);line-height:1;color:transparent;-webkit-text-stroke:1.5px var(--on-dark-3);pointer-events:none}

@media (max-width:767px){
  /* موبایل: عکس بالای متن (MobileHome.dc.html) */
  .em-gallery + .em-textile{padding-top:0}
  .em-textile__in{flex-direction:column;align-items:stretch;gap:18px}
  .em-textile__media{order:-1;flex:0 0 auto;height:170px;min-height:0;border-radius:var(--radius-md)}
  .em-textile__badge{font-size:64px;-webkit-text-stroke-width:1.2px}
  .em-textile__body{flex:0 0 auto}
  .em-textile__h2{margin-bottom:6px;font-size:24px}
  .em-textile__text{margin-bottom:14px;font-size:var(--fs-sm)}
  .em-textile__packs{margin-bottom:18px}
  .em-textile__packs li{padding:4px 12px;font-size:var(--fs-xs)}
  .em-textile__btn{display:flex;justify-content:center;width:100%;min-height:50px;padding-block:0}
}

/* ---------- مقاله‌ها ---------- */
.em-blog__h2{margin-bottom:10px}
.em-blog .em-head__text{max-width:none;text-wrap:pretty}
.em-blog .em-posts{grid-template-columns:repeat(4,minmax(0,1fr))}

@media (max-width:1000px){
  .em-blog .em-posts{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:767px){
  .em-blog__all,.em-post__more{display:none}
  .em-blog__h2{margin-bottom:0}
  .em-posts > li{width:260px}
  .em-post{border-radius:var(--radius-card)}
  .em-post__body{padding:14px 16px 16px}
  .em-post__meta{gap:4px 8px;margin-bottom:4px;font-size:12px}
  .em-post__cat{inset-block-start:8px;inset-inline-start:8px;padding:2px 10px}
  .em-post__title{margin:0;font-size:17px}
}

/* ---------- اسلایدر افقی موبایل (گالری و مقاله‌ها؛ بعد از قواعد شبکه‌ای تا روی آن‌ها اعمال شود) ---------- */
@media (max-width:767px){
  .em-gal,.em-posts{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:var(--gutter);margin:0 calc(var(--gutter) * -1);padding:0 var(--gutter) 6px;scrollbar-width:none}
  .em-gal::-webkit-scrollbar,.em-posts::-webkit-scrollbar{display:none}
  .em-gal > li,.em-posts > li{flex:0 0 auto;scroll-snap-align:start}
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce){
  .em-hero__media,.em-wi,.em-rise{animation:none!important;transform:none!important;opacity:1!important}
  /* با کاهش حرکت فقط فریم اول ویدئو ثابت دیده می‌شود؛ لودر متحرک لازم نیست */
  .em-hero__loader{display:none!important}
  .em-hero__live,.em-hero__track,.em-btn__icon,.em-card__img,.em-svc__arrow,.em-ind__more,.em-ind__arrow,.em-ind .em-card__img img,.em-ind .em-card__img::after{transition:none!important}
  .em-mw{animation:none!important;color:var(--ink)!important}
  /* نوار مشتریان ثابت، هر ردیف یک خط با اسکرول افقی (مثل افتخارات)؛ تکرارها پنهان.
     چندخطی نه: ردیف ۹ لوگویی از کانتینر پهن‌تر است و یک لوگو تنها به خط دوم می‌افتاد. */
  .em-clients__wrap{overflow-x:auto;-webkit-mask-image:none;mask-image:none;scrollbar-width:thin}
  .em-clients__track{margin-inline:auto;animation:none!important}
  .em-client__logo img{transition:none!important}
  .em-clients__list[aria-hidden],.em-client[data-em-copy]{display:none}
  /* محصولات و خط تولید: بدون جابه‌جایی؛ نقشه کامل و ثابت */
  .em-ppanel__img{animation:none!important}
  .em-pcat,.em-pcat__thumb{transition:none!important}
  .em-pl__d,.em-pl__d2,.em-pl__lb,.em-pl__fi{animation:none!important;stroke-dashoffset:0!important;opacity:1!important}
  .em-pl__fl{animation:none!important;opacity:1!important}
  .em-pl__nd,.em-pl__bl,.em-pl__pd{animation:none!important}
  .em-gal__img{transition:none!important}
  .em-banner__img{animation:none!important;transform:none!important}
}

/* ---------- چرا ایمن تاش ----------
   بالا: تیتر و پرسش (راست) کنار جمله شاخص و متن (چپ). پایین: کارت‌ها با آیکون، شماره و عنوان.
   کارت‌ها با تعداد خودشان تقسیم می‌شوند (۳ یا ۴)؛ هاور: خط آبی بالای کارت و کمی بالا آمدن. */
.em-why__head{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:var(--why-gap);align-items:start;margin-bottom:var(--why-gap)}
.em-why__subtitle{margin:12px 0 0;color:var(--blue);font-weight:500;font-size:var(--fs-why-sub);line-height:1.7;text-wrap:balance}
.em-why__body{padding-inline-start:var(--why-gap);border-inline-start:1px solid var(--line)}
.em-why__lead{margin:0 0 10px;font-family:var(--font-head);font-weight:700;font-size:var(--fs-why-lead);line-height:1.6;color:var(--navy-900);text-wrap:balance}
.em-why__text{margin:0;color:var(--muted);line-height:var(--lh-body)}
.em-why__list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:20px;list-style:none;margin:0;padding:0}
.em-why__card{position:relative;display:flex;flex-direction:column;gap:14px;padding:28px 26px;overflow:hidden;border:1px solid var(--line-soft);border-radius:var(--radius-md);background:var(--white);transition:transform .3s var(--ease-out),box-shadow .3s ease,border-color .3s ease}
.em-why__card::before{content:"";position:absolute;inset:0 0 auto;block-size:3px;background:var(--blue);transform:scaleX(0);transform-origin:right;transition:transform .35s var(--ease-out)}
.em-why__card:hover{transform:translateY(-4px);border-color:var(--line);box-shadow:var(--shadow-card)}
.em-why__card:hover::before{transform:scaleX(1)}
.em-why__icon{display:inline-flex;align-items:center;justify-content:center;inline-size:56px;block-size:56px;border-radius:var(--radius-md);background:var(--navy-900);color:var(--white)}
.em-why__icon svg{inline-size:26px;block-size:26px}
.em-why__num{position:absolute;inset-block-start:22px;inset-inline-end:24px;font-family:var(--font-head);font-weight:700;font-size:28px;line-height:1;color:var(--line)}
.em-why__title{margin:4px 0 0;font-family:var(--font-head);font-weight:700;font-size:var(--fs-why-card);line-height:1.6;color:var(--ink)}
.em-why__desc{margin:0;color:var(--muted);font-size:var(--fs-sm);line-height:1.8}
@media (max-width:900px){
  .em-why__head{grid-template-columns:minmax(0,1fr);gap:18px}
  .em-why__body{padding-inline-start:0;padding-block-start:18px;border-inline-start:0;border-block-start:1px solid var(--line)}
}
@media (max-width:560px){
  .em-why__card{flex-direction:row;flex-wrap:wrap;align-items:center;padding:18px}
  .em-why__icon{inline-size:46px;block-size:46px}
  .em-why__icon svg{inline-size:22px;block-size:22px}
  .em-why__title{flex:1 1 0;margin:0;font-size:var(--fs-body)}
  .em-why__num{display:none}
  .em-why__desc{flex:1 1 100%}
}
@media (prefers-reduced-motion:reduce){
  .em-why__card,.em-why__card::before{transition:none}
  .em-why__card:hover{transform:none}
}
