/* ─────────────────────────────────────────────────────────────────────────────
   header: a clear glass bar, every section inside it a liquid-glass capsule in
   the Apple sense — a true pill with a crisp top rim light, a soft glare across
   the crown, and enough translucency that the page reads through it.
   the matte/frosted treatment is gone: this is glass, not etched glass.
   ───────────────────────────────────────────────────────────────────────────── */

.gh{
  position:fixed; inset-block-start:0; inset-inline:0; z-index:9;
  display:flex; align-items:center; gap:clamp(8px,1.2vw,18px);
  padding-block:clamp(9px,1.3vh,15px);
  padding-inline:clamp(12px,2vw,30px);
  /* clear glass: a thin neutral tint, no milkiness, no grain */
  background:linear-gradient(180deg,rgba(22,23,28,.52) 0%,rgba(15,16,20,.36) 70%,rgba(11,12,16,.26) 100%);
  backdrop-filter:blur(18px) saturate(165%);
  -webkit-backdrop-filter:blur(18px) saturate(165%);
  border-block-end:1px solid rgba(255,255,255,.12);
  box-shadow:0 14px 44px -26px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.10);
  opacity:0; transform:translateY(-8px);
  transition:opacity 1.2s ease .35s, transform 1.2s ease .35s;
  isolation:isolate;
}
body.ready .gh{opacity:1;transform:none}

.gh__mark{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;
  padding-inline-end:clamp(6px,1vw,16px)}
.gh__mark img{height:clamp(30px,4.4vh,40px);width:auto;display:block;
  filter:drop-shadow(0 3px 12px rgba(0,0,0,.45))}

/* ── the row of capsules ─────────────────────────────────────────────────── */
.gh__nav{display:flex;align-items:center;gap:clamp(6px,.8vw,11px);flex-wrap:nowrap;
  min-inline-size:0;margin-inline:auto}

.drop{position:relative;display:inline-flex}
.drop__body{
  position:relative; display:inline-flex; align-items:center; justify-content:center;
  block-size:clamp(36px,4.4vh,42px);
  padding-inline:clamp(16px,1.4vw,25px);
  font:500 clamp(11.5px,.9vw,13.5px)/1 'Vazirmatn','DM Sans',system-ui,sans-serif;
  color:rgba(255,255,255,.95); text-decoration:none; white-space:nowrap;
  /* a capsule, not an ellipse: the ends are true half-circles */
  border-radius:999px;
  border:1px solid rgba(255,255,255,.42);
  background:
    linear-gradient(180deg,rgba(255,255,255,.22) 0%,rgba(255,255,255,.08) 42%,
      rgba(255,255,255,.02) 70%,rgba(255,255,255,.11) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),            /* rim light, top */
    inset 0 -1px 0 rgba(255,255,255,.34),           /* rim light, bottom */
    inset 0 13px 18px -15px rgba(255,255,255,.95),  /* glare across the crown */
    inset 0 -12px 18px -15px rgba(255,255,255,.6),  /* bounce off the base */
    0 1px 2px rgba(0,0,0,.28),
    0 3px 10px -4px rgba(0,0,0,.30),
    0 7px 20px -11px rgba(0,0,0,.6);
  backdrop-filter:blur(11px) saturate(180%) brightness(1.06);
  -webkit-backdrop-filter:blur(11px) saturate(180%) brightness(1.06);
  text-shadow:0 1px 3px rgba(0,0,0,.7);
  transition:transform .32s cubic-bezier(.2,.9,.25,1),box-shadow .32s ease,
             background .32s ease,border-color .32s ease,color .25s ease;
}
/* the glare: a soft white wash sitting in the top half of the capsule */
.drop__body::before{
  content:""; position:absolute; inset-inline:15%; inset-block-start:1px;
  block-size:44%; border-radius:999px;
  background:linear-gradient(180deg,rgba(255,255,255,.58) 0%,rgba(255,255,255,.14) 55%,
    rgba(255,255,255,0) 100%);
  filter:blur(3px); opacity:.9; pointer-events:none;
}
.drop__body:hover,.drop__body:focus-visible{
  color:#fff;
  border-color:rgba(255,255,255,.52);
  background:
    linear-gradient(180deg,rgba(255,255,255,.28) 0%,rgba(255,255,255,.10) 44%,
      rgba(255,255,255,.04) 72%,rgba(255,255,255,.13) 100%);
  transform:translateY(-1px) scale(1.035);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -1px 0 rgba(255,255,255,.5),
    inset 0 14px 20px -15px rgba(255,255,255,1),
    inset 0 -12px 18px -15px rgba(255,255,255,.75),
    0 2px 3px rgba(0,0,0,.22),
    0 12px 28px -12px rgba(0,0,0,.7);
  outline:none;
}
.drop.is-open > .drop__body{
  color:#fff; border-color:rgba(255,255,255,.52);
  background:
    linear-gradient(180deg,rgba(255,255,255,.26) 0%,rgba(255,255,255,.09) 44%,
      rgba(255,255,255,.03) 72%,rgba(255,255,255,.12) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -1px 0 rgba(255,255,255,.48),
    inset 0 14px 20px -15px rgba(255,255,255,1),
    0 10px 26px -12px rgba(0,0,0,.65);
}

/* ── the pool of sub-sections under a capsule ─────────────────────────────── */
.drop__pool{
  position:absolute; inset-block-start:calc(100% + 10px); inset-inline-start:50%;
  translate:-50% 0;
  inline-size:max-content; max-inline-size:min(86vw,560px);
  display:flex; flex-wrap:wrap; gap:7px; justify-content:center;
  padding:14px;
  border-radius:26px;
  background:linear-gradient(180deg,rgba(26,27,32,.62),rgba(15,16,20,.50));
  backdrop-filter:blur(24px) saturate(165%);
  -webkit-backdrop-filter:blur(24px) saturate(165%);
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 26px 64px -26px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.14);
  opacity:0; visibility:hidden; transform:translateY(-7px) scale(.985);
  transition:opacity .28s ease, transform .28s cubic-bezier(.2,.9,.25,1), visibility .28s;
  pointer-events:none;
}
.drop:hover > .drop__pool,
.drop:focus-within > .drop__pool,
.drop.is-open > .drop__pool{
  opacity:1; visibility:visible; transform:none; pointer-events:auto;
}
/* the pool is centred on its capsule; header.js nudges it back inside the
   viewport when the capsule sits near an edge. */

/* ── the smaller capsule, used for sub-sections and the language chip ────── */
.bub{
  position:relative; display:inline-flex; align-items:center; justify-content:center;
  padding:7px 16px; font:500 12px/1.3 'Vazirmatn',system-ui,sans-serif;
  color:rgba(255,255,255,.92); text-decoration:none; white-space:nowrap;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.36);
  background:
    linear-gradient(180deg,rgba(255,255,255,.17) 0%,rgba(255,255,255,.06) 46%,
      rgba(255,255,255,.015) 74%,rgba(255,255,255,.09) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65),
    inset 0 -1px 0 rgba(255,255,255,.26),
    inset 0 10px 14px -12px rgba(255,255,255,.85),
    0 1px 1px rgba(0,0,0,.18),
    0 6px 16px -10px rgba(0,0,0,.55);
  backdrop-filter:blur(10px) saturate(175%) brightness(1.05);
  -webkit-backdrop-filter:blur(10px) saturate(175%) brightness(1.05);
  text-shadow:0 1px 2px rgba(0,0,0,.5);
  transition:transform .3s cubic-bezier(.2,.9,.25,1),color .25s,border-color .3s,
             box-shadow .3s,background .3s;
}
.bub:hover,.bub:focus-visible{
  color:#fff; border-color:rgba(255,255,255,.46);
  background:
    linear-gradient(180deg,rgba(255,255,255,.24) 0%,rgba(255,255,255,.09) 46%,
      rgba(255,255,255,.03) 74%,rgba(255,255,255,.11) 100%);
  transform:translateY(-1px) scale(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -1px 0 rgba(255,255,255,.4),
    inset 0 11px 15px -12px rgba(255,255,255,.95),
    0 9px 22px -11px rgba(0,0,0,.6);
  outline:none;
}

/* ── the far end of the bar ──────────────────────────────────────────────── */
.gh__end{flex:0 0 auto;display:flex;align-items:center;gap:8px;margin-inline-start:auto}
.bub--lang{font:600 11.5px/1 'DM Sans',sans-serif;letter-spacing:.06em;padding:9px 14px}

.gh__burger{
  display:none; position:relative;
  inline-size:clamp(44px,5.6vh,48px); block-size:clamp(36px,4.4vh,42px);
  padding:0; cursor:pointer;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.42);
  background:
    linear-gradient(180deg,rgba(255,255,255,.20) 0%,rgba(255,255,255,.07) 46%,
      rgba(255,255,255,.02) 74%,rgba(255,255,255,.10) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75),inset 0 -1px 0 rgba(255,255,255,.34),
             inset 0 12px 16px -14px rgba(255,255,255,.9),0 7px 20px -11px rgba(0,0,0,.6);
  backdrop-filter:blur(11px) saturate(175%);
  -webkit-backdrop-filter:blur(11px) saturate(175%);
  transition:transform .3s ease,border-color .3s,background .3s;
}
.gh__burger i{position:absolute;left:50%;top:50%;
  display:block;inline-size:16px;block-size:1.6px;margin:-0.8px 0 0 -8px;border-radius:2px;
  background:rgba(255,255,255,.92);transition:transform .32s ease,opacity .25s}
.gh__burger i:nth-child(1){transform:translateY(-5.4px)}
.gh__burger i:nth-child(3){transform:translateY(5.4px)}
body.gh-open .gh__burger i:nth-child(1){transform:rotate(45deg)}
body.gh-open .gh__burger i:nth-child(2){opacity:0}
body.gh-open .gh__burger i:nth-child(3){transform:rotate(-45deg)}

/* ── the sheet: the same capsules, stacked, under 1080px ─────────────────── */
.gh__sheet{
  position:fixed; inset:0; z-index:8; display:none;
  flex-direction:column; gap:9px;
  padding:calc(74px + env(safe-area-inset-top,0px)) clamp(14px,4vw,30px) 40px;
  overflow:auto; overscroll-behavior:contain;
  background:linear-gradient(180deg,rgba(16,17,22,.62),rgba(9,10,14,.76));
  backdrop-filter:blur(26px) saturate(150%);
  -webkit-backdrop-filter:blur(26px) saturate(150%);
  opacity:0; visibility:hidden;
  transition:opacity .3s ease,visibility .3s;
}
body.gh-open .gh__sheet{opacity:1;visibility:visible}
body.gh-open{overflow:hidden}
.gh__sheet .gh__nav{display:flex;flex-direction:column;align-items:stretch;gap:7px;inline-size:100%}
.gh__sheet .drop{flex-direction:column;align-items:stretch;inline-size:100%}
.gh__sheet .drop__body{block-size:auto;padding-block:15px;padding-inline:26px;
  font-size:14.5px;justify-content:center;
  inline-size:min(100%,340px);margin-inline:auto}
.gh__sheet .drop__pool{
  position:static; translate:none; transform:none; inline-size:auto; max-inline-size:none;
  margin-block-start:7px; border-radius:22px; padding:12px;
  display:none; opacity:1; visibility:visible; pointer-events:auto;
}
.gh__sheet .drop.is-open > .drop__pool{display:flex}
.gh__sheet .bub{font-size:12.5px;padding:9px 16px}

@media (max-width:1080px){
  .gh__nav{display:none}
  .gh__burger{display:inline-block}
  .gh__sheet{display:flex}
  .gh__end{margin-inline-start:auto}
  .gh{gap:0}
}
@media (min-width:1081px){
  .gh__sheet{display:none}
}
@media (prefers-reduced-motion:reduce){
  .gh,.drop__body,.bub,.gh__sheet{transition-duration:.01ms}
}
