/* header.css — استایل هدر + انتقال نرم بین صفحه‌ها (مشترک همه‌ی صفحه‌ها) */
@view-transition{navigation:auto}::view-transition-group(root){animation-duration:.18s}@media (prefers-reduced-motion:reduce){@view-transition{navigation:none}}

/* base the header relies on (identical to the page's own rules, so they are harmless when this file is loaded into index.html) */
@property --i { syntax:"<number>"; initial-value:.3; inherits:true; }
@property --wv { syntax:"<number>"; initial-value:0; inherits:true; }
:root { --c1:#00008b; --c2:#0000cd; --c3:#041690; --c4:#6f00ff; --c5:#32127a; --c6:#4b0082; --text:#eef1f8; --muted:#8a92a8; --ci: in srgb; }
@supports (background:conic-gradient(in oklab, red, blue)) { :root { --ci: in oklab; } }
.wrap { --h:68px; position:relative; height:var(--h); border-radius:999px; isolation:isolate; transition:--i .6s ease, --wv 1.1s cubic-bezier(.4,0,.2,1); }
.wrap:hover { --i:.62; }
.wrap:focus-within { --i:1; }

/* ===== header: desktop ===== */
#hdrD {--page-bg: #383838;
    --bar-bg: rgba(220, 220, 220, .288);   
    --blue: #2020d6;
    --ink: #000;
    --inner: 49.28px;  
    --pad: 2.8px;       
    --h: calc(var(--inner) + var(--pad) * 2);}
#hdrD * {box-sizing: border-box; margin: 0; padding: 0;}
#hdrD .header {position: relative;
    width: 70%;                 /* ×0.7 of the previous width */
    max-width: calc(1400px * .7);
    height: var(--h);
    margin: 0 auto;
    background: var(--bar-bg);
    
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border-radius: calc(var(--h) / 2);
    
    box-shadow:
      inset 0 1.05px .7px rgba(255, 255, 255, .264),
      inset 0 -1.4px 2.1px rgba(0, 0, 0, .14),
      inset 0 0 9.8px rgba(255, 255, 255, .0672),
      0 7px 21px rgba(0, 0, 0, .28),
      0 1.4px 4.2px rgba(0, 0, 0, .18);
    display: flex;
    align-items: center;
    padding: var(--pad);}
#hdrD .header::before {content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: .5px;
    background: linear-gradient(135deg,
      rgba(255, 255, 255, .48) 0%,
      rgba(255, 255, 255, .24) 22%,
      rgba(255, 255, 255, .0768) 50%,
      rgba(255, 255, 255, .24) 78%,
      rgba(255, 255, 255, .48) 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, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;}
#hdrD .nav {position: relative;
    display: flex;
    align-items: center;
    padding-inline-start: 0;}
#hdrD .goo {position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    filter: url(#goo);
    opacity: 0;
    transition: opacity .25s ease;}
#hdrD .goo.show {opacity: 1;}
#hdrD .blob {position: absolute;
    right: 0;   
    top: 0;
    width: 0;
    height: var(--inner);
    background: var(--blue);
    border-radius: calc(var(--inner) / 2);
    will-change: transform, width;}
#hdrD .nav a {position: relative;
    z-index: 2;
    transition: color .25s ease;
    height: 33.6px;
    padding-inline: 18.55px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;}
#hdrD .nav a span {max-width: 0;
    opacity: 0;
    filter: blur(8px);
    overflow: hidden;
    white-space: nowrap;
    font-size: 12.6px;
    transition:
      max-width .4s cubic-bezier(.4, 0, .2, 1),
      margin .4s cubic-bezier(.4, 0, .2, 1),
      opacity .35s ease,
      filter .35s ease;}
#hdrD .nav a.active {color: #fff;}
#hdrD .nav a.active span, #hdrD .nav a:hover span, #hdrD .nav a:focus-visible span {max-width: 112px;
    opacity: 1;
    filter: blur(0);
    margin-inline-start: 7px;}
#hdrD .h-ico {display: flex; align-items: center; height: var(--inner); flex: none;}
#hdrD .nav svg {height: 19.6px;
    width: auto;
    flex: none;
    overflow: visible;}
#hdrD .nav svg .s {fill: none;
    stroke: currentColor;
    stroke-width: 2px;
    stroke-miterlimit: 10;}
#hdrD .nav svg .dot {fill: currentColor;}
#hdrD .nav svg .door .s {stroke-width: 2px;}
#hdrD .nav svg .door .leafpoly {fill: var(--blue); stroke: #fff; stroke-linejoin: round;}
#hdrD .nav svg path, #hdrD .nav svg rect, #hdrD .nav svg circle, #hdrD .nav svg g {transform-box: fill-box;
    transform-origin: center;}
#hdrD .spacer {flex: 1;}
#hdrD {--search-open: 214.2px; --cta-w: 105.7px;}
#hdrD .search {width: var(--inner);
    height: var(--inner);
    background: #fff;
    border-radius: calc(var(--inner) / 2);
    display: flex;
    align-items: center;
    padding-inline: calc((var(--inner) - 19.6px) / 2);
    gap: 0;
    margin-inline-end: 5.6px;
    flex: none;
    overflow: hidden;
    cursor: pointer;
    transition:
      width .324s cubic-bezier(.34, 1.25, .64, 1),
      padding .324s cubic-bezier(.34, 1.25, .64, 1),
      gap .324s cubic-bezier(.34, 1.25, .64, 1);}
#hdrD .search.open {width: var(--search-open);
    padding-inline: 21px;
    gap: 8.4px;
    cursor: text;}
#hdrD .search input {border: 0; outline: 0; background: transparent;
    flex: 1; min-width: 0; width: 0;
    font: inherit; font-size: 12.6px;
    opacity: 0;
    filter: blur(6px);
    transition: opacity .206s ease, filter .206s ease;}
#hdrD .search input::placeholder {color: #8a8a8a; opacity: 1;}
#hdrD .search.open input {opacity: 1; filter: blur(0); transition-delay: .06s;}
#hdrD .search svg {overflow: visible;
    height: 19.6px; width: 19.6px; flex: none;
    fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;}
#hdrD .search input::-webkit-search-cancel-button, #hdrD .search input::-webkit-search-decoration {-webkit-appearance: none; appearance: none; display: none;}
#hdrD .hcta {position: relative;
    width: var(--cta-w);
    height: var(--inner);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.2px;
    text-decoration: none;
    flex: none;
    -webkit-tap-highlight-color: transparent;}
#hdrD .cta-goo {position: absolute;
    inset: 0;
    filter: url(#goo);
    pointer-events: none;}
#hdrD .cta-shape {position: absolute;
    inset: 0;
    background: var(--blue);
    border-radius: calc(var(--inner) / 2);}
#hdrD .bulge {position: absolute;
    left: 0; top: 0;
    width: 46.2px; height: 46.2px;     
    margin: -23.1px 0 0 -23.1px;       
    border-radius: 50%;
    background: var(--blue);
    pointer-events: none;
    transform: translate(-100px, -100px) scale(0);
    will-change: transform;}
#hdrD .cta-label {position: relative; z-index: 1;}
#hdrD .drop {position: absolute;
    border-radius: 50%;
    background: var(--blue);
    pointer-events: none;}
@media (max-width: 900px) {
#hdrD .nav {padding-inline-start: 0;}
#hdrD .nav a {padding-inline: 10px;}
#hdrD {--search-open: 140px;}
#hdrD .hcta {width: 86.8px;}
}
@media (max-width: 620px) {
#hdrD .search {display: none;}
}
/* ===== header: mobile ===== */
#hdrM {--page-bg: #383838;
    --glass: rgba(236, 236, 236, .3744);
    --blue: #2020d6;
    --ink: #fff;
    --inner: 57.6px;
    --pad: 4px;
    --h: calc(var(--inner) + var(--pad) * 2);
    --gap: 12px;}
#hdrM * {box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent;}
#hdrM :focus-visible {outline: 3px solid #8fa2ff; outline-offset: 2px;}
#hdrM .dock {position: fixed; z-index: 20;
    inset-inline: max(var(--gap), env(safe-area-inset-left)) max(var(--gap), env(safe-area-inset-right));
    bottom: max(calc(var(--gap) * 1.5), calc(env(safe-area-inset-bottom) * 1.5));
    width: min(368.64px, calc(100% - var(--gap) * 2), max(calc((100% - var(--gap) * 2) * .768), 280px)); margin-inline: auto;   /* ×1.2, but never narrower than 280px (so the active tab's label always fits on small phones) */
    height: var(--h); padding: var(--pad);
    display: flex; gap: 2.4px;   /* ×1.2 */
    background: var(--glass);
    border-radius: calc(var(--h) / 2);
    box-shadow:
      inset 0 1.5px 1px rgba(255,255,255,.264),
      inset 0 -2px 3px rgba(0,0,0,.12),
      0 10px 30px rgba(0,0,0,.28),
      0 2px 6px rgba(0,0,0,.18);}
#hdrM .dock {-webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);}   /* same blur as the desktop header (the old rule was invalid CSS and never applied) */
#hdrM .item {flex: 1 1 0; min-width: 44px; height: var(--inner);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    border: 0; background: none; font: inherit; cursor: pointer;
    border-radius: calc(var(--inner) / 2);
    color: var(--ink); text-decoration: none; overflow: visible;
    transition: flex-grow .4s cubic-bezier(.3,1.25,.5,1), background-color .25s, color .25s;}
#hdrM .item.active {flex-grow: 2.6; background: var(--blue); color: #fff;}
#hdrM .item svg {height: 24px; width: 26px; flex: none; overflow: visible;}
#hdrM .item svg .s {fill: none; stroke: currentColor; stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; stroke-miterlimit: 10;}
#hdrM .item svg .dot {fill: currentColor;}
#hdrM .item svg .door .s {stroke-width: 2px;}
#hdrM .item svg .door .leafpoly {fill: var(--blue); stroke: #fff; stroke-linejoin: round;}
#hdrM .item svg path, #hdrM .item svg rect, #hdrM .item svg circle, #hdrM .item svg g {transform-box: fill-box; transform-origin: center;}
#hdrM .item svg.srch {fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;}
#hdrM .item.nolabel.active {flex-grow: 1;}
#hdrM .item svg.srch {width: 28px; height: 28px;}
#hdrM .item svg.srch * {transform-box: view-box; transform-origin: 0 0;}
#hdrM .h-ico {display: flex; align-items: center; height: var(--inner); flex: none;}
#hdrM .label {max-width: 0; opacity: 0; white-space: nowrap; overflow: hidden;
    font-size: 12px; font-weight: 600;
    transition: max-width .4s ease, opacity .25s ease;}
#hdrM .item.active .label {max-width: 76px; opacity: 1;}
@media (max-width: 340px) {
#hdrM {--inner: 52.8px; --gap: 8px;}
#hdrM .item {min-width: 40px;}
}
@media (prefers-reduced-motion: reduce) {
#hdrM *, #hdrM *::before, #hdrM *::after {animation: none !important; transition: none !important;}
}

/* ===== mobile nav: unified icons — same optical size, same rendered stroke (1.75px) for every tab =====
   stroke-width in user units = 1.75px / scale (scale = px per viewBox unit), so every icon draws the same line weight */
#hdrM .item[data-anim="home"] svg      {width:25px;   height:22.7px; }
#hdrM .item[data-anim="courses"] svg   {width:27px;   height:20.5px; }
#hdrM .item[data-anim="portfolio"] svg {width:26px;   height:19.95px;}
#hdrM .item[data-anim="about"] svg     {width:24.5px; height:24.5px; }
#hdrM .item[data-anim="sites"] svg     {width:25px;   height:21.7px; }
#hdrM .item[data-anim="sites"] svg .s           {stroke-width:2.38;}
#hdrM .item[data-anim="search"] svg.srch {width:33px; height:33px; }
#hdrM .item[data-anim="home"] svg .s,
#hdrM .item[data-anim="home"] svg .door .s      {stroke-width:2.15;}
#hdrM .item[data-anim="courses"] svg .s         {stroke-width:2.61;}
#hdrM .item[data-anim="portfolio"] svg .s       {stroke-width:2.61;}
#hdrM .item[data-anim="portfolio"] svg mask path{stroke-width:3.0;}   /* cut-out gap = stroke + ~.4 */
#hdrM .item[data-anim="about"] svg .s           {stroke-width:2.18;}
#hdrM .item[data-anim="search"] svg.srch        {stroke-width:1.91;}
#hdrM .item svg .s {stroke-linecap:round; stroke-linejoin:round;}

/* ===== header integration (wrappers, sticky behaviour, isolation from page CSS) ===== */
#hdrD{ position:fixed; top:20px; left:32px; right:32px; z-index:100; pointer-events:none;
  font-family:"Vazirmatn","Vazir",Tahoma,sans-serif; font-size:12.6px; }
#hdrD .header{ pointer-events:auto; }
/* page-level `input{}` rules must not leak into the header search (restore the original look) */
#hdrD .search input{ height:auto; color:#000; letter-spacing:normal; caret-color:auto; }
#hdrD .search input::placeholder{ transition:none; }
#hdrM{ font-family:"Vazirmatn","Vazir",Tahoma,sans-serif; color:#eee; }
#hdrM .dock{ z-index:100; }
@media (max-width:768px){
  #hdrD{ display:none; }
  html, body{ overflow-x:clip; }   /* from the mobile header file: keeps the fixed dock aligned to the real screen width */
  body{ padding-bottom:calc(66px + 30px + env(safe-area-inset-bottom,0px)); }   /* room for the bottom dock */
}
html, body{ overflow-x:clip; }   /* nothing may widen the page at any width (category chips track, glow, measuring span) */
@media (min-width:769px){
  #hdrM{ display:none; }
}


/* ===== NAV v2 =====
   • نویگیشن (هدر دسکتاپ + داک موبایل) = همان باکس سرچ‌بار: پس‌زمینهٔ تیره، حلقهٔ گرادینت آرورا، گلوی بیرونی/درونی، خط بازتاب بالا
   • تب انتخاب‌شده = همان دکمهٔ سرچ (.go): گرادینت ۱۴۵ درجه c2→c4→c6 + هایلایت بالا-چپ + سایهٔ بنفش
   نکته: #hdrD * و #hdrM * مقدار padding را صفر می‌کنند، پس padding حلقه‌ها اینجا با سلکتور id دوباره تنظیم شده است */
#hdrD, #hdrM { --door:#6200d2; }   /* رنگ پردهٔ در آیکن خانه؛ هم‌رنگ گرادینت تب انتخاب‌شده */

:is(#hdrD,#hdrM) .wrap.navwrap {
  --h:calc(var(--inner) + var(--pad) * 2);
  background:none; box-shadow:none;
  -webkit-backdrop-filter:none; backdrop-filter:none;
}
#hdrD .header.navwrap::before { display:none; }          /* حلقهٔ شیشه‌ای قبلی */
:is(#hdrD,#hdrM) .navwrap:focus-within { --i:.3; }       /* فوکوس/کلیک گلو را زیاد نکند */
:is(#hdrD,#hdrM) .navwrap:hover { --i:.62; }
:is(#hdrD,#hdrM) .navwrap .halo { animation:none; }

:is(#hdrD,#hdrM) .navwrap .far  { z-index:-4; }
:is(#hdrD,#hdrM) .navwrap .near { z-index:-3; }
:is(#hdrD,#hdrM) .navwrap .ring { z-index:-2; inset:-1.5px; padding:1.5px; }
:is(#hdrD,#hdrM) .navwrap .inner { padding:3px; }

:is(#hdrD,#hdrM) .hbar {
  position:absolute; inset:0; z-index:-1; border-radius:inherit; overflow:hidden; pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 55%), linear-gradient(180deg, #0e1030, #07081a);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.1),
    inset 0 -1px 0 rgba(255,255,255,.03),
    0 10px 30px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.4);
}
:is(#hdrD,#hdrM) .hbar::before {
  content:""; position:absolute; inset:0 12% auto; height:1px; z-index:2; pointer-events:none;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  opacity:calc(.35 + var(--i) * .4);
}

/* ---- دسکتاپ: بلاب انتخاب (داخل فیلتر goo) با استایل دکمهٔ سرچ ---- */
#hdrD .blob {
  background:radial-gradient(120% 120% at 28% 18%, rgba(255,255,255,.26), transparent 55%),
             linear-gradient(145deg, var(--c2), var(--c4) 58%, var(--c6));
}
@supports (background:linear-gradient(in oklab, red, blue)) {
  #hdrD .blob {
    background:radial-gradient(120% 120% at 28% 18%, rgba(255,255,255,.26), transparent 55%),
               linear-gradient(145deg in oklab, var(--c2) 0%, var(--c4) 58%, var(--c6) 100%);
  }
}
/* box-shadow داخل فیلتر goo آستانه‌گذاری می‌شود؛ پس سایهٔ بنفش .go بعد از goo با drop-shadow اعمال می‌شود */
#hdrD .goo { filter:url(#goo) drop-shadow(0 6px 20px rgba(111,0,255,.4)); }
#hdrD .nav svg .door .leafpoly { fill:var(--door); }

/* ---- موبایل: تب فعال با استایل دکمهٔ سرچ (با فید نرم) ---- */
#hdrM .item { position:relative; isolation:isolate; }
#hdrM .item.active { background:none; }
#hdrM .item::before {
  content:""; position:absolute; inset:0; z-index:-1; border-radius:inherit; pointer-events:none; opacity:0;
  background:radial-gradient(120% 120% at 28% 18%, rgba(255,255,255,.26), transparent 55%),
             linear-gradient(145deg, var(--c2), var(--c4) 58%, var(--c6));
  box-shadow:0 6px 20px rgba(111,0,255,.4), inset 0 1px 0 rgba(255,255,255,.35);
  transition:opacity .3s ease;
}
@supports (background:linear-gradient(in oklab, red, blue)) {
  #hdrM .item::before {
    background:radial-gradient(120% 120% at 28% 18%, rgba(255,255,255,.26), transparent 55%),
               linear-gradient(145deg in oklab, var(--c2) 0%, var(--c4) 58%, var(--c6) 100%);
  }
}
#hdrM .item.active::before { opacity:1; }
#hdrM .item svg .door .leafpoly { fill:var(--door); }

/* ===== NAV v3: بدون گلو، بوردر ثابت ===== */
:is(#hdrD,#hdrM) .navwrap:hover, :is(#hdrD,#hdrM) .navwrap:focus-within { --i:.3; }   /* شدت بوردر با هاور تغییر نکند */
:is(#hdrD,#hdrM) .navwrap .ring::before { animation:none !important; }               /* بوردر نچرخد */

/* ===== NAV v4: موبایل — جابجایی تب‌ها با همان انیمیشن بلاب مایع (goo) هدر دسکتاپ ===== */
#hdrM .item::before { display:none; }          /* فید قبلی تب فعال حذف شد؛ بلاب جایگزینش است */
#hdrM .item { z-index:1; }
#hdrM .goo {
  position:absolute; inset:var(--pad); z-index:0; pointer-events:none;
  filter:url(#gooM) drop-shadow(0 6px 20px rgba(111,0,255,.4));
  opacity:0; transition:opacity .25s ease;
}
#hdrM .goo.show { opacity:1; }
#hdrM .blob {
  position:absolute; right:0; top:0; width:0; height:var(--inner);
  border-radius:calc(var(--inner) / 2); will-change:transform,width;
  background:radial-gradient(120% 120% at 28% 18%, rgba(255,255,255,.26), transparent 55%),
             linear-gradient(145deg, var(--c2), var(--c4) 58%, var(--c6));
}
@supports (background:linear-gradient(in oklab, red, blue)) {
  #hdrM .blob {
    background:radial-gradient(120% 120% at 28% 18%, rgba(255,255,255,.26), transparent 55%),
               linear-gradient(145deg in oklab, var(--c2) 0%, var(--c4) 58%, var(--c6) 100%);
  }
}

/* ===== NAV v5: همهٔ رنگ‌های هدر و نویگیشن = رنگ دکمهٔ «شرایط همکاری» (#2020d6) ===== */
#hdrD, #hdrM {
  --cta:#2020d6;
  --door:var(--cta);
  --c1:color-mix(in srgb, var(--cta) 45%, #000);
  --c2:var(--cta);
  --c3:color-mix(in srgb, var(--cta) 70%, #000);
  --c4:color-mix(in srgb, var(--cta) 78%, #fff);
  --c5:color-mix(in srgb, var(--cta) 55%, #000);
  --c6:var(--cta);
  --aurora: var(--c1) 0%, var(--c3) 14%, var(--c2) 30%, var(--c4) 48%, var(--c6) 66%, var(--c5) 84%, var(--c1) 100%;
}
:is(#hdrD,#hdrM) .hbar {
  background:linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 55%),
             linear-gradient(180deg, color-mix(in srgb, var(--cta) 22%, #05050f), color-mix(in srgb, var(--cta) 12%, #03030a));
}
#hdrD .blob, #hdrM .blob { background:var(--cta); }
@supports (background:linear-gradient(in oklab, red, blue)) {
  #hdrD .blob, #hdrM .blob { background:var(--cta); }
}
#hdrD .goo { filter:url(#goo) drop-shadow(0 6px 20px rgba(32,32,214,.4)); }
#hdrM .goo { filter:url(#gooM) drop-shadow(0 6px 20px rgba(32,32,214,.4)); }
#hdrD .nav svg .door .leafpoly, #hdrM .item svg .door .leafpoly { fill:var(--cta); }

/* ===== NAV v6: آیکن‌های خانه / سایت‌ها / سرچ هم‌مقیاس با دوره‌ها و نمونه‌کار (≈0.67px per unit، ضخامت خط ۱٫۷۵px) ===== */
#hdrM .item[data-anim="home"] svg      { width:20.6px; height:18.7px; }
#hdrM .item[data-anim="sites"] svg     { width:22.8px; height:19.8px; }
#hdrM .item[data-anim="search"] svg.srch { width:27px; height:27px; }
#hdrM .item[data-anim="home"] svg .s,
#hdrM .item[data-anim="home"] svg .door .s { stroke-width:2.61; }
#hdrM .item[data-anim="sites"] svg .s  { stroke-width:2.61; }
#hdrM .item[data-anim="search"] svg.srch { stroke-width:2.33; }
#hdrD .nav a[data-anim="home"] svg  { height:18.1px; }
#hdrD .nav a[data-anim="sites"] svg { height:19.2px; }

/* ===== NAV v7: Liquid Glass — باکس نویگیشن (هدر دسکتاپ + داک موبایل) =====
   فیلتر لنز (lg-d / lg-m) با JS و بر اساس اندازهٔ واقعی باکس ساخته می‌شود (feImage و scale متناسب با ابعاد). */
:is(#hdrD,#hdrM) .navwrap .halo { display:none; }          /* حلقهٔ آرورا و گلوی قبلی حذف شد؛ لبهٔ شیشه جایگزین است */
:is(#hdrD,#hdrM) .hbar {
  background:rgba(255,255,255,.12);
  /* Fallback: frosted glass (Safari, Firefox) */
  -webkit-backdrop-filter:blur(14px) saturate(1.8) brightness(1.15) contrast(1.05);
  backdrop-filter:blur(14px) saturate(1.8) brightness(1.15) contrast(1.05);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.15),
    inset 1.5px 1.5px 0 rgba(255,255,255,.5),
    inset 0 0 12px rgba(255,255,255,.2),
    0 8px 32px rgba(0,0,0,.2);
}
/* Lens effect (Chromium): overrides the fallback where supported */
/* لنز SVG فقط وقتی فعال می‌شود که JS تأیید کند مرورگر آن را رندر می‌کند (کلاس lg-lens)؛ در غیر این صورت شیشهٔ مات (frosted) بالا می‌ماند */
html.lg-lens #hdrD .hbar { backdrop-filter:blur(1px) url(#lg-d) blur(2px) saturate(1.5) brightness(1.1); }
html.lg-lens #hdrM .dock .hbar { backdrop-filter:blur(1px) url(#lg-m) blur(2px) saturate(1.5) brightness(1.1); }
:is(#hdrD,#hdrM) .hbar::before { display:none; }

/* ===== NAV v8: داک موبایل — طراحی مرجع 1080×1920 (همه‌چیز با --u = 100vw/1080 مقیاس می‌شود) =====
   فاصلهٔ گروه از چپ/راست/پایین = 70؛ سرچ = باکس مستقل 170×170 (دایره) سمت راست؛ داک چهار آیکن، بدون نمایش متن تب‌ها */
#hdrM {
  --u:calc(390px / 1080);                               /* واحد ثابت: اندازهٔ نویگیشن با عرض صفحه تغییر نمی‌کند */
  --edge:calc(var(--u) * 70);
  --sbox:calc(var(--u) * 170);
  --sgap:calc(var(--u) * 30);
  --navw:min(calc(var(--u) * 740), calc(100vw - 16px - var(--sbox) - var(--sgap)));   /* فقط در عرض‌های خیلی کوچک جمع می‌شود */
  --grp:calc(var(--navw) + var(--sgap) + var(--sbox));   /* کل گروه: داک + فاصله + سرچ */
  --pad:4px;
  --inner:calc(var(--sbox) - var(--pad) * 2);        /* ارتفاع داک = 170 */
}
#hdrM .dock {
  inset-inline:auto; right:auto; margin:0;
  left:calc((100vw - var(--grp)) / 2);                   /* گروه وسط‌چین؛ با تغییر عرض، فاصلهٔ دو طرف تغییر می‌کند */
  bottom:max(var(--edge), env(safe-area-inset-bottom));
  width:var(--navw);
}
#hdrM .item .label { display:none; }                     /* متن تب‌ها هرگز نمایش داده نمی‌شود */
#hdrM .item.active, #hdrM .item.nolabel.active { flex-grow:1; }
#hdrM .item { min-width:0; }

#hdrM .srchbox {
  position:fixed; z-index:100; flex:none; margin:0; padding:0;
  right:auto; left:calc((100vw - var(--grp)) / 2 + var(--navw) + var(--sgap));
  bottom:max(var(--edge), env(safe-area-inset-bottom));
  width:var(--sbox); height:var(--sbox); min-width:0;
  border-radius:50%;                                      /* مربع با گردیِ حداکثر = دایره */
  display:flex; align-items:center; justify-content:center;
  color:#fff; overflow:visible;
}
#hdrM .srchbox .hbar { z-index:-2; }
#hdrM .srchbox svg.srch { position:relative; z-index:1; width:calc(var(--sbox) * .44); height:calc(var(--sbox) * .44); }
#hdrM .srchbox::before {                                  /* حالت انتخاب‌شده: دایرهٔ هم‌رنگ دکمهٔ «شرایط همکاری» */
  content:""; display:block; position:absolute; inset:var(--pad); z-index:-1; border-radius:50%;
  background:var(--cta); opacity:0; transition:opacity .3s ease;
}
#hdrM .srchbox.active::before { opacity:1; }
html.lg-lens #hdrM .srchbox .hbar { backdrop-filter:blur(1px) url(#lg-s) blur(2px) saturate(1.5) brightness(1.1); }

/* ===== NAV v9: آیکن‌های داک ×0.8 (ضخامت خط ثابت ≈1.75px)؛ آیکن سرچ کمی به راست ===== */
#hdrM .dock .item[data-anim="home"] svg      { width:16.5px; height:15px; }
#hdrM .dock .item[data-anim="sites"] svg     { width:18.2px; height:15.8px; }
#hdrM .dock .item[data-anim="courses"] svg   { width:21.6px; height:16.4px; }
#hdrM .dock .item[data-anim="portfolio"] svg { width:20.8px; height:16px; }
#hdrM .dock .item[data-anim="home"] svg .s,
#hdrM .dock .item[data-anim="home"] svg .door .s,
#hdrM .dock .item[data-anim="sites"] svg .s,
#hdrM .dock .item[data-anim="courses"] svg .s,
#hdrM .dock .item[data-anim="portfolio"] svg .s { stroke-width:3.26; }
#hdrM .dock .item[data-anim="portfolio"] svg mask path { stroke-width:3.66; }
#hdrM .srchbox svg.srch { translate:calc(var(--sbox) * .03) 0; }

/* the phone dock and its search button must always stay pinned to the viewport (a plain .wrap{position:relative} must never win over this) */
#hdrM .dock.wrap, #hdrM .srchbox { position:fixed !important; }
#hdrD .header.wrap { position:relative; }
