/* Shared navigation glass. The dock, case chapters and gallery controls remain distinct. */
:root {
  --ios-nav-edge: max(clamp(9px,2.35vw,42px),env(safe-area-inset-left,0px),env(safe-area-inset-right,0px));
  --ios-nav-top: max(8px,calc(env(safe-area-inset-top,0px) + 5px));
  --ios-nav-height: 58px;
  --ios-nav-ink: #faf8f4;
  --ios-nav-subtle: #d7d4cc;
  --ios-nav-stroke: rgba(242,242,244,.25);
  --ios-glass-base: rgba(29,30,32,.94);
  --ios-glass-coat: linear-gradient(164deg,rgba(255,255,255,.10),rgba(255,255,255,.025) 31%,transparent 56%,rgba(174,183,200,.045));
  --ios-glass-shadow: inset 0 1px 0 rgba(255,255,255,.13),inset 0 -1px 0 rgba(255,255,255,.035),0 8px 23px rgba(3,4,9,.24);
}
@supports ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))) {
  :root { --ios-glass-base: rgba(24,25,27,.72); }
}
html:has(body > header .officialBrand),html:has(body.brief-page) {
  scroll-padding-block-start: calc(var(--ios-nav-height) + var(--ios-nav-top) + 12px);
}
/* Select the masthead itself, including the high-specificity legacy home and case layouts. */
body:is(:has(>header .officialBrand),:has(#sculpt))>header,body.brief-page:has(.brief-studio)>nav,
.cinema-page .cinema-shell>.mast,.cinema-page .cinema-shell>.floating-nav,
body #siteMenu,.cinema-page #creator-menu {
  box-sizing:border-box;
  color:var(--ios-nav-ink);
  border:1px solid var(--ios-nav-stroke);
  background:var(--ios-glass-coat),var(--ios-glass-base);
  box-shadow:var(--ios-glass-shadow);
  -webkit-backdrop-filter:blur(20px) saturate(155%);
  backdrop-filter:blur(20px) saturate(155%);
}
body:is(:has(>header .officialBrand),:has(#sculpt))>header,body.brief-page:has(.brief-studio)>nav {
  position:sticky;top:var(--ios-nav-top);z-index:9;
  width:min(1392px,calc(100% - var(--ios-nav-edge) - var(--ios-nav-edge)));
  max-width:none;height:var(--ios-nav-height);min-height:var(--ios-nav-height);
  margin:var(--ios-nav-top) auto 0;
  display:flex;align-items:center;justify-content:space-between;gap:clamp(8px,1.65vw,27px);
  padding:5px 7px;padding-inline-start:clamp(14px,2.1vw,32px);
  border-radius:100px;
}
body>header .officialBrand {
  display:inline-flex;align-items:center;flex:0 1 auto;
  width:clamp(126px,12.7vw,183px);min-width:0;min-height:44px;
}
body.brief-page>nav img { width:clamp(120px,13vw,172px);height:auto; }
body>header .topLinks {
  display:flex;align-items:center;justify-content:center;flex:1 1 auto;
  margin:0;padding:0;
  gap:clamp(2px,.42vw,8px);
}
body>header .headActions {
  display:flex;align-items:center;justify-content:end;
  gap:clamp(2px,.5vw,9px);margin:0;flex:0 0 auto;
}
body>header .topLinks>a,body>header .headActions>a:not(.talk),body>header #openMenu,
body.brief-page>nav>a,.cinema-page .mast .identity,.cinema-page .floating-nav>a {
  display:inline-flex;align-items:center;justify-content:center;
  align-self:center;box-sizing:border-box;white-space:nowrap;min-height:44px;min-width:44px;
  color:var(--ios-nav-subtle);text-decoration:none;
  border:1px solid transparent;border-radius:999px;
  line-height:1.25;-webkit-tap-highlight-color:transparent;
}
body>header .topLinks>a,body>header .headActions>a:not(.talk),body.brief-page>nav>a[hreflang] {
  padding:0 clamp(9px,1vw,18px);
  font-size:clamp(.805rem,.78rem + .12vw,.92rem);font-weight:590;
}
body>header .topLinks a[aria-current],body.folio-page>header .topLinks a[aria-current] {
  color:var(--ios-nav-ink);
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.11);
}
body>header #openMenu,body.brief-page>nav>a[hreflang],.cinema-page .floating-nav .menu-toggle {
  background:linear-gradient(165deg,rgba(255,255,255,.17),rgba(255,255,255,.07));
  border:1px solid rgba(255,255,255,.22);
  color:var(--ios-nav-ink);box-shadow:inset 0 1px 0 rgba(255,255,255,.13);
  font-weight:650;
}
body>header #openMenu { padding:0 clamp(13px,1.2vw,24px);gap:10px; }
body>header #openMenu i,.cinema-page .menu-icon { color:#f2eee7; }
body>header #openMenu[aria-expanded="true"],.cinema-page #menu-toggle[aria-expanded="true"] { background-color:rgba(219,196,151,.21); }
body>header .language:lang(ar),body.brief-page>nav>a[hreflang="ar"] { font-family:StudioArabic,-apple-system,sans-serif; }
body.brief-page>nav>a:first-child { justify-content:flex-start; }
body>header .officialBrand:focus-visible,body>header :is(.topLinks,.headActions) :focus-visible,body.brief-page>nav>a:focus-visible,
.cinema-page :is(.mast,.floating-nav,#creator-menu) a:focus-visible,body #siteMenu :focus-visible {
  outline:2px solid #f7d8a4;outline-offset:2px;
}
.cinema-page {
  --ios-nav-stroke:rgba(238,222,251,.28);
  --ios-nav-subtle:#e6dded;
  --ios-glass-base:rgba(28,22,37,.90);
  --ios-creator-edge:max(var(--ios-nav-edge),calc(var(--rim) + 9px));
  --ios-creator-top:max(calc(var(--rim) + 10px),calc(env(safe-area-inset-top,0px) + 6px));
}
@supports ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))) {
  .cinema-page { --ios-glass-base:rgba(25,19,34,.70); }
}
.cinema-page .cinema-shell>.mast,.cinema-page .cinema-shell>.floating-nav {
  min-height:54px;height:54px;border-radius:99px;
}
.cinema-page .cinema-shell>.mast {
  inset-block-start:calc(var(--ios-creator-top) - var(--rim) - 1px);
  inset-inline-start:calc(var(--ios-creator-edge) - var(--rim) - 1px);
  padding:3px clamp(13px,1.3vw,22px);gap:clamp(8px,1vw,16px);
}
.cinema-page .mast .identity { min-height:44px; }
.cinema-page .mast .divider { background:rgba(255,255,255,.23); }
.cinema-page .mast .mast-label { color:var(--ios-nav-ink); }
.cinema-page .cinema-shell>.floating-nav {
  inset-block-start:var(--ios-creator-top);inset-inline-end:var(--ios-creator-edge);
  padding:4px;gap:1px;
}
.cinema-page .floating-nav>a { padding:.25rem clamp(10px,1.2vw,19px); }
.cinema-page #creator-menu {
  inset-block-start:calc(var(--ios-creator-top) + 61px);
  inset-inline-end:var(--ios-creator-edge);
  max-height:calc(100vh - var(--ios-creator-top) - 76px);
  max-height:calc(100dvh - var(--ios-creator-top) - 76px);
  overflow-y:auto;overscroll-behavior:contain;border-radius:22px;
}
.cinema-page #creator-menu header>a { display:grid;place-items:center;min-height:44px;min-width:44px;line-height:1; }
.cinema-page #creator-menu>div>a { min-height:46px; }
body #siteMenu { border-radius:25px;--ios-glass-base:rgba(26,27,29,.92); }
body #siteMenu::backdrop { background:rgba(6,7,10,.42); }
body #siteMenu .dock a { border-color:rgba(255,255,255,.14);min-height:50px; }
body #siteMenu #closeMenu { min-width:44px;min-height:44px;border-radius:50%;color:var(--ios-nav-ink);background:rgba(255,255,255,.10);border:1px solid var(--ios-nav-stroke); }
@media(min-width:721px) {
  body #siteMenu,html[dir="rtl"] body #siteMenu {
    inset:auto;
    inset-block-start:var(--ios-nav-top);
    inset-inline-end:max(var(--ios-nav-edge),calc((100vw - 1392px)/2));
    max-height:calc(100vh - var(--ios-nav-top) - 12px);
    max-height:calc(100dvh - var(--ios-nav-top) - 12px);
    overflow:auto;overscroll-behavior:contain;
  }
}
@media (max-width:850px) {
  body>header .topLinks { display:none; }
  body>header .officialBrand { width:clamp(106px,23vw,147px); }
}
@media (max-width:720px) {
  :root { --ios-nav-height:54px;--ios-nav-top:max(5px,calc(env(safe-area-inset-top,0px) + 3px)); }
  body:is(:has(>header .officialBrand),:has(#sculpt))>header,body.brief-page:has(.brief-studio)>nav { padding:4px 5px;padding-inline-start:clamp(12px,3vw,20px);gap:5px; }
  body>header .headActions { gap:2px; }
  body>header .headActions>a:not(.talk) { padding-inline:clamp(6px,1.5vw,10px); }
  body>header #openMenu { padding-inline:clamp(10px,2.5vw,14px);gap:7px;font-size:.82rem; }
  body #siteMenu,html[dir="rtl"] body #siteMenu {
    margin:0 auto;inset:auto 0 0;
    width:100%;max-width:none;
    border-radius:24px 24px 0 0;padding-bottom:max(15px,calc(env(safe-area-inset-bottom,0px) + 8px));
    padding-inline:max(18px,env(safe-area-inset-left,0px),env(safe-area-inset-right,0px));
    max-height:calc(100vh - var(--ios-nav-top) - 8px);
    max-height:calc(100dvh - var(--ios-nav-top) - 8px);
    overflow:auto;overscroll-behavior:contain;
  }
  .cinema-page .cinema-shell>.mast,.cinema-page .cinema-shell>.floating-nav { min-height:52px;height:52px; }
  .cinema-page .floating-nav>a { padding-inline:clamp(6px,2vw,11px); }
}
@media(max-width:380px) { .cinema-page .mast .mast-label,.cinema-page .mast .divider { display:none; } }
@media(hover:hover) {
  body>header .topLinks>a:hover,body>header .headActions>a:not(.talk):hover,.cinema-page .floating-nav>a:hover { background-color:rgba(255,255,255,.12);color:white; }
  body>header #openMenu:hover,body.brief-page>nav>a[hreflang]:hover { background-color:rgba(255,255,255,.10); }
}
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more) {
  :root,.cinema-page { --ios-glass-base:#222326;--ios-nav-stroke:#89888a;--ios-nav-subtle:#fff; }
  body:is(:has(>header .officialBrand),:has(#sculpt))>header,body.brief-page:has(.brief-studio)>nav,.cinema-page .cinema-shell>.mast,.cinema-page .cinema-shell>.floating-nav,
  body #siteMenu,.cinema-page #creator-menu { -webkit-backdrop-filter:none;backdrop-filter:none; }
  body #siteMenu { --ios-glass-base:#222326; }
}
